0% found this document useful (0 votes)
6 views

Bài Báo Fpga

Uploaded by

Phan Phúc Tài
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views

Bài Báo Fpga

Uploaded by

Phan Phúc Tài
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 5

ICCAIS 2013: Main Track ICCAIS 2013

FPGA-Realization of Fuzzy Speed Controller for PMSM Drives


without Position Sensor
Nguyen Vu Quynh and Ying-Shieh Kung, Member, IEEE

Abstract—This work realizes the speed control for permanent II. CONTROL SYSTEM DESIGN OF PMSM DRIVES
magnet synchronous motor (PMSM) drives under the condition
of without position sensor. Rotor flux angle and rotor speed are A. Mathematical Model of PMSM
obtained by using the algorithm of sliding mode observer. And The typical mathematical model of a PMSM is described,
the fuzzy controller is adopted for controlling the speed of
in two-axis d-q synchronous rotating reference frame, as
PMSM in order to increase the robust performance. In this
paper, we provide an approach from modeling, system design, follows
co-simulation in Modelsim/Simulink to experiment in FPGA di d r Lq 1 (1)
= − s id + ω e iq + vd
which can be used to design and validate our proposed control dt Ld Ld Ld
system. Finally, both simulation and experiment results are
confirmed the effectiveness and correctness of the proposed diq L r K 1 (2)
= −ω e d id − s iq − ω e E + vq
FPGA-based fuzzy speed controller for PMSM which is without dt Lq Lq Lq Lq
position sensor.
where vd, vq are the d and q axis voltages; id, iq, are the d and q
Keywords: Simulink/Modelsim co-simulation, fuzzy controller,
FPGA, PMSM.
axis currents, rs is the phase winding resistance; Ld, Lq are the d
and q axis inductance; ω e is the rotating speed of magnet
I. INTRODUCTION flux; K E is the permanent magnet flux linkage.

S EVERAL methods have been applied in order to control


the speed of permanent magnet synchronous motor
(PMSM) and estimate rotor flux angle (FA) from the
The sensorless speed control block diagram for PMSM
drives is shown in Fig 1. The current loop control is based on a
vector control approach. That is, if the id is controlled to 0, the
measurements of electric current, without traditional sensors PMSM will be decoupled and controlling a PMSM like to
such as neural network, extended kalman filter, etc [1]-[3]. control a DC motor. Therefore, after decoupling, the torque of
However, most of them were implemented by a digital signal PMSM can be written as the following equation,
processor (DSP). Unfortunately, DSP suffers from a long 3P (3)
Te = K E i q ∆ K t iq
period of development and exhausts many resources of CPU. 4
The FPGA can provide alternative method for this issue. Considering the mechanical load, the overall dynamic
FPGA with programmable hard-wired feature, fast equation of PMSM drive system is obtained by
computation ability, shorter design cycle, embedding d (4)
J m ω r + B m ω r = Te − T L
processor, low power consumption, and higher density is dt
better for implementation of the digital system than DSP [4]. where Te is the motor torque, P is pole pairs, Kt is torque
This paper follows the previous published paper [5] where the constant, Jm is the inertial value, Bm is damping ratio, TL is the
fuzzy controller (FC) and sliding mode observer (SMO) external torque, ωr is rotor speed.
algorithm have been studied and only successfully simulated
by Matlab/Simulink and Modelsim. This article improves the B. Fuzzy Controller
estimation method for obtaining the accuracy of rotor FA and Recently, the FC has appeared which was based on
experiment in FPGA board. The contents are organized as knowledge or an experience of expert rather than on a
follows. Firstly, the mathematical model of PMSM and FC complicate mathematical modeling. The FC was capable of
were designed and derived. Secondly, the innovation of SMO real time control using fuzzy rule base. The structure of FC
algorithm was introduced. Finally, the simulation and was shown in Fig 2. The fuzzification (FI) transformed the
experiment setups and results are described. input linguist values to supply for inference mechanism (IM).
The IM emulated the expert’s decision making in interpreting
and applying knowledge about how to control the speed of
PMSM based on the knowledge base (a set of if-then rules).
Manuscript received May 31, 2013. The defuzzification (DFI) based on product-inference rule
N. V. Quynh is with the Lac Hong University, Dong Nai, Vietnam. Tel:
and central average defuzzifier method to convert the results
84-61-3951-937; Fax: 84-61.3952-534 (e-mail: [email protected])
Y. S. Kung is with the Department of Electrical Engineering, Southern of IM into the inputs for the PI process.
Taiwan University of Science and Technology, Tainan, Taiwan. (e-mail:
[email protected]).

