Vous êtes sur la page 1sur 6

Electrimacs 2005, Hammamet, Tunisie, April 17-20 2005

Modeling and simulation of a hybrid dynamic system used in haptic interfaces

F. Khatounian(1), S. Moreau(1), J.P. Louis(2), E. Monmasson(1), F. Louveau(3), J.M. Alexandre(3)


(1)
SATIE – CNRS UMR8029 – Université de Cergy, rue d’Eragny, 95301 Cergy-Pontoise, France,
flavia.khatounian@iupge.u-cergy.fr, sandrine.moreau@univ-poitiers.fr, eric.monmasson@iupge.u-cergy.fr
(2)
SATIE – CNRS UMR8029 – ENS de Cachan, 61 avenue du Pr. Wilson, 94230 CACHAN, jplouis@satie.ens-cachan.fr
(3)
HAPTION – 1 bis, rue Pierre et Marie Curie, 92140 Clamart, France,
e-mails: francois.louveau@haption.com, jean-marc.alexandre@cea.fr

Abstract – A haptic system consists in an articulated


mechanical structure with motors and position sensors, as well The proposed system is based on brushless Permanent
as embedded electronics allowing force feedback. It is driven Magnet Synchronous Motors (PMSM). The combination of
by a haptic interface, which enables the user to interact with an inner permanent magnet rotor and outer windings offers
an image in a virtual reality application, through the sense of
the advantages of low rotor inertia, efficient heat
touch. Thus, it is a hybrid dynamic system, which contains
subsystems with continuous dynamics and subsystems with dissipation, and reduction of the motor size. Moreover, the
discrete dynamics that interact with each other. This paper elimination of brushes reduces noise and suppresses the
develops a hybrid dynamic system model of the system, which need of brushes maintenance. The PMSM is connected to
takes into account the different sampling periods of the an incremental encoder to sense rotor position. A
desired regulation, and the interaction between continuous, TMS320LF2407 digital signal processor (DSP) allows the
switching and discrete subsystems. It is interesting when very torque control of the motor. Two shunt resistances sense
short electrical transients coexist with very long mechanical stator currents and send analog signals to one of the DSP’s
ones. peripherals: the analog to discrete converter. Torque control
is developed in the DSP, which provides logic signals for
I. INTRODUCTION
electronically switching the stator windings of the PMSM
in the proper sequence to maintain rotation of the magnet
A haptic interface is a computer device, which enables
assembly. The voltage applied to this motor is created by
its user to interact with the image in a virtual reality
using the Space Vector Modulation (SVM) technique.
application or model, through the sense of touch. Users can
Torque reference is provided asynchronously through a
experience feelings of touch and movement thanks to this
haptic interface, as shown in Fig. 2.
technology that optimizes human communication with
machines and intensifies a human' s immersion in a virtual
Hybrid dynamic systems (HDS) contain subsystems
world. Such systems are in growing demands for
with continuous dynamics and subsystems with discrete
applications such as mobile robotics, force feedback
dynamics that interact with each other [3][4]. These
remote-control systems for extreme environment, man-
systems typically contain variables or signals that take
machine interaction and training in professional operating
values from a continuous set and also variables that take
procedures [1][2]. They consist in an articulated
values from a discrete, typically finite set. These continuous
mechanical structure with motors and position sensors, as
or discrete-valued variables depend on independent
well as embedded electronics. The user holds the end-point
variables such as time, which may also be continuous or
of the structure in his hand, and can move it around, both in
discrete; some of the variables may also be discrete event
the real and in the virtual world on the computer screen.
driven in an asynchronous manner. Fig. 2 shows that the
Whenever his virtual hand makes contact with a digital
proposed system is a hybrid dynamic system. As a matter of
object, a force value is sent to the motors, which simulates
fact, it contains subsystems with continuous dynamics
a real contact as in Fig. 1.
(PMSM), switching dynamics (inverter) and subsystems
with discrete dynamics (DSP and haptic interface) that
interact with each other. Moreover, the haptic interface and
the DSP evolve in an asynchronous manner.

PM
inverter
SM
θ
Id
ADC

DSP
Iq
encoder
Iq*
Haptic
interface

Asynchronous Switching Continuous


