Project Proposal Low-Cost Motor Speed Controller for Bradley ECE Department Robots L.C.M.S.C. By Ben Lorentzen Advisor Dr. Gary Dempsey Bradley University Department of Electrical Engineering December 10, 2003
Summary: This project is a microcontroller-based, speed control system for a dc motor. The controller accepts the desired speed input from the keypad and outputs a control signal to the power electronics. A pulse width modulation board is used to convert the 0-5 volts output of the EMAC development board to a 30 volt modulated signal. A block diagram is shown in Fig. 1. There is a feedback signal to let the controller know the actual motor speed. The speed sensor is a rotary encoder, which outputs a signal proportional to the speed of the motor. The microcontroller reads the signal then adjusts the control signal to make the actual motor speed match the desired motor speed. The complete system block diagram is shown in Figure 2 below. The load attached to the motor will be another dc motor driven in reverse, i.e. a generator, for load testing. Directional control will also be provided. Desired Speed Controller Circuitry Actual Speed Figure 1. System Inputs and Outputs LCD Display Desired Speed from Keypad EMAC Board PWM Signal H-bridge Desired Direction from Keypad Sensor (feedback) DC Motor Load Figure 2. Digital Controller Block Diagram Detailed Description: Within the software of the EMAC development board, the control system used will be proportional integral control. This control will be output in the form of a pulse width 2
modulated signal. The signal will then be amplified using an H-bridge to drive the dc motor. With a load attached to the motor, the speed will not be the same as what is desired, but will be corrected with a velocity sensor in a closed-loop feedback configuration. The microcontroller will vary the control signal to adapt the system to the desired speed. The design of the project will entail evaluation of H-bridge power electronics to drive the motor and modeling the power electronics and motor. Developing a model for the system allows for the development of various controller algorithms. This project will be much easier if it is done in phases, rather than just starting with PI digital control on the EMAC development board. First, an all analog controller with a linear amplifier will be utilized to make sure that the motor was modeled correctly. The second design iteration will be replacing the analog input signal with a PWM signal and adding in a PWM board. The linear amplifier will be replaced with a H-bridge. At this point the EMAC development board will be used to measure the speed of the motor. It will be used to test the linear analog controller and the PWM controller. The next phase will be using the EMAC development board to control the system using proportional control. Finally, proportional integral control will be implemented using the EMAC development board. The code for the EMAC 80515 development board will be compiled using Keil, and then downloaded to the EMAC development board. The high level software flow chart is shown in Figure 3. The microcontroller will accept the desired motor velocity from the keypad and then turn it into a control signal for the motor. EMAC Initialization Code Input Desired Convert to DC value Output to D/A New Input? Yes Adjust Signal to Meet Desired Check Feedback No Figure 3. High Level Software Flowchart 3
The LCD on the EMAC development board will provide the user with information on the DC motor. The screen will display the desired motor velocity as well as the actual motor velocity as seen in Figure 4. Line 1: Desired RPM XXX Line 2: Actual RPM XXX Figure 4. LCD Display The desired speed will be entered from the keypad on the EMAC development board. Three digits will be typed followed by an E and then the LCD will change the desired speed and the control system will change the speed of the motor. The Intel 80515 microcontroller on the EMAC development board will be the center of the system, see Figure 5 for block diagram. It will use the downloaded code from the PC to interface with the LCD display, keypad, pulse width modulation board, and rotary encoder. It will output a DC signal to the PWM board and receive feedback from the encoder to correct the output signal. Keypad Sensor EMAC Development Board LCD Display PWM Board Figure 5. EMAC Development Board Block Diagram The pulse width modulation board will accept the DC control signal from the D/A of the EMAC development board and convert it into a PWM signal. The higher the DC input, the greater the pulse width will be. This signal will be used by the H-bridge power electronics to control the motor velocity. The motor velocity is used by the encoder to output a signal with a frequency proportional to the velocity. The output is a TTL signal that can be used by the EMAC development board for feedback. See Figure 6. The encoder outputs 512 pulses per shaft rotation. 4
Shaft, w Sensor (Rotary Encoder) TTL Signal Figure 6. Rotary Encoder Block Diagram Preliminary lab work completed thus far is the motor modeling, the inintial design of the linear amplifier circuit, and the collection of some experimental motor data. Figure 7 shows the electrical model in Pspice of the motor, based on the values given on the motor spec sheet. Figure 7. Motor Model The linear amplifier was designed for a gain of six. This is due to the 5 volt output of the D/A on the EMAC development board and the 30 volt input of the motor. The linear amplifier is shown in figure 8, this is also done in Pspice. In the linear amplifier, Q2 is a current limiter. This is a safety device to protect Q1 from exceeding its maximum ratings. The complete schematic of the motor and the linear amplifier is shown in figure 9. 5
Figure 8. Linear Amplifier Figure 9. Linear Amplifier and Motor In lab, speed and current data was collected on the motor over the 0 to 30 volt range. Microsoft Excel was used to plot the results of the collected data. The shaft speed went up to 825 RPM at 30 volts, which is the same as the expected value. 6
Voltage vs. RPM 900 800 700 600 RPM 500 400 300 200 100 0 0 5 10 15 20 25 30 35 Motor Voltage Figure 10. Motor Shaft RPM vs. Motor Voltage Figure 11 shows the current that the motor draws from 0 to 30 volts. The data shows that the max current is about.1 amps at 30 volts. Motor Current vs. Voltage 0.14 0.12 0.1 Current 0.08 0.06 0.04 0.02 0 0 5 10 15 20 25 30 35 Voltage Figure 11. Motor Armature Current vs. Motor Voltage The current and voltage graph can give the amount of power dissipation requried by Q1 in the linear amplifier. Figure 12 shows the Power Dissipation of the transistor vs. the motor voltage. It shows that the average peak power dissipation is about 1.6 watts. This is higher than the transistor can handle so a heat sink will be required to get the transistor in a safe operating region. 7
Transistor Power Dissipation 2.5 2 Motor Current 1.5 1 0.5 0 0 5 10 15 20 25 30 35 Motor Voltage Figure 12. Transistor Power Dissipation vs. Motor Voltage Laboratory Schedule: There are fourteen weeks next semester to work on the LCMSC. The last two will be spent working on the final presentation and the student expo which leaves twelve weeks for lab work. Week 1 & 2 Analog controller with linear amplifier. Week 3 & 4 Analog controller with PWM board. Week 5, 6, & 7 Use EMAC board to measure RPM and display. Week 8, 9, & 10 Develop digital proportional control with EMAC board. Week 11 & 12 Proportional Integral control with EMAC board. Equipment & Parts List: For the most part, general purpose lab equipment will be used such as power supplies, multimeters, heatsink, H-Bridge, EMAC board, Pittman GM9236C534-R2, and other small components that are available. The only thing that needs to be acquired is one or two PWM boards. At this time the PWM boards have not been evaluated so the exact boards can not be specified. 8