You are on page 1of 6

Permanent Magnet Synchronous Motor Vector

Control Based on MATLAB/Simulink

Xiaotong Li, Daoliang Xi, Yulin Zhang*


School of Information Science and Engineering University of Jinan
Jinan, China
ise_zhangyl@ujn.edu.cn

Abstract—This paper presented the mathematical model of combined with DSP TMS320F28035, a set of model including
permanent magnet synchronous motor (PMSM) and the basic interrupt control and field oriented control of the motor system
principle and realization of vector control (also called field- is established in Simulink, which then loaded and debugged in
oriented control, FOC). The simulation model of PMSM based on CCS (Code Composer Studio) development environment of 3.3
speed and current double closed loop using vector control in the version to generate project code and built to DSP hardware
MATLAB/Simulink environment is built and experimentally platform connected with the XDS100 simulator to observe the
simulated. The result shows that the vector control system of rotation of PMSM.
PMSM has the super characteristics of dynamic response and
speed control, effectively verifying the correctness of the “id = 0” II. PMSM MATHEMATICAL MODEL
control algorithm, and provides a theoretical basis for the
analysis, design and debugging of PMSM. Finally, according to In order to simplify the mathematical model of the
the basic idea of space vector pulse width modulation (SVPWM) synchronistic coordinate system of PMSM, the following
technology, combined with TI Company’s DSP (Digital Signal assumptions are often made: Neglecting the core saturated of
Processor) TMS320F28035, a complete set of model system in the motor; excluding eddy current and hysteresis losses of the
Simulink capable of being built to hardware circuit board drives motor; the current of motor is symmetrical three-phase sine
PMSM with speed adjustment. wave current; neglecting magnetic saturation and iron loss;
magnetic circuit is linear; inverter provides an ideal three-phase
Keywords—PMSM; vector control; MATLAB; TMS320F28035 power; ignoring the higher harmonics and the rotor shaft
friction [2]. Vector control is a control method based on
I. INTRODUCTION coordinate transformation theory. By coordinate transformation,
Compared with other forms of motor, permanent magnet speed control performance of PMSM can rival the great
synchronous motor (PMSM) has better dynamic performance, standard as the DC motor. For this purpose, the mathematical
smaller size and higher efficiency. In recent years, with the model in d-q coordinate system of PMSM can be described as
rapid development of electric power electronics technical, rare followed where the voltage, flux, torque and motion equations
earth permanent magnetic materials and the increasingly are given respectively.
sophisticated research in permanent magnet motor, PMSM is
Voltage equation:
widely used in national defense, agriculture and daily life [1].
The control method of permanent magnet synchronous u d = R ⋅ id + Pψ d − ω ⋅ψ q  (1)
motor is mainly divided into two kinds: One is vector control
and the other is direct torque control. The basic principle of
vector control is achieved by measuring and controlling the u q = R ⋅ iq + Pψ q + ω ⋅ψ d  (2)
stator current vector. It regulates the excitation current and
torque current of motor respectively according to the principle
of field orientation so as to control the motor torque. While the Flux equation:
direct torque control, as the name suggests, is to dominate the
torque directly. This paper discusses the first control method. ψ d = Ld ⋅ id + ψ f (3)
Based on MATLAB/Simulink platform, the PMSM vector
control simulation system model is built in Simulink. The ψ q = Lq ⋅ iq (4)
model has two loops that the outer one is the velocity loop and
the current loop is inside. The reference voltage values of the
three-phase motor are calculated through the control of speed Torque equation:
and stator current from the PMSM, and are sent to the Pulse
Width Modulation (PWM) unit, generating three-phase PWM 3
signals needed by voltage inverter in accordance with the rules Te = n p ⋅ [ψ f ⋅ iq + ( Ld − Lq ) ⋅ id ⋅ iq ] (5)
of the PWM to drive the motor. From the foundation on this,
2
As the Ld equals to Lq for the surface permanent magnet It is indicated by the Fig. 1 that the vector control system of
synchronous motor (SPMSM), the formula above can be permanent magnet synchronous motor is composed of several
written as: parts: Position and speed detection module, PI regulator of
speed loop and current loop, coordinate transformation module,
3 SVPWM module together with the rectifier and inverter
Te = n p ⋅ψ f ⋅ iq (6) module.
2
B. Vector Control Coordinate Transformation
In the above equations, ψd and ψq express respectively the d In the ABC coordinate system, the spatial position of the
and q axis component of stator flux; Ld and Lq express three-phase stator windings is 120 degrees of the mechanical
respectively the d and q axis equivalent inductance of stator angle. The three-phase sinusoidal current feeding into three-
windings; id and iq express respectively the d and q axis phase windings connected to each other by 120 degrees
component of stator current; ud and uq express respectively the electrical angle will produce a magnetic field rotating with the
d and q axis component of stator voltage; ψf express the flux same intensity, which is the actual driving magnetic field of
of PMSM; R express the resistance of stator windings; ɷ motor.
express the rotor speed; P expresses the differential operator; np
However, to generate such a magnetic field does not
expresses the number of the pole pairs and Te is proportional to
necessarily require three-phase winding. The two-phase current
iq.
perpendicular to each other can also make the composite
Motion equation: magnetic field with two-phase sinusoidal current different from
90 degrees electrical angle in the α-β coordinate system. This
ω ω field has the same characteristics as the three-phase rotating
Te = J × p( ) + RΩ × + TL (7) magnetic field mentioned above.
np np
As another example, suppose two DC windings with the
same number of turns and perpendicular to each other are
Where, TL is the load torque, and RΩ is the damping placed on the rotor. When they are fed with two DC currents
coefficient; J means rotational inertia while ɷ represents the called id and iq, it is still feasible to synthesize such a constant
rotor electric angular velocity. The formula (6) reflects the rotating magnetic field as above two. This coordinate is known
vector control method of “id = 0”, i.e., the torque is a function as the d-q coordinate system which corresponds to the polar
of only torque component of current (iq) and is maximum when coordinate transformation of α-β coordinate system.
id = 0 [3].
C. Principles of SVPWM Technique
III. PMSM VECTOR CONTROL THEORY SVPWM means a special switch trigger sequences and
A. The Main Idea of Vector Control pulse width combinations of three-phase voltage source
inverter in AC induction motor and PMSM, which will
PMSM is a high order, strong coupling multiply variable generate three sinusoidal current waveforms with 120 degrees
system. The various parameters of the motor couple with each electrical angle differing from each other [5]. A three-phase
other, therefore, make the AC motor control strongly nonlinear. voltage type PWM inverter is shown in Fig. 2. The aim of
The basic idea of vector control is to make the torque current vector control strategy based on SVPWM technique is to
and exciting current forming in the space of 90 electrical angle obtain a circular magnetic field through the combination of
degrees in d-q coordinate system through coordinate different width voltage pulse sequences [6]. We see from the
transformation to achieve decoupling control of stator current. Fig. 2 that there are six power switches.
Then AC motor is equivalent to the excitation DC motor. The
Fig. 1 shows the structure diagram of vector control system in
PMSM [4].

