PMSM DSP Control System
PMSM DSP Control System
Abstract- A digital servo system using a Digital Signal Processor (DSP) is presented in this
paper. A Permanent Magnet Synchronous Motor (PMSM) with rotor position encoder and
Hall sensor is used. The eld oriented vector control technique is employed to achieve robust
performance and fast torque response. The system uses position and speed regulations as the
system outer loop, and the current regulation with vector control as the inner loop. A DSP system
using TI's TMS320C240 is developed, and the proposed digital control strategy is implemented
in the DSP.
Key Words: Vector Control, Motion Control, Servo System, Digital Control, Permanent Mag-
net Synchronous Motor (PMSM), Digital Signal Processor (DSP)
I. Introduction
Precise motion control plays an important role in various areas such as automation industry,
semiconductor industry, etc. Permanent magnet synchronous motors (PMSM) are ideal for
advanced motion control systems for their potentials of high eciency, high torque to current
ratio, and low inertia. Advances in Digital Signal Processors (DSP) have greatly enhanced the
potential of PMSM in servo applications. Digital control can be implemented in the DSP, which
makes it superior to analog based stepper control, since the controller is much more compact,
reliable, and
exible. High performance of PMSM can be obtained by means of eld oriented
vector control, which is only realizable in a digital based system.
In this paper a DSP based servo system is presented. A digital servo controller using TI's
TMS320C240 is developed. Position and speed regulations are developed to ensure accurate
position control and fast tracking, and current regulation with eld oriented vector control is
implemented to secure fast dynamic response. The system has been proved to be robust and
eective with very reasonable cost.
b q q
E
I
Lq iq
d
λ d
θ iq
λmLd id
O a ,x
O θ a, x
id
(b)
(a)
c
Figure 1: (a)Dierent frames of the PMSM. (b)Flux, Current and Voltage Vectors
The voltage and
ux equations for a PMSM in the rotational d-q reference frame can be
expressed as:
Vd = Rsid + ddtd , ! q (1)
Vq = Rsiq + ddtq + ! d (2)
= Ld id + m
d (3)
q = Lq iq (4)
where Vd; Vq and id; iq are voltages and currents in the d-q axis, Rs is the stator winding resistance,
Ld ; Lq are inductances in d-q axis, d ; q are
ux linkages in d-q axis, m is the main
ux linkage
of the permanent magnet, and ! is the angular frequency of the rotor. The transformation
between dierent reference frames can be achieved by[1]
2 3 2 3
id ia
6 7
4 iq 5 = Tabc,dq 64 ib 75 (5)
0 ic
2
2 3 2 3
ix ia
6 7 6 7
4 iy 5 = Tabc,xy 4 ib 5 (6)
0 ic
" # " #
id ix
iq
= Txy,dq iy
(7)
where
2 3
2 cos cos( , 2=3) cos( + 2=3)
Tabc,dq = 4 sin sin( , 2=3) sin( + 2=3)
6 7
5
3 1=2 1=2 1=2
2 3
2 6 1 ,p1=2 p
Tabc,xy = 4 0 , 3=2
,1=2 7
3 1=2 1=2 13==22 5
" #
Txy,dq =
cos sin
, sin cos
and
Tdq,abc = ,1 ;
Tabc ,dq
Txy,abc = ,1 ;
Tabc ,xy
Tdq,xy = ,1 :
Txy ,dq
Vd Vq
PI PI
Controller Controller
i i
a b
Position
id
Encoder
abc-dq
-
+ Transformation
- iq
+
- θ
i*= 0 i*
d q
A. System Structure
The servo control scheme of the PMSM is illustrated in Fig. 3. As shown in Fig. 3, the
controller has an inner loop of current regulation using vector control, and an outer loop of
hybrid speed and position regulation. This dual-loop structure ensures the fast torque response
by using the vector control, high position accuracy with the position controller, and fast tracking
performance with the hybrid (speed and position) control. The structure is also important to
secure the stability of the system.
B. Initial Position Identication
Incremental encoders can only give displacements from the initial position and cannot provide
absolute position. Hence to achieve vector control usually initial position alignment to a known
position is required. However in some circumstances such alignment is not desired and needs
avoided.
By means of Hall sensors the rotor initial position can be identied, and further corrected
when the rotor starts rotating. Assuming the Hall sensors are located at each phase, as shown
in Fig. 4. The output signals of the Hall sensors are illustrated in Fig. 5. It can be seen that
the resolution of the Hall sensor signals are 60o (electrical degree). Table 1 shows the possible
combinations corresponding to dierent positions.
From Fig. 5 and Table 1, given a specic Hall sensor output combination, the rotor must
reside in certain region with a range of 60o. The initial position is determined as follows. When
a group of output signals are obtained, for example, (101), we can nd which region the rotor is
in (region 1 in this example). We can set the initial position at the center of the region (30o in
this example). It can be seen that the maximum4 error of the initial position is 30o, which occurs
Va,Vb,Vc Sa,Sb,Sc
PWM VSI
dq-abc
Inverter PMSM
Generator
Transformation
Vd Vq
PI PI
Controller Controller
i i
a b
Position
id
Encoder
abc-dq
-
+ Transformation
- iq
+
- θ
PI
i*= 0 i*
d q Controller +
- -
+ +
θ ref
n
- d/dt
Kv
+ d/dt
n
ref
S
Hb=0 Hc=0
5
60 60 60 60 60 60 60 60 60 60 60
Ha
Hb
Hc
0 60 120 180 240 300 360 420 480 540
(0) (60) (120) (180)
(Electrical Degrees)
Region Ha Hb Hc Position
1 1 0 1 0-60
2 1 0 0 60-120
3 1 1 0 120-180
4 0 1 0 180-240
5 0 1 1 240-300
6 0 0 1 300-360
Table 1: Combinations of Hall Sensor Output Signals
C. Anti-Hunt Processing
When the motor reaches to the required position and needs to produce torque at standstill,
special attention needs paid since the rotor will very likely oscillate (hunting). A variable gain
anti-hunt algorithm is developed.
As shown in Fig. 6, the PI gains of the speed and position regulators are kept normal when
the position error is large. When the position error is small enough (in region 1 or 3), the gains
should be gradually reduced. Once the rotor enters the anti-hunt window (region 2), the gains
are reset to zero. This approach has eectively avoided the rotor oscillation at the standstill
position.
6
1 2 3
P, I Gains
X
Position
External
D/A Converter Display
Memory
JTAG TMS320F240
Emulator DSP
A/D Converter
Host
Driver Circuit
Computer
Current Sensor
Power Circuit
PMSM
Encoder
/Hall Sensor
V. Conclusions
7
Figure 8: The DSP Servo Controller
A TMS320F240 based DSP servo controller has been developed. The system has reached
compact size and high reliability. Highly complicated digital control algorithms, including vector
control, current regulation, and speed/position regulations have been implemented in the DSP.
To avoid initial rotor alignment, initial position identication using the Hall sensor signals are
implemented. Anti-hunt technique using anti-hunt window and variable controller gains are also
developed. The system has been proven to be highly eecticve and ecient with relatively low
cost.
VI. References
[1] Paul C. Krause, Oleg Wasynczuk, and Scott D. Sudho, \Analysis of electric machinery,"
McGraw Hill, 1986.
[2] P. Pillay and P. Freere, \Literatre survey of permanent magnet AC motors and drives."
IEEE-IAS Annual Meeting, 1989, pp. 74-84.
[3] D. W. Novotny and T. A. Lipo, Vector Control and Dynamics of AC Drives. Oxford University
Press, 1997.