AS-74.3199 Wireless Automation

AS-74.3199 Wireless Automation
Implementing PIDPLUS for Halvari
system
Halvari – a ball balancing system




The goal is to keep the ball and
the cart in the middle.
Can be controlled by a manual
joystick or a computer.
The position of the ball (angle φ)
and of the cart (coordinate y) are
measured and their derivatives
calculated. Thus our system has
four states from which a control
variable (force F) can be derived.
In optimal control force is
calculated as a linear combination
of the states
F  K1 y  K 2 y  K 3  K 4
Halvari – a ball balancing system
Halvari can be described with two nonlinear differential equations
y(M  m)  m( R  r )( cos    2 sin  )  F

J (R  r)
 mr ( R  r )(  sin 2    2 sin  cos  )  mrg sin   Mry cos   Fr cos 
r
The constants used in the equations
M  4 kg Mass of the cart without the ball
m  0.7 kg Mass of the ball
J  0.175 103 kgm 2 Ball’s moment of inertia
R  0.5 m Radius of the arch
r  0.2 m Radius of rotation
g  9.81 m 2 s Acceleration of gravity
Halvari – a ball balancing system
The linearized form is derived by assuming that the angle φ is
small. Thus we have the following assumptions:
sin 2   0
sin   
cos   1
 2  0
The linearized equations are
mgr 2 (M  m)
mr 2
 

F
2
2
( R  r )(( M  m) J  Mmr )
( R  r )(( M  m) J  Mmr )
m2 r 2 g
mr 2  J
y  

F
2
2
(M  m) J  Mmr
(M  m) J  Mmr
Traditional PID


PID controller consists of three terms: proportional, integral and
derivative.
t

1
de(t ) 


u (t )  K p  e(t )   e( )d  Td
Ti 0
dt 

The input of a PID controller is an error signal which is the
difference between a reference signal and the measured output
of the process:
e(t )  yr (t )  y(t )
P
yr
+
Σ
e
I
D
Σ
u
process
y
PIDPlus




In wireless automation loss of measurement and
control data is common
Traditional PID doesn’t handle packet loss that well
and gives a poor dynamic response
The solution is to replace PID’s integral part with a
filter that takes packet loss into account  PIDPlus
PIDPlus holds on to the last filter output until a new
measurement is received and after that it calculates a
new filter output from the last controller output and
time elapsed since the last communication
PIDPlus integral
Source:
Addressing Control
Applications Using
Wireless Devices,
Emerson Global
Users Exchange
The filter eguation:
FN  FN 1  (ON 1  FN 1 )(1  e
 T
Treset
FN  filter output
)
FN 1  the last filter output
ON 1  the last controller output
T  time between received packages
P
Treset 
I
PIDPlus derivative
The derivative term is described by the equation
eN  eN 1
OD  K D
T
Because the reference signal is 0 there
is a connection
eN   y N
eN  current error
eN 1  last error
T  time between packages
OD  controller derivative term
e f , N  filter output
A filter has to be added to the derivative e f , N 1  last filter output
term. The filter equation is
e f ,N
T
e N  e N 1 

e f , N 1 
T  T f
T  T f
Tf
T f  filter tim e constant
yN  controlled variable
(angle φ or place y)
Some simulations
PIDPlus without
any packet loss.
red = angle φ
blue = place y
green = y’
turquoise = φ’
Some simulations
red = angle φ
blue = place y
green = y’
turquoise = φ’
PIDPlus with some
packet loss.
Sampling packet loss
probability = 20%
and
Actuator packet loss
probability = 20%
The longest time
between updates
is about 3 times the
sampling time.
Some simulations
red = angle φ
blue = place y
green = y’
turquoise = φ’
PIDPlus with a lot of
packet loss.
Sampling packet loss
probability = 40%
and
Actuator packet loss
probability = 40%
Time between updates
can be even 9 times the
sampling time.
References

Addressing Control Applications Using
Wireless Devices, Emerson Global Users
Exchange, PowerPoint-show