discrete Discrete system
system
system
system
Fig. 2 – Global scheme of the presented hybrid dynamic system
Fig. 1 – Articulated mechanical structure for haptic interfaces
Electrimacs 2005, Hammamet, Tunisie, April 17-20 2005
A first simulation of the system has been realized under Speed loop Current loop
Tk = 240 µs Tn = 60 µs
Matlab-Simulink. However simulation time is very long
because, in order to approach the real system, the ω* I* PMSM
K Current
simulation step should be 25ns, which is the period of the controller
-ω -I
internal clock of the DSP. Moreover, only short intervals of
θ
time can be simulated, thus, the study of the system is very
d/dt
difficult on long ones. The objective of the study is to
obtain a torque regulation with the best dynamic behavior
and without ripples. This is why, in order to simulate θ*
Km
precisely the whole system and to extend the time and the Reversing Cem *
block Bm d/dt
precision of the simulation, this paper develops a hybrid
dynamic model of the system described above, with Haptic interface
ordinary differential equations to include discrete time and Ti = 1 ms

variables that extend results to switching systems. Fig. 3 – Overall regulation system
Moreover this model takes into account the problem of
the different frequencies induced in the system, such as III. PMSM MODEL AND CONTROL STRATEGY
switching/sampling frequencies and inner/outer loops time
periods. A. PMSM Model

Section II gives an overview of the system regulation. The PMSM electrical model, in a synchronous reference
Section III describes the PMSM model and its current frame is described in (1) and (2), where Ed and Eq are
regulation. Section IV develops a hybrid dynamic model of coupling terms. Rms is the stator winding resistance, Ld and
the studied system and section V presents simulations Lq the direct and quadrature axis inductances, whereas Vd,
comparing MATLAB-Simulink results, hybrid model Vq, Id and Iq are the direct and quadrature axis voltage and
results and experimental ones. current components. ϕf is the permanent magnet flux and
Cem the electromagnetic torque.
II. OVER-ALL REGULATION SYSTEM
d
Vd = Rms I d + Ld I d + Ed
The overall regulation system is shown in Fig 3. It dt
(1)
contains three major steps: d
- The first one consists in a current regulation (level 3) Vq = Rms I q + Lq I q + Eq
dt
realized in the DSP with a period Tn of 60 µs. This
Ed = −ω Lq I q
regulation is the image of the desired torque in a force (2)
feedback application, and as such, it must be as good Eq = ω Ld I d + ωϕ f
as possible.
- Cem =
2
3
(
p ϕ f − ( Lq − Ld ) I d I q ) (3)
- The second step is a speed regulation (level 2), also
done in the DSP with a period Tk of 240 µs. This
regulation is only a step to obtain a better force The PMSM mechanical equation is described in (4),
feedback, so it is not very important, and a simple where J and f are the inertia and the friction coefficient of
gain K is enough to control the system. It determines the system, Ω the mechanical speed, and Cr the load torque.
the desired current reference, which is thus updated
every 240 µs. dΩ
J + f .Ω = Cem − Cr (4)
dt
- The third step is realized in the haptic interface (level
1) with a period Ti of 1 ms. First, the reversing block
compensates the speed regulation realized in the Id
I*d Vd* 1/R ms
second step, so that the desired current – image of the PI Ld
desired torque in the force feedback application – is _ - 1+
R ms
p
reflected in the current regulation made in the first
Êd Ed
step. Then, a position and speed regulation is realized
with references obtained from the virtual
environment.
I*q Vq* 1/R ms Iq
PI Lq
The regulators gains and K are calculated to obtain the _ - 1+ p
R ms
desired dynamic in every loop, whereas Km and Bm, are
calculated depending on the desired transparency and Êq Eq
rigidity of the system. This paper only describes the current
regulation corresponding to the first step. In summary, the
current references are updated at a Tk period, and the Control system PMSM
current regulation is realized with a Tn period.
Fig. 4 – Current regulation loop
Electrimacs 2005, Hammamet, Tunisie, April 17-20 2005
B. PMSM control strategy - level 2: the speed regulation loop has a 240 µs time
period corresponding to the sampling period (Tk),
The transfer functions between the stator currents and - level 3: the current regulation loop has a 60 µs time
voltages of the PMSM are first order ones. The coupling period corresponding to the sampling period (Tn),
terms Ed and Eq can be estimated. Two PI regulators are - level 4: the SVPWM creates the duty cycles of the
used to control the current loop, as shown in the block inverter switches (Tn1, Tn2, Tn3), which change at
diagram in Fig. 4. each sampling period and define three new time
1 + τ i .s periods in the system.
C (s) = K (5)
τ i .s A. PMSM and inverter model