Fig. 2. Circuit of three-phase voltage inverter

We make the rules that when the upper arm is turned on


Fig. 1. PMSM vector control system block diagram (lower bridge arm off), the switch state is “1”. On the contrary,
when the upper arm turns off (at this time the lower arm on), simple and efficiency which makes the motor control easier to
the status is “0”. The six switch tubes of the three bridge arms modify.
are formed “000, 001, 010, 011, 100, 101, 110, 111”, a total of
eight modes. Among these combinations, “000” and “111”
modes represent zero in inverter. The eight kind of switching
modes correspond to a group of eight voltage space vectors
associated by three-phase voltages (Uan, Ubn and Ucn) which are
called the basic voltage space vectors. The six nonzero vectors
have the same amplitude, with an interval of 60 degrees for
each adjacent side.
The two zero vectors have no magnitude, located in the
center. The movement orbits of terminal point of stator flux
vector is a regular hexagon when the six nonzero vectors Fig. 4. Simulation model of permanent magnet synchronous motor
output respectively one by one, but in this way can only
generate a hexagonal rotating magnetic field instead of desired As shown in Fig. 4, the vector control system consists of
rotating magnetic field. The hexagonal shape of basic voltage two control loops: A PI regulator speed controller in an outer
space vector is shown in Fig. 3. loop and a PI regulator current controller in an inner loop.
There are Clarke, Park and inverse Park transforms used for the
When the shape of rotating magnetic field is regular
currents to generate the voltages required with appropriated
polygonal with countless edges instead of hexagonal, we can
duty cycle for balanced Uan, Ubn and Ucn supplied to motor [7].
approximately get a circular rotating field. Obviously, the more
edges there are, the better degrees of approximation it is. Simulink has many advantages over other simulation
However, there are only six nonzero vectors. To obtain a platforms currently in use. It has a clear structure, rich
rotating field with edges as more as possible, the solution is to functional modules, and the correctness of the module can be
use linear combinations of six nonzero fundamental voltage guaranteed. Simulink platform provides a wealth of simulation
space vectors for multiply switch states. blocks with basic functions. Users only need to learn how to
use them and drag each block from the Simulink function
library in a certain order according to the requirements. Users
don't need to use specific hardware, nor do they cost too much
time and effort on how the module functions. The properties
can be modified as needed quickly.
B. Simulation Results
The parameters used of the permanent magnet synchronous
motor for the simulation test are shown below: stator windings
resistance R = 1.132Ω, d-axis winding inductance Ld = 12.38e-
3H, q-axis winding inductance Lq = 15.72e-3H, rotational
inertia J = 1.79e-3kg·m2, the pole number np = 2 and the static
friction is 0.1N.m, the total simulation time t = 1s. Initially, the
speed given is 900 rpm (revolutions per minute), and the load
torque is set to 2N.m. When the simulation time reaches 0.4s,
the torque value increases to 5N.m. The waveforms are as
follows:

