28 CHAPTER 2 MODELLING AND STUDY OF THE BLDC MOTOR DRIVE 2.1 INTRODUCTION This chapter discusses the simplified, and a fast running simulation model of BLDC motor drive using MATLAB/SIMULINK. This model provides a mechanism for monitoring and controlling the voltage, current, speed and torque response of motor. This simplified model can be used to predict the performance of BLDC motor during transient and steady state conditions. The complete simulation model of BLDC motor drive has several sub-blocks. The inverter and switching function are implemented as separate S-function builder blocks. The developed model can serve as a design tool for engineers, researchers, and whosoever concern working on BLDC drive to reduce the computation time in developing and simulating a complex model. 2.2 MODELLING OF BLDC MOTOR A three phase star connected BLDC motor driven by a three phase inverter with six step commutation is considered in this analysis. Figure.2.1 shows the simplified BLDC motor drive scheme. The BLDC drive scheme consists of a three phase inverter, BLDC motor and position sensor. Figure 2.2 shows the ideal current, back emf and rotor position signal for a three phase BLDC motor. Each interval starts when rotor and stator field lines are 120° apart and ends when they are 60° apart. 29 a b c Figure 2.1 Simplified BLDC motor drive Figure 2.2 Ideal current, back emf and hall signals of three phase BLDC motor The conducting interval of each phase is 120 electrical degrees. The commutation instant is determined from the hall sensors mounted on the shaft. 30 A BLDC motor normally operated in a two phase ON mode i.e. at any instant of time only two phases conduct current, leaving the third phase open which is available for measuring the back emf. The entire simulation model is developed on Matlab/Simulink environment. The analysis is based on the following assumptions: Stator resistances of all the windings are equal, self and mutual inductances are constant, the motor is not saturated, iron losses are negligible and semiconductor switches are ideal. The voltage equations of the BLDC motor shown in Figure (2.1) are given in Equations (2.1) to (2.3). vab vbc vca R ia ib L d ia ib ea eb dt d R ib ic L ib ic eb ec dt d R ic ia L ic ia ec ea dt where, R = stator resistance per phase L = stator inductance per phase ia , ib , ic = instantaneous stator phase currents vab , vbc , vca = instantaneous stator line voltages ea , eb , ec = instantaneous phase back emf. The current relationship is given by, (2.1) (2.2) (2.3) 31 ia ib ic 0 (2.4) Equation (2.4) is rewritten as, ic ia ib (2.5) Using Equation (2.5) the line voltage equations are rearranged as vab Ria ib L vbc Ria 2ib L d ia ib ea eb dt d ia 2ib eb ec dt (2.6) (2.7) Back emf depends on the flux of the permanent magnet rotor and the speed of the rotor, and is given in Equation (2.8) ªe a º «e » « b» «¬ec »¼ ª « F (T ) e « k eZm « § 2S F ¨T e « 3 2 © « 4S § « F ¨T e 3 «¬ © º » » ·» ¹̧» » ·» ¹̧»¼ (2.8) The generated electromagnetic torque is given by Equation (2.9) 2S · Kt § 4S · º K § ªK Te « t FTe ia t F¨Te ib F¨Te ic 2 © 3 ¹̧ 2 © 3 ¹̧ »¼ ¬2 (2.9) The dynamics of the motor and load are expressed as given in Equations (2.10) to (2.14) 32 Te d Z m TL dt d K f Zm J Z m dt K f Zm J Te TL (2.10) (2.11) d Zm Te TL K f Z m dt k 1 Z m' f Z m >Te TL @ J J (2.12) J (2.13) T m' Zm (2.14) where, 2.3 Te = Electrical angle, degrees Zm = rotor speed, rad/sec ke = back-emf constant, volts/rad/sec J = moment of inertia, kg/m2 kf = friction constant, N-m/rad/sec TL = load torque, N-m kt = torque constant, N-m/A p Tm 2 MODELLING OF BLDC DRIVE SYSTEM Inverter and its switching sequence are modeled using S-function. Table 2.1 gives information on the switching sequence, current direction and the position signals used in triggering the switch in a phase A or B or C which is more positive with respect to the neutral point. 33 Table 2.1 Switching sequence Switching interval Degree Position Sequence Phase current Switch sensor closed number H1 H2 H3 A B C (0-60) 0 1 0 0 T1 T4 +Ia -Ib off (60-120) 1 1 1 0 T1 T6 +Ia Off -Ic (120-180) 2 0 1 0 T3 T6 off +Ib -Ic (180-240) 3 0 1 1 T3 T2 -Ia +Ib off (240-300) 4 0 0 1 T5 T2 -Ia Off +Ic (300-360) 5 1 0 1 T5 T4 off -Ib +Ic There are six states in a cycle of operation of BLDC motor. The values of voltages of BLDC drive are given in Equations (2.15) to (2.32) for the state 1 to state 6. Figures 2.3 to 2.8 show the circuit configuration for complimentary PWM from state 1 to state 6. State 1 (0-60ƕ): The phases A and B are conducting and phase C is freewheeling through diode D6. Figure 2.3 shows the circuit configuration of drive for complimentary PWM for state 1. (a) ON state and commutation Figure 2.3 (b) Freewheeling Circuit diagram of drive during commutation, ON state and free wheeling for state 1 34 During ON state (ic vab eab vbc ebc 0) Vs ea eb (2.15) 1 Vs ea eb 2 During commutation ( ic z 0 ) vab eab Vs ea eb vbc ebc eb ec (2.16) During freewheeling ( ia z 0, ic z 0 ) Vab eab Vs ea eb vbc ebc Vs eb ec (2.17) State 2 (60-120ƕ): The phases A and C are conducting and phase B is freewheeling through diode D3. Figure 2.4 Shows the circuit configuration of inverter for complimentary PWM, for state 2. (a) ON state and commutation Figure 2.4 (b) Free wheeling Circuit diagram of drive during commutation, ON state and freewheeling for state 2 35 During ON state (ib 0) vab eab vbc ebc 1 Vs ea ec 2 1 Vs ea ec 2 (2.18) During commutation (ib z 0) vab eab vbc ebc ea eb (2.19) Vs eb ec During freewheeling (ic z 0, ib z 0) Vab eab vbc ebc Vs ea eb (2.20) eb ec State 3 (120-180ƕ): The phases B and C are conducting and phase A is freewheeling through diode D2. Figure 2.5 shows the circuit configuration of inverter for complimentary PWM, for state 3. a, ON state and commutation Figure 2.5 b, Free wheeling Circuit diagram of drive during commutation, ON state and freewheeling for state 3 36 During ON state (ia 0) vab eab vbc ebc 1 Vs eb ec 2 (2.21) V s eb ec During commutation (ia z 0) vab eab vbc ebc Vs ea eb (2.22) Vs eb ec During freewheeling (ib z 0, ia z 0) Vab e ab ea e b Vbc ebc V s e b e c (2.23) State 4 (180-240ƕ): The phases A and B are conducting and phase C is freewheeling through diode D5. Figure 2.6 shows the circuit configuration of inverter for complimentary PWM for state 4. a, ON state and commutation Figure 2.6 b, Free wheeling Circuit diagram of drive during commutation, ON state and freewheeling for state 4 37 During ON state (ic vab eab vbc ebc 0) Vs ea eb (2.24) 1 Vs ea eb 2 During commutation (ic z 0) vab eab vbc ebc Vs ea eb (2.25) eb ec During freewheeling (ia z 0, ic z 0) Vab eab Vs ea eb Vbc ebc Vs eb ec (2.26) State 5 (240-300ƕ): The phases A and C are conducting and phase B is freewheeling through diode D4. Figure 2.7 shows the circuit configuration of inverter for complimentary PWM, for state 5. (a) ON state and commutation Figure 2.7 (b) Free wheeling Circuit diagram of drive during commutation, ON state and freewheeling for state 5 38 During ON state (ib vab eab vbc ebc 0) 1 Vs ea ec 2 (2.27) 1 Vs ea ec 2 During commutation (ib z 0) vab eab vbc ebc ea eb (2.28) Vs eb ec During freewheeling (ic z 0, ib z 0) Vab eab Vs ea eb Vbc ebc eb ec (2.29) State 6 (300-360ƕ): The phases B and C are conducting and phase A is freewheeling through diode D1. Figure 2.8 shows the circuit configuration of inverter for complimentary PWM, for state 6. a, ON state and commutation Figure 2.8 b, Free wheeling Circuit diagram of drive during commutation, ON state and freewheeling for state 6 39 During ON state ( ia 0) vab eab vbc ebc 1 Vs eb ec 2 Vs eb ec (2.30) During commutation (ia z 0) vab eab vbc ebc Vs ea eb Vs eb ec (2.31) During freewheeling (ib z 0, ia z 0) Vab eab Vbc ebc ea eb Vs eb ec (2.32) where, vab , vbc and vca are the instantaneous stator line voltages ia ,ib and ic are the instantaneous stator phase current. Vs is the dc source voltage 2.4 SIMULATION MODEL OF BLDC MOTOR DRIVE The simulation model of BLDC motor drive consists of four blocks namely, the BLDC motor block, switching sequence block, Inverter block and the generation of Hall signals block. Equations (2.1) to (2.14) are used to develop the simulation model of motor using Matlab/Simulink. 40 2.4.1 BLDC motor block The BLDC motor block consisting of four sub-blocks as labeled in the Figure 2.9 representing the Equations (2.1) to (2.8). phi'r 1 Step v ab vab Te is is we we phi'r the the eabc Tm m_mech Te 2 Back EMF and Flux Linkage we,the,te Hthe Hthe habc Electromagnetic Torque 2 v bc 3 vbc is bldc_mech To Workspace 4 eabc 1 habc Hall sensor1 simout1 bldc current equation Figure 2.9 Simulation model of BLDC Motor Sub-block 1 as shown in Figure 2.10 represents the BLDC motor Equations (2.5) and (2.6) which takes the voltages vs, vab and vbc as inputs and gives the phase current, is as output. The sub- block 2 implements Equation (2.9) using the current as input along with the flux linkage to produce the electromagnetic torque (Te) as the output. The sub-block 3 represents Equations (2.10) to (2.14) and is modeled as the mechanical block which takes the electromagnetic torque (Te) along with the load torque (TL) as input and gives speed and position as outputs. The sub-block 4 takes speed and position as input and gives back emf and flux linkages as output as given in Figure 2.11. 41 1 vab 1/L In Gain2 Out integrator Gain3 Divide1 R 2 Constant1 Divide -3 2 1/L In 1 is Constant Out vbc Gain1 integrator1 Gain4 R Figure 2.10 Model for voltage and current equations Phi' r 2 p cos(u[1]) Flux/trap the 1 1 phi'r p we Phi' r cos(u[1]-2*pi/3) Flux/trap Phi' r cos(u[1]+2*pi/3) Flux/trap 2 eabc Figure 2.11 Simulation model for Generation of back emf and flux linkage 2.4.2 Inverter and Switching logic The inverter and switching logic are implemented as an S-function that takes DC source voltage and the firing sequence as the inputs as shown in Figures 2.12 and 2.13. The output voltage of the inverter depends on DC source voltage, rotor position, phase current and also the value of the back 42 emf. In this modelling, hall sensor is used to sense the position of the rotor. The hall sensor mounted on the stator generates a three digit number that keeps changing for every 60 degree electrical rotation. For every 60 degree of electrical rotation, one hall sensor changes its state. Hence, it takes 6 states to complete one 360 degree of electrical rotation. This is shown in Table 2.1. pwm1 2 pwmin Duty Cycle(%) pwm2 ha pwm3 switch_sequencer 1 Gates_pwm pwm4 Habc hb 1 pwm5 hc pwm6 S-Function Builder2 Figure 2.12 Simulation model for Generation of switching sequence ha habc 1 hb hc vs 2 vs vab ea 1 vab eb 5 eabc ec ia is 4 inverter_nochop_double iz ib zero detecter ic is pwmd1 pwmd2 vbc pwmd3 2 vbc 3 pwmduty pwmd4 pwmd5 pwmd6 S-Function Builder1 Figure 2.13 Simulation model of Inverter using S-function builder 43 2.4.3 Generation of hall signals The hall signals give the position and the speed information of the rotor. Turn on and turn off of the power switches of the inverter are synchronized with the position signal. Based on the position information, the controller generates the PWM signal to turn on and turn off of the switches to control the speed of the motor. When a switch in a phase is turned off, the outgoing phase current freewheels through the diode where as the incoming phase current increases from zero to the new steady state. The position of the rotor decides the incoming and outgoing phases. The speed of the motor is controlled by measuring the actual speed of the motor and comparing it with the set speed to generate an error signal. This error signal is amplified with a PI controller and it is used to vary the duty cycle, thereby varying the speed. Figure 2.14 shows the hall sensor block, where the position signals are generated by using simple relational and logical operators, and Figure 2.15 shows the generated hall sensor signals. These signals are then used in the speed calculation. The specifications of the motor used for the simulation are given in Table 2.2. sin 1 Hthe T rigonometric Function cos T rigonometric Functi on1 atan2 -K- T rigonometric Function2 Gai n -60 Constant 120 >= Relational Operator AND Convert <= Logical Operator Data Type Conversion OR Convert Relational Operator1 Constant1 60 Constant2 -120 Constant3 -180 Constant4 0 Constant5 >= Relational Operator2 <= Logical Data T ype Conversion1 Operator2 1 habc Relational Operator3 >= AND Relational Operator4 <= Convert Logical Data T ype Conversion2 Operator1 Relational Operator5 Figure 2.14 Simulation model for generation of signals from hall sensors 44 Figure 2.15 Generated hall sensors signals Table 2.2 Motor Parameters MOTOR PARAMETERS VALUES Voltage 40 Volt Current 20 Amps Per phase resistance (R) 0.6 ohm Per phase Inductance (L) 0.42mH Moment of inertia (J) 0.0002 Kg-m2 Back emf Constant (Kb) 0.1 V/rad/sec Torque Constant(Kt) 0.1 N-m/A Number of poles 4 Speed 1200 rpm 45 2.5 OPEN LOOP CONTROL OF BLDC MOTOR DRIVE In open loop control, the duty cycle is directly calculated from the set speed as there is no feedback. Figure 2.16 shows the developed simplified open loop simulation model of the BLDC motor drive to study the characteristics of the system. 5 7 vab gate_signal habc 40 Habc v ab Habc Terminal Voltage we,the,te pwmduty 3 is Duty Cy cle(%) is duty cycle 1 we,the,te Gates_pwm .5 2 habc v ab vs v bc iabc v bc 4 eabc switch sequence eabc Inverter 6 BLDC Motor eabc vbc F28335 eZdsp Figure 2.16 Simplified simulation model of BLDC motor for open loop operation The performance during starting, running and speed reversal of the BLDC motor drive under open loop operation are discussed in this section. 2.5.1 Starting operation The BLDC drive system is started with a constant load of 0.5 N-m from stand still condition. Figure 2.17 shows the starting response of the phase current, back emf, speed and electromagnetic torque of the motor. The speed response reaches the steady state value at time t=0.5 sec. The stator 46 phase winding draws a maximum current of 17 amps during starting and reduces to 4 amps during steady state. The electromagnetic torque increases to a maximum value of 12.2 N-m and then drops to 2.1 N-m at steady state. (a) phase current (b) back emf Figure 2.17 (Continued) 47 (c) Speed waveform (d) Electromagnetic torque Figure 2.17 Starting responses of BLDC motor drive 2.5.2 Running operation The response of the drive under load perturbation is shown in Figure 2.18. When the motor is running at steady state for a constant load of 0.5 N-m, an additional load of 4 N-m was applied at t=2 seconds and was removed at t=2.5 seconds. The change in load causes the speed to drop from 700 rpm to 600 rpm over a period of 0.025 second. The current reaches the maximum value of 15 amps with in one cycle and the developed torque 48 increases to 4.5 N-m which is equal to the applied torque. It is seen that the back emf decreases from 15 volt to 10 volt, as the speed falls to 600 rpm with increase in load torque of 4N-m. (a) Phase current (b) back emf waveform Figure 2.18 (Continued) 49 (c) Speed response (d) Electromagnetic torque Figure 2.18 Responses of BLDC motor during load perturbations 2.6 HARDWARE IMPLEMENTATION Figure 2.19 shows the hardware setup for the validation of the simplified modelling of BLDC motor drive. The BLDC motor scheme has four major elements: A dSPACE DSP board, BLDC motor, processor board and PC. The dSPACE DS2204 DSP board forms the main core of the closed loop control system. 50 Figure 2.19 Hardware setup for BLDC motor drive Apart from the duties of controlling the operator interface, it performs the acquisition of the feedback signal, computes the error signal, delivers the error signal to the control algorithm and executes the control algorithm to determine the switching signal. The control algorithm is built within Simulink environment combined with the real time interface provided by dSPACE and is implemented by the main processor of DS2204 board. The processor board is interfaced with the DS2204 DSP board. The processor board is programmed to monitor and measure the position and speed information and feed this information back to the control algorithm. A 0.5 hp, 2000 rev/min BLDC machine manufactured by Hurst motors has been used. The BLDC motor is equipped with hall sensors and incremental optical encoder. The sensors detect the rotor position and give the information to the switching logic to excite the proper phase of the stator. The 51 optical position encoder with resolution of 500 pulse/ revolution is used to give the speed and position information for the closed loop operation. The measured line voltage Vab waveform is shown in Figure 2.20. The measured phase current and speed waveforms on no load and loaded condition is shown in Figures 2.21 and 2.22. The simulation and hardware results are closely matched and thus validating the simplified modelling. Figure 2.20 Measured line voltage Vab waveform (a) Phase current Figure 2.21 (Continued) 52 (b) Speed waveform Figure 2.21 Measured phase current and speed waveform on no-load (a) Phase current Figure 2.22 (Continued) 53 (b) Speed waveform Figure 2.22 Measured phase current and speed waveform on load 2.7 CLOSED LOOP OPERATION OF BLDC MOTOR DRIVE In the closed loop operation, the set speed and the actual speed are compared to generate an error signal. This error signal is fed to the PI controller to control the duty cycle for varying the dc voltage applied to the motor. The simulation model of BLDC motor drive for the closed loop operation is shown in Figure 2.23. 54 <signal1> -KGain 5 7 vab gate_signal habc 40 Habc Habc v ab we,the,te Terminal Voltage gate_signal pwmduty is Speed input is v bc eabc Inverter 6 <signal1> 1 we,the,te 3 iabc v bc eabc Controller 2 habc v ab vs BLDC Motor 4 eabc vbc Figure 2.23 Simplified simulation model of BLDC drive for closed loop operation 2.7.1 Design of PI controller The structure of PI controller selected to the BLDC motor drive is shown in Figure 2.24. Figure 2.24 Structure of a PI controller 55 Equation (2.33) gives the expression of the PI controller output. The output of controller is sum of proportional gain, K p times the magnitude of error and the Ki times the integral of error. K p e(t ) K i ³ e(t ) dt t u (t ) (2.33) 0 where, u(t) = output of the controller e(t) = error difference between the set point and the actual output K p = Proportional gain Ki = Integral gain Table 2.3 gives a brief note on the effect of PI controller parameters for a step response of speed. Table 2.3 Effect of PI controller parameters for a step response of the speed Parameter Rise time Overshoot Settling time Increase in Decrease Increase Steady state stability error Small change Decrease Degrade Increase Degrade Kp Increase in Decrease Increase Ki Decrease significantly 56 Due to its simplicity, PI controllers are used in more than 90% of closed-loop control systems in industrial processes. The PI controller was designed by trial and error method. The best controller gains are found to be K p = 0.01 and Ki =0.000013. The responses of the drive under different operating conditions are discussed in the succeeding sections. 2.7.2 Load perturbation The closed loop response of BLDC motor drive under load perturbation is shown in Figure 2.25. The motor is run at 600 rpm under steady state. A step load of 4 N-m is applied at t= 2 second and removed at t= 2.2 second. The responses of rotor speed, phase current and electromagnetic torque are shown in Figure 2.25. The stator phase current reaches to the steady state value of 12 amps within half a cycle. The dip in speed is around 100 rpm and the controller takes 0.25 second to reach the set speed. The electromagnetic torque rises to a maximum value of 3.7 N-m and remains till the load is changed. (a) waveform of phase current Figure 2.25 (Continued) 57 (b) Waveform of back emf (c) Speed response (d) Electromagnetic torque response Figure 2.25 Responses of BLDC motor during load perturbations 58 2.7.3 Change in set speed Figure 2.26 shows the response of the motor speed when the set speed is changed for a constant load torque of 0.5 N-m. The motor starts at t=1 second and reaches the set speed of 300 rpm in 0.25 seconds. The set speed was again changed to 600 rpm at t=2 seconds. The controller tracks the new set speed within 0.5 seconds. This clearly shows that the controller behaves smoothly without any oscillations and steady state error. The set speed is superimposed on the actual speed in order to compare its performance. Figure 2.26 Speed response of BLDC motor during change in set speed 2.7.4 Speed reversal Figure 2.27 shows the response of the controller during speed reversal. The motor operating with a constant load and with a set speed of 600 rpm in clock wise direction is suddenly made to rotate in the counter clock wise direction at t= 2.5 sec. The controller smoothly shifts the rotor speed in the opposite direction and it takes 0.5 sec to attain the set speed. This shows that the controller works well even under speed reversal. 59 Figure 2.27 Speed response of BLDC motor during speed reversal 2.8 CONCLUSION The simplified modelling and analysis of BLDC drive with hall sensor using Matlab/Simulink has been discussed. The simulation model of BLDC motor was developed as several sub blocks, which also includes the inverter and switching logic control. This facilitates the analysis of transient and steady state behavior of the drive in detail. The operation of the drive during on state, commutation and freewheeling are discussed in detail with the necessary equations. The responses of the BLDC motor drive during starting, load perturbations, change in set speed and speed reversal were monitored and compared with the ideal waveforms and also with the waveforms available in the literature. The performance of BLDC drive system was also compared with a hardware setup to validate the simulation model. The simulation and hardware results are closely matched and hence this model can be easily extended for the sensorless control of the BLDC motor drive with an Artificial intelligence controller.