978-1-4799-0572-0/13/$31.00 ©2013 IEEE 278


ICCAIS 2013: Main Track ICCAIS 2013

FPGA board DC
Power
Speed loop Current Current loop
ω r* Fuzzy
iq* controller
vq Park-1
modify
Clark-1vref 1
Controller PI
vα PWM1
+ +
— —
d,q α, β vref 2 PWM2
PWM3
SVPWM Inverter
id* = 0 vd vβ PWM4
α, β a,b,c vref 3 PWM5
ωˆr + PI PWM6

iq iα ia iu
d,q α, β
ib A/D
iv
id iβ ic convert
α, β a,b,c
Park Clark
)
θe iα θe
A
B
QEP
Sliding mode iβ Z PMSM
observer vα Encoder
vβ ωr
1-Z-1

Fig. 1. The overall experimental block diagram for PMSM drives

In Fig. 2, the tracking error and the error change are defined differential operator. From (10), the EMF developed is
by: calculated as
)
e(n) = ω r* (n ) − ω r ( n) (5) eα  − sin θ e  (11)
e =   ∆ ωe K E  
de(n) = e(n) − e(n − 1) (6) e
 
β  cos θ e 
The membership function has shape of symmetrical triangle and the SMO is designed by
and 49 controlling rules have form: d  iˆα   −rs / L 0  iˆα  1  vα − zα 
 =  + 
(12)

dt iˆβ   0 − rs / L  iˆβ  L  vβ − zβ 
If e was Am and de was Bn then uf was Cm,n (7)
Crisp value in the output of FC:
i +1 j +1 the discrete equation of (12) is:
∑∑c m ,n [ µ An (e)* µ Bn ( de)] i +1 j +1 iˆα (n + 1)  σ 0  iˆα (n)   vα (n) − eˆα (n)  (13)
u f (e, de) =
n =i m = j
≈ ∑ ∑ cm ,n d n , m (8) ˆ =  ˆ  +ψ  
i +1 j +1 iβ (n + 1)   0 σ  iβ (n)   vβ (n) − eˆβ ( n) 
∑ ∑ [µ
n =i m = j
An (e) * µ Bn (de)] n =i m = j
we use [eˆα ê β ]T instead of [ zα z β ]T as the feedback value in
where cm,n dn,m is adjusting parameters for FC. The output of SMO; σ Ts , r and [iˆα iˆβ ]T is the estimated current on
≈ ψ ≈ 1 − Ts s
fuzzy supplies for digital PI controller (9): L L
iq* (n) = u p (n) + ui (n) fixed coordinate.
(9)
= ui (n − 1) + K p u f ( n) + Ki u f (n − 1)  zα  î − i  (14)
Z =   ∆ k * sign(  α α  )
u p (t )  zβ  îβ − iβ 
Kp where the current error is defined by
e 8 i* ( t)
de FI
Inference
DFI
Ki 8 q ~ ~ T ˆ
[ ] [ T
]
ecur ∆ iα iβ = iα − iα iˆβ − iβ . If k is large enough, the
Mechanism 1 − Z −1
uf ui ( t ) inequality in (21) can be satisfied and the SMO can enter into
1− Z −1
sliding mode condition.
Knowledge T
ecur e&cur <0 (15)
Base
Fig. 2. Structure of fuzzy sensorless speed controller Therefore, it generates the results of ecur = e&cur = 0 . The
C. Sliding Mode Observer back-EMF will be:
SMO block in Fig.1 constructed by a sliding mode  zα  eα  − sin θ e  (16)
 z  = e  = ωe K E  
observer, a bang-bang controller, two low-pass filters, and a    
β β  cos θ e 
rotor FA computation was shown in Fig. 3. The equation of To alleviate the high frequency in bang-bang control, two
PMSM on the α − β [7]: low-pass filters (LPF) are applied to create smoother
vα  rs + sL 0  iα  − sin θ e  back-EMF signal:
(10) ) ) )
v  =   i  + ωe K E   eα  2π f 0  zα  eα filtered  2π f 0  eα 
 β  0 rs + sL   β   cos θ e  e)  =   )  = ) 
