Professional Documents
Culture Documents
6, NOVEMBER 2007
Abstract—The new generation of field programmable gate have a fast dynamic response to adjustments in its control
array (FPGA) technologies enables an embedded processor intel- parameters, so that the motor outputs that influenced by the dis-
lectual property (IP) and an application IP to be integrated into a
turbances can recover to their original status as soon as possible
system-on-a-programmable-chip (SoPC) developing environment.
Therefore, this study presents a speed control integrated circuit [6]. However, the execution of a neural network or adaptive
(IC) for permanent magnet synchronous motor (PMSM) drive fuzzy control requires many computations, so implementation
under this SoPC environment. First, the mathematic model of of these highly complex control algorithms depend on the PC
PMSM is defined and the vector control used in the current loop systems in most studies [3], [7]. In recent years, the fixed-point
of PMSM drive is explained. Then, an adaptive fuzzy controller
adopted to cope with the dynamic uncertainty and external load digital signal processor (DSP) and field programmable gate
effect in the speed loop of PMSM drive is proposed. After that, an array (FPGA) also provide a possible solution in this issue
FPGA-based speed control IC is designed to realize the controllers. [8], [9]. Comparing with FPGA, although the aforementioned
The proposed speed control IC has two IPs, a Nios II embedded intelligent control technique using DSP provides a flexible
processor IP and an application IP. The Nios II processor is
used to develop the adaptive fuzzy controller in software due to skill, it suffers from a long period of development and exhausts
the complicated control algorithm and low sampling frequency many resources of the CPU [9].
control (speed control: 2 kHz). The designed application IP is Nowadays, due to the progress of VLSI technology, the
utilized to implement the current vector controller in hardware FPGA has brought more attention before. The advantages of
owing to the requirement for high sampling frequency control
(current loop: 16 kHz, pulsewidth modulation circuit: 4–8 MHz) the FPGA include their programmable hard-wired feature, fast
but simple computation. Finally, an experimental system is set up time-to-market, shorter design cycle, embedding processor,
and some experimental results are demonstrated. low power consumption and higher density for the implemen-
Index Terms—Field programmable gate arrays (FPGAs), fuzzy tation of the digital system [10]. FPGA provides a compromise
control, permanent magnet motors, synchronous motor drives, between the special-purpose application specified integrated
system-on-a-programmable-chip (SoPC). circuit (ASIC) hardware and general-purpose processors [11].
Hence, many practical applications in inverter [12], [13] and
I. INTRODUCTION motor control [9], [14]–[17] have been studied. Tzou [12]
and Zhou [13], respectively, gave an FPGA realization of the
can be realized by software in FPGA. With the results of scheme for PMSM is implemented by hardware in FPGA. The
the software/hardware co-design function increase the pro- detailed theoretical description follows.
grammable, flexibility of the designed digital system, reduce
A. Mathematical Model of PMSM
the development time and enhance the system performance.
Our previous works [21]–[23] have successfully applied the The mathematical model of a typical PMSM is described, in
SoPC technology to the servo system of PMSM drive, robot two-axis - synchronous rotating reference frame, as follows
arm, and – table. [1]:
To exploit the advantages, this study presents a fully digital (1)
speed control integrated circuit (IC) for PMSM drive based on
the new-generation FPGA technology, as in Fig. 1. The pro-
(2)
posed motion control IC has two IPs, a Nios II embedded pro-
cessor IP and an application IP. The Nios embedded processor
where are the and axis voltages; are the and
IP is adopted to implement the adaptive fuzzy control functions
axis currents, is the phase winding resistance; are the
using software, and the application IP is used to realize the cur-
and axis inductance; is the electrical angular speed;
rent vector control with hardware. Besides, a finite state machine
is the permanent magnet flux linkage. The current control of a
(FSM) method is also considered to reduce the logic elements
PMSM drive is based on vector control approach, such that if
(LEs) usage of FPGA in this paper. Hence, all functionalities,
is controlled to 0 in Fig. 1, the PMSM is decoupled. Therefore,
which are based on software/hardware co-design, required to
the developed electromagnetic torque can be simplified to [1]
build a fully digital servo control for PMSM drive can be in-
tegrated in one FPGA chip. The FPGA chip employed herein
is an Altera Cyclone EP1C20 with 20 060 LEs, maximum 301 (3)
user I/O pins, 294 912 b of RAM, and a Nios II embedded pro-
cessor. The processor has a 32-b configurable CPU core, 16 M with
byte Flash memory, 1 M byte SRAM and 16 M byte SDRAM.
Finally, an experimental system included by an FPGA experi-
mental board, an inverter and a PMSM, is set up to verify the (4)
correctness and effectiveness of the FPGA-based speed control
IC. Considering the mechanical load, the dynamic equation of
PMSM can be written as follows [1]:
II. SYSTEM DESCRIPTION OF PMSM DRIVE
AND ITS DESIGN METHODOLOGY
(5)
The internal architecture of the proposed FPGA-based servo
system for the PMSM drive is shown in Fig. 1. The adaptive where and are the number of pole
fuzzy control in the speed loop is developed in software using pairs, the rotor speed, the motor toque, the torque constant, the
the Nios II embedded processor. The current vector control inertial value, the damping ratio and the load toque, respectively.
2478 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 22, NO. 6, NOVEMBER 2007
has more flexible and less steady state error than the former 2) Select the initial fuzzy control rules by referring to the dy-
one. The fuzzy controller in this study uses singleton fuzzifier, namic response characteristics [4], such as
triangular membership function, product-inference rule and
central average defuzzifier method [24]. In Fig. 1, the tracking IF is and is THEN is
error and the error change are defined by (13)
There are seven fuzzy sets for each linguist value
(10) and 49 fuzzy control rules are designed
(11) for the two inputs and one output fuzzy system. Therefore,
is 49 in (13).
3) Construct the fuzzy system, , by using the sin-
and represents the output of the fuzzy controller. The is
gleton fuzzifier, product-inference rule, and central average
the output of the reference model. The design procedure of the
defuzzifier method. Therefore, (13) is replaced with the
fuzzy controller is as follows.
following expression: [25]
1) Take and as the input and output vari-
able of fuzzy controller, and define their linguist values as
based on the symmetrical triangular member-
ship function
(14)
Applying the bilinear transformation, the continuous model where represents learning rate. The formulations for the ad-
in (15) can be transformed to a discrete model by justment of the parameters of the fuzzy controller are derived,
by initially, assume to be zero in (5), and taking Laplace
transformation of (3) and (5)
(16)
(20)
the is back shift operator and and are the
parameters of the discrete model. Furthermore, the difference
equation is written as Next, the bilinear transformation is used to derive the following
difference equation of PMSM drive system
(17)
(21)
3) Parameter Adjusting Mechanism: The gradient descent
method is used to derive the fuzzy control law in Fig. 1. The pri- where is a back-shift operator and is the sampling period.
mary purpose of adjusting the parameters of the fuzzy controller Additionally, in Fig. 1, the current command, is formulated
is to minimize the square error (instantaneous cost function) be- by the output of fuzzy controller,
tween the rotor speed and the output of the reference model. The
instantaneous cost function is defined by
(22)
(18)
and where are the PI controller gains, and is the
and the parameters of are adjusted according to output of the controller. From (21) and (22)
(19)
(23)
KUNG AND TSAI: FPGA-BASED SPEED CONTROL IC 2481
(24)
(25)
and
(26)
Therefore, (25) and (26) are substituted into (24) and (19), and
then the parameters of fuzzy controller described by (14) can
be adjusted using the following expression:
(27) Fig. 6. (a) Circuit of SVPWM generation and (b) circuit of QEP detection and
transformation.
TABLE I
UTILITY EVALUATION OF SPEED CONTROL IC FOR PMSM DRIVE IN FPGA FOR
THE DESIGNED CCCT CIRCUIT IN FIG. 2 BY USING (a) PARALLEL
PROCESSING METHOD and (b) FSM METHOD
stator current are 0.63 , 2.77 mH, 1.1 Kg-m/A and 12 A, re-
spectively. An incremental optical encoder (2 500 ppr) attached
to PMSM is used as the rotor’s position sensor. The inverter has
six sets of IGBT type power transistors. The collector-emitter
voltage of the IGBT is rating 600 V, the gate-emitter voltage is
rating 20 V, and the collector current in dc is rating 25 A and
in short time (1 ms) is 50 A. The photo-IC, Toshiba TLP250,
is used for gate driving circuit of IGBT. Input signals of the in-
verter are PWM signals from FPGA device. For the implement,
the PWM switching frequency of inverter, dead-band and the
control sampling frequency of current and speed loop are de-
signed to 16 kHz, 1 s, 16 kHz, and 2 kHz, respectively. In the
proposed FPGA-based speed control IC, the current controller
is implemented by using PLD hardware and the adaptive fuzzy
speed controller is realized by using software in the Nios II em-
bedded processor. The fuzzy controller in this study uses sin-
gleton fuzzifier, triangular membership function, product-infer-
ence rule and central average defuzzifier method. The parameter Fig. 9. Step response of rotor speed and control effort operated at
1200–1500 rpm square wave command and 0.2 N*m load torque under
adjustment mechanism is based on the gradient descent method. case of: (a) without adaptation, (b) with adaptation by learning rate 0.05,
The transfer function of the reference model in Fig. 1 is chosen (c) with adaptation by learning rate 0.1.
by a second order system with the natural frequency of 50 rad/s
and the damping ratio of 1. After applying the bilinear transfor-
mation with sampling frequency by 2 kHz, the parameters of dif- without load connection, PWM1 and PWM2 signals are mea-
ference equation in (17) are obtained by 0.000152 sured and show the results of 16 kHz switching frequency and
0.000306 0.000152 1. 950617 0.951227. 1 s dead-band in Fig. 7(b). When the experimental system is
To verify the correctness of SVPWM generation function in serially connected to a RC circuit with 10 resistor and 47 f
Fig. 1, an experimental block diagram is constructed in Fig. 7(a). capacitor, the results show the measured PWM1 and PWM3 as a
The input signal is set to a constant voltage and the is set saddle waveform in Fig. 7(c). Furthermore, to validate the effec-
to zero in Fig. 7(a), then PWM1–PWM6 outputs can be gen- tiveness of the current vector control in Fig. 1, the input current
erated through the transformation of inverse Park, modified in- command, is set, and the measured currents
verse Clarke and SVPWM. When the experimental system is of and corresponding currents in - - axes are shown in
2484 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 22, NO. 6, NOVEMBER 2007
Fig. 11. Frequency response of a 2 Hz sinusoid input signal with 1.0 N*m load
torque under using the (a) fuzzy controller and (b) adaptive fuzzy controller.
loop of Fig. 1. The step response under two tested cases is first
evaluated. The first case is motor running at the light-load con-
dition that the amplitude of speed command is 1200–1500 rpm
square wave and the external load torque is 0.2 N*m. The
second case is motor running at the heavy-load condition that
the amplitude of speed command is 0–300 rpm square wave
and the external load torque is 1.2 N*m. In addition, the per-
formance of using different control laws by PI controller only,
PID type fuzzy controller and the proposed adaptive fuzzy
controller are compared. At the light-load condition, when the
PI controller (PI gains: 0.61 and 0.015) is only
Fig. 10. Step response of rotor speed and control effort operated at 0–300 rpm used in the speed loop of Fig. 1, the step response is shown
square wave command and 1.2 N*m load torque under case of (a) without adap-
tation, (b) with adaptation by learning rate 0.05, and (c) with adaptation by in Fig. 9(a). It reveals a bad tracking result with overshoot
learning rate 0.1. and oscillation. However, when the fuzzy controller is serially
connected to the PI controller (called PID type fuzzy controller)
in Fig. 1, the experiment is done again and the step response is
Fig. 8. The load torque of brake is set to 2 N*m. In Fig. 8, the re- also shown in Fig. 9(a). It is obvious that although the dynamic
sults present that the measured current tracks current command is improved in Fig. 9(a) by using the PID type fuzzy controller,
perfectly. The experimental results validate the success of cur- the rotor speed is still can’t follow the output of the reference
rent vector control, and will make the PMSM decouple. model. However, when the proposed adaptive fuzzy controller
Having confirmed the effectiveness of the current vector is presented in Fig. 1, and the learning rate are chosen by 0.05
control, the dynamic performance of PMSM drive is evaluated or 0.1, its tracking results are highly improved and presented in
while the adaptive fuzzy controller is applied in speed control Fig. 9(b) and (c). At initial, the rotor speed tracks the output of
KUNG AND TSAI: FPGA-BASED SPEED CONTROL IC 2485
IV. CONCLUSION
A speed control IC for PMSM drive based on the novel FPGA
technology is successfully demonstrated in this paper. First, a
vector control in the current loop of the PMSM drive is used
to decouple the nonlinear and coupled characteristics of PMSM
and an adaptive fuzzy controller in the speed loop of the PMSM
drive is applied to cope with the dynamic uncertainty and ex-
ternal torque effect. Secondly, a speed control IC based on an
FPGA and a Nios II embedded processor is designed to realize
the aforementioned control algorithms for ensuring high perfor-
mance. The current vector control algorithm is implemented by
hardware in FPGA and the adaptive fuzzy controller algorithm
is implemented in software by using Nios II embedded pro-
cessor. Therefore, all functionalities, which are based on soft-
ware/hardware co-design, required to build a fully digital speed
control for PMSM drive have been integrated in one FPGA chip.
In addition, a finite state machine (FSM) method is also pre-
sented in this paper, and given the results that the total resource
usages save 2 795 LEs of FPGA in the overall circuits. Com-
pared with DSP, using FPGA in the proposed control architec-
ture has two benefits, which are described as follows.
Fig. 12. Frequency response of a 2 Hz sinusoid input signal with 2.0 N*m load 1) Current controller implemented by hardware and speed
torque under using the (a) fuzzy controller and (b) adaptive fuzzy controller. controller implemented by software can all be pro-
grammable design. Therefore, the flexibility of designing
a specified function of PMSM drive is greatly increased.
reference model with oscillation; at the meanwhile, the param- 2) Parallel processing of current loop vector controller and
eters of fuzzy controller are tuned toward reducing the error, speed loop adaptive controller makes the dynamic perfor-
which is the output of the reference model and the rotor speed, mance of the PMSM drive improvable.
at each control sampling interval. After one or two square Finally, the performance of the proposed controller is val-
wave command tracking, the parameters of fuzzy controller idated by the experimental results of the step and frequency
are tuned to an adequate value, and the actual rotor speed can command responses. In the test of the step command response,
get a good following with the output of the reference model. the adaptive fuzzy controller used in the speed loop of the
Similarity, the proposed adaptive fuzzy controller demonstrates PMSM drive, compared with the PI controller and fuzzy
the same adaptation ability at heavy-load condition, and the controller, is demonstrated to be the best tracking result at the
prescribed dynamic response under the different external load
tracking results are shown in Fig. 10. Secondly, the frequency
condition.
response is considered to evaluate the performance of the
proposed controller. A tested input signal of the sinusoid wave
with 1,350 150 rpm amplitude and a frequency of 2 Hz under REFERENCES
different load torque by 1.0N*m and 2.0N*m are provided. In [1] B. K. Bose, Power Electronics and Variable Frequency Drives—Tech-
this design, the frequency tracking response and the tracking nology and Application. New York: IEEE Press, 1997.
error of the PMSM without and with adaptation are shown in [2] B. K. Bose, “Expert system, fuzzy logic, and neural network applica-
tions in power electronics and motion control,” Proc. IEEE, vol. 82, no.
Figs. 11 and 12. In the case of light-load torque with 1.0N*m,
8, pp. 1303–1323, Aug. 1994.
it reveal that the 20 rpm amplitude tracking error obtained [3] Y. S. Kung, C. M. Liaw, and M. S. Ouyang, “Adaptive speed control
by using the adaptive fuzzy controller (learning rate 0.1) is for induction motor drives using neural networks,” IEEE Trans. Ind.
better than the 34 rpm tracking error obtained by only using Electron., vol. 42, no. 1, pp. 25–32, Feb. 1995.
[4] C. M. Liaw and Y. S. Kung, “Fuzzy control with reference model-fol-
the fuzzy controller in Fig. 11(a) and (b). Similarly, in the case lowing response,” in Fuzzy Theory Systems: Techniques and Applica-
of heavy-load torque with 2.0 N*m, although the tracking error tions. New York: Academic, 1999, vol. 1, pp. 129–158.
2486 IEEE TRANSACTIONS ON POWER ELECTRONICS, VOL. 22, NO. 6, NOVEMBER 2007
[5] Y. S. Kung and P. G. Huang, “High performance position controller [21] Y. S. Kung, P. G. Huang, and C. W. Chen, “Development of a SOPC
for PMSM drives based on TMS320F2812 DSP,” in Proc. IEEE CCA/ for PMSM Drives,” in Proc. 47th IEEE Int. Midwest Symp. Circuits
ISIC/CACSD Joint Conf., 2004, vol. I, pp. 290–295. Syst., 2004, vol. II, pp. II-329–II-332.
[6] T. S. Radwan, M. A. Rahman, A. M. Osheiba, and A. E. Lashine, “Dy- [22] Y. S. Kung and G. S. Shu, “Design and implementation of a control
namic analysis of a high performance permanent magnet synchronous IC for vertical articulated robot arm using SOPC Technology,” in Proc.
motor drive,” in Proc. Canadian Conf. Elect. Comput. Eng., 1996, vol. IEEE Int. Conf. Mechatron., 2005, pp. 532–536.
2, pp. 611–614. [23] Y. S. Kung, K. H. Tseng, and F. Y. Tai, “FPGA-based servo control
[7] F. J. Lin, R. J. Wai, and H. P. Chen, “A PM synchronous IC for X-Y table,” in Proc. IEEE Int. Conf. Ind. Technol., 2006, pp.
servo motor drive with an on-line trained fuzzy neural network 2913–2918.
controller,” IEEE Trans. Energy Conversion, vol. 14, no. 4, pp. [24] D. Driankov, H. Hellendoorn, and M. Reinfrank, An Introduction to
319–325, Dec. 1998. Fuzzy Control. New York: Springer-Verlag, 1993.
[8] H. H. Chen, S. N. Yeh, J. C. Hwang, and M. H. Chen, “Development [25] L. X. Wang, A Course in Fuzzy Systems and Control. Englewood
of DSP-based servo drive for permanent-magnet synchronous motors,” Cliffs, NJ: Prentice-Hall, 1997.
in Proc. 22nd Symp. Elect. Power Eng., 2001, pp. 417–421.
[9] Z. Zhou, T. Li, T. Takahahi, and E. Ho, “FPGA realization of a high-
performance servo controller for PMSM,” in Proc. 9th IEEE Appl.
Power Electron. Conf. Expo, 2004, vol. 3, pp. 1604–1609.
[10] H. C. Roth, “Digital System Design Using VHDL,” in Proc. PWS
Conf., Boston, MA, 1998, [CD ROM].
[11] R. Wei, X. H. Gao, M. H. Jin, Y. W. Liu, H. Liu, N. Seitz, R. Gruber, Ying-Shieh Kung (M’03) was born in Taiwan,
and G. Hirzinger, “FPGA based hardware architecture for HIT/DLR R.O.C., in 1957. He received the B.S. degree in
Hand,” in Proc. IEEE/RSJ Int. Conf. Intell. Robots Syst., 2005, pp. aeronautical engineering from National Cheng
523–528. Kung University, Tainan, Taiwan, in 1980, the M.S.
[12] Y. Y. Tzou and T. S. Kuo, “FPGA realization of space-vector PWM degree in mechanical engineering from National
control IC for three-phase PWM inverters,” IEEE Trans. Power Elec- Taiwan University, Taipei, Taiwan, in 1982, and the
tron., vol. 12, no. 6, pp. 953–963, Nov. 1997. Ph.D. degree in power mechanical engineering from
[13] Z. Zhou, T. Li, T. Takahahi, and E. Ho, “Design of a universal space National Tsing Hua University, Hsinchu, Taiwan, in
vector PWM controller based on FPGA,” in Proc. Appl. Power Elec- 1993.
From 1983 to 1996, he was an Engineer and fo-
tron. Conf. Expo Conf., 2004, vol. 3, pp. 1698–1702.
cused on the research in the field of automatic con-
[14] T. Takahashi and J. Goetz, “Implementation of complete AC servo con-
trol of machine system at the Industrial Technology Research Institute, Hsinchu.
trol in a low cost FPGA and subsequent ASSP conversion,” in Proc. Since 1996, he has been an Associate Professor with the Department of Elec-
Appl. Power Electron. Conf. Expo, 2004, vol. 1, pp. 565–570. trical Engineering, Southern Taiwan University (STU), Tainan. He is currently
[15] G. Yang, Y. Liu, N. Cui, and P. Zhao, “Design and implementation of a Professor at STU. His areas of research interest are controller design for ac
a FPGA-based AC servo system,” in Proc. 6th World Congress Intell. motor drives and linear motor drives, robot control, intelligent control, and dig-
Control Autom., 2006, vol. 2, pp. 8145–8149. ital control using the DSP and FPGA implementations.
[16] C. H. Fang, W. N. Huang, C. H. Chen, J. K. Chen, and H. Y. Chang,
“New design concept of an FPGA-based chip with considerations of
flexible functions applying sliding mode control strategy for permanent
magnet synchronous motor drives,” Proc. Appl. Power Electron. Conf. Ming-Hung Tsai was born in Taipei, Taiwan,
Expo, vol. 3, pp. 1903–1908, 2005. R.O.C., in 1978. He received the B.S. degree in
[17] F. J. Lin, D. H. Wang, and P. K. Huang, “FPGA-based fuzzy sliding electrical engineering from Minghsin University of
mode control for a linear induction motor drive,” Proc. Inst. Elect. Eng., Science and Technology, Hsinchu, Taiwan, in 2001
vol. 152, no. 5, pp. 1137–1148, Sep. 2005. and the M.S. degree in electrical engineering from
[18] Altera Corp., SOPC World Tech. Rep., 2004. Southern Taiwan University, Tainan, Taiwan, in 2004
[19] Nios datasheet, Version 1.2, DS-NIOSDMA-1.2, Altera Corp., 2003. where he is currently pursuing the Ph.D. degree.
[20] T. S. Hall and J. O. Hamblen, “System-on-a-programmable-chip de- His research interests are in the areas of ac motor
velopment platforms in the classroom,” IEEE Trans. Education, vol. control, fuzzy control, FPGA controller realization,
47, no. 4, pp. 502–507, Nov. 2004. and FPGA-based control ICs for motor drives.