However, this regulation is realized in the DSP, and the The shortest sampling period is the current regulation
PI regulator must be discretised in order to implement them one (level 3). Using (1) and (2), a continuous dynamic state
in the DSP algorithm. space model, with the initial condition: X(tn) = Xn, can be
written as:
Tn Tn
τ in = K , Kn = K 1 + (6) dX / dt = A4 ( X ) . X + B4 .U n (7)
τi τi

IV. HYBRID DYNAMIC SYSTEM MODELING Rms Lq


− ω 0 0
Ld Ld
As described previously, there are different time periods ϕf
Ld Rms
and duty cycles in the studied system: Ti, Tn, Tk, Tn1, Tn2, −ω − − 0
Tn3. The simulation of such a system under Matlab- where A4 = Lq Lq Lq ,
Simulink is very difficult, because in order to obtain a pϕ f f
model as close to the reality as possible, the simulation step 0 − 0
J J
should be of 25ns, which is the internal clock of the DSP.
However, the results presented in the last section have a 0 0 1 0
simulation step of 500ns. This leads to very slow 1
simulations. A solution is to increase the simulation step, Ld
but this reduces the precision of the simulation. Another Id Vdn
solution is to use Hybrid Dynamic System (HDS) models 1
Iq Vqn
that include all the different time periods. X = , B4 = Lq , Un = .
ω Crn
1
Fig. 5 shows the different levels of time periods θ 0 −
involved in the regulation: J
- level 1: the current or torque reference is delivered 0
asynchronously by the haptic interface every The input in d-q reference frame has the following
millisecond (Ti), expression:

H a p tic in terfa c e tim e p erio d (T i = 1 m s )

S p eed reg u la tio n lo o p (T k = 2 4 0 µ s)

ti tk tk+1 tk+2 tk+ 3 t i+ 1 tk+4

S p eed reg u la tio n lo o p (T k = 2 4 0 µ s )

C u rren t reg u la tio n lo o p (T n = 6 0 µ s)

tk = tn tn + 1 tn+ 2 tn +3 t k + 1 = tn + 4

C u rren t reg u la tio n lo o p (T n = 6 0 µ s)

S w itc h in g d u ty c y c les (T n 1 , T n 2 , T n 3 )
Tn3
T n2
T n1

tn = tn 0 tn1 tn 2 tn 3 t k+ 1 = t n + 4

Fig. 5 – Different levels of the regulation time periods