Fig. 3. Regular hexagon track of rotating magnetic field

IV. PMSM SIMULATION MDEL IN SIMULINK


A. PMSM Simulation Model
The model of permanent magnet synchronous motor based
on vector control built in Simulink is shown in Fig.4. PMSM
block and inverter modules in the model are both supplied from
the SimPowerSystem in the Simulink library. They don't show
the internal structure but providing the parameters for users to
modify. You can double click the two modules to fill the Fig. 5. Current response curve
parameters in the blanks to meet the needs of the actual
operation. Users can use oscilloscope block to observe the
simulation effect and changes in real time. This method is
Fig. 6. d-q axis current waveform

Fig. 9. Field-oriented control specialized to DSP TMS320F28035

Fig. 7. Rotor angular velocity (rad/s) and rotor speed (rpm) Among them, the hardware interrupt is used to trigger the
ADC sampling, collecting two phases of current and a given
motor speed as feedback to the FOC module. Speed
Calculation can get the current motor speed. The optical
encoder is installed around the rotor shaft of PMSM, consisting
of the light source, code plate, detection grating, photoelectric
detection devices and conversion circuit. Rotation of the motor
drives the grating disk to rotate at the same speed. The code
plate is a circular board with certain number of non-opaque
rectangular hole around used for calculating the number of
pulses to get the position increment [8]. Outputting the pulses
to eQEP (enhanced Quadrature Encoded Pulses) block in DSP
control board can get the current motor position and speed. The
given speed sampling from the ADC and the rotor actual speed
are the inputs of speed control module, which produce the
Fig. 8. Electromagnetic torque waveform given q axis current calculated by PI regulator in the speed loop
for FOC algorithm.
We see from the simulation results that when the load
torque changes from 2 to 5 at 0.4s, the response time of the The composition of FOC algorithm in model is shown in
currents is very short and the speed fluctuation is very small. Fig. 10. We may notice that the ADC and PWM modules are
The waveforms suggest that the performance of this simulation provided by Simulink Library. Users only need to modify the
system is very steady and quick-responsible, which validate the parameters within the module while not need to concern much
static and dynamic characteristics of vector control. about the algorithm itself. The purpose of the FOC algorithm is
to obtain six complementary PWM waveforms to drive the
V. HARDWARE EXPERIMENT motor speed. To realize this algorithm, speed and current
A. The Composition of the Experimental Model double closed loop model mentioned above is needed. The
given voltages of α and β axis calculated through the Clarke,
MATLAB Link for CCS Development Tools (CCSLink for Park and inverse Park coordinate transformations and PI
short) integrated in the MATLAB provides a two-way regulator input to SVPWM module for six square wave, which
connection among MATLAB, TI DSP integrated development is the key essential of PMSM vector control. Since the motor is
environment (CCS) and hardware circuit board, allowing rotating all the time, the position is required to use for
developers to complete operations of CCS and hardware target coordinate transformation calculated by photoelectric encoder
in MATLAB environment. The powerful visualization, data and the eQEP module. We may see the Simulink
processing and analysis performance in MATLAB make it accomplishment of SVPWM technology in Fig. 11.
easier to extract data and realize the function needed than under
the CCS environment.
The Simulink PMSM model based on field-oriented control
specialized to DSP TMS320F28035 is shown in Fig. 9. As seen
from the figure, the model has the following components:
Hardware Interrupt, FOC Algorithm, Speed Calculation, Speed
IIR Filter, Speed Control and F28035 chip.
Fig. 10. The composition of FOC algorithm in model

