digital control principle for controlling the PM synchronous motor are described. The sampling period and the controller parameters are determined analytically ...
516
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 35, NO. 4, NOVEMBER 1988
Microprocessor-Based Controller Design and Simulation for a Permanent Magnet Synchronous Motor Drive TIAN-HUA LIU, CHUNG-MING YOUNG, AND CHANG-HUAN LIU, MEMBER,
Abstract-The speed control of a permanent magnet (PM)synchronous motor drive that is fed by a current hysteresis-controlld voltagesource inverter is investigated. The objective is to study the feasibility of implementing a microprocessor-based controller that may achieve complete software control of motor speed. A mathematical model and a digital control principle for controlling the P M synchronous motor are described. The sampling period and the controller parameters are determined analytically according to a linearized model. A systematic simulation procedure is proposed for verifying the feasibility of theoretical modeling and controller design. An experimental prototype system is constructed for correlating with the theoretical results. The experimental results closely follow theoretical predictions, thus validating the proposed control method.
I. INTRODUCTION
I
N RECENT YEARS permanent magnet (PM) synchronous motors have been gradually replacing PM dc motors in various high-performance demanded applications such as machine tools and industrial robots. The advantage of using PM synchronous motors is that many drawbacks caused by the brushes and commutators of the dc motors can be eliminated. In addition, the PM synchronous motors have lower rotor moments of inertia, better heat dissipation, and smaller size, as compared with the PM dc motors having the same given output rating. To achieve fast four-quadrant operation and smooth starting and acceleration, a PM synchronous motor is usually powered by a transistorized inverter. Many control schemes for the inverted-fed PM synchronous motor drives have been proposed that can achieve the required performance in servo-drive applications [11-[4]. One popular approach is to employ a current hysteresis-controlled PWM voltage-source inverter (VSI) that feeds a PM synchronous motor. The control objective is to minimize the deviation between the reference three-phase line current commands and the feedback three-phase line currents through the switching of inverter transistors. The reference current commands are generated based on the principle that the resultant stator current vector is always kept in quadrature with the rotor flux vector. The goal is to achieve maximum generated torque per ampere during on-line operation. This paper investigates a microprocessor-based controller design method for the speed control of a PM synchronous Manuscript received September 3, 1986; revised April 21, 1988. The authors are with the Department of Electrical Engineering, National Taiwan Institute of Technology, Taipei, Taiwan 10772. R.O.C. IEEE Log Number 8823358. ~
IEEE
motor drive that is fed by a current hysteresis-controlled PWM VSI. The main topic in this paper that differs from those in [ 11-[4] is the study of the feasibility of implementing a digital speed control system in which the controller is totally realized by algorithms*Other distinctive featuresin this paper are the determination of sampling period and controller parameters based on a simplified analytic system model and the proposition of a step-by-step simulation for evaluating system performance. The paper is organized as follows. A general description of the proposed speed control system is given in Section 11. The mathematical model for the PM synchronous motor is established next by using de-qe equations in the synchronously rotating reference frame. The design of the digital controller based on the current hysteresis-controlled VSI and vector control [3] is formulated in Section III. In Section IV the determination of the sampling period and the controller parameters is given; the parameters are obtained analytically based on a linearized system model. Section V provides both computer Simulation and experimental results for evaluating dynamic responses of the speed control system. Finally, in Section VI concluding remarks are given.
II. SYSTEM DESCRIPTION AND MODELING The block diagram for the digital speed control system to be considered in this paper is shown in Fig. 1. The hardware part of the system consists of a three-phase PM synchronous motor and load, a current hysteresis-controlled PWM VSI with three independent phase controls [5], and a three-phase sinusoidal current-referencegenerator that received amplitude and phase commands of the stator current vector from the digital controller. The motor chosen for the study is a three-phase Yconnected four-pole Electro-Craft BLM-2004 PM synchronous motor with a trapezoidal air-gap magnetic flux distribution. A resolver is mounted on the motor shaft for velocity and position sensing. The output of the resolver is converted into digital rotor speed and absolute rotor position values using a resolver-to-digital converter (RDC). The motor does not utilize a conventional commutation sensor or a brushless tachometer for determining the absolute rotor position. The digital controller uses feedback RDC information, the sensed three-phase line currents, and the input reference speed to generate amplitude and phase commands for the sinusoidal current-referencegenerator. The mathematical model of the PM synchronous motor can
0278-0046/88/1100-0516$01.000 1988 IEEE
517
LIU e?al. : MICROPROCESSOR-BASED CONTROLLER DESIGN
synchronous motor will be used in the numerical simulation of the drive performance.
III. CONTROL LAWFORMULATION
Fig. 1 .
Block diagram for the proposed digital speed control system.
be set up by expressing the machine dynamic equations in the de-@synchronously rotating reference frame. The machine is assumed to have no damper windings and is under balanced operating conditions. In per unit form the voltage equations are written as PA& uds=-+rlids-Aqs-
Wr We
*e
PA, Wr uqs = - rl iqs A, -
+
We
+
We
where p is the differential operator d / d t , U, and uqsare the deand qe-axis stator voltages, A, and A, are the de- and qe-axis flux linkages, id, and iqsare the de- and @-axis stator currents, rl is the stator resistance, oris the rotor angular speed, and we is the angular synchronous speed. The flux linkage equations are
A& = xdi& + XmdIfd
(3)
A, = xq iqs
(4)
The method of controlling the PM synchronous motor drive can by described by using the vector diagram shown in Fig. 2 and the field orientation principle. In Fig. 2, with the as-axis being the fixed reference axis, at steady-state, the de-qeaxes revolve around the air-gap in synchronism with U , . Since, in the PM synchronous motor, the magnetic flux generated from the rotor is in fixed relation to the rotor, the flux angular position is determined by the rotor position, which is in alignment with the de-axis. In the de-qecoordinate frame, the stator current is has two components i, and iqs,where id, is the flux producing component and iqs is the torque producing component. The angle 4 between id, and iqsis computed from 4 = tan- (ih/iqs). If by properly controlling the angle 4 so that the stator current vector is all transformed to the qe-axisand i& is zero, the air-gap flux will be completely determined by the rotor magnet whose flux is the constant A,. According to (7), the generated torque T, is now linearly proportional to iqs. Thus, direct torque control of the motor can be achieved, if the phase angle of is with reference to the de-qecoordinate frame is adjusted according to the condition 4 = 0 and the magnitude of is is adjusted according to the torque demand. To achieve the above control approach, the digital speed control system for the PM synchronous motor drive is proposed as shown in Fig. 1. The system is assumed to operate under a uniform sampling rate. In each sampling period, the deviation between the reference speed W : and the feedback motor speed W , is processed by a digital PI control algorithm that generates the torque command T,*. Let AWr = U: - W r . In the z-domain
(9)
where Xd and X , are the de- and @-axis reactances, x m d is the where Kp and KI are the PI controller parameters. Taking the de-axis magnetizing reactances, and Ifd is the equivalent deinverse z-transform of (9) axis magnetizing current, since the magnet excitation is fixed. k The electro-mechanical equation of the machine is T,*(kT)=KpAw,(kT)+KI Aw,(iT) (10) i=O
Jm
where J, is the inertia constant, TL is the load torque, and the motor torque Te is given by
for k = 1, 2, new variable
*
e,
where T i s the sampling period. Define a k
a ( k T ) = C Awr(iT) i=O
where A&(O) = 0. Equation (10) can be rewritten as
Substitution of (3), (4) into (l), (2) yields
T , * ( k T ) = K p A ~ , ( k+TK,a(kT) )
1
pidc= - [U, v d s - WJI id, + XqiqSw,]
(7)
x d
Equations (5)-(8) represent three-state (a,,id,, iqs)nonlinear differential equations. The nonlinear model of the PM
(1 1)
and a(0) = 0. T,*( k T ) is passed through a limiter to form the magnitude i: of the stator current vector. i: and T,*are related bY
T,* q m a x - T z m xIT,*IT z m x .
(12)
518
E E E TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 35, NO. 4, NOVEMBER 1988
where i: is computed from (12); [* = tan-'(-ids/iqs), if is lags the @-axis, and [* = 0, if is leads the @-axis. A. Current Hysteresis-Controlled Operation
CS
Fig. 2. The vector diagram for controlling the PM synchronous motor.
Notice that the limiter adds up to a new nonlinearity element in the system model. In order to accurately identify the position of the stator current vector in the d'-qe coordinate frame, the absolute rotor position and the angle [ must be determined. The absolute rotor position is measured by using the resolver mounted on the motor shaft and the RDC. The de-axis and the rotor flux positions are determined accordingly, since they all align with the absolute rotor position. The angle 4 is computed via the three-phase to two-axis transformation of the stator line currents. Let i,, ibs, and i,, be the three-phase stator line currents that are obtained by using current sensors and A/D converters. The two-axis stator currents ids and iqs are computed from
The generated three-phase line current commands as computed from (14) serve as references for the current hysteresiscontrolled PWM VSI. The basic circuit of a three-phase VSI is shown in Fig. 3. The three pairs of power transistors (denoted by TI - T,' , T2 - T i , and T3 - T i ) provide eight conduction modes according to the switching of transistors that is determined from the hysteresis controllers. Table I summarizes the eight conduction modes of the inverter. In the table, 1 denotes the ON state and 0 denotes the OFF state of the transistors. For the conduction modes N, = 6 and N, = 7, the three transistors situated on the same side of the inverter are turned OFF or ON simultaneously. In either case, the machine is disconnected from the inverter. These modes are called freewheeling periods [4]and are indicated in Table I by the index FW = 0; the rest of the modes are indicated by F W = 1. The first six conduction modes in Table I provide six nonzero voltage vectors, while the last two modes provide zero voltage vectors [5]. By properly applying the firing sequences (Ns = 0 to N, = 5 ) to the inverter transistors according to Table I, the resultant stator voltage vectors and consequently stator current vectors will interact with the rotor flux to provide necessary electromagnetic torque for motor motion. The switching of the power transistors is determined from
-I,
ibs
0
-1 2
where 8, is the absolute rotor position. The angle 4 is then computed as: [ = tan-'(ids/iqs). As mentioned before, the control objective is to position the stator current vector on the @-axis so that ids = 0 (hence [ = 0) and maximum torque/ ampere may be achieved. Referring to Fig. 2, through the feedback computation of (13) the stator current vector is assumed to be at the shown position-i.e., is lags the @-axis by an angle 4. If the stator current vector is to be located on the @-axis during the next sampling period, the generated stator current command vector must lead the @-axis by an angle 4. Thus, the generated three-phase current commands are given by i;= i: sin
(e, + [*)
(13)
the current hysteresis controllers. In this paper, three independent phase current controllers are used. Fig. 4 shows the control for one inverter leg. In the figure, the phase-a current reference i; is subtracted from the feedback phase-a motor line current i, to form the current deviation Ai, (= i; - i,). If Ai, is greater (less) than the preset hysteresis band h, the inverter leg is switched in the positive (negative) direction; otherwise, if [Ai,] < h, the inverter leg retains its current conduction mode. The hysteresis band in effect regulates the maximum current ripple in phase-a. The operation of the other two hysteresis controllers can be similarly described. Detailed operation of the current hysteresis controllers has been reported in [5]. Based on the conduction modes tabulated in Table I, the
5 19
LIU et al.: MICROPROCESSOR-BASED CONTROLLER DESIGN
controlling the duration of the free-wheeling period [4]. When the free-wheeling period is detected, it is allowed to continue for a certain duration (e.g., 100 ps). Then the hysteresis band h is set to zero for every specified duration (e.g., 50 ps) of free-wheeling period in a periodic fashion. The approach not only eliminates free-wheeling periods but also provides protection for transistors through delay switching that avoids excessive modulation. The lockout circuit shown in Fig. 4 is used to delay the switching of transistors, thus reducing the modulation frequency and losses.
Inverter
"c
Fig. 3.
IV . SAMPLING PERIODAND CONTROLLER PARAMETERS DETERMINATION
The power circuit of a voltage-source inverter.
Due to the nonlinear dynamics of the PM synchronous motor drive and nonlinear ON-OFF switching characteristics of the current hysteresis controllers, analytic solutions concerning the determination of the sampling period and controller parameters are unattainable. The nonlinear system model must be linearized so that analytic methods may be applied. Consider the operation of the current hysteresis controllers at steady-state. Since the current deviations between the current references and the actual line currents are at most twice the preset hysteresis band h [ 5 ] , which is usually quite small, as compared to the actual current magnitude, we may assume that, at steady-state, i z G i,, i;, ibs, and i z G its. Furthermore, in two-axis representation, the desired stator current vector is to be positioned on the qe-axis so as to achieve maximum torque per ampere. That is, i: its and E 0. Using (13) and the assumption that i z G i,, i;, = ibs, and i; E i,,, the de-axis current i* is regarded as zero. Then (5)-(8) are reduced to
=
hysteresls controller
=
i*
GS
Fig. 4. Current hysteresis controller for one inverter leg.
iX
1
two-axis stator Voltages vds and Vqs,in closed-loop fashion, can be expressed as functions of N, and inverter dc input voltage vc :41 where L, = xq/we, Lmd = Xmd/Ue, and K~ = ~ ~ d ~ Notice that the simplified system dynamic equations have exactly the same form as that of a PM dc servo motor. The ' c' FW (16) block diagram for the simplifed speed control system is shown in Fig. 5, in which if = iqs at sampling instants. In Fig. 5, a saturation type current limiter is included in the where vds and Vqsserve as input to (7), (8). feedforward loop. The simplifed system dynamics are still B. Low Speed Operation nonlinear. However, there is only one nonlinear element in the One drawback of the hysteresis controllers is that for very control loop, the classical describing function technique [6], low speed operation, the three-phase current errors Ai,, Aibs, [7] can be applied for the analysis and design of the controller. and Ai,, are very small and all lie within the hysteresis band. In the z-domain, the linear transfer function in the feedforward This leads to the conduction modes of free-wheeling periods. loop is given by All three inverter legs are either turned ON or OFF. The machine is disconnected from the inverter power supply. This results in insufficient torque for motion control. Thus, the performance of the current hysteresis controllers is degraded The three parameters, K p , K I , and T, in (19) are to be during very low speed operation. To improve the low speed operation of the motor drive, determined. some modifications of the hysteresis controllers have been The describing function technique considers the design in proposed [4], [5]. In this paper, we choose the method of the frequency domain. This is done by using the bilinear *
Vc
FW
(15)
f d .
520
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 35, NO. 4, NOVEMBER 1988 TABLE II COMPUTATIONAL COMPLEXITY OF THE CONTROL ALGORITHM
IT
Ltnittr
7
1
2
1
6
0 0
0 3
0
5
t’
0
0
0
1
0
0
1
3
1
I 8.
Total Operation
Fig. 5 . Simplified speed control system block diagram.
0 0
2
‘ds’ ’qs
.
7
2
8
1
3
3
transformation. Let
l+w z=1-w Substituting (20) into (19), in the w-domain, (19) becomes G(w)=
(KT/Jm) . T
[-(K1+2KP)w2+2Kpw+K,] 4w2 (21)
The transfer function G(w) is easily transformed into the frequency domain by letting w = ju to obtain G ( j u ) . The current limiter can be approximated by its describing function as r71
It is well known that, in the gain-phase plane, if G ( j u )and 1/N intersect, the closed-loop response will exhibit limit cycles. Observe that the describing function for the current limiter is only a magnitude expression, and the phase of - 1/ N is always equal to - 180”. Thus, the condition required for the closed-loop system to be stable (i.e., without limit cycles) is that the gain margin of G (ju)must be positive and less than 1 (or 0 dB),since the minimum magnitude of - l/N is 1. As the phase-crossover frequency uc for G ( j u ) is a relatively large value, the gain margin of G ( j u ) , I G(ju,)l, is approximated by
The condition for the closed-loop system to be stable requires
The controller parameters K,, and KI and the sampling period T are chosen according to the inequality (24). The proportional and integral controllerparameters Kp and KI are selected based on the transient and steady-state specifications such as maximum overshoot, rise time, settling time, and steady-state error requirements. The sampling period T depends not only on (24) but also on the specific microprocessor chosen for the implementation. An evaluation of the controller complexity
will aid the selection of microprocessors. The computational complexity analysis is carried out by counting the number of arithmetic operations in executing the digital speed control algorithms, which consists of (11)-(13). Equation (14) is realized by the hardware current-reference generator. The computational complexity of the control algorithm is summarized in Table II. Although only the conventional proportionalintegral controller is used for investigation, more advanced and complicated control algorithms can be developed, as the controller is executed completely by software computation. The proportional-integral controller is most widely used in industrial applications and its validity will be further verified by actual implementation discussed in Section V. In order to illustrate the design procedure discussed in this section, a numerical example is given in the following. The parameters of the PM synchronous motor are tabulated in Table III. Fig. 6 gives the gain-phase plot for G ( j u ) that intersects the describing function - 1/N at the point ( - 180”, 1). The G(ju)-plot is obtained by computing (21) in which KI is set equal to 0.08 and T and Kp are selected according to (23). The G(ju)-plot establishes an upper bound for selecting maximum permissible sampling periods based on given Kp’s. AND EXPERIMENTAL RESULTS V. IMPLEMENTATION
An experimental prototype drive system based on the proposed control method’has been constructed. The block diagram representing the hardware structure of the proposed system is shown in Fig. 7. The 16-bit 8-MHz Motorola MC68000 monoboard microcomputer, VME-110, serves as the controller. The microprocessor-based controller is interfaced to various peripheral devices such as the A/D and D/A conversion modules, and a parallel 110 module via the VMEbus. The output of the controller consists of the reference stator current magnitude command if and the compensation angle [* . An adder sums up [* and the rotor absolute angle Or. The 39 sinewave generator then provides three-phase reference currents to the current hysteresis-controlled inverter using a look-up table. The three-phase motor line currents are measured by hall-effect current sensors and are fedback to the hysteresis current controllers and the microprocessor-based controller. The other feedback quantities are the absolute rotor position and the motor speed, which are measured by the resolver and tachometer mounted on the motor shaft. The dynamic performance of the PM synchronous motor drive is evaluated by using both computer simulation and online measurements. The aim is to verify the validity of the proposed modeling and controller design method. The testing
52 1
LIU et al.: MICROPROCESSOR-BASED CONTROLLER DESIGN
TABLE 111 PARAMETERS OF THE P M SYNCHRONOUS MOTOR
Ld
4.04
mh mh
4.04
Lq
'1
0.31
KT
0.384
fl N.m/A
Jm
0.00052
N+m.sec2
Gain
0.1 -180
-160
-1 40
-100
-120
Fig. 6. Gain-phase plots of G ( j w ) and
-
Phase
1/N.
DC Power W 64000
VHE-110
Fig. 7. The block diagram for the system hardware.
data are given by: a : = 5 0 0 r/min, TL = 2 N - m (half-load), verter-fed PM synchronous motor drive has been investigated. the hysteresis band h = 0.5 A, Kp = 20, KI = 0.08, and T = The implementation of the controller is based on a high 1 ms. The procedure for simulating drive responses is given in performance 16-bit microprocessor. The paper has provided a systematic and analytic approach for designing the microprothe Appendix. The steady-state current waveforms of phase-a, both mea- cessor-based PM synchronous motor drives. The proposed sured and simulated, are shown in Fig. 8(a) and @). Fig. 9 theoretical modeling and design approach has been validated gives the measured and simulated voltage waveforms of phase- by using both computer simulation and actual implementation. a. Both the measured and simulated speed responses are The implemented motor control system is flexible, as the shown in Fig. 10. The figures clearly indicate that the controller is executed solely by software computation. Thus, simulated and the experimental results are in good agreement. more advanced digital control algorithms can be developed so Though, due to space limitation, only one case is given, as to improve the drive performance. similar results can be obtained for other cases. VI. CONCLUSIONS In this paper the design and implementation of a microprocessor-based current hysteresis-controlled voltage-source in-
APPENDIX The computer simulation method is of a hybrid type: the control algorithm is computed, discretely, in each sampling
522
IEEE TRANSACTIONS ON INDUSTRIAL ELECTRONICS, VOL. 35, NO. 4, NOVEMBER 1988
v
A
6.6
r
I
3 3
-0 0
-3 3 40
-6-6
'
I 15.5
0.0
3 1. 0
L6 5
50
ms
V
62.Oms
(a) A 6 h
3 3
-0 0
20
- 3 3
-6 6
30
50 m i
Ib) Fig. 9. Steady-state voltage waveforms of phase-a. (a) Measured. @) Simulated. 00
15 5
31 0
L5 5
6 2 0 ms
@)
Fig. 8. Steady-state motor line current waveforms of phase-a. (a) Measured. @) Simulated.
interval; the inverter-motor-load equations are numerically integrated using the fourth-order Runge-Kutta-Gill routine. The simulation procedure is summarized as follows.
-
simlloted
o measured
Step 1: Set the input speed command U : , the hysteresis band h, the sampling period T, the number of iterations N , and the duration of the free-wheeling period 7. Step 2: Determine the initial values for the state variables of the motor-load equation. Set the integration step size 6. Let n = 1 and i = 0. Step 3: Forn = 1 , 2 , * . . , i f n = 1 o r n . 6 = amultiple of T, compute T,* by (11) and the angle 4* (see (14), for n = 1, E* = 0); otherwise, retain the values of T,* and 4* obtained at the (n - I)" iteration. Step 4: Compute :i by (12). Step 5: Compute i;, its,and :i by (14j. Step 6: Compute the current deviations Ai,, Aibs, and Aics. For each phase, determine which direction, ON or OFF, the inverter leg is to be switched by comparing the current deviations with the hysteresis band h. Step 7: Determine the conduction modes, N, and FW, of the VSI by Table I.
400 aoo 1200 16 00 Fig. 10. Measured and simulated motor speed responses at min.
3 2000 ms 0 : =
500 r/
Step 8: If FW = 1, go to Step 9; otherwise, set i = i + 1. If i - 6 # 7,go to Step 9; otherwise, i.6 = 7 , and the system is in the low-speed operating range. Then let 17 be the duration of the freewheeling period in the low-speed operating range. Set h = 0 a n d j = 0, then go to Step 12. Step 9: Compute V, and V,, by (15) and (16). Step 10: Solve U,, i&, and i4sby (5)-(8) using the RungeKutta-Gili routine. Step 11: Set n = n + 1. If n = N, go to Step 17; otherwise, go to Step 3. Step 12: Same as Step 9. Step 13: Same as Step 10. Step 14: Set n = n + 1. If n = N, go to Step 17; otherwise, go to Step 15. Step 15: Execute Steps 3-7.
LIU el al. : MICROPROCESSOR-BASED CONTROLLER DESIGN
Step 16: I f j - 6
= 17,
setj = j Step 17: Stop.
reset h = 0 and j = 0,go to Step 12; the hysteresis band h( +o) and 1, go to Step 12.
+
REFERENCES
[l] A. V. Gumaste and G. R. Slemon, “Steady-state analysis of a permanent magnet synchronous motor drive with voltage-source inverter,” IEEE Trans. Ind. Appl., vol. IA-17, pp. 143-151, Mar./ Apr. 1981. [2] G. F‘faff, A. Waschta, and A. F. Wick, “Design and experimental results of a brushless ac servo drives,” IEEE Trans. Ind. Appl., vol. IA-20, pp. 814-821, JUly/AUg. 1984.
523 [3] S. Meshkat and E. K. Person, “Optimum current vector control of a brushless servo amplifier using microprocessors,” in Conf. Rec. IEEE/IAS Annu. Meet. (Chicago, IL), pp. 451-457, Sept. 30-Oct. 4. 1984. [4] M. Lajoie-Mazenc, C. Villanueva, and J. Hector, “Study and implementation of hysteresis controlled inverter on a permanent magnet synchronous machine,” IEEE Trans. Ind. Appl., vol. IA-21, pp. 408-413, Mar./Apr. 1985. [5] D. M. Brod and D. W. Novotny, “Current control of VSI-PWM inverters,” IEEE Trans. Ind. Appl., vol. IA-21, pp. 562-570, May/ June 1985. [6] K. Ogata, Modern Control Engineering. Englewood Cliffs, NJ: Prentice-Hall, 1970. [7] S. M. Shinners, Modern Control System Theory and Application, 2nd ed. Reading, MA: Addison-Wesley, 1978.