Electrimacs 2005, Hammamet, Tunisie, April 17-20 2005
Vdn It is possible to write the global dynamic model by the
(V ) dq n =
Vqn
= P ( −θ n ).C32t . (Vabc ) ref , n (8) composition of equations (11), (12) and (13) on the “greater
period” Tk = 4.Tn. We obtain an analytical model of the
where θ is the position of the rotor and P(.) and T32, the following form:
classical matrices of rotation and Clarke :
X k +1 = Φ 2 ( X k , Γ 2, k ) (15)
cos θ − sin θ 1 −1/ 2 −1/ 2
P (θ ) = , C32t = (9)
sin θ cos θ 0 3/2 − 3/2 where Γ2,k = (Γ4,n , Γ4,n+1, Γ4,n+2, Γ4,n+3) contains all the
commutation instants in the interval [tk, tk+1], and Xk+1 =
We take into account the real shape of the signals, thus X(tk+1).
we must resolve (7) on each of the following four intervals:
The principle of the modeling is inspired by the method
- tn0 tn1
= tn , = tn + Tn1 presented in [5]. And the problem of the regulations with
- tn1 , tn2 = tn + Tn2 several sampling periods was presented in the case of DC
- tn2 , tn3 = tn + Tn3 motor in [6]. The HDS model takes into account all the time
- tn3 , tn4 = tn+1 = tn + Tn periods (except Ti, which is not included in this study) and
the modeling can be as precise as desired.
The duration Tni are deduced from the reference three-
phased voltages given by the current control algorithm: V.RESULTS COMPARISON
(Vabc,ref) = (Va,ref, Vb,ref, Vc,ref)t. An algorithm to find those
duty cycles is described in [7] as the following: The system was first simulated under Matlab-Simulink
(subscript S) with a 500 ns simulation step and with the 2nd
Tn1 1 V1, ref order Runge-Kutta solver (ode 2), and then with the HDS
1 V1, ref + V3, ref 1 model (subscript H). Simulation results were then
Tn
2
= Tn . 1− . 1 + V2, ref (10) confirmed with experimental results (subscript E).
2 E E
Tn
3
1 V3, ref
Fig. 6 and 7 show the d and q axis voltages (a) and
currents (b), and the electrical speed (c) of the PMSM. Fig.
where (1,2,3) is the permutation associated to Va,ref, Vb,ref,
6 and 7 respectively correspond to the Matlab-Simulink and
Vc,ref (for example, if Va,ref > Vb,ref > Vc,ref, then, 1 = b, 2 =
hybrid results. We can see that maximum voltages are not
a, 3 = c).
reached for the maximal currents with the discrete PI
regulators. A future study could consist in elaborating
B. Hybrid dynamic model
discrete regulators such as RST or first step responses,
which are known to impose higher control voltages
We must note that the durations Tni are small, thus the
allowing smaller response time. Concerning the dynamic
digital resolution of (7) can be made by several approaches.
behavior of the system, there are no noticeable differences
In this study, we choose a 2nd order Runge-Kutta algorithm,
between the two different simulations.
where the integration step can be one elementary interval,
as Tn1 for example. Thus we can write a state-space model
Fig. 8 compares in detail the current ripples obtained
of the form:
with both simulations on a larger scale. The top plots show
the dynamic response of the system in the transient mode,
X n +1 = Φ 4 ( X n , Γ 4, n ) (11) while the bottom ones compare results in the permanent
mode. The plots in the left column are sampled (discrete)
where Φ is a transition function and Γ4,n = (tn0, tn1, tn2, tn3), results, while the right column shows the same results with
the subscript 4 designing the level 4. These instants are a linear interpolation. We can see that six samples with the
deduced from (10), and can be written as a function: hybrid model are enough to obtain the precision of the
Simulink model. Those six samples correspond to the six
Γn = Gn (Vabc,ref (tn)) (12) states of the inverter in one period. However, we can also
see that some differences appear between the two methods.
In practice, the computation of the current control (level
3) is not instantaneous, and we must introduce a delay of To better understand the advantages and drawbacks of
one period in the model describing the algorithm: each method, it would be interesting to increase on the one
hand the simulation step of the Simulink model, and on the
Vabc , ref ( t n ) = A lg Curr ,3 ( X n −1 , Cemref , n −1 ) (13) other hand the number of points in each state of the inverter
for the hybrid model. Fig. 9 compares the results obtained
The torque reference, Cem,ref is given by the speed-loop for 0.25, 0.5 and 1µs simulation steps with Simulink. (a)
(level 2), which has a greater period (Tk = 4.Tn), and the shows that as expected, increasing the simulation step
computation time of this algorithm also introduces a delay deteriorates the quality of the results. Moreover, (b) and (c)
equal to the small period Tn: show more precisely that important differences are obtained
in the switching moments of the inverter and in the form of
the current ripples.
ωref , k = A lg Speed ,2 ( X k , Cemref , k − ( n −1) ) (14)
Electrimacs 2005, Hammamet, Tunisie, April 17-20 2005
10
case, the sampling period is small enough to allow those
(a)
Vd*S results. In an application where the sampling period is
Vq*S
5
bigger, it could be interesting to increase the number of
voltages (V) 0 points in order to obtain better simulations.
-5 4.5 4.5
Iq*H Iq*H
4 Iq*S 4 Iq*S
-10 3.5 3.5

t (s) 3 3

currents (A)
currents (A)
-15
0 0.005 0.01 0.015 0.02 0.025 2.5 2.5

2 2