(17)
where [vα vβ ]T and [iα iβ ]T are voltage on fixed coordinate  β  s + 2π f 0  zβ  and eβ filtered  s + 2π f 0 eβ 
The rotor FA ( θˆe ) can be computed by:
and current on fixed coordinate, respectively; L is the
inductance of the d-axis or q axis; θ e is rotor FA; s is the

978-1-4799-0572-0/13/$31.00 ©2013 IEEE 279


ICCAIS 2013: Main Track ICCAIS 2013

iα  ) )
 zα   eα  eα filtered 
i  e) 
 vα   β z   e) 
v   β  β  β filtered  )
- )
 β Sliding + Bang- Low- Low- θe + θout
Flux angle
mode bang pass pass
computation
+ observer controller filter filter )
- ) +
 iα  θcompensate
)  )
Low- ωout
iβ 
Speed
estimation pass
filter

Fig. 3. Rotor FA estimation based on SMO

ψ zβ ( n ) = k
ψ iβ ( n) Y 2πf 0
vα ( n ) - ~ k eˆβ ( n )
vβ ( n ) iβ ( n ) zβ ( n)
+ x + x + + ≥ x + x +
- σ - σ ~ z β (n) -
iβ ( n ) N
eˆα (n) î ( n ) zβ ( n ) = − k eˆβ (n) eˆβ (n)
α êβ ( n ) î β ( n )
x + x Y zα ( n ) = k 2πf 0
~ k
iα ( n) iβ ( n ) zα ( n ) eˆα (n)
- ~ ≥ x + x +
iα ( n ) zα ( n ) -
+
N zα ( n ) = −k eˆα (n) eˆα (n)
s0 s1 s2 s3 s4 s5 s6 s7 s8 s9 s10 s11 s12 s13 s14

Estimate the current values and compute current errors Bang-bang control First LPF

2πf0 eˆα filtered (n) kspeed fs


− ) )
eˆβ (n) eˆβ filtered (n) θˆe (n) ω (n) ωout (n)
eˆα filtered (n )
+ x + ÷ tan-1 atan2 + + + + x + x
- - -
Table θˆe ( n − 1) )
eˆα filtered (n ) eˆα filtered (n) ωout (n)
+
2πf0 -
θˆe ( n − 2)
eˆα (n) + θˆe ( n) θˆout (n)
+ x + - +
- eˆβ filtered (n) θˆe (n − 3)
+ )
eˆβ filtered (n ) eˆβ filtered (n) θcompensate
θˆe ( n − 4) -
s15 s16 s17 s18 s19 s23 s26 s27 s28 s29 s30 s31 s32 s33 s34

Second LPF Computation of the rotor position Computation of rotor speed LPF &rotor FA out
Fig. 4 Hardware design of SMO algorithm

eˆα filtered (n) (18) embedded with the new version.


θˆe (n) = tan −1 (− )
eˆβ filtered (n) A finite state machine (FSM) is employed to all VHDL
code, and this paper just shown FSM of SMO in Fig.4. There
The rotor speed is calculated by this equation:
4 ) ) are 35 steps machine to carry out the overall computations.
)
ω = kspeed * ∑ (θe (n) − θ e (n − 1)) (19) The multiplier, adder and divider apply Altera LPM standard
0
component but the arctan function uses our developed
The speed is computed by accumulating rotor FA values over component. The steps S0~S8 execute the estimation of current
four sample time and then multiplying by a constant kspeed. To values and compute the current errors; steps S9~S10 is the
)
obtain a smoother rotor speed, the LPF is as well applied to ω . bang-bang control; S11~S18 describe the computation of two
LPF topology is the same as the ones used for back-EMF LPFs; S19~S26 perform the computation of the rotor FA;
filtering. The delays in the filtering process must be removed S27~S31 compute rotor speed; S32~S34 is LPF and executes
by adding a compensating offset theta, as follows rotor FA with compensative data. The operation of each step
θˆ out = θ filterd + θˆcompensate (20) in Fig.4 is 80ns (12.5MHz) in FPGA; therefore total 35 steps
III. SIMULINK/MODELSIM COSIMULATION AND EXPERIMENT only need 2.8µs operation times.
ON HARDWARE SYSTEM DESCRIPTION After testing the effectiveness of the fuzzy sensorless speed
control in co-simulation system by Simulink/Modelsim, the
The Simulink/ModelSim co-simulation architecture of
experiment work of the step speed response was tested by
system in Fig.1 is the same as the ones used in previous paper
FPGA kit (Fig.5) by directly applying the VHDL code from
[5]. The VHDL code inside work-1 to work-3 of ModelSim is

