You are on page 1of 6

3URFHHGLQJVRI,QWHUQDWLRQDO$XWRPDWLF&RQWURO&RQIHUHQFH &$&6 

7KH(YHUJUHHQ/DXUHO+RWHO7DLFKXQJ7DLZDQ1RYHPEHU

The Modeling and Simulation for Current Regulation of PMSM Drive System
using Verilog HDL and Variable Structure Control
Chiu-Keng Lai and Chia-Che Tsai

 here, we proposed a hardware controller with the VSC


Abstract—In this study, we design the permanent magnet scheme to the d- and q-axes current regulation for PMSM
synchronous motor (PMSM) drive system using field drive system to achieve the desired performance such as
programmable gate array (FPGA), and adopt variable structure invariant to parameter variations and fast response
control (VSC) to the current regulation. The system is first requirements, and reducing the cost to realize the motor
modeled with Matlab/Simulink, and the controllers in the drivers which are usually realized by digital signal processor
system, including the speed PI control and current variable (DSP).
structure control, are hardware implemented by Verilog HDL Field programmable gate array (FPGA) is fully
code. Finally, the resulting hardware system is co-simulated customizable to the requirements of the system designer. This
with the software motor model to evaluate the accuracy and allows a completely flexible design which is custom made for
performance. The resulting Verilog HDL codes can be as an IP the particular type of motor control technology [7], and its
format to hardware realize the vector control for PMSM, and further functionality can be added anytime. It can be adapted
with the properties of robustness to the parameter variations to any change in design by dynamic reconfiguration [8]. In
and fast responses on the current loop control. fact, FPGA-based digital controllers have been implemented
with success in many different applications and controller
Keywords: Field Programmable Gate Array, Permanent Magnet designs, examples as motor drives for induction motor [9],
Synchronous Motor, Vector Control, Variable Structure Control, permanent magnet synchronous motor [10-11], stepper motor
Verilog HDL. [12], and brushless DC motor [13]. FPGAs are also used to
the controller design, such as PID controller [14], fuzzy
controller [10], tracking controller [12], and also designed to
I. INTRODUCTION
implement the space vector pulse width modulation
Permanent magnet synchronous motor (PMSM) drive has (SVPWM) [11].
been widely used in various fields due to its characteristics of In this paper, we implements all the control loops (inner
rapid response, high tracking precision, strong current and outer velocity and position) using the FPGA chip.
anti-disturbance ability and simple structure. However, in a We first use Matlab/Simulink to model a PMSM drive system
practical PMSM drive system, which is nonlinear, and there including all the facilities of controllers and signal converters.
are large quantities of disturbances and uncertainties, e.g., And via the functionality of Matlab/Simulink, we create a
unmodeled dynamics, parameter variation, friction force, and Verilog HDL code to digitalize the software system into
load disturbances. Thus, it is difficult to achieve a satisfactory hardware code. At last, we use the co-simulation technology
performance in the entire operating range only by linear to verify the accuracy and performance of the proposed
control algorithms [1-2]. hardware controller. The hardware system can be in an
In recent years, with the development of modern control Intellectual Property (IP) format to be used to realize the
theory and motion control technique, various methods of PMSM drive design to reduce the cost. Furthermore, the
nonlinear control have been proposed for the PMSM drive parameter’s variations of the current loops can be solved by
system. Generally, for most of the commercial AC motor the proposed variable structure controllers to have a fast
drive system design, the position control, speed control and response and robust performance.
current regulation are usually realized by PI controller [3]. On
II. THE MODELING OF PERMANENT MAGNET
the other hand, the variable structure control (VSC) scheme
SYNCHRONOUS MOTOR DRIVE SYSTEM
has also been used on AC motor drive, e.g., PMSM [1-2],
induction motor (IM) [4, 5] and synchronous reluctance The model of the PMSM expressed in the d-q synchronous
motor (SynRM) [6], for current, speed or position control. In reference frame is given as [3]

ªv ds
e º
ª R s  Ls P 0 º ªids
e º
ª 0  Ze Ls º ªids
e º
ª 0 º
Research supported by the Ministry of Science and Technology of Taiwan « e » « » « e »« « e »«
with grant no. MOST 104-2221-E-167-005. ¬«v qs ¼» ¬ 0 R s  L P
s ¼¬ « qs ¼» ¬Z e Ls
i 0 ¼ ¬«iqs ¼» ¬Z eI F' »¼
»
C. K. Lai is with the Department of Electrical Engineering, National
Chin-Yi University of Technology, Taichung City, Taiwan. (corresponding
(1)
author TEL: 886-4-23924505 ext. 7216; Fax: 886-4-23924419; e-mail: e
chiukl@ncut.edu.tw). where Rs is the stator resistance, Ls is the inductance, vds ,
C. C. Tsai is with the Department of Electrical Engineering, National e e
Chin-Yi University of Technology, Taichung City, Taiwan. (e-mail: vqs e
, ids and iqs are respectively the d and q-axis voltages and
four0924@yahoo.com.tw).


3URFHHGLQJVRI,QWHUQDWLRQDO$XWRPDWLF&RQWURO&RQIHUHQFH &$&6 
7KH(YHUJUHHQ/DXUHO+RWHO7DLFKXQJ7DLZDQ1RYHPEHU

currents. I F' is the flux, Ze is the electrical rotating speed, where a Rs / Ls and b 1 / Ls . To consider the
and P d / dt . The generated torque of PMSM is expressed parameter’s variations, the variables a and b are re-defined
in terms of the rotor flux and stator current as as
a a  'a
I Fc e
Te iqs (2)
c and

where c 2 / 3 or 2 / 3 . b b  'b
The rotor dynamics is described as follows,
where a and b are the nominal values, and 'a and 'b are
dZ m the uncertainties. Thus, we have a set of new function to
J  BZm  TL Te (3)
dt represent the d- and q-axes equivalent circuits as:
where Zm is the rotor mechanical speed, TL is the external e
dids e e e
(a  'a)ids  (b  'b)vds  Zeiqs (6)
load, B and J denote the damping ratio and inertia constant dt
respectively.
The motor drive system for the proposed control scheme e
diqs e e e
can be simplified as Fig. 1. In which, the outer-loop speed (a  'a)iqs  (b  'b)vqs  Zeids  bZeIF' (7)
dt
control is realized by PI controller, and inner current loops are
dominated by VSC, and power converter is with the vector Next, to propose the current controllers with the VSC
control scheme. In this paper, we only present the designs of scheme, we define the d- and q-axes current errors between
d- and q-axes current control by VSC to compensate the current commands and reference currents as follows:
parameter variations on the electrical circuit. Since the power
e * e *
conversion is realized by space vector PWM (SVPWM), and eids ids  ids , eiqs iqs  iqs (8)
the control voltages are directly from the eight discrete type
patterns, they are all switching type signals, the chattering * *
where ids and iqs are respectively the desired d-axis and
phenomenon on current loop would not be considered.
* *
q-axis currents. If ids and iqs are piecewise continuous
constants, the derivatives of (8) can be represented as
e deiqs e
deids dids diqs
, (9)
dt dt dt dt
By substituting (6) and (7) into (9), and with some
manipulations, one has the dynamic equations as (10) and
(11):
deids e
a eids  b vds Ed (10)
dt
deiqs
e (11)
a eiqs  b vqs  Eq
dt
Fig. 1.The block diagram of PMSM speed control system with VSC as the
* * e e
current controller. where Ed a ids  'a(eids  ids )  'bvds  Zeiqs and
* * e e
III. THE VARIABLE STRUCTURE CURRENT CONTROLLER Eq a iqs  'a(eiqs  iqs )  'bvqs  Zeids  bZeIF' . Ed and
DESIGN
Eq can be considered as the terms of disturbances in (10) and
The system (1) can be further rewritten as (11).
e
dids e e e Defining the variable structure current controllers as
aids  bvds  Zeiqs (4)
dt follows:
e
diqs e 1
e e e vds [a eids  qd sgn(eids )] (12)
aiqs  bvqs  b(Ze Ls ids  ZeI F' ) (5) b
dt
e 1
vds [a eiqs  qq sgn(eiqs )] (13)
b


3URFHHGLQJVRI,QWHUQDWLRQDO$XWRPDWLF&RQWURO&RQIHUHQFH &$&6 
7KH(YHUJUHHQ/DXUHO+RWHO7DLFKXQJ7DLZDQ1RYHPEHU

Fig. 2.The block diagram of PMSM current vector control.

where sgn(˜) is the sign function. The two parameters, qd model. The current-loop control structure is based on a
and qq , in (12) and (13) are positive real, and denoted by the standard field oriented control. The compensation voltages
are from the errors of reference and feedback currents, and the
upper bound of Ed and Eq as control voltages are determined through the variable structure
controller.
qd t Ed , q q t Eq (14) Since the generated torque is proportional to the q-axis
e
current, we only demonstrate the response of iqs . To
With the VSC control theorem, the control law (12) and (13)
*
would force the stator’s currents to be equal to the reference complete the simulations, there are two types of iqs
ones. commands used to verify the performance and accuracy. Fig.
IV. THE MODELLING AND SIMULATION OF PMSM DRIVE 3 is the simulated response with square waveform command,
SYSTEM the amplitude is 1 A and frequency is 100 Hz. And Fig. 4, the
command is a sinusoidal signal with amplitude being 1 A, and
The system model created by Matlab/Simulink is shown in the frequency is also 100 Hz. The two results are shown good
Fig. 2, which includes the variable structure current controller, performance.
the 3I / 2I conversion, the SVPWM block and the PMSM

command command
response response
Current (A)

Current (A)

Time (second) Time (second)

Fig. 3.The current response with 100 Hz square waveform current command. Fig. 4.The current response with 100 Hz sinusoidal command.


3URFHHGLQJVRI,QWHUQDWLRQDO$XWRPDWLF&RQWURO&RQIHUHQFH &$&6 
7KH(YHUJUHHQ/DXUHO+RWHO7DLFKXQJ7DLZDQ1RYHPEHU

may make the system un-completely realized by one


V. DIGITAL MODEL AND SIMULATION
unsuitable chip.
The FPGA realized system is one of the digital control Once the designers have made the software model system
systems. In the platform of Matlab/Simulink, we first convert into hardware code except the motor model, the resulting
the continuous system into digital form, and as shown in Fig. Verilog HDL system could be applied to the Matlab/Simulink
5 where the inputs are the current commands of ids * *
and iqs , system to make a co-simulation to verify the accuracy and
performance. The hardware system is set to work on 20 kHz
and the outputs are the six gate driver signals for inverter. sampling frequency on the current control loop. The resulting
Furthermore, the designed hardware system also considers block diagram of the co-simulation system is shown in Fig. 7
the interfaces of feedback signals, they mainly include the where the hardware controller is the one located in the center.
encoder counter with two-phase quadrature channels and the The verification process includes two procedures. First, the
three phase currents by A/D converter. And Fig. 6 is the pure model system without the Verilog HDL code is
unfolded of VSC controllers as has shown in Fig. 5 with the simulated, and its results have been proved in Figs. 3 and 4.
block name VSC. Afterwards, the developed control systems Second, the hardware controller which includes the current
are converted into Verilog HDL represented model. Note that, vector control, the transformations of Park, inverse Park,
the resulting hardware code must be checked and made some Clarke, inverse Clarke and the sine table are checked. Figs. 8
or a lot of modifications since the hardware implementations and 9 are the simulated results of hardware systems with iqs *
depend on the selected FPGA chip, some constraints such as
the amount of multiplier, gate count, and even the I/O pins command as those shown in Figs. 3 and 4. The responses are
similar to the results of Figs. 3 and 4 simulated by pure
software system.

Fig. 5. The digital model of PMSM current vector control.

Fig. 6.The VSC module for current control.


3URFHHGLQJVRI,QWHUQDWLRQDO$XWRPDWLF&RQWURO&RQIHUHQFH &$&6 
7KH(YHUJUHHQ/DXUHO+RWHO7DLFKXQJ7DLZDQ1RYHPEHU

Fig. 7.The co-simulation system platform by ModelSim and Simulink.

IV. Conclusions
Acknowledgement
In this paper, we have designed a hardware current
This work is financial supported by the Ministry of Science
controller for PMSM with the variable structure control and Technology of Taiwan with grant no. MOST
instead of the tradition PI controller, and realized by FPGA 104-2221-E-167-005.
with Verilog HDL code. The next work we are going to do is
hardware implementation by Altera FPGA to practically
realize the variable structure controller to complete the References
overall system as full digital and full FPGA control. The
resulting hardware is expected to have low cost as compared [1] Shihua Li, Mingming Zhou, and Xinghuo Yu, “Design and
with the DSP based drive system. Implementation of Terminal Sliding Mode Control Method for PMSM
Speed Regulation System”, IEEE Trans. on Industrial Informatics, vol. 9,
no. 4, pp. 1879-1891, Nov. 2013.
[2] Xiaoguang Zhang, Lizhi Sun, and Li Sun, “Nonlinear Speed Control for
PMSM System Using Sliding-Mode Control and Disturbance
command Compensation Techniques,” IEEE Trans. on Power Electronics, vol. 28,
response
no. 3, pp. 1358-1365, March 2013.
[3] Amor Khlaief, Moussa Bendjedia, Mohamed Boussak and Moncef Gossa,
“A Nonlinear Observer for High-Performance Sensorless Speed Control
Current (A)

of IPMSM Drive”, IEEE Trans. on Power Electronics, vol. 27, no. 6, pp.
3028-3040, June 2012.
[4] Kuo-Kai Shyu and Hsin-Jang Shieh, “A New Switching Surface
Sliding-Mode Speed Control for Induction Motor Drive Systems”,
IEEE Transactions on Power Electronics, vol. 11, no. 4, pp. 660-667,
July 1996.
[5] Kuo-Kai Shyu and Hsin-Jang Shieh, “Variable Structure Current Control
Time (second) for Induction Motor Drives by Space Voltage Vector PWM”, IEEE
Transactions On Industrial Electronics, vol. 42, no. 6, pp. 572-578, Dec.
Fig. 8. The hardware simulated result with 100 Hz square waveform
1995.
command.
[6] Kuo-Kai Shyu and Chiu-Keng Lai, “Incremental Motion Control of
Synchronous Reluctance Motor Via Multisegment Sliding Mode
Control Method”, IEEE Transactions On Control Systems Technology,
vol. 10, no. 2, pp. 169-176, March 2002.
command
response [7] Yam P. Siwakoti and Graham E. Town, “Design of FPGA-Controlled
Power Electronics and Drives Using MATLAB Simulink,” IEEE/ECCE
Asia 2013, pp. 571-577, 2013.
Current (A)

[8] Alexander Stumpf, Darrell Elton, John Devlin and Howard Lovatt,
“Benefits of an FPGA based SRM controller,” IEEE 9th Conference on
Industrial Electronics and Applications (ICIEA), pp. 12-17, 2014.
[9] Chaurasiya Rohit B., Mukesh D. Patil, Divya Shah and Abhijit Kadam,
“FPGA Implementation of SVPWM Control Technique for Three Phase
Induction Motor Drive Using Fixed Point Realization,” 2014
International Conference on Circuits, Systems, Communication and
Time (second) Information Technology Applications (CSCITA), pp. 93-98, 2014.
Fig. 9. The hardware simulated result with 100 Hz sinusoidal waveform
command.


3URFHHGLQJVRI,QWHUQDWLRQDO$XWRPDWLF&RQWURO&RQIHUHQFH &$&6 
7KH(YHUJUHHQ/DXUHO+RWHO7DLFKXQJ7DLZDQ1RYHPEHU

[10] Ying-Shieh Kung and Ming-Hung Tsai, “FPGA-Based Speed Control


IC for PMSM Drive With Adaptive Fuzzy Control,” IEEE Transactions
on Power Electronics, vol. 22, no. 6, pp. 2476-2486, Nov, 2007.
[11] Nguyen Vu Quynh and Ying-Shieh Kung, “FPGA-Realization of Fuzzy
Speed Controller for PMSM Drives without Position Sensor,” ICCAIS
2013, pp. 278-282, 2013.
[12] Zhang Chengjun, Wu Xiaoguang and Zuo Xiaoyan, “FPGA Soft-Core
Based Step Motor Driving,” 2010 International Conference on Electrical
and Control Engineering, pp. 1035-1038, 2010.
[13] Robert Horvat, Karel Jezernik and Milan Cˇ urkovicˇ, “An Event-Driven
Approach to the Current Control of a BLDC Motor Using FPGA,” IEEE
Transactions on Industrial Electronics, vol. 61, no. 7, pp. 3719-3726, July
2014.
[14] Michal Kocur, Stefan Kozak and Branislav Dvorscak, “Design and
Implementation of FPGA - Digital Based PID Controller,” 15th
International Carpathian Control Conference (ICCC), pp. 233-236, 2014.



You might also like