1.5 1.5
5 1
Id*S (b) 1

0.5 0.5
Iq*S
0 t (s) 0 t (s)
5 5.2 5.4 5.6 5.8 6 5 5.2 5.4 5.6 5.8 6
currents (A)

-3 -3
x 10 x 10

4.7 4.7
Iq*H Iq*H
4.65 Iq*S 4.65 Iq*S

4.6 4.6
t (s)

currents (A)
-5 4.55

currents (A)
4.55
0 0.005 0.01 0.015 0.02 0.025
4.5 4.5

4.45 4.45
0
(c) 4.4 4.4
-20 4.35
4.35
electrical speed (rad/s)

-40 t (s) 4.3


t (s)
4.3
8.55 8.6 8.65 8.7 8.75 8.55 8.6 8.65 8.7 8.75
-3 -3
-60 x 10 x 10

-80
Fig. 8 – Comparing methods in transient and permanent mode
5
-100
Iq*S,0.25us
(a)
Iq*S,0.5us
-120 0
Iq*S,1us
t (s)

currents (A)
-140 -5
0 0.005 0.01 0.015 0.02 0.025

Fig. 6 – Matlab-Simulink Results -10

10 -15

V d*H (a)
-20 t (s)
V q*H 0 0.005 0.01 0.015 0.02 0.025
5
voltages (V)

4.8
0 0.25us
(b) 0.25us
(c)
4 0.5us 0.5us
4.7
1us 1us

-5 3 4.6

currents (A)
currents (A)

4.5
2
t (s)
-10 4.4
0 0.005 0.01 0.015 0.02 0.025
1
4.3

0 t (s) 4.2 t (s)


5 5 5.2 5.4 5.6 5.8 6 8.55 8.6 8.65 8.7 8.75
Id*H (b) x 10
-3
x 10
-3

Iq*H Fig. 9 – Simulink results with different simulation steps


5
(a) (b)
currents (A)

Iq*H,1pt 4.6 Iq*H,1pt


Iq*H,2pts Iq*H,2pts
0 0 4.4
Iq*H,3pts
Iq*H,3pts
4.2
currents (A)
currents (A)

-5
4
-10
3.8
t (s)
-5 -15 3.6
0 0.005 0.01 0.015 0.02 0.025
3.4
-20
0 0.005 0.01 0.015 0.02 0.025 8.55 8.6 8.65 8.7 8.75
t (s) t (s) x 10
-3
0
(c)
-20 4.7
electrical speed (rad/s)

1pt
(c) 1pt (d)
-40 4 2pts 4.65 2pts
3pts 3pts
4.6
-60 3
currents (A)
currents (A)

4.55
-80 4.5
2
4.45
-100
1 4.4
-120
4.35
t (s)
-140 0 4.3
0 0.005 0.01 0.015 0.02 0.025 5 5.2 5.4 5.6 5.8 6 8.55 8.6 8.65 8.7 8.75
t (s) x 10
-3 t (s) x 10
-3

Fig. 7 – Hybrid System Modeling Results Fig. 10 – Hybrid modeling results for different number of points per state

Fig. 10 compares the results obtained with 1, 2 and 3 Fig. 11 gives an overview of the differences obtained
samples per state of the inverter. (b) shows that the between a 1µs simulation step with Simulink and a one
precision of the results is better when the number of points point per state of the inverter simulation with the HDS
between each state of the inverter is increased, however, (c) model. It compares in detail the current ripples obtained
and (d) show that results displayed with a linear with both simulations on a larger scale. (b) and (c) show the
interpolation are identical no matter the number of points. dynamic response of the system in the transient mode,
It is thus useless to increase the number of points to more while (d) and (e) compare results in the permanent mode.
than one point per state. It is important to note that in our The plots in the left column are sampled (discrete) results,
Electrimacs 2005, Hammamet, Tunisie, April 17-20 2005
while the right column shows the same results with a linear 5
(a)
interpolation. We can see that the precision of the Simulink IqS,1us
IqH,1pt

model has decreased and that more important differences

currents (A)
appear between the two methods. 0

The choice between the Simulink and the hybrid model


could also be influenced by the duration of every t (s)
-5
simulation. Table 1 shows that decreasing the simulation 0 0.005 0.01 0.015 0.02 0.025

