International Journal of Advanced Mechatronics and Robotics (IJAMR) Vol. 3, No. 1, January-June 2011; pp. 29-42; International Science Press, ISSN: 0975-6108 A Robust Controller Design for a Brushless DC Drive System using Moving Average Speed Estimation on Cortex M3 ARM Microcontroller V. M. Takodia, J. J. Patel & M. A. Mulla Electrical Engineering Department, S. V. National Institute of Technology, Ichchhanath, SURAT - 395 007, Gujarat, India. E-mail: mam@eed.svnit.ac.in ABSTRACT Brushless DC (BLDC) drive systems are continually gaining popularity in motion control applications. Motion control applications require very good stability limits, steady state and transient responses, hence brushless dc drive systems should respond to meet these requirements. Encoder feedback is normally used for designing robust controller for BLDC drive, in this paper, hall sensor based moving average speed estimation and variable Kp-Ki PI controller is presented. The digital controller is implemented using Cortex M3 ARM microcontroller (LM3S2616) with only hall-sensors feedback. The experimental setup is tested by loading BLDC motor from no load to full load as well as with continuous and impact load. Serially, motor parameters like speed, current are gathered on PC and analysed, which confirms the robustness of controller designed. Keyword: BLDC (Brushless dc) Motor Drive, Digital Control, Modelling and Analysis, Motion Control. 1. INTRODUCTION The brushless dc motor (BLDC) motor has been used in various industrial applications and has increased demand in diverse fields because of its high efficiency, simple control compared to ac motors, low EMI, and high reliability due to absence of brushes. Most three-phase motors, including BLDC motor need at least six PWM channels for inverter power devices such as IGBTs and MOSFETs. In order to meet these requirements, generally a specialpurpose processor is necessary. Using special purpose processor or a device for BLDC motor drive presents several advantages such as small driver size and less development time. However, these processors are more expensive than the general purpose processors and eventually will increase the cost of BLDC motor drive system. Since the main flux of BLDC motor is produced by the permanent magnets, this motor has high power density and is capable of operating at high efficiencies while having similar torque control performance as a dc motor [1, 2]. Trapezoidal type BLDC motors are generally used for low-cost industrial applications. Therefore, low-cost application of BLDC motors is being considered for many products. In
30 International Journal of Advanced Mechatronics and Robotics order to achieve low-cost BLDC motor drive, a general-purpose processor with hall sensors is used instead of using position sensor encoder and a special purpose processor. In this paper a 32-bit ARM microcontroller LM3S2616, which gives 75 MIPS performance with the availability of 1 cycle flash from Texas Instruments (TI) (Formally Luminary Microsystem) is suggested for BLDC motor control. The digital controller is implemented with moving average speed estimation using hall sensor feedback and variable Kp-Ki PI algorithm in order to improve the system response. The simulated results are verified by the experimental setup by loading motor from no load to full load as well as with continuous and impact load. 2. BLDC MOTOR Permanent magnet (PM) motors are synchronous motors with permanent magnets mounted on the rotor, and the armature windings located on the stator. PM motors are categorized into two types: The first type is referred to as PM synchronous motor (PMSM) which has sinusoidal back-emf. The other type is referred as BLDC motor which has a trapezoidal back-emf as shown in Fig.1. In the BLDC motor drives, the polarity reversal is performed by power transistors switching in synchronization with the rotor position. Therefore, the BLDC motor has to use either internal or external position sensor to detect the actual rotor position. Also, the rotor position can be estimated without the need for position sensor. However, in proposed scheme, three hall sensors are used to determine the actual rotor position. Figure 1: Schematic of BLDC Motor
A Robust Controller Design for a Brushless DC Drive System using Moving Average Figure 2: Position Sensor Output and Ideal Current Waveforms Figure 3: Voltage Source Inverter (VSI) 31
32 International Journal of Advanced Mechatronics and Robotics Figure 4: The Back-EMF of BLDC Motors In general, BLDC motor may use either 600 or 1200 conduction intervals. In this paper, the 1200 conduction interval is used. Figure 1 shows a schematic of BLDC motor with placement of hall sensors. Figure 2 shows the position sensors outputs and ideal current waveforms with respect to position. Figure 3 shows a three phase voltage source inverter (VSI). The ideal phase current in each of the motor windings are shown with hall sensor output in Figure 2. Figure 4 shows the trapezoidal back emf of the BLDC motor. According to Figure 2 from the first interval, phase A will conduct positive dc link current, while phase B will conduct negative dc link current. Phase C will be left open. As a result, only phase A and B are conducting and phase C is left silent, which means that only two switches (A_H and B_L) are active, while the rest (A_L, B_H, C_H, and C_L) are inactive. During each PWM cycle to achieve this switching scheme, the desired duty cycle is imposed by the upper switch (A_H) of the two involved switches (A_H and B_L) and the lower switch (B_L) is kept on (100% duty cycle). Therefore, there is no need for dead time to be considered for BLDC motor. Because, whenever the upper switch is turned on, the lower switch of the same leg is already off and vice versa [3]. 3. PROPOSED SETUP AND ALGORITHM Proposed BLDC drive consist of four units: supply line interface, digital controller, motor and sensors, and power converter or drive unit. The overall system can be represented by
A Robust Controller Design for a Brushless DC Drive System using Moving Average 33 a block diagram shown in Figure 5. Hall-sensors feedback is connected with microcontroller via commutation circuit block, which is connected to PWM generator block. Hall-sensors feedback is used to calculate the actual speed of the motor. The required PWM duty-ratio is calculated in order to achieve reference speed. PWM generator will generate gate pulses with required duty-ratio, which need to be synchronised with hall-sensors feedback for proper electronics commutation of the switches. Figure 5: Schematic Diagram of BLDC Motor with Closed Loop Control When speed responses are obtained with classical PI controllers, the Kp and Ki are kept constant. General approach of tuning is initially have no integral gain, increase Kp until satisfactory response is obtained and then add in integral until the steady state error is removed in satisfactory time (may need to reduce Kp if the combination becomes oscillatory). Here, Kp is responsible for process stability and Ki is responsible for driving error to zero. Too low value of Kp can cause drift, and too high value will cause oscillations. Very high value of Ki will also invoke oscillations or instability [4]. When the command changes, the system needs a large control input for fast response. To produce a large control input, the PI controller should have a large Kp and small Ki. When the motor reaches the command value, it needs a small Kp to avoid overshoot and large Ki to reduce steady state error. Thus, the modified PI controller parameters as a function of the position or speed error is expressed by equation (1) and (2). K p = K p,min + K p,max K p,min emax e (1)
34 International Journal of Advanced Mechatronics and Robotics K i = K i,max K i,max K i,min emax e (2) The gain constants vary as an instantaneous function of error within specified limits. Thus, Kp and Ki are variables instead of constants. Digital variable Kp-Ki control algorithm is implemented to improve the system response. The theory and modeling of BLDC motors have been developed with an assumption that hall sensors are placed exactly 1200 apart. Practically it is difficult to achieve this with high accuracy, this result in imbalance among the phases and leads to increase in torque pulsation, vibrations, acoustic noise, and deterioration in mechanical performance. In order to overcome this misalignment of hall sensors a moving average speed estimation algorithm is developed. This algorithm will move the twelve count reading of timer on every hall sensor output state change and provides speed value in intermediate hall sensor transition stages also. Moving average is done on arrival of new hall sensor count; this improves the speed measurement ability and makes it equivalent to speed measurement using incremental encoder. 4. SIMULATION RESULTS The simulation of proposed BLDC drive is done using the software package MATLAB/ SIMULINK, schematic of arrangement is as shown in Fig 6 [5, 6]. The motor s closed loop control models were constructed with required control circuit. After running the simulations, the speed, torque, current waveforms were recorded and analysed. Figure 6: Simulation of Proposed BLDC Drive
A Robust Controller Design for a Brushless DC Drive System using Moving Average (a) Stator currents, back EMF, hall signals, speed, and torque (from top to bottom) (b) Speed (in RPM) for constant value of Kp and Ki 35
36 International Journal of Advanced Mechatronics and Robotics (c) Speed (in RPM) for varying values of Kp and Ki Figure 7: Simulated Results of the Proposed BLDC Drive The parameters of the BLDC drive system for dynamic simulations are obtained and compare with fixed Kp-Ki performance, the obtained reading are as tabulated in Table 1. It is seen from the results that peak overshoot and settling time of the system reduce with this variable Kp-Ki PI algorithm. The simulated current, torque, hall signals and speed responses are shown in Fig 7. The effectiveness of variable Kp-Ki PI algorithm is illustrated in Table 1. Given a range of Kp between 0.01 to 01 and Ki between 0.2. to 0.3, the PI controller tuned itself and reduces the peak overshoot from 1.5% to 1% and also reduces the reduces the settling time from 17.1ms to 15.4ms. These results are compared with performance of motor with constant Kp = 0.05 and Ki = 0.25; for which the system is tuned. Table 1 Comparison of Motor Parameters with Constant and Varying K p-ki Algorithm Time domain Kp = 0.05 and Ki= 0.25 Kp, min = 0.01, Kp,max = 0.1 and specifications (Constant Kp-Ki) Ki,min = 0.2, Ki,max = 0.3 (Variable Kp-Ki ) Peak overshoot Settling time for 2% tolerance in speed 1.5 % 1% 17.1 ms 15.4 ms 5. EXPERIMENTAL SETUP A 24 V, DC supply is generated using a step down transformer and a rectifier unit or standard 24 V SMPS can be used alternatively. A 32-bit ARM microcontroller LM3S2616 is used for the BLDC motor control. A 4000 RPM BLDC motor DPM 57BLS94 with only
A Robust Controller Design for a Brushless DC Drive System using Moving Average 37 hall sensor output is used in the test setup. MOSFET based three phase power converter is used as a driving unit. The digital control design strategy was validated with an experimental setup constructed in order to implement and further validate the simulation results. A. Digital Controller To achieve proper control of BLDC motor, the required digital controller should have minimum following capabilities [7, 8]: 1. Minimum 3 number of interrupts for hall sensor base rotor position sensing interface. This interrupt can be configurable for its both; positive going edge and negative going edge. 2. Minimum 6 independent PWM generation units, (with a 16 or 32 bit timer) with dedicated output pins. PWM should be configurable for edge aligned or centre aligned PWM. 3. Minimum 2 channels for quadrature encoder interfacing. This will be useful for speed measurement, position tracking and direction of rotation. 4. Processor should have single cycle multiplication instruction and division instructions for fast computations. 5. On chip multi-channel 500 ksps to 1 msps ADC to sense currents and/or back emf signals. After searching in the category of 32-bit controllers, following controllers were considered: TMS 320F2812 BY TI ARM CORTEX M-3 (STM32) BY ST ARM7 TDMI BY NXP ARM CORTEX M-3 BY LUMINARY MICRO Last option of a 32 bit controller by TI (Formally luminary micro systems) with around 75MIPS performance, KEIL IDE for software development and availability of 1 cycle flash is selected. From the family of 32-bit Cortex M3 ARM processor LM3S2616 microcontroller is selected. The overall proposed scheme for BLDC drive is depicted as shown in Fig.8. An LM3S2616, ARM micro controller was chosen for the task of performing the logic operations required to commutate and control the motor. A micro controller was chosen over a digital signal processor (DSP) to reduce cost and lower the complexity of the associated hardware. Also, development tools and support were readily available for the ARM. They allow user control of certain motor controller functions such as direction, mode, and start/stop. Crystal used is of 25MHz, capacitors are provided for crystal stabilizing, a pull-up resistor is used for the micro controller resets pin, the micro controller ADC reference
38 International Journal of Advanced Mechatronics and Robotics Figure 8: Overall BLDC Drive Scheme used is +2.5 V reference and PORTA and PORTB is configured as Pulse width modulation (PWM) output port. B. Three Phase Inverter and Gate Driver A standard three-phase dc to ac inverter was used. The switches were conservatively chosen; MOSFETs (STP80NF55-06) rated for 55 V, 80 A and RDS(on)=0.005 ohm, is well over the power ratings of the BLDC motor. To drive the switches, a high-speed power MOSFET and insulated gate bipolar transistor driver IC was used (IR2130). The recommended connections given by the IC s data sheet were used to interface the inverter with the driver [9]. Full bridge topology is implemented for higher torque output as compared to half bridge. The gate driver circuit (IR 2130) forms the interface between the micro controller and the power MOSFETs. The gate driver circuit has two purposes: Firstly, it buffers the gate signals generated by the micro controller. The second purpose of the gate drive circuit is to generate the gate voltages required to activate the topside transistor.
A Robust Controller Design for a Brushless DC Drive System using Moving Average 39 Figure 9: Hall Effect Sensor Interface Figure 10: Current Sensing Unit C. Current Control and Sensing Hardware Most BLDC motors have several hall-effect sensors, incorporated in the stator. These sensors provide rotor position information to the motor controller. A current sensing amplifier is required to provide motor current information to the micro controller. Current was sensed in both directions. Under normal operation, the current flows from the +V motor rail, through
40 International Journal of Advanced Mechatronics and Robotics the motor and to ground through the current sensing resistor. When braking is applied to the motor; current flows from ground, through the motor and the +V motor rail. The current needs to be limited to 10 amps in both directions to prevent damage to the motor s stator winding. A single supply, rail-to-rail opamp, the LMV324 was chosen. The opamp is supplied from the +5 V rail, ensuring that the microcontroller s ADC does not see more than 5 V on its inputs. The current signal is amplified differentially to avoid any DC offset due to opamp bias currents. D. BLDC Motor with Mechanical Load and Overall Setup The BLDC motor used for the experimental testing was DPM 57BLS94 which is a 4000 RPM and 36 V. A pulley is mounted on the shaft of the motor and the arrangement is fixed on the table for mechanical loading on the motor. The ratings and all other motor information were taken from the manufacturer s data sheet. 6. EXPERIMENTAL RESULTS The moving average speed estimation and varying Kp-Ki PI digital control working with hall-sensors feedback has been validated with an experimental setup. The speed readings of the motor are collected every 200 ms and downloaded into Excel sheet for further analysis through serial transmission. The graphs are plotted for speed in RPM versus time in seconds. The experimental results are matched with the simulated results of the proposed BLDC drive system. Figure 11: Experimental Setup of Overall BLDC Drive
A Robust Controller Design for a Brushless DC Drive System using Moving Average 41 (a) (b) Figure 12: Experimental Results of Proposed Closed Loop BLDC Drive: (a) Speed Performance for Step Change in Set Points, and (b) Speed Performance While Tracking Trapezoidal Reference Set Points Fig. 12(a) shows the performance of motor while set point of the motor is changed in steps and impact loading on the motor is applied and removed. It has been observed from this graph that the performance of motor is very good and matches exactly to set point. Fig. 12(b) shows the performance of motor with continuous varying set point. Artificially the set point of the motor is changed in accelerating ramp and decelerating ramp fashion on loaded
42 International Journal of Advanced Mechatronics and Robotics motor. It has been observed that the performance of motor is very good and matcheds exactly to set point. 7. CONCLUSIONS A new concept for digital control of BLDC motor with only hall-sensor feedback with moving average speed estimation and variable Kp-Ki PI controller has been introduced. The idea behind the new concept is to achieve robust control at low cost; conventionally encoder is must for getting such level performance. The moving average speed estimation improves the speed measurement ability and makes it equivalent to speed measurement using incremental encoder. The closed loop speed control has been simulated in Matlab/Simulink with constant Kp - Ki and variable Kp - Ki PI control. It has been noted that variable PI controller gives good response, from the view point of settling time and peak overshoot. Closed loop speed control has been physically implemented with fast running 32-bit microcontroller with sampling rate as small as 4 ms. The drive s speed responses have been experimented and are found reasonably good. ACKNOWLEDGMENT The authors are grateful to Dr. R. Chudamani for her valuable discussions and her help in proof reading of this paper. REFERENCES [1] F. Rodriguez, P. Desai, and A. Emadi, A Novel Digital Control Technique for Trapezoidal Brush-less DC Motor Drives, in Proc. Power Electron. Technol. Conf., Chicago, IL, Nov. 2004. [2] F. Rodriguez and A. Emadi, A Novel Digital Control Technique for Brushless DC Motor Drives: Conduction-angle Control, In Proc. IEEE Int. Elect. Mach. Drives Conf., May 2005, San Antonio, Texas, pp. 308-314. [3] R. Krishnan, Switched Reluctance Motor Drives: Modeling, Simulation, Analysis, Design and Applications, Industrial Electronic Series, CRC Press; 1 Edition (June 28, 2001). [4] M. A. El-Sharkawi, Fundamentals of Electric Drives, Pacific Grove, CA: Brooks/Cole, 2000, pp. 5-10. [5] The Student Edition of MATLAB User s Guide, The MathWorks, Inc., Prentice Hall, 1997. [6] MATLAB Primer (2nd Edition), Kermit Sigmon, Department of Mathematics, University of Florida, Gainesville, FL 32611. [7] H. C. Chen, M. S. Huang, C. M. Liaw, Y. C. Chang, P. Y. Yu, and J. M. Huang, Robust Current Control for Brushless DC Motors, Proc. Inst. Electr. Eng. Electric Power Applications, 147, No. 6, pp. 503-512, Nov. 2000. [8] Yashwant Jani, Implementing Embedded Speed Control for Brushless DC Motors: Part 1-6, Renesas Technology America, Inc., Dec 2006. [9] International Rectifier, IR2130/IR2132(J)(S) & (PbF) 3-phase Bridge Driver. Data Sheet No. PD60019 Rev.P.