A MC56F8357 Based Permanent Magnet Synchronous Motor (PMSM) Servo System Feirong Jiang, Wei Zhang, Wenyi Liang, Xianxu Liu
College of Electrical Engineering, Zhejiang University, Hangzhou 310027, CHINA Abstract A digital servo system based on MC56F8357 is presented in this paper. The system principle, hardware and software architectures of the AC servo drives are introduced. By utilizing Field Oriented Control (FOC), Space Vector PWM (SVPWM), DC bus ripple compensation, digital PI regulating with correction of the integral term and AntiHunt Processing control strategies, the hardware and software of the servo system are implemented. Experiments including different position and speed control have been carried out and the experimental results are also given.
Keywords PMSM, Servo System, MC56F8357 I. INTRODUCTION
The servo systems are commonly used in those positioning applications require higher instantaneous torque response, lower torque ripple, wide adjustable speed range and excellent speed regulation such as NC machine tools, industrial robots, and other automation equipment, e.g. printing, packaging, food, and textile machines. In many types of AC motors, Permanent Magnet Synchronous Motor (PMSM) has been considered the one better fits servo application because the PMSM offers the advantage of low rotor inertia, high efficiency, efficient heat dissipation structure, and reduction of the motor size. Moreover, the elimination of brushes reduces noise and suppresses the need of brush maintenance. The AC PMSM servo system has attracted more and more researchers' attention. In this paper, a digital servo system using a Digital Signal Processor (DSP) MC56F8357 is presented. The system principle, hardware and software architectures of the AC PMSM servo drives are introduced, the experimental results are given as well.
The reference frames of FOC shown as Fig. 2 can be used to analyze the PMSM, in the FOC, the expression of the voltage, flux linkage equations of PMSM in the d, q coordinate system are given as:
F 1Sd U Sq
YSd
R siSd i
±d
dt
Y
Sd
=Rs ISq + YS LdiSd Mdt
(1fY
Sq
+ O)A] Sd
(1)
Y Sd =Ld iSd +YVM
AI Sq =LqiSq where, R, is the stator phase resistance, co is the electrical rotor speed, Vfsd, Vfsq are d, q axis flux linkage, iSd, iSq are d, q axis current, Ld, Lq are d, q axis inductance respectively. The torque equation in d, q coordinate system is T
=
3
2 V4SqlSd) -P(VSdiSq
=2[ymiJsq -(Lq
-Ld )SdISq]
(2)
where, P is the number of pole pairs, VlM is permanent magnetic flux linkage. When iSd is controlled to be zero then the torque is directly proportion to iSq, and the torque equation should be: Te =312pymisq (3)
II. CONTROL THEORY OF THE Ac SERVO SYSTEM
The principle diagram of the PMSM servo system base on vector control is shown as Fig. 1. In order to get the satisfied position control, the position and speed regulations are designed as outer loop to ensure accurate position control and fast tracking, the current regulation with vector control is designed as the inner loop to achieve robust performance and fast torque response. By utilizing Field Oriented Control (FOC), Space Vector PWM (SVPWM), DC bus ripple compensation, digital PI regulating with correction of the integral term and Anti-Hunt Processing control strategies, the software of position and speed loop control of the servo system is implemented. The main applied strategies are considered as follow. A. Field Oriented Control of PMSM 1519
Fig. 1. Vector control based PMSM servo system principle.
a oc
Fig. 2. Reference frames of FOC.
Voltage Space Vector PWM The six transistors in the inverter can form eight switch variables, corresponding to 8-space vectors: Uo, U60, U120, U180, U240, U300, 0000, 0111, here six states are non-zero vectors, two states (Oooo, °111) are zero vectors, the non-zero vectors form the axes of a hexagonal, the angle between two adjacent non-zero vectors is 60 degrees. The space voltage vector PWM is shown as Fig. 3. The SVPWM method with zero vectors that combined with states 0000 and °111 in each sector is adopt in this paper. The inclusion of zero vectors helps to balance the turn on and turn off periods of the transistors, and thus their power dissipation. The objective is to approximate the motor voltage Us by a combination of eight switching patterns of the six power transistors. The projected motor voltage Us, at any time, can be approximated by the vector sum of two vector components lying on the two adjacent basic vectors: B.
Us=T1 TUx+ T21TUx+60+ TnullI T(Oooo or 01 l) T=T1+ T2+ Tnull T is the PWM period. This approximation means that the upper transistors must have the on and off patterns corresponding to Ux and Ux+60 for the time T1 and T2, to apply voltage Us to the motor, e.g., the projected motor voltage Us is in the sector I, the time T1 and T2 of the two vectors Uo and U60, can be calculate as T1 = )* T / 2 (4)
(FUua
UT2 =u, ET
where, u., up is a, ,B component of Us respectively C. DC Bus Ripple Compensation In order to eliminate the influence of DC bus voltage ripples on the generated pulse-width-modulated waveforms, an arithmetic is induced to compensate the amplitude of a and ,B component of the projected motor voltage Us, the formulae are shown in (5), (6): index *ac u ddcbus F ine if I index* c < (5) cc
u dcbus sign(c ) * 1.0 otherwise
Undebus i
if index * D
<
2
(5)
2
(6)
Au(k) = u(k) -u(k -1) = Kp[e(k) -4k -1)]+KI ek) (7) where, k is sampling order number, u(k) is the output of the controller at the sampling time k. e(k) is input errors at time k. Kp is the proportion, KI is integral factor. To avoid the saturation and overflow of the regulator variables and output, one solution is to add a correction Kcor of the integral term to the previous structure, to quickly quit the saturation and overflow. The innovated PI algorithm is as follow, e(k)= r(k)-y(k) u(k) =x(k-1)+Kp e(k) x(k) =x(k-1)+±K e(k) +Kcor EpI where, Kcor=K1 /Kp is the integral correction factor, EPI= uour-u(k), if PI regulator is saturation and overflow, uO1t=Umax when u(k)>Umax, or uo,t=Umin when u(k)
sign (D ) *1.0 otherwise
where, index must be within a fractional range and positive: 0
01.0 1 .0
if
x
U240 (001) X
U300
V.
(101)
[-I1/ ,1]
[-I /,-13 Fig. 3. Space voltage vector PWM.
O
otherwise
where, x =a, , are input duty-cycle ratios and a*,,* are output duty-cycle ratios. D. Digital PI Regulator If the sampling period is small enough, the incremental form of normal PI algorithm is expressed as: 1520
/
PjIGains -x
I
O ~~I
Position Error
Fig. 4. Variable PI gains for Anti-Hunt.
+
A. System Structure and Hardware Design
The MC56F8357 based servo system hardware structure is shown in Fig. 5. The hardware is mainly consisted of a DSP MC56F8357EVM board, Power Integrate Module (PIM) and PWM power drivers, voltage, current detection and feedback circuits, position detect circuits, LCD/LED display and indicate circuits, power supply circuits, a PMSM servomotor with an optical encoder. (1) MC56F8357 is a cost efficient 16-bit fixed-point DSP of Freescale Company, up to 60 MIPS at 60 MHz core frequency, the power supply is 3.3V. The main characteristics of the DSP are: 1) Large capacity memory. 256KB Program Flash, 4KB Program RAM, 8KB Data Flash, 16KB Data RAM, 16KB Boot Flash, combined with the on-board 128KB external Program/Data SRAM. 2) Multiple motor control modules. Four 4-channel 12-bit simultaneous or sequential sampling ADCs, the ADC internal clock is 5MHz, sample time is 1.2us; two 6-channel independent or complementary PWM modules; two quadrature decoders for capture the position signal; four general-purpose cascadable quad timers and temperature sensor. 3) Mass communication module for extend. Two asynchronous serial interfaces SCI and two synchronous serial interfaces SPI, CAN bus module and extend a serial RS232 communication for PC master control and display etc. The high calculation speed, large capacity memory, high sample precision and strong extend capability make MC56F8357 very optimized for digital motor control. In this system, the calculation of FOC, SVPWM, DC bus ripple compensation, four digital PI regulator and AntiHunt processing etc are all implement in MC56F8357. (2) A PIM P549-A-PM is adopted as the power stage, the PIM consist of 1/3 phases input rectifier, brake chopper, 3 phases inverter IGBT + FRED with open emitter. Three IR2 11 Os are used as the PWM driver circuit, so it can use only one group power supply to control the six IGBT inverters. If some hardware error generate, the error signal will braking the PIM module and block all the PWM output, the PWM drive flowchart is shown as Fig. 6.
(3) Two current LEMs (LA28-NP) and one voltage LEM (LV28-P) are used to sense two phase current of motor and DC bus voltage separately. The amplified and filtered current/voltage signals are transmitted to the A/D port of DSP. At the same time, the sample values are also used as the hardware and software protection signals, such as under voltage, over voltage and over current, the detect flowchart is shown as Fig. 7. (4) The position pulse signals from the motor optical encoder, after anti-jamming processing, are transmitted to the quadrature decoder of DSP. The DSP get the speed and relative position value via calculate the pulse, at the same time, the index signal of the encoder is use to initialize alignment and correct the position offset. (5) One 8 bit LCD (W-C1601A) is used to display the position, speed, voltage, current value and other variant if needed. LEDs are also used to display the system
Voltage
FOC<
12
bit_9 T
Current
Si _R
Display |
u/top
Up speed Down
+
G
<
1
E
Quadrature/
0
Freescale DSP MC56F8357EVM
speed
PM
D
E
R
Fig. 5. MC56F8357 based servo system hardware structure.
IPWMDv
OpticaleC
j1
PWM
Fig. 6. PWM drive flowchart.
Fig. 7. Voltage/current detect flowchart.
state, e.g. run/stop motor, up/down speed when press the corresponding buttons. Besides, a Human Machine Interface (H4MI) is extended via an electrically isolated serial RS232 communication, to control the motor and display system state in real-time. (6) In the power supply circuits, digital and simulative power grounds connected by one point in this servo system, the different groups of power supply are isolated by optically coupled isolator, the different powers level translation are also used in this system. B. Software Design The main idea of the servo control program in this paper is: 1) Calculate the position error of the required position and the actual position, which return back by the position interrupt program. After Anti-Hunt processing, the position PI controller generates a required speed by the position error. 2) Calculate the speed error of the required speed and the actual speed, which is calculated by M1T algorithm. Then the speed PI controller generates a required current by the speed error. 3) Calculate the actual currents in d, q coordinate system by the ADC interrupt program, then compare to the required currents, the currents PI controller generate the required output voltages. 4) Eliminate DC bus voltage ripple, then generate PWM signal drive the servo motor by SVPWM. The control program flowchart of servo system is shown as Fig. 8, it consists of the main program, ADC and position interrupt program. In the main program, initialization DSP, fault control, application control and brake control and performed In the ADC interrupt program, the analog sensing processing, sin, cos generation, current control and PWM output are performed, the interrupt period is 125us. In the position interrupt program, position/speed measurement, alignment control, position control and speed control processes are performed. The interrupt period is 3ms. In order to control the motor and detect the parameters more convenient, a graphic user interface is programmed
1521
with the PC master. The PC master, which extended via an electrically isolated serial RS232 communication, is plug in the program software for Freescale DSP. The programmed HMI is shown as the Fig. 9. IV. EXPRIMENT RESULTS
The experimental equipment is shown in Fig. 10. It contains a PMSM servo motor, a MC56F8357EVM board and a parameter detection and drive board. Ranges of experiments including current, different speed and position Star Initialization
(ADC Interrupt)
Enable Interrupt
Analog Sensing Processing
Fault Control Undervoltage Overheating Overvoltage Overcurrent
Currents sensing ia, ib |Voltage sensing-DC bus|
Sin, cos Generation
Current Control
Application Control
PC Master/Manual control Run/stop control Alignment control Position/speed loop control Up/down speed control LED indication control LCD display control
Brake Control
A. Main program flowchart
Currents transformation (a,b,c to d,q) Current d regulator PI controller Current q regulator PI controller Voltages transformIation (d,q to no DCBus ripple compensation SVPWM Module sets duty circle
PWM Output (
Return
Fb_SiZMmzNa\+evg=w.A8VjP-0EltfI?X;hWs*ibFrS_
control have been carried out. The parameters of the PM servomotor are as follow: PN=4, T,1=0.59 N m, Rw=27.15 Ohm, Lw=45 mH, Jm=0.027 kgm2 103, P11=201 W, I 1 A. An embedded incremental encoder with a resolution of 1024 lines/r (the quadruple frequency is 4096 lines/r) provides position and speed feed back for servo control. The PWM frequency is 8 KHz, DC bus voltage is 36 V, voltage and current sampling period is 125 us, speed and position sampling period is 3ms, PC master sampling period is lOims, the HTML control form of the PC master refresh period is 1 s. The steady state and transient state phase currents respondent waveforms are shown in Fig. 11 and Fig. 12 separately. It can be seen that the precise sinusoidal waveforms are obtained. The id, iq currents respondent waveforms with sudden load and unload, obtained from the PC master, are shown as Fig. 13. These waveforms proved the high control performance and fast torque response. The speed respondent waveform from 20 rpm to 200 rpm, final 600 rpm is shown as Fig. 14. It indicates a fast and steady speed respond.
o)
B. ADC interrupt program
Fig. 10. Prototype of experimental set up
.r
r
r
r
r.
r.
I.r.
.r
.r
1
,..
C. Position interrupt program
Fig. 8. Servo system control program flowchart.
lrllW m
qtl .P
5H' .
S
Ie ,J ...
Fig. I11. Phase currents waveform at steady mode (0.2 A/grid). T . .
_t
s
*
.
W.
lsb \? th76 =-Bs--RyM-1ffi-f]'i't-Be Br0b-*--1bB
ffi
gr
X
k
at
.t
g
W Eg ' H XR tS4mS
g
ii
W
A M
l}is;-
_
_
*0t>-Sh1.
l2;e1
P_
|R _
. I
B __ _
Fig. 12. Phase currents waveform with abruptly strike (0.2 A/grid).
Fig. 9. PC master control and display interface.
1522
The different position respondent waveforms obtained from the PC master when change position setting: 1) From 0 pulse to 1000 pulses is shown as Fig. 15. 2) From 0 pulse to ±20000 pulses, then -20000 pulses, fmnal 0 pulse is shown as Fig. 16. ('±' means clockwise, '-' means anticlockwise). They verified that the servo control can run in four quadrants very well, the position error is very small (only one line error, 4096 lines/r) and the speed response is fast. The experimental results show that the servo system proposed can accomplish precise position and speed control with fast torque respondent.
Actual Positionl
R~cjuired Po ition
16.
respondent
Position
pulse
change position
pulses,
from 0
pulse.
final 0
experiment results,
the
to
then-20000
CONCLUSION
V.
According
when
wavetorm
pulses,
to 20000
it
can
be
con-
cluded that: The
servo
system using MC56F8357
cost man
make the an
Fig.
13.
Current
qwvform with load and without
abruptly
regulating
con-
control servo
DC
convenient. MC56F8357 is
more
strategies,
control
precision
a
digital motion control. bus ripple compensation, digital integral
with correction of the
Processing md o d nd
control
servo
ideal selection for
By utilizing
load.
the DSP
as
higher performance ratio. The intelligent program compiler, friendly hucontrol interface and reliable fault tackle ability
troller needs fewer elements but has
the
term
PI
and Anti-Hunt
functions, performance,
ability
and the anti-disturbance
of the
system have been greatly improved.
The
servo
system proposed has been proved
to be
ro-
Company
for
bust and effective with very reasonable cost.
AcKNOWLEDGMENT
The authors
supporting
are
grateful
to the Freescale
this research.
REFERENCES
[1]
Zhang Dongliang,
Ai
Xing,
Chuanjun,
Xu
and
Zhang Chengrui,
systems with PM synchronous
DSP-based software AC
servo
tors, proc~. of
Electrical Machines and Systems,
ICEMS
on
mo-
pp. 755
-758, 2001.
Re qird Po6-siition
[2]
Longya Xu, Minghua Fu, and tem
Using
Permanent
Li
Magnet
Zhen, A DSP Based Servo Sys-
Synchronous
Motors
(PMSM),
Texas Instruments Semiconductors.
[3]
Libor
Prokop,
Motor Vector
and
Pavel
Control
Grasblum,
Using
56F80x,
a
3-Phase
PM
56F8100,
or
Synchronous
56F`8300
De-
vice, Freescale Semiconductor Application Note, 2005.
[4]
Zhaoyong Zhou, tion of
a
Tiecai
Li, and Takahashi.T, Ho.E., FPGA realiza-
high-performance
servo
controller for PMSM,
Applied
Po-wer Electronics Conference and Exposition, proc. of APEC '04. Nineteenth Annual IEEE, pp. 1604-
[5]
Freescal,
SDKI09,
Embedded
1609, 2004.
SDK(Software Development Kit),
Motor Control Library, 2002
[6]
Fig. 15. Position respondent waveform when change position from 0 pulse to 1000 pulses.
Hyung-Tae Moon, Hyun-Soo Kim, and Myung-Joong Youn, discrete-time on
1523
Power
predictive
Electronics,
current control for
pp. 464
-472, 2003.
PMSM;
proc.
A
of IEEE