Fig. 11. Simulink accomplishment of SVPWM technology Fig. 13. “checkEnvSetup(‘ccs’,‘F28035’,‘check’)” command

B. Building and Running Result The Simulink model can be compiled and built once the
MATLAB has rich interface resources, one of which named connection is successful. After that, a complete project is
MATLAB Link for CCS tool can not only provide control and generated in CCS, which contains source files, header files,
operation of the embedded system mechanism, but also assist library files, link command file, and an executable file. When
the DSP programming and debugging. MATLAB Link for the emulator and hardware board has been connected to the
CCS can make MATLAB and CCS linked to each other, which host computer, the project file codes will be automatically
is, making MATLAB to compile, link loading and run the CCS downloaded to the hardware circuit board, and the PMSM
files, and also doing reading and writing operations upon data rotation process can be observed when connected. We may
from DSP memory. This paper is based on the MATLAB2014a input the wanted speed transmitted to ADC input for changing
and CCS3.3 version software. After selecting the appropriate the motor speed. And if a serial communication interface (sci)
DSP target board and the emulator model in CCS and is used to transfer the actual feedback speed of motor to host
establishing a seamless connection between the two software, computer, we could watch the regulation process. A complete
you can input commands in MATLAB such as “ccsboardinfo” test system includes the following parts: PMSM, electric power
and “checkEnvSetup (‘ccs’,‘F28035’,‘check’)” commands to supply, DSP control and drive board, three-phase inverter
view the connection status. The results can be seen in Fig. 12 circuit, current sampling circuit, speed setting circuit and
and Fig. 13. XDS100 emulator. The two complementary PWM pulses of
one phase voltage collected through the oscilloscope is shown
in Fig. 14.

Fig. 12. “ccsboardinfo” command in MATLAB command window

Fig. 14. Two complementary PWM pulses of one phase voltage

VI. CONCLUSION
This paper verified the performance of PMSM simulation
based on vector control in MATLAB/Simulink using the
control. The strategy of the model system is “id = 0”. Firstly, Technology (ICCSIT), 2010 3rd IEEE International Conference on IEEE,
we build a set of control system with the existing PMSM and 2010, pp. 539 - 542.
inverter module provided by Simulink Library. The simulation [2] H Lin, S Chen, J Yao and M Tsuji, “Sensorless vector control system of
permanent magnet synchronous motors based on adaptive and fuzzy
results show that the control model has good performance. The control,” International Conference on Electrical Machines and Systems
current can respond quickly and the fluctuation period of the 2008, pp. 3074-3078.
speed is short when the torque is suddenly changed, which [3] AA Apte, VA Joshi, RA Walambe and AA Godbole, “Speed Control of
proves to be a stable software simulation model. Based on this, PMSM Using Disturbance Observer,” Ifac Papersonline 49.1, 2016, pp.
another model is set up to drive the real motor. By connecting 308-313.
the MATLAB with CCS, programming codes are generated [4] L Li, “DSP Based Digital Control System Implementation of Permanent
referring to the model. The experiment results suggest that the Magnet Synchronous Motor,” Control and Decision Conference IEEE,
2014, pp. 3527-3531.
motor starting and braking ability is fine and the model has a
stable speed during the rotation. [5] H Wang, “Research and Design on the Vector Control System of PMSM
Based on DSP,” Expert Systems with Applications, Dalian University of
The simulation and experiment results prove that the vector Technology, 2008, pp. 80-88.
control algorithm can be applied to the actual control of [6] J Qin, “Vector Control of PMSM Applied in Ship Electric Propulsion
permanent magnet synchronous motor. It provides an effective System based on dsPIC,” 2nd International Workshop on Materials
Engineering and Computer Sciences (IWMECS 2015), 2015, pp. 365-
means and tools for analysis and design of PMSM control and 369.
provides a guideline of designing and debugging for practical [7] TT Vu, HC Han and JW Jung, “Certainty equivalence adaptive speed
PMSM system. Furthermore, MATLAB/Simulink is easily controller for permanent magnet synchronous motor,” Mechatronics, vol.
operated and clearly observed, which represents outstanding 22, 2012, pp. 811-818.
software for power control. [8] T Zhang, ZQ Yang and XX Wang, “Inverse Method for measuring
position and speed of electric machine using eQEP and encoder,”
REFERENCES ELECTRIC DRIVE, vol. 41, 2011, pp. 48-51.
[1] Z Zhang and J Shu, “Matlab-based permanent magnet synchronous
motor vector control simulation,” Computer Science and Information

You might also like