3-Phase BLDC Motor Control with Hall Sensor V1.3 - Dec 22, 2006 English Version 19, Innovation First Road • Science Park • Hsin-Chu • Taiwan 300 • R.O.C. Tel: 886-3-578-6005 Fax: 886-3-578-4418 E-mail: [email protected]http://www.sunplusmcu.com http://mcu.sunplus.com
33
Embed
3-Phase BLDC Motor Control with Hall Sensorread.pudn.com/downloads362/ebook/1574390/3-Phase BLDC... · 2011-06-20 · similar to three-phase asynchronous motor. Since motor rotor
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
3-Phase BLDC Motor Control with Hall Sensor
V1.3 - Dec 22, 2006 English Version
19, Innovation First Road • Science Park • Hsin-Chu • Taiwan 300 • R.O.C.
Since current BLDC has substituted the electrical commutator for the mechanical one, it conquered the disadvantages of noise, spark, electromagnetic disturbance, short lifetime, etc. Now BLDC is provided with advantages of simple structure, dependable operation and easy maintenance as AC motor does, as well as advantages of high efficiency, no excitation cost and functional speed regulation as traditional DC motor does. Thus, it is widely used in various fields of industrial control presently.
1.2 Basic Principle
Usually, motor stator winding is three-phase symmetry star connection type which is similar to three-phase asynchronous motor. Since motor rotor is assembled with magnetized permanent magnet, in order to detect rotor polarity, a position sensor is built in motor. Motor driver, consisting of inverters and integrated circuit, is designed for: receiving start/stop/brake signals to control the motor operations; capturing position and forward/backward rotate signals to control the transistors state and make BLDC generate the continuous torque; receiving speed command and speed feedback signal to control and adjust rotate speed; protecting BLDC. The basic principle of BLDC is shown as Figure 1-1.
Figure 1-1 BLDC Control Principle
The main circuit is a typical voltage source AC-DC-AC converter. The inverters supplies a symmetrical rectangular voltage with a permanent amplitude & frequency (5 ~24 KHz). Alternating the N-S pole of permanent magnet makes the position sensor generate H1, H2 and H3 waveform with 120° phase-different, which forms six condition codes: 010, 011, 001, 101, 100, and 110. Via some logic components, these codes control to conduct V6 – V1, V5 – V6, V4 – V5, V3 – V4, V2 – V3, V1 – V2 respectively, that is, load bus of U - >V, W - >V, W - >U, V - >U, V - >W, U - >W with DC voltage in turns. Therefore, each time the rotor revolves a pole-pair, the transistors V1, V2, V3, V4, V5 and V6 are conducted one
by one according to their condition code and the magnetic field produced by stator winding rotates 60 electrical degree for that only two phases winding are loaded. Consequently, the rotor rotates 60 electrical degrees. The new position signal of rotor will be captured via the sensor to form a new set of condition codes, thus to drive the corresponding transistors, which makes the rotor rotate 60 electrical degrees further. Circulating unceasingly, BLDC will generate a continuous torque to rotate the load continuously.
1.3 Driving for BLDC
This application is designed for driving the IGBT built in IPM (Intelligent Power Module) using 120-degree waveform, thus to drive BLDC. The signals of driving IGBT are generated according to the motor position. The feedback position signal is encoded as six condition codes: 010, 011, 001, 101, 100, and 110, which can determine the assignment of IGBT driving signal. Here we add PWM signal to the upper phase and active voltage to the lower one so that we can vary the output voltage by changing the PWM duty. The timing of driving assignment and position signals are shown as Figure 1-2.
Figure 1-2 Driving and Position Signals
Where, the upper phase transistors V1, V3, V5 and the lower phase transistors V2, V4, V6 consist of a three-phase full-bridge circuit which controls the current direction of U, V, W phases which are connected as shown in Figure 1-1. H1, H2 and H3 are hall signals.
If the motor is driven in forward direction as shown in Figure 1-2, the transistors are conducted as the sequence: 010 (H3 H2 H1) V6-V1, 011 (H3 H2 H1) V5-V6, 001 (H3 H2 H1) V4-V5, 101 (H3 H2 H1) V3-V4, 100 (H3 H2 H1) V2-V3, 110 (H3 H2 H1) V1-V2. Accordingly, based on the position signal, the conducting sequence of transistors when the motor rotates in backward direction can be obtained as: 001 (H3 H2 H1) V1-V2, 011 (H3 H2 H1) V2-V3, 010 (H3 H2 H1) V3-V4, 110 (H3 H2 H1) V4-V5, 100 (H3 H2 H1) V5-V6, and 101 (H3 H2 H1) V6-V1. The commutate timing should be considered carefully; otherwise, BLDC will vibrate or doesn’t work, or will have a larger current with a wrong waveform.
The control signals mentioned above control the state of transistors, thus make the current flow into the three-phase coil (U, V, W) in turn and accordingly generate rotating magnetic field within BLDC. Figure 1-3 shows the current timing of each phase.
Figure 1-3 Current Timing
1.4 Speed Regulation by PWM Control
The inverters are based on the PWM modulation, which means that they can vary the output voltage fundamental with different PWM duty, thus to control the motor speed. There are totally 4 methods to add PWM-based control: upper phase, lower phase, pre-sixty degree and post-sixty degree as shown in Figure 1-4.
BLDC is widely applied in various technology fields with different control methods. This application adopts SPMC75F2413A chip equipped with a 16-bit TPM (Timer PWM Mode, TPM) timer and IPM (Intelligent Power Module) via basic driving algorithm to drive and adjust rotate speed of three-phase winding BLDC
The hardware circuit mainly contains power supply, control system, IPM and the corresponding driver, position sensors and RS232 communication module. The hardware block diagram and schematic are shown in Figure 2-1 and Figure 2-2 respectively.
Figure 2-1 System Block Diagram
In the following, we will illustrate IPM and the corresponding driver, position sensors and RS232 communication module in detail.
The SPMC75F2413A is the embedded 16-bit micro-controller, designed for inverter-fed motor driver, power electronics, home appliance and car fan control system, etc.
Figure 2-3 shows the hardware schematic of SPMC75F2413A.
Figure 2-3 SPMC75F2413A Hardware Block Diagram
Connecting the embedded In-Circuit-Emulation circuit of SPMC75F2413A via Probe can facilitate the development for user, accordingly improve the production efficiency and reduce time to market.
2.2 IPM Module and Driver
IPM (Intelligent Power Module) product is designed and developed with the advantages of reduced design, development and manufacturing costs as well as increased system reliability through self protection circuits (such as over-current, over-voltage, and over-temperature circuits) . It also supplies a solution for users to drive low-power BLDC. Figure 2-4 shows IPM electrical connections.
To protect MCU, electrical isolation is done between IPM and MCU with HVDC (High Voltage Direct Current) which improves the stability and reliability of system. Figure 2-5 shows the electrical diagrams via optical isolating the drive between IPM and MCU.
Figure 2-5 Optical Isolate the Drive Between IPM and MCU
Where, OC (Optical Coupler) must be connected to different power supplies in its two sides to implement electrical isolation. It is recommended to adopt quick OC, however, when the carrier wave frequency is not required too high, PC817/TLP521 OC can also be considered to reduce the cost.
Additionally, the ability of the IPM to self protect in fault situations is critical when MCU runs abnormally. Therefore, a “protect lock” is specially designed into hardware circuit. Once an error is detected, the driving signal sent to IPM will be cut off immediately and the hardware will request for IRQ to MCU at the same time. Upon eliminating the error, MCU enables the signal output bit to run IPM again. Figure 2-6 shows the hardware protection circuit.
Since commutate timing of BLDC depends on rotor position which determines the next excited phase, it is important to detect the current rotor position for driving BLDC. This application selects the BLDC integrated with Hall sensor as shown in Figure 2-7.
The PID controller is commonly used to adjust speed. It receives signals from sensors and computes corrective action to the actuators from a computation based on the error (Proportion), the sum of all previous errors (Integral) and the rate of change of the error (Derivative). The mathematical model of the PID controller can be represented as:
])()(1)([)(u0 dt
tdeTddtteTi
teKptt
++= ∫ (Formula 3-1)
Where:
u(t) Output of PID controller
e(t) Input of PID controller, which is the error between the desired input value and the actual output value, so called error signal.
Kp Proportional gain
Ti Integral time, also called integral gain
Td Derivative time, also called derivative gain
The mathematical model of the PID controller consists of Proportional Response, Integral Response and Derivative Response which are described as follows:
1. Proportional Response
The proportional component can be expressed as Kp*e(t).
In PID controller, the effect of controlling error depends on the proportional gain (Kp). In general, increasing the proportional gain will increase the speed of the control system response and reduce the steady-state error. However, if the proportional gain is too large, the system will begin to oscillate and become unstable. Thus, Kp must be suitably selected to keep the system stable and reduce the rise time and steady-state error.
2. Integral Response
The integral component can be expressed as∫t
dtteTiKp
0)(
.
From the expression shown above, we can see that the integral component sums the error term over time. The result is that even a small error term will cause the integral component to increase slowly. The integral response will continually increase over time unless the error is zero, so the effect is to drive the Steady-State error to zero.
But the integral control will reduce the speed of the overall control system response and increase the overshoot. Increasing the integral gain (Ti) will cause the integral component to accumulate weakly and reduce the overshoot, thus it will make system not oscillate during the rising time, therefore improve its stability. However, it will slow the
process of eliminating Steady-State error. Reducing Ti will strengthen the accumulation of integral component and shorten the time of eliminating error, but it will make the system oscillate. So Ti should be selected according to the practical needs.
3. Derivative Response
The derivative component can be expressed as dttdeTdKp )(*
.
The effect of derivative component depends on the derivative time constant (Td). In general, the larger Td, the better the effect to restrain the change of e(t) and vice versa. Thus, to select Td properly can make the derivative component better meets the system requirement.
The appearance of computer makes it easy to perform PID control by software to realize the control of Formula 3-1 is called digital PID control.
Since software control method uses sampling, which calculates the control signals based on the error at the sampling point, the signal cannot be output serially as analog control method does. Therefore, the integral and derivative components must be discrete.
])1()()()([)(1 T
kekeTdjeTiTkeKpku
k
j
−−++= ∑
=
(Formula 3-2)
Where:
K Sampling number, k=0, 1, 2 …
Uk Output value sampling at the K times
ek Error sampling at the K times
∑=
k
j
je1
)( Accumulative error sampling from the first time to the k times
A closed loop control system puts the regulator under pure proportion function, then changes the proportional gain from small to large to make the system oscillate continuously. The current proportional gain is called the critical gain Ku and the time interval between two neighboring peaks is called critical oscillation period Tu.
This application is designed for driving BLDC using 120-degree upper phase PWM waveform via hall sensor and adjusting motor speed by PID controller. Here we use SPMC75F2413A as an example for demonstration purpose.
4.2 Source File
File Name Function Type
Main Initialize parameters for driving BLDC, monitor BLDC running status (which is also performed in interrupt subroutine)
C
ISR Start up, run, protect BLDC and adjust its speed C
Spmc75 _BLDC_V100 Functions for driving BLDC lib
Spmc75_dmc_lib_V100.lib DMC communication program lib
4.3 DMC Interface
Speed1_Cmd: Set the rotate speed of motor
Speed1_Now: Feedback the current rotate speed of motor
User_R0: Current value in P_TMR3_TGRA
User_R1: Error between the desired speed and the actual speed
Motor 1 Start and Motor 1 Stop: Start/Stop the motor
4.4 Subroutines
Spmc75_System_Init ( )
Prototype void Spmc75_System_Init(void)
Description Initializations for I/O, PDC, MCP, CMT, Fault, PID and DMC
Note Call this subroutine when BLDC starts up or runs at quite a lower speed. It is recommended to call it in TCV interrupt of IRQ1
Example BLDC_Motor_Startup();
BLDC_Motor_Normalrun ( )
Prototype void BLDC_Motor_Normalrun (void)
Description BLDC running ISR
Input Arguments None
Output Arguments None
Head File Spmc75_BLDC.h
Library File Spmc75_BLDC_V100
Note Call this subroutine in PDC interrupt of IRQ1 to keep BLDC run normally (including position detection, commutation and speed calculation).
Example BLDC_Motor_Normalrun ();
BLDC_Motor_Actiyator ( )
Prototype void BLDC_Motor_Actiyator(void)
Description BLDC speed control including charging IPM, moving filter, PID adjustment and PWM amplitude limiting.
Input Arguments None
Output Arguments None
Head File Spmc75_BLDC.h
Library File Spmc75_BLDC_V100
Note This subroutine is critical to adjust BLDC speed. It is recommended to call this subroutine periodically using timer interrupt (512Hz). The calling frequency is determined by the highest speed of motor.
Note This subroutine responds for detecting and receiving the start-up/stop command, which can be called in main loop or timer interrupt within 10KHz.
Example BLDC_Run_Service();
IPM_Fault_Protect ( )
Prototype void IPM_Fault_Protect(void)
Description External fault protection
Input Arguments None
Output Arguments None
Head File Spmc75_BLDC.h
Library File Spmc75_BLDC_V100
Note This subroutine which must be called by IRQ0, is designed for protecting BLDC. Once an external fault input signal occurs, interrupt will generate when the output pins are set to high-resistance state.
Main program performs the system initializations, and ISR routines respond for the real time motor operations. The ISR include: input/output error interrupt (IRQ0), PDC and TCV interrupt (IRQ1), UART RXD interrupt (IRQ6) and CMT0 timer interrupt. Figure 5-1 flow charts the main loop.
Fault input, output short circuit, PDC, TCV, RXD and CMT0 interrupt routines help to control BLDC starting, working, speed adjusting and fault protection. These interrupt sources have been configured in the system initialization routines. Figure 5-2 shows the interrupt operation process of PDC and TCV for your reference.
This test is aimed to use 120-degree upper phase PWM waveform to drive BLDC with hall sensor and adjust motor speed by PID controller.
Test contents:
Six phase output signals
WN2: IOB0/W1N
VN6: IOB1/V1N
UN4: IOB2/U1N
W5: IOB3/W1
V3: IOB4/V1
U1: IOB5/U1
Three phase hall input signals
H3: IOB8/TIO0C
H2: IOB9/TIO0B
H1: IOB10/TIO0A
7.1 Control Signals
The relationship between control signal and position feedback signal is available through theoretical analysis and practical operation. Figure 7-1 shows the 120-degree upper phase PWM waveform when the motor is driven in forward direction and Figure 7-2 shows that in backward direction.
Figure 7-1 120-degree Upper Phase PWM Waveforms When the Motor Is Driven in Forward Direction
From the waveform, we can see that when the motor is driven in forward direction, the corresponding relationship between position detection and control signals can be obtained as: 010 (H3 H2 H1) V6-V1, 011 (H3 H2 H1) V5-V6, 001 (H3 H2 H1) V4-V5, 101 (H3 H2 H1) V3-V4, 100 (H3 H2 H1) V2-V3, 110 (H3 H2 H1) V1-V2.
Figure 7-2 120-degree Upper Phase PWM Waveform When the Motor Is Driven in Backward Direction
From the waveform, we can see that when the motor is driven in backward direction, the corresponding relationship between position detection and control signals can be obtained as: 001 (H3 H2 H1) V1-V2, 011 (H3 H2 H1) V2-V3, 010 (H3 H2 H1) V3-V4, 110 (H3 H2 H1) V4-V5, 100 (H3 H2 H1) V5-V6, 101 (H3 H2 H1) V6-V1.
The SPMC75F2413A chip is dedicated to drive motor which can generate various driving signals such as pre-sixty degree PWM waveform shown in Figure 7-3. Here we simply demonstrate a possible design idea and give a reference for user’s further application.
As mentioned above, BLDC speed is adjusted by PID controller which can vary the output voltage fundamental with different PWM duty, thus to control the motor speed. Figure 7-4 and Figure 7-6 respectively depict the waveforms when BLDC runs at 1000rpm and 3200rpm.
Figure 7-4 PWM Waveform (1000rpm)
From the waveform, we can see that when BLDC runs at 1000rpm: Hpwm=22us, Lpwm=102us. Thus PWM duty can be calculated as: Dpwm=Hpwm/ (Hpwm+Lpwm)*100%=22us/124us*100%=17.74%.
From the waveform, we can see that when BLDC runs at 3200rpm: Hpwm=94us, Lpwm=32us. Thus PWM duty can be calculated as: Dpwm=Hpwm/ (Hpwm+Lpwm)*100%=94us/126us*100%=74.6%.
7.3 Current Waveform
Figure 7-6 is current waveform tested via current probe during BLDC running. The test conditions are: small load, low current, and 6 KHz PWM carrier waveform.
As described in Chapter 3, in order to correct system response, the only thing to do is to chang Kp. Following depicts the system response curves when Kp is set as different values.
Figure 7-7 shows the steady-state characteristic test curve at Kp= 0.385. Obviously, the system oscillates when the rotate speed is low (1000rpm) and has a long duration during rising time (1000rpm ~1500rpm).
Figure 7-7 Steady-State Characteristic Test
Figure 7-8 shows the step response curve at Kp= 0.225 when the rotate speed ranges from 0rpm to 2000rpm.
Additionally, steady-state error must be considered into the speed feedback system. Figure 7-10 shows the steady-state error curve when the rotate speed is 1000rpm, where steady-state errorδ=(C (t)-C∞) / C∞ * 100% < ±10/1000 * 100%=1%.
Figure 7-10 Steady-State Error when the Rotate Speed is 1000rpm
Figure 7-11 shows the steady-state error curve when the rotate speed is 3000rpm, where steady-state error δ=(C (t)-C∞) / C∞ * 100% < ±12/3000 * 100%=0.4%.
Figure 7-11 Steady-State Error when the Rotate Speed is 3000rpm
Figure 7-12 shows the step response curve at Kp=0.225 when the rotate speed ranges from 1000rpm to 3000rpm. We can see that the overshoot is always zero and no oscillation occurs. But the error (C (t)-C∞) is always higher than 150rpm irrespective of whether the rotate speed is lower or higher.