978-1-4799-0572-0/13/$31.00 ©2013 IEEE 280


ICCAIS 2013: Main Track ICCAIS 2013

simulation to experiment system. Except the aforementioned faster than previous paper. In Fig.7(b) and Fig.9(b), the
controller’s VHDL codes, in implementation, the VHDL code current in d-axis (id) is approach to zero, it show that a good
for ADC and QEP interface circuits must be integrated for decoupling effect after using vector current control in Fig.1.
reading three-phase motor current and actual rotor FA, )
e
400
)
re 300 θ
respectively. The actual rotor FA is read by encoder is just g
e
D
(
used for comparing with estimated rotor FA. The main A200
F
r
devices are a PMSM, a DE2 board with Altera CycloneII to100
o
R θ
FPGA, a motor driver, and a power supplier. The parameters 0
(a) Time (s) 0.1
0 0.02 0.04 0.06 0.08
of PMSM and FPGA resources are listed in table 1 and table )
400
e )
2, respectively. The motor speed command was designed with e
r
g 300
θ
e
step response. The results for real rotor FA, estimated rotor (D
A200
F
FA, actual rotor speed, estimated rotor speed, and current r
to 100
o
control were shown in Fig. 6~9. R
0
θ
0 0.02 0.04 (b) 0.06 0.08 Time (s) 0.1
400
)
e )
e
r 300
g θ
e
D
(
A200
F
r
o
t 100
o θ
R
0
0 0.02 0.04 (c) 0.06 0.08 Time (s) 0.1
)
Fig. 6. Actual rotor FA ( θ e ) and estimated rotor FA ( θ e ) under PMSM
speed running at (a)500rmp, (b)1000rpm and (c)1500rpm in case simulation
)1500 Actual rotor Speed
m
rp speed command
(
d1000
e
e
p
s
r 500 Estimated
to
o rotor speed
R
Fig. 5 Experimental system 0
0 0.1 0.2 0.3 0.4 (a) 0.5 0.6 0.7 0.8 0.9
Time (s)
) 1
IV. COSIMULATION AND EXPERIMENT RESULTS (A
l
o Iq
tr 0.5
n
In the simulation and experiment of the rotor FA estimation o
c
t
n 0
in sensor speed control is considered and the running speeds e
rr
u
C Id
of PMSM with 500rpm, 1000rpm, and 1500rpm are tested. -0.5
0 0.1 0.2 0.3 0.4 (b) 0.5 0.6 0.7 0.8 0.9
Time (s)
The simulation and experiment results for the actual rotor FA,
Fig. 7. (a) Speed command, actual rotor speed, and estimated rotor speed
the estimated rotor FA are shown in Fig. 6 and Fig. 8, response (b) current response in case simulation
respectively. It presents that the estimated rotor flux position )
e
e θ
)
r 300
can follows the actual rotor flux position very well. The delay g
e
D
(
time in experiment (Fig.8) is about 200µs while PMSM A200
F
r
o
running speed at 500 rpm and about 100µs at 1500 rpm but in t 100
o
R
θ

simulation case (Fig.6), the delay time is approximate to zero. 0


0 0.02 0.04 (a) 0.06 0.08 Time (s) 0.1
400
Both simulation and experiment results of rotor FA in this )
e )
e
r 300 θ
paper are better than rotor FA in previous paper. g
e
D
( 200
After confirming the effectiveness of the rotor flux position A
F
r
estimation in both simulation and experiment system, we to 100
o θ
R
continue the checking in speed response. The estimated rotor 0
0 0.02 0.04 (b) 0.06 0.08 Time (s) 0.1

FA and estimated rotor speed are feed-backed to the current )