steps in order to obtain more precise simulations in the


Simulink model increases noticeably the duration of the 4
IqH (b)
4
IqH (c)
IqS IqS
simulation, while a one point per state of the inverter is
sufficient in the HDS model, in which case, the duration of 3 3

currents (A)
currents (A)
the simulation is shorter. 2 2

1 1
Table I – Duration of the simulations
Simulation 0
t (s) 0
t (s)
0.25 0.5 1 5 5.2 5.4 5.6 5.8 6 5 5.2 5.4 5.6 5.8 6

step (µs) x 10
-3
x 10
-3

Simulink
Duration 4.7 4.7
21 9 5 IqH (d) IqH (e)
(s) 4.6
IqS
4.6
IqS

Number of
1 2 3

currents (A)
currents (A)
4.5 4.5
points
HDS
Duration 4.4 4.4

5 9 18
(s) 4.3 4.3

t (s) t (s)
4.2 4.2
8.55 8.6 8.65 8.7 8.75 8.55 8.6 8.65 8.7 8.75
In order to validate both simulations, Fig. 12 shows x 10
-3
x 10
-3

experimental results of the system concerning the current Fig. 11 – Comparing methods in transient and permanent mode
loop with a 60µs sampling period. (c) shows that the 3
Id
(a)

measures taken by using the DSP analog to discrete 2 Iq

converter don’t allow to visualize the current ripples and


1
currents (A)

0
(b) shows the dynamic response of the system with a -1

response time of 0.4 ms. However, to obtain an acceptable -2

behavior of the system, the regulators gains had to be -3


0 0.05 0.1 0.15 0.2
t (s)
0.25

different from the theoretical ones, this shows the necessity


of improving the simulations using the hybrid dynamic 3
(b) 3
(c)
model to better represent the whole system with its delays 2.5
2.8
2
and different sampling periods. Moreover, discrete currents (A)
currents (A)

2.6
1.5

regulators can be implemented to improve the dynamic 1 2.4

responses. 0.5
2.2
0

-0.5 t (s) 2 t (s)

VI. CONCLUSION
0.05 0.052 0.054 0.056 0.058 0.06 0.0855 0.086 0.0865 0.087 0.0875

Fig. 12 – Experimental results

The analytical model (15) can be a powerful tool for


[3] P.J. Antsaklis, A. Nerode, “Hybrid Control Systems:
treating some difficult problems such as stability. But as a
An Introductory Discussion to the Special Issue”, IEEE
first application, we will only use this approach as a very
Trans. On Automatic Control, pp. 457-460, vol. 43,
fast hybrid model for a digital simulation, which will take
Apr 1998.
into account the exact shape of the signals, especially to
determine the currents and torque ripples. Thus we have a [4] J. Zaytoon, “Les Systèmes Dynamiques Hybrides”,
good tool to examine the performances of a permanent Traité I2C, Hermès, 2001
magnet motor fed by an inverter and controlled by a [5] D. Flieller, J.-P. Louis, J. Barrenscheen, “General
complex set of multi-levels commands for haptic sampled data modeling of power systems supplied by
applications. static converter with digital and analog controller”,
Mathematics and Computer in Simulation (North
VII.REFERENCES Holland), pp. 373-385, vol. 46, 1998.
[6] J.-P. Louis, C. Bergmann, “Commande numérique,
[1] J.E. Colgate, P.E. Grafing, M.C. Stanley, G. Schenkel, Convertisseur-moteur à courant continu”, Technique
“Implementation of stiff virtual walls in force- de l’Ingénieur, traité Génie électrique (Paris), pp. 1-30,
reflecting interfaces”, in Proc. IEEE-VRAIS, pp. 202- N° D 3641, 1995.
208, 1993. [7] F. Labrique, J.-P. Louis, “Modélisation des onduleurs
[2] P.A. Millman, M. Stanley, J.E. Colgate, “Design of a de tension en vue de leur commande en M.L.I.’, in J.-
high performance haptic interface to virtual P. Louis (ed.) : Modèle pour la commande des
environments”, IEEE 1993. actionneurs électriques (Hermes, Lavoisier, 2004, pp.
185-213)

Vous aimerez peut-être aussi