as-74.3199 wireless automation
DESCRIPTION
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. - PowerPoint PPT PresentationTRANSCRIPT
AS-74.3199 Wireless Automation
Implementing PIDPLUS for Halvari 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
Halvari – a ball balancing system
4321 KKyKyKF
Halvari – a ball balancing system
Halvari can be described with two nonlinear differential equations
FrRmmMy )sincos)(()( 2
coscossin)cossinsin)(()( 22 FryMrmrgrRmr
r
rRJ
The constants used in the equations
kg 4Mkg 7.0m
23 kgm10175.0 J
m 5.0Rm 2.0r
sm 81.9 2g
Mass of the cart without the ball
Mass of the ball
Ball’s moment of inertia
Radius of the arch
Radius of rotation
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:
FMmrJmMrR
mr
MmrJmMrR
mMmgr
)))((()))(((
)(2
2
2
2
FMmrJmM
Jmr
MmrJmM
grmy
2
2
2
22
)()(
sin
0sin 2 1cos
02
The linearized equations are
Traditional PID PID controller consists of three terms: proportional,
integral and derivative.
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:
dt
tdeTde
TteKtu
t
di
p
)()(
1)()(
0
)()()( tytyte r P
I
D
processΣ Σ+
-
yyr e u
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
The filter eguation:
)1)(( 111resetT
T
NNNN eFOFF
outputfilter NF
outputfilter last the1 NF
output controllerlast the1 NO
packages receivedbetween timeT
I
PTreset
Source:Addressing Control Applications Using Wireless Devices,Emerson Global Users Exchange
PIDPlus derivative
The derivative term is described by the equation
Because the reference signal is 0 thereis a connection
A filter has to be added to the derivativeterm. The filter equation is
packagesbetween timeT
termderivative controllerDO
constant efilter timfT
(angle φ or place y)
T
eeKO NN
DD
1 errorcurrent Neerrorlast 1 Ne
outputfilter , Nfe
outputfilter last 1, Nfe
variablecontrolled Ny
NN ye
11,,
NN
fNf
f
fNf ee
TT
Te
TT
Te
• N2 receives packet and uses external pins to relay information to N3• Range: [0,4095] Physical values: [0,2.5 V]• Measurements range: [1300, 1900] [0.79,1.15 V]
N1Joystic
kCH 12.
N2
• Joystick measurement and Joystick ON/OFF
N3DAC1
ON/OFF
• N3 calculates control speed and direction and sends packet to N4
CH 18.
N4
• N4 assigns external pins for speed and direction• Signals are amplified from 0-2.5 V to 0-5.0 V.
SYSTEMDIR
SPEED
Halvari: Joystick Control
• N3.5 uses PIDplus algorithm to determine control• Sends control command to N4 and waits for ACK packet• If measurements from N3 not received, old control
values used
• N3 receives cart and ball position measurements from the system• If control switch is activated, PIDplus control used• Measurements are sent to N3.5
BALL POS.
CART POS.CH 16.
N4
• N4 assigns external pins for speed and direction• Signals are amplified from 0-2.5 V to 0-5.0 V.
SYSTEMDIR
SPEED
N3.5
CH 18.
ACKCH 18.
N3
Halvari: PIDplus controllerHalvari: PIDplus controller
Some simulations
PIDPlus without any packet loss.
red = angle φblue = place ygreen = y’turquoise = φ’
Some simulationsPIDPlus with somepacket loss.Sampling packet loss probability = 20%andActuator packet loss probability = 20%
red = angle φblue = place ygreen = y’turquoise = φ’
The longest timebetween updates is about 3 times thesampling time.
Some simulationsPIDPlus with a lot ofpacket loss.Sampling packet loss probability = 40%andActuator packet loss probability = 40%
red = angle φblue = place ygreen = y’turquoise = φ’
Time between updatescan be even 9 times thesampling time.
References
Addressing Control Applications Using Wireless Devices, Emerson Global Users Exchange, PowerPoint-show
Ajankäyttö