400
)
e θ
loop for vector control and to the speed loop for speed control, re 300
g
e
respectively. The results for actual rotor speed, estimated D
( 200
A
F
rotor speed response, and current response are shown in Fig.6 r
o
t 100 θ
o
R
and Fig.8. The rising time in simulation and experiment are 0
0 0.02 0.04 (c) 0.06 0.08 Time (s) 0.1
about 50ms and 250ms, respectively, which present a good )
Fig. 8. Actual rotor FA ( θ e ) and estimated rotor FA ( θ e ) under PMSM
speed following response without overshoot occurred. The
speed running at (a)500rmp, (b)1000rpm and (c)1500rpm in case of FPGA
speed response trends in Fig.7(a) and Fig.9(a) is very similar.
experiment
The response time in simulation is faster than in experiment
because the different of PMSM and controller parameters are
adopted which can accelerate the overall simulation time.
However, both simulation and experiment speed responses are

978-1-4799-0572-0/13/$31.00 ©2013 IEEE 281


ICCAIS 2013: Main Track ICCAIS 2013

2000
Speed
[5] Y. S. Kung and N. V. Quynh, "Simulink/ModelSim co-simulation of
)
M
P1500
command sensorless PMSM speed controller," in Industrial Electronics and
(R Applications (ISIEA), 2011 IEEE Symposium on, 2011, pp. 24-29.
d Estimated
e [6] Y. S. Kung and M. H. Tsai, "FPGA-Based Speed Control IC for PMSM
e1000 rotor speed
p
S Actual rotor Drive With Adaptive Fuzzy Control," Power Electronics, IEEE
500 speed Transactions on, vol. 22, pp. 2476-2486, 2007
0
[7] J. Zambada, Sensorless Field Oriented Control of PMSM Motors.
0 1 2 3 4 5 Time (s) 6
Microchip Technology Inc, datasheet, 2007
0.4
)
(A 0.3
l
o
rt 0.2 Iq
n
o
c
t 0.1
n
re
r 0
u
C -0.1 Id

-0.2
0 1 2 3 4 5 Time (s) 6
Fig. 9. (a) Speed command, actual rotor speed, and estimated rotor speed
response (b) current response in case of FPGA experiment

The simulation and experiment shown in Figs. 6~9


demonstrate the effectiveness and correctness of the
sensorless speed control for PMSM.

TABLE 1. PARAMETERS OF PMSM

Simulation Experiment
Parameters Value Parameters Value
Stator resistor 1.3Ω Cont. torque 0.64 Nm
Stator inductance 6.3mH Input 3ΦAC 92V, 1.6A
Pole pairs 4 Rated output 0.2 kW
Inertia Jm=108*10-6 kgm2 Rated freq. 200 Hz
Rated
Friction factor F=0.0013 Nms 3000r/min
revolution

TABLE 2. FPGA RESOURCES

Simulation Experiment
Parameters Logic RAM Logic RAM
elements bits elements bits
Speed controller 2,887 0 2,887 0
Current controller 1,828 98,304 1,828 98,304
SMO 1,969 49,152 1,969 49,152
CPU 0 0 4,226 75,264
ADC 0 0 146 0
QEP 0 0 66 0

V. CONCLUSION
This study has been presented a fuzzy sensorless speed
control for PMSM drive and successfully demonstrated its
performance through Simulink/ModelSim cosimulation and
experiment on FPGA board.

REFERENCES
[1] S. Bolognani, L. Tubiana, and M. Zigliotto "Extended Kalman filter
tuning in sensorless PMSM drives," Industry Applications, IEEE
Transactions on, vol. 39, pp. 1741-1747, 2003.
[2] H. H. Chou, Y. S. Kung, N. V. Quynh, and S. Cheng, "Optimized
FPGA design, verification and implementation of a neuro-fuzzy
controller for PMSM drives," Mathematics and Computers in
Simulation.
[3] M. Jain, M. Singh, A. Chandra, and S. S. Williamson, "Sensorless
control of permanent magnet synchronous motor using ANFIS based
MRAS," in Electric Machines & Drives Conference (IEMDC), 2011
IEEE International, 2011, pp. 599-606.
[4] Z. Zhaoyong, L. Tiecai, T. Takahashi, and E. Ho, "FPGA realization of
a high-performance servo controller for PMSM," in Applied Power
Electronics Conference and Exposition, 2004. APEC '04. Nineteenth
Annual IEEE, 2004, pp. 1604-1609 Vol.3.

978-1-4799-0572-0/13/$31.00 ©2013 IEEE 282

You might also like