CHAPTER 1 INTRODUCTION
1.2 T HESIS O RGANIZATION
The purpose of the thesis is to drive the BLDC motor by implementing the
sensorless control strategy in the F2812 DSP board, which has complete interfaces and powerful operating frequency. Hence, the proposed sensorless control strategy can regulate the motor to a high speed by producing control signals. The high speed R/C BLDC motor is used as the plant since it is small and has high efficiency and low power consumption. In the thesis, Chapter 2 introduces the basic concepts of BLDC motor and Chapter 3 introduces the sensorless method based on zero-crossing
detection [7] and the start-up procedure [7]. The description of the DSP board is briefly
given in Chapter 4, especially on the ADC module and PWM module. The core of this thesis is the software programming and hardware implementation proposed in Chapter 5, including the flow charts and the circuitries. Some techniques and trial-and-error ways are also proposed in Chapter 5. The experiment results are shown in Chapter 6 to verify the sensorless control strategy and the start-up procedure. Finally, Chapter 7 presents the concluding remarks.
Chapter 2
The Review of BLDC Motors
The traditional DC motor has to commutate phase currents with the use of brushes, which are easily worn and thus require maintenance. Commonly, friction and noise would be also produced by the brushes not only to disturb the surrounding electrical equipments, but also to shorten the lifetime of the DC motor. To avoid the above disadvantages, the brushless DC motor, BLDC motor in brief, has been adopted as a substitute of the traditional DC motor. This chapter will introduce the mathematical model of a BLDC motor and present its typical driver.
2.1 The mathematical model of BLDC motors
The equivalent circuit model of a BLDC motor with Y-connected stator windings is shown in Fig.2.1. Since the neutral point is isolated, the phase currents of BLDC
motor, ias(t), ibs(t), ics(t), are related as
( )
t +i( )
t +i( )
t =0ias bs cs (2-1)
i as
i bs
i cs
Fig.2.1 Equivalent circuit model of a BLDC motor vas
The three windings are distributed with 3 2π
in electrical degree apart to each other.
Let Ls and Lms represent the self-inductance and the mutual inductance of the stator winding, and λas, λbs, λcs be the flux linkages related to the three phases of the
stator [8]. Therefore, the stator flux can be expressed as
( )
e produced by the permanent magnets, which are assumed sinusoidally distributed in theair-gap. Then, the stator voltages, vas(t), vbs(t), and vcs(t), can be formulated as
( ) ( ) (
t,matrix form as
⎥⎥
From (2-9)-(2-11), the dynamic equation of the 3-phase stator is represented as
( )
s a( )
as( )
e pm e( ) ( ) ( )
⎟Besides, since the rotor would be engaged by the excited phase currents, the torque of the motor produced while moving could be shown as[20]
( )
where Wco is the co-energy defined in Fig.2.2, and represented as
∫
Fig.2.2 Characteristic for co-energy
From (2-3)-(2-5), for a p-pole 3-phase motor, the total electrical energy could be expressed as
Then, the electromagnetic torque would be formulated by three phase currents as
( )
⎥From (2-16), the relationship between electromagnetic torque and back-EMFs would be represented as
According to the Newton law, the electromechanical equation can be expressed as
(
m e L) (
eTherefore, the mathematical model of the BLDC motors are (2-14)-(2-16) and (2-23). In these dynamic equations, there are four state variables, ias, ibs, ics, and ωe, and three input voltages, vas, vbs, and vcs, and one external load torque TL.
2.2 The typical driver of BLDC motors with Hall-effect sensors
The typical commutation for a BLDC motor is accomplished by controlling the six inverter switches based on the sequence of six segments C , BB A , A , CC B ,
A
B , C to produce the phase current waveforms as shown in Fig.2.3[21], and the A
rotor position is required to be detected before switching. The rotor position which is commonly obtained according to the Hall-effect sensors located inside the motor is represented by a three-bit digital signal. With these Hall-effect sensors, the system of a BLDC motor is schematically depicted in Fig.2.4, including the driver circuit and PWM control.
Phase C 0 Phase B
0 Phase A
0
ic
ia
ea
ec
eb ib
0° 60° 120° 180° 240° 300° 360°
Fig.2.3 Ideal back-EMF and phase current waveform of a BLDC Motor θe
B
C AB AC BC BA CA
Hall-effect sensor Hc
Commutation Logic Hb PWM control Duty
ratio
Ha
Fig.2.4 System schematic of a BLDC Motor by using Hall-effect sensor
Driver circuit
ia
ib ic
For example, if the Hall-effect sensors send out 001 which means the rotor
position is in the segment C , the transistors SB 1 and S5 in the driver circuit should be turned ON to produce the phase current pass through a to b. Then, the rotor will move
to the region located in segment A and the Hall-effect sensors will send out the B three-bit signal 101. Step by step, the rotor will be rotated following the sequence of
B
C , BA , A , CC B , B , A C , and the properties related to these six segments are A
shown in Table.2.1. By the way, the segment A also represents the direction of the B phase current pass through a to b where ia is positive and ib is negative as shown in Fig.2.3. Additionally, the two cascaded power transistors in the driver circuit can not conduct at the same time, such as S1 must be ON while S4 is OFF, to avoid burned out.
Evidently, the Hall-effect sensors are commonly used to measure the rotor
position, which is important information for normally operating the BLDC motor.
Unfortunately, the Hall-effect sensors have some disadvantages to face. They may increase the cost and size of the motor, or may be affected by the operating conditions, such as temperature or humidity. Therefore, the strategy of sensorless instead of the Hall-effect sensors has become more and more popular nowadays, which will be
discussed in the next chapter.
segment Electrical angle Switch on Hall-effect sensor signal B
C 0 ~o 60 o S3, S5 001
B
A 60 ~o 120o S1, S5 101
C
A 120 ~o 180o S1, S6 100
C
B 180 ~o 240o S2, S6 110
A
B 240 ~o 300o S1, S4 010
A
C 300 ~o 360o S3, S4 011
Table 2.1 Properties related to the six segments
Chapter 3
Sensorless Control for BLDC Motors
From the previous chapter, in order to substitute the Hall-effect sensors located inside the motor, several sensorless control strategies have been proposed, such as back-EMF based position estimation method[10], Kalman-filter based method[4], third harmonics voltage position detection method[5], and free-wheeling diode conducting method[6]. This chapter will focus on the back-EMF based position estimation method, which will be employed in this thesis.
3.1 Back-EMF Based Position Estimation Method
In the basic BLDC motor operation, only two of three stators windings are excited at any segment and the third one is open while in the transition period with declined or rising back-EMF in Fig.2.3. Based on this appearance, the rotor position could be detected by sensing the back-EMF voltage, the so-called zero-crossing point detection, to determine the switching sequence by detecting the instant where the back-EMF in the unexcited phase crosses zero. With Y-connected stator windings and the neural voltage vn, the three terminal voltages , va vb, and vccan be expressed as
n
from (3-1) to (3-3). When one phase is non-excited, its phase current will vanish and
the other two phase currents are constant. For example, sections C and CB B in Fig.2.3 show that ib =−ic, eb =−ec, and ia =0, i.e., phase a is non-excited. In this
case, the back-EMF voltage of non-excited phase a becomes
(
⎥⎦⎤which can be derived from (3-1) to (3-4). Similarly, the back-EMFs of non-excited
phase b and non-excited phase c can be respectively obtained as
(
⎥⎦⎤It is noticed that only the back-EMF voltage of the non-excited phase has the feature of zero-crossing, which is the basic concept of the zero-crossing point detection. As the previous example concerning non-excited phase a, the section CB and BC where rotor is located are considered to obtain. The relationship between three terminal voltages and the waveform of the back-EMF produced from (3-5) are shown in Fig.3.1 which is matched with the Fig.2.3. Thus, when the back-EMF equals to zero, the position of the zero-crossing point is been detected, then the electrical angle
ea
ea
could be in the region of 0°-60° or 180°-240°, i.e., section CB and BC respectively.
Furthermore, the other angles will be found with phase b and phase c in the same way.
( )
⎥⎦⎤Fig.3.1 Ideal three terminal voltages and the waveform of back-EMF Vdc
The system scheme in Fig.2.4 could be changed as Fig.3.2. Note that most of the existing sensorless techniques cannot be applied in the low speed range, since it is difficult to sense the zero-crossing points of back-EMF voltage from a low voltage signal. To overcome such problem, compensation algorithms have been proposed in [11], and other strategies are also proposed such as [12].
Phase Voltage Zero-crossing detection
a b c n
Commutation Logic PWM control Duty
ratio
Fig.3.2 System schematic of sensorless BLDC motor drive
Driver circuit
3.2 Commutation Phase Shifter
By the previous method, the zero-crossing signal would be produced and shown in Fig3.3, and the Hall-effect signal is also presented as reference. Compared with these two signals in Fig.3.3, the zero-crossing signal advances 30 electrical degrees. In order to produce the same commutation signal, the zero-crossing signal should be delayed 30 electrical degrees for matching the Hall-effect signal. Thus, the produced commutation signal will be correct with this sensorless method instead of Hall-effect sensor.
Zero-crossing signal
Ha
non
ea−
0° 60° 120° 180° 240° 300° 360°
Fig.3.3 The relationship of the non-excited phase back-EMF, zero-crossing signal, and Hall-effect signal
In traditional, the phase shifter with low pass filter will be affected by the rotor speed. A novel phase shifter which has been proven independent of input signal frequencies is proposed in [3], and it also can be implemented easily on a microcomputer. This frequency-independent phase shifter (FIPS) has been improved in [1] and the block diagram presented by Simulink® is shown in Fig.3.4. The variable γ which denote the decreasing increments for the counters can be set with desired degrees φ*of the phase shift and represented as
φ*
γ = π (3-8)
Thus, to produced the 30∘delayed zero-crossing signal y
( )
k , γ should equal to 6 while x( )
k is the zero-crossing signal.Fig.3.4 Block diagram of FIPS[1]
xP
xN
( )k cn
( )k cp
3.3 Start-up Strategy for BLDC Motors
Since there is no or a little back-EMF to sensed when the motor standstill or at a low speed, the sensorless method based on zero-crossing detection may not be used.
An additional start-up procedure should be executed first to avoid this problem.
In the experiment, an open-loop start-up strategy is accomplished by providing a rotating stator field which increases gradually in frequency, and the stator field attracts the rotor field to overcome friction and inertia, then the rotor begins to rotate. Assume one of the input PWM control signal shown in Fig.3.5, and its period is changed from T1 to T4, where T1> T2> T3> T4. The final period T4 is determined in a trial-and-error way based on the specification of the motor, and the value of initial period T1 should be set a little larger. From standstill to starting, the period of the input signal attenuates with time, and the rotor will become rotating while the period equals to the final value.
After this start-up procedure, the motor starts rotating and the sensorless method can be used by detecting the zero-crossing points from the computed back-EMF.
T1 T2 T3 T4
Fig.3.5 The contracted PWM control signal
Chapter 4
Description of DSP F2812
In the experiment of this thesis, a DSP board called ezDSPTM F2812 was utilized to realize the previous theorem. The DSP chip as a microprocessor or microcontroller in this board is TMS320F2812. It is a member of TMS320C2000 DSP generation which is a high-performance solution for demanding control applications and manufactured by TI. The generation TMS320C2000 is divided into two groups, TMS320C24x and TMS320C28x. The DSP chips, TMS320F240, TMS320LF2407A, and TMS320F2812, which belong to those two groups, are mostly used in the control applications. A roughly specification comparison of these three DSP chips is shown in Table 4.1, where the advantages of TMS320F2812 can be seen obviously due to the highest operating frequency, fastest conversion speed and 12-bit high resolution ADC module. In addition, the on-chip memory is also the largest for users to store data.
Therefore, this chip is powerful in application and may be adaptive in the high-speed situation.
The main purpose of using this DSP board is not only developing the algorithm inside the chip but also utilizing its useful peripherals such as ADC module and PWM waveform generation module to connect the motor plant and the driver circuit. The two modules will be introduced in the following sections.
TMS320F240 TMS320LF2407A TMS320F2812
Frequency 20 MHz 40 MHz 150 MHz
CPU 16-Bit 16-Bit 32-Bit
Multiply/Accumulate 16×16 16×16 32×32
On-Chip Ram 544×16 2.5K×16 18K×16
On-Chip Flash 16K×16 32K×16 128K×16
ADC Resolution 10-Bit 10-Bit 12-Bit
ADC Channels 16 16 16
ADC Conversion time 6.1us 500ns 200ns
PWM 12-ch 16-ch 16-ch Table 4.1 Specification Comparison of TMS320F240, TMS320LF2407A, and
TMS320F2812 [22]
4.1 Hardware Description
The hardware description of the DSP should be divided into two parts, the DSP chip and the DSP board, and the manufacturers are different. Some problems which might occur when designing the peripheral circuit were solved by the manufacturer of the DSP board. The end user needn’t consider the problem of the compatibility when connecting to other equipments.
The functional block diagram of the DSP chip is shown in Fig.4.1, and it can be roughly divided into four parts, CPU, memory, peripherals, and external interface. The external interface is not used in the experiment since no extra memory is required. To
enable the functions of the peripherals, some flags should be set first according to some header files released by TI for end users to define these flags. Hence, this experiment could directly give the specific command in programming instead of assembling the complicated machine code of the flags.
With this functional block diagram, let’s see how to implement the motor drive procedure. First, the signals of the motor’s three-phase terminal voltages will be sent through three channels into the 12-bit ADC, which converts these analog signals into digital data and stores them in the ROM. Then, the CPU will use these digital data to execute the pre-designed process, such as the process to find the zero-crossing. Finally, the desired signals generated from the pre-designed process will be sent out through General-Purpose Input/Output (GPIO), and thus the procedure of the motor drive is realized.
Fig.4.1 Functional Block Diagram [13]
The layout of the DSP board ezDSPTM F2812 is shown in Fig.4.2. Socket U8 is the place where the DSP chip is installed. If the DSP chip is damaged, it can be
replaced easily. Although both the JTAG interface P1 and the parallel port P3 could be used to download the DSP programs, our experiment adopts P3 only. The connectors P4, P7, and P8 are the GPIO interfaces, and the connectors P5 and P9 are the analog interfaces. Note that the input voltage of the analog interface is between 0V and 3V,
thus a voltage-decaying circuit will be needed for voltage reduction. According to the previous example, the input signal must be connected to P5/P9, and the produced signal will be output by P4/P8/P7. In addition, the source voltage of this DSP board is 5V and is provided through P6.
This DSP board contains six jumpers JP1, JP7, JP8, JP9, JP11, and JP12 are also shown in Fig.4.2, which are available for users to determine the functions on the DSP board. The jumper JP1 is used to set the operating mode. In this experiment, the jumper JP1 is set as microcomputer mode for the use of the software CCS. The jumpers JP7, JP8, JP11, and JP12 are used to determine what mode the DSP will use for bootloading on power up. The mode of running code from flash memory can be set by these jumpers. Users can store their program in the flash memory and load it after booting the DSP board instead of loading it again from computer. Finally, the jumper JP9 is used to enable/disable the use of the Phase Lock Loop (PLL) logic on the DSP, and the default setting “PLL Enabled” is only used in the experiment.
Fig.4.2 Layout of ezDSP F2812 [14]
4.2 Analog-to-Digital Converter (ADC)
The ADC module of TMS320F2812 will be utilized in our experiments as converting the signals of the motor’s three-phase terminal voltages. The specification [15] is listed below:
12-bit ADC core with built-in dual sample-and-hold (S/H)
Analog input: 0V to 3V
Fast conversion time runs at 25 MHz, ADC clock, or 12.5 MSPS
16-channel, multiplexed inputs
16 result registers (individually addressable) to store conversion values Since the input voltage is limited between 0V and 3V, a simple circuit such as shown in
Fig.4.3 is used to lower down the three terminal voltages of the motor, which are analog signals and will be input to ADC module through three channels, ADCINA0, ADCINA1 and ADCINA2, shown in Fig.4.4. Actually, these analog signals Vi are converted into digital values via ADC module as
0 if
where ADCLO is the reference voltage of the analog ground which located in pin18 of the port P9 shown in Fig.4.2 and 4095 is related to 12-bit resolution. The obtained digital values will be stored in the 16 Result Registers, whose addresses can be
assigned in the on-chip memory. Further, re-scale the digital values within the range of 0~3 volts to match with the 16-bit ADC Result Registers such that the ADC output range will be between 0000h and FFF0h. In our experiment, the three registers, Result Reg 0, Result Reg 1 and Result Reg 2, store the converted values from ADCINA0, ADCINA1 and ADCINA2, respectively.
+12V
V 3 30KΩ
10KΩ
Fig.4.3 Voltage-divider circuit
Fig.4.4 Block Diagram of the F2812 ADC module[15]
In general, programming skill in DSP code is used to simplify the initial setting and extract the signal of ADC module, so is in our experiment. It is known that the ADC control registers must be set for initializing the ADC module to determine its
specification such as operating mode, sampling mode, and etc. Those parameters of ADC control registers have been defined in the head files, and the users should include all these head files in their programs for parameter setting. However, using these parameters directly in our main function will make the program complicated. For simplicity, a self-defined head file is further developed by constructing a structure which define a smaller number of new parameters, each able to represent some of the parameters related to the ADC control registers. Below show part of the structure containing some new defined parameters utilize in our main function:
typedef struct { int16 Ch1Out; //Output: Channel 1 output int16 Ch2Out; //Output: Channel 2 output int16 Ch3Out; //Output: Channel 3 output
Uint16 ChSelect; //Parameter: ADC channel selection ……
In this structure, ChSelect represent the four channels of ADC module are selected and the other Ch1Out, Ch2Out and Ch3Out respectively represent the results of the signals converted by the ADC module from channel 1, channel 2 and channel 3. To use the parameters in the structure directly, the structure is named as adc1 in main function.
Therefore, if ChSelect is needed, the parameter adc1.ChSelect should be used instead.
For example, in our main function, when the value of Chselect is assigned as 0x3210,
it means that the channel A0, A1, A2, and A3 are selected. Then, call the ADC initial function to store the change. This will complete the initialization of the ADC module
it means that the channel A0, A1, A2, and A3 are selected. Then, call the ADC initial function to store the change. This will complete the initialization of the ADC module