You are on page 1of 27

Hydraulic Cylinder Simulation

Simulating a hydraulic cylinder starts with the basic F=m*a and then is enhanced by
doing a series of substitutions. The net force is equal to the force applied on the piston
minus the opposing force required to push oil out the other side and the opposing force
due to friction.
F
net
F
a
F
b
F
l
F
f
=
Substitute for the for the force on both sides of the piston and the frictional and load
forces. Assume the friction is proportional to the velocity. Ignore static friction for now
and just model the kinetic friction
a
P
a
A
a
P
b
A
b
Fl F
f

mass
= The acceleration that must be
integrated to provide velocity and
position.
Since a is the same as
t
v
d
d
The acceleration or rate of
change in velocity
t
v
d
d
Pa Aa Pb Ab
mass
=
t
P
d
d
Q
V
=
Expressed as a simple ODE
Since the moving piston changes the volume or V on both sides of the piston the velocity
of the piston must also be taken into account
t
P
d
d

V
Q v A + ( ) =
Calculate how pressure changes as a function of net flow
Va and Vb are the volumes of oil between the valve or pump and the cylinder piston. The
subroutines Qa(Pa) and Qb(Pb) are needed to calculate the net flow.
t
Pa
d
d

Va
Q Pa ( ) v Aa ( ) = Calculate the rate of
change in pressure as a
function of flow and
velocity.
t
Pb
d
d

Vb
Q Pb ( ) v Ab + ( ) =
(c) 2010 Delta Computer Systems, Inc. 1/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Simulate the Hydraulic Actuator Acceleration
Pt 14.7 := Tank pressure psia
Ps0 2000 := Initial system pressure, psia
CylDia 2 :=
RodDia 1.375 :=
Aa

4
CylDia
2
:= Aa 3.142 =
Ab

4
CylDia
2
RodDia
2

( )
:= Ab 1.657 =
CylLen 24 :=
W 600 := Weight in lbf
Slinch. A slinch is 12 slugs. 1 lb force
accelerates a slinch at 1 in/s^2
mass
W
386
:= mass 1.554 =
Fl W sin 0 ( ) := Fl 0 =
Kf 5 :=
lbf sec
in
frictional velocity constant
Va
min
5 := Cubic inches of oil between the valve and the pump
Try setting the volumes to 1000 and then 10000.
Vb
min
5 0.25 CylLen + :=
160000 := The bulk modulus of oil
Calculate the natural frequency of the cylinder and system

n

mass
Aa
2
Va
min
Aa
CylLen
2
+
Ab
2
Vb
min
Ab
CylLen
2
+
+
|

\
|
|
|
|

:=

n
181.497 = Natural frequency in radians per second
Calculate the acceleration time using the natural
frequency method.
18

n
0.099 =
(c) 2010 Delta Computer Systems, Inc. 2/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Pa0
0.5 Ps0 Ab Fl
Aa Ab +
:= Pa0 345.269 = The initial pressure on the A and B port
should be 1/2 the supply pressure if the
valve leakage from P->A and A->T is
identical. The same applies to the B port. Pb0
0.5 Ps0 Aa Fl +
Aa Ab +
:= Pb0 654.731 =
Pa0 Aa Pb0 Ab 2.274 10
13
=
Calculate the valve flow coefficient
GPM 27 := Rated valve flow at rated pressure drop.
P 1015 := Rated pressure
Calculate the flow constant for
the powered land. Yields flow in
cubic inches per second
K
v
GPM
231
60

P
2
:= K
v
4.614 =
(c) 2010 Delta Computer Systems, Inc. 3/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Valve Spool Response
The valve spool response can be roughly simulated by a natural frequency and a damping
factor. For the purposes of this model the spool's natural frequency and damping factor are
assumed to be fixed but in reality the natural frequency drops as the amplitude increases. This
may be due to the fact that is takes significantly more power to move at twice the frequency.

s
20 2 :=
s
125.664 = A 20 Hz valve

s
0.7 := Spool damping factor. The closer to 1
the better.
Assume the spool is a second order
system and possibly under damped.
The Bode plots show this to be the
case
T
s
s ( )

s
2
s
2
2
s

s
s +
s
2
+
:=
n 0 320 .. := Iterate the frequency from .01 HZ
to 1000 HZ
using 64 steps per decade for a
total of 256
iterations. hz
n
10
n
64
2
:=
M
n

n
|

\
|
|
|

r T
s
j 2
( )
hz
n

a
arg r ( )
deg

a a 360 n 0 > a
n 1
100 > if
20 log r ( )
a
|

\
|
|

:=
Calculate magnitude and phase for T(s)
(c) 2010 Delta Computer Systems, Inc. 4/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
0.01 0.1 1 10 100 1
.
10
3
80
60
40
20
0
20
0
50
100
150
200
Magnitude
Phase
Valve Spool Bode Plot
Frequency Hz
M
a
g
n
i
t
u
d
e

d
b
P
h
a
s
e

d
e
g
The Bode plot looks something like the plots provided by the valve manufacturers. It
must be acknowledge that this approximation is better than nothing but there is much
more to modeling just the valve. For instance the valve has on board electronics and
closed loop control which alter the response. The controller may even have a PID
control but I best most have just a simple proportional controller. Still the magnitude
is down -3db at 20 Hz. This means that at 20 Hz one must provide a 20% signal to
get a 10% response from the valve. This works at low amplitudes but the controller
can at most provide a 100% signal and get 50% amplitude from the valve 20Hz.
There are two difference equations for the spool because it is a second order system.
There is one for the velocity of the spool and one for the position of the spool
t
x
s
d
d
v
s
= Calculate the spool position
t
v
s
d
d
2
s

s
v
s

s
2
u t ( ) x
s

( )
+ = Calculate the spool velocity
(c) 2010 Delta Computer Systems, Inc. 5/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Verifying the valve spool response
y
0
0
|

\
|
|

:= Initial spool position and velocity are 0


The control signal to the valve is a
simple step signal of 90%
u t ( ) 100 :=
Time 0.1 := Simulation time
D t y , ( )
x
s
v
s
|

\
|
|
|

y
v
s

s
2
u t ( ) x
s

( )
2
s

s
v
s

(
(
(

:=
S rkfixed y 0 , Time , 100 , D , ( ) :=
0 0.02 0.04 0.06 0.08 0.1
0
50
100
150
2000
0
2000
4000
6000
Spool Position
Spool Velocity
Spool Response to a Step Input
Time
S
p
o
o
l

P
o
s
i
t
i
o
n
,

p
e
r
c
e
n
t
S
p
o
o
l

V
e
l
o
c
i
t
y
,

p
e
r
c
e
n
t

p
e
r

s
e
c
o
n
d
One can see that the model is close to 100% open in 25 milliseconds. The valve is actually
open 101% at 25 milliseconds which is close to the valve documentation. The over shoot is
caused because the spool is under damped as indicated by the damping factor being less than
1. In reality the spool will probably hit an end of travel stop instead of going over 100%.
(c) 2010 Delta Computer Systems, Inc. 6/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Target Generator for Position, Velocity and Acceleration
Generation motion profile using a cosine ramp target generator. This target
generator will calculate a position, velocity and acceleration at time t. The
motion profile assumes the ramp up, constant velocity and ramp down
sections each take 1/3 of the total move time. All that is required is the
move time and the distance to move.
Cosine Ramps
MoveTime 2 := MoveDist 16 := x0 4 :=
MaxVel
3
2
MoveDist
MoveTime
:= MaxVel 12 = AvgAcc
9
2
MoveDist
MoveTime
2
:= AvgAcc 18 =
r t t , x ,
( )
3
4
x
t
t
1
3
t
sin 3

t
t
|

\
|
|

\
|
|
|

x0 +
3
4
x
t
1 cos 3

t
t
|

\
|
|

\
|
|


9
4
x
t
2
sin 3

t
t
|

\
|
|

(
(
(
(
(
(
(
(
(

0 t
t
3
< if
3
2
x
t
t
1
3
t
|

\
|
|


1
4
x + x0 +
3
2
x
t

(
(
(
(
(
(

t
3
t 2
t
3
< if
1
4
x

sin 3
t
2
3
t
t

|

\
|
|
|


3
4
t
1
3
t +
|

\
|
|

x
t
+ x0 +
3
4
x
t
1 cos 3
t
2
3
t
t

|

\
|
|
|

+
|

\
|
|
|


9
4
x
t
2
sin 3
t
2
3
t
t

|

\
|
|
|

(
(
(
(
(
(
(
(
(
(
(

2
t
3
t t < if
x x0 +
0
0
|

\
|
|
|

t t if
:=
(c) 2010 Delta Computer Systems, Inc. 7/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Linear Ramps
r t t , x ,
( )
9
4
x
t
2
t
2
x0 +
9
2
x
t
2
t
9
2
x
t
2

\
|
|
|
|
|
|
|
|
|

0 t
t
3
< if
3
2
x
t
t
1
3
t
|

\
|
|

1
4
x + x0 +
3
2
x
t

(
(
(
(
(
(

t
3
t 2
t
3
< if
5
4
9
2
t
t

9
4
t
2
t
2
+
|

\
|
|
|

x x0 +
9
2
x
t
2
t t
( )

9
2

x
t
2

(
(
(
(
(
(
(
(
(

2
t
3
t t < if
x x0 +
0
0
|

\
|
|
|

t t if
:=
Step, No Ramps
r t t , x ,
( )
x
4
0
0
|

\
|
|
|
|
|

:=
(c) 2010 Delta Computer Systems, Inc. 8/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Define the valve control signal a function of time, u(t)
The control signal can be ramped shut to simulate quick stops and check for pressure increases.
t 0.001 :=
t
0
0 := Start ramping up
t
1
MoveTime
3
:= End of ramp up
t
2
2 MoveTime
3
:= Start of ramp down
End of ramp down. Make the difference between t
3
and t
2
bigger to get a ramp that doesn't oscillate.
t
3
MoveTime :=
N
MoveTime 1 +
t
:= N 3000 = Ending time and number of iterations
Open loop Control
u t ( ) 0.5 1 cos
t t
0

t
1
t
0

\
|
|

\
|
|

t
0
t t
1
< if
1 t
1
t t
2
< if
0.5 1 cos
t t
2

t
3
t
2

\
|
|

+
|

\
|
|

t
2
t t
3
< if
0 t
3
t if
:= The control signal as a function of time.
The control signal has a range of -1 to 1
where -1 will move the spool to 100%
P->B and A->T, 0 is leakage only and 1
will move the spool to 100% P->A and
B->T.
(c) 2010 Delta Computer Systems, Inc. 9/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Estimate Valve Leakage
Calculate the leakage flow constant K
l
from the leakage specification

The total leakage flow is the sum of the flow from P->A and P->B. Since the orifice is
assumed to be symmetrical we can assume the flow from P->A is equal to the flow from
P->B therefore the total leakage flow Ql is equal to 2 times the leakage from P->A, Q
pa.
Q
l
0.25
231
60
:= Q
l
0.963 = The specification for valve leakage for
my NG10 is about .25 gpm. Convert to
cubic inches per second.
The total valve leakage, Q
l
, is equal to the leakage from P->A plus the leakage from P->B.
Assuming the leakage is symmetrical then the total leakage is 2 times the leakage from P->A.
The leakage flow is 2 times
the flow from A->B
Q
l
2 Q
pa
= 2 K
l

P
s
2
=
Q
l
K
l
2 P
s
= Combine some constants
K
l
Q
l
2 Ps0
:= Divide both sides by the
square root term
K
l
0.015 = Leakage flow constant. This is very
small relative to K
v
.
Select valve over/under lap type.
The valve overlap is determined by x
l
. The spool position, x
s
, is in percent of full spool travel.
x
l,
should be a small number in per cent overlap or under lap. A value of 0 signifies a 0
lapped spool whereas negative value specify under lapped spools and positive values signify
overlapped spools.
x
.lt
allows one to specify a different leakage coefficient A->T and B->T that differs from P->A
and P->B.
Spool over/under lap variable in percent.
Set negative of under lap and positive for
over lap spools. For the pressure port
x
l
0 :=
x
lt
x
l
:= Spool over/under lap for the tank port.
Normally this should be the same as the
pressure port over/under lap.
(c) 2010 Delta Computer Systems, Inc. 10/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Calculate the flow coefficients as a function of spool position
The flow around each edge of the spool is modeled using a simple function. Basically there
are two states. Either the edge is in a normal flowing condition or it is blocked and in a
leakage state. This results in two linear segments that will determine the flow coefficient as
a function of the position as it goes from -100% to +100%.
K
pa
x
s
( )
K
v
K
l

( )
x
s
x
l

100 x
l

K
l
+ x
s
x
l

( )
0 if
K
l
100 x
s
+
100 x
l
+
|

\
|
|

otherwise
:= Calculate the flow coefficient from the
P to A ports as a function of the spool
position
K
at
x
s
( )
K
v
K
l

( )
x
s
x
lt

100 x
lt

\
|
|

K
l
+ x
s
x
lt

( )
0 if
K
l
100 x
s

100 x
lt
+
|

\
|
|

otherwise
:=
Calculate the flow coefficient from the
A to T ports as a function of the spool
position
Calculate the flow coefficient from the
P to B ports as a function of the spool
position
K
pb
x
s
( )
K
v
K
l

( )
x
s
x
l

100 x
l

K
l
+ x
s
x
l
+ 0 if
K
l
100 x
s

100 x
l
+
|

\
|
|

otherwise
:=
Calculate the flow coefficient from the
B to T ports as a function of the spool
position
K
bt
x
s
( )
K
v
K
l

( )
x
s
x
lt

100 x
lt

\
|
|

K
l
+ x
s
x
lt
+ 0 if
K
l
100 x
s
+
100 x
lt
+
|

\
|
|

otherwise
:=
Note, the spools are assume to be cut so that the flow changes linearly with spool position.
This is not always the case. There are 'curvilinear' and 'nick' spools. Modeling either one of
these spools would require modifications to the four flow coefficient functions above. For
instance, and 'nick' spool can be simulated by adding a third linear segment with a higher
gain when the spool reaches 20% or 40% depending on the spool.
(c) 2010 Delta Computer Systems, Inc. 11/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Sanity check the flow constant formula by graphing the flow coefficients as a
function of the control signal. Note that the control signal goes from -1 to 1.
x 100 099.9 , 100 .. :=
100 50 0 50 100
0
2
4
6
Flow Coefficient P to A
Control Signal %
F
l
o
w

C
o
e
f
f
i
c
i
e
n
t
100 50 0 50 100
0
2
4
6
Flow Coefficient P to B
Control Signal %
F
l
o
w

C
o
e
f
f
i
c
e
n
t
100 50 0 50 100
0
2
4
6
Flow Coefficient A to T
Control Signal %
F
l
o
w

C
o
e
f
f
i
c
i
e
n
t
100 50 0 50 100
0
2
4
6
Flow Coefficient B to T
Control Signal %
F
l
o
w

C
o
e
f
f
i
c
i
e
n
t
(c) 2010 Delta Computer Systems, Inc. 12/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Simulating Pump and Accumulators
A real hydraulic system does not have a constant supply pressure. The supply pressure drops
when a lot of flow is required. To offset this accumulators are used to supply energy. This allows
the designer to use a pump that supplies just a little more than the average flow. During slow or
dwell times the oil/energy is stored in accumulators and during times when the flow exceeds the
pump capacity the accumulator can make up the difference. To start lets assume the pump is a
fixed displacement pump of 60 gpm and that any excess oil flows over a relief valve at 2000 psi.
Also, assume the accumulator capacity is 10 gal accumulator.
GPM 5 := GPM
231
60
19.25 = Pump capacity
PPB 200 := Pump proportional band
p 0.050 := Pump time constant
AccumSize 5 := Accumulator size in gallons
V
a
AccumSize 231 := V
a
1155 = Accumulator size in cubic inches
1.4 := Ratio of specific heat Cp/Cv
Calculate the Supply Pressure and Accumulator Volume As A Function of Time.
P
0
0.9 Ps0 := P
0
1800 = Pre charge pressure
Calculate K, nrT, using pre
charge values calculated above
for pressure calculations below.
K P
0
V
a

:= K 3.49 10
7
=
K Ps V
g

=
solve V
g
,
explicit
e
ln
K
Ps
|

\
|
|

Vg0 e
ln
K
Ps0
|

\
|
|

:= Vg0 1071.268 = Initial gas volume in cubic inches


Ps Vg ( )
K
Vg

:= Ps Vg0 ( ) 2000 = Supply pressure as a function of the


accumulator volume.
(c) 2010 Delta Computer Systems, Inc. 13/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Total Flow Equations
Qa and Qb are the net flow to either side of the cylinder piston. The total flow equations are
important since they determine the rate of change in pressure,P=*V/V or P=*Q*t.
The current flow equation has four parts. The top equation calculates the flow from the supply
to the A or B port and the second equation calculates the flow from the A or B port to the
tank.The leakage terms are very important. Without the leakage terms the system will tend
to oscillate for an unrealistically long time since there is little if any energy loss when the
valve is shut. When accelerating there is plenty of energy loss due to the pressure drop
across the valve. You can see there isn't any hint of oscillating because the damping factor
is very high when the spools is wide open.
Q
pa
Pa x
s
, Vg ,
( )
K
pa
x
s
100
( )
sign Ps Vg ( ) Pa ( ) Ps Vg ( ) Pa :=
Q
at
Pa x
s
,
( )
K
at
x
s
100
( )
sign Pa Pt ( ) Pa Pt :=
Q
pb
Pb x
s
, Vg ,
( )
K
pb
x
s
100
( )
sign Ps Vg ( ) Pb ( ) Ps Vg ( ) Pb :=
Q
bt
Pb x
s
,
( )
K
bt
x
s
100
( )
sign Pb Pt ( ) Pb Pt :=
Qa Pa x
s
, Vg ,
( )
Q
pa
Pa x
s
, Vg ,
( )
Q
at
Pa x
s
,
( )
+ :=
Qb Pb x
s
, Vg ,
( )
Q
pb
Pb x
s
, Vg ,
( )
Q
bt
Pb x
s
,
( )
+ :=
Force load as a function of time and distance
The force can be changed as a function of time or distance.
Fl t x , ( ) 2000
t 0.40 MoveTime
0.03 MoveTime
|

\
|
|

0.40 MoveTime t 0.43 MoveTime < if


2000 0.43 MoveTime t 0.47 MoveTime < if
2000
0.5 MoveTime t
0.03 MoveTime
|

\
|
|

0.47 MoveTime t 0.5 MoveTime < if


0 x 19 ( ) x 19 if
0 otherwise
:=
(c) 2010 Delta Computer Systems, Inc. 14/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
When extending against a load
v 1 := The spool is symetrical
Ape Aa := Ape 3.142 =
FL 0 := FL 0 =
c
Aa
Ab
:= c 1.896 = Ratio of the powered end area
the exhausting end area
Compute maximum steady state velocity in each direction to estimate velocity feed forwards
Calculate the maximum velocity
when the control output is one
using the VCCM equation
vss_ext K
v
Ps0 Ape FL
Ape
3
1
v
2
c
3
+
|

\
|
|
|

:= vss_ext 61.342 =
Ape Ab :=
FL 0 := No load when retracting
c
Ab
Aa
:= c 0.527 = Ratio of the powered end area
the exhausting end area
vss_ret K
v
Ps0 Ape FL
Ape
3
1
v
2
c
3
+
|

\
|
|
|

:= vss_ret 44.545 =
(c) 2010 Delta Computer Systems, Inc. 15/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
Closed Loop Control
Define the valve control signal a function of error between the target and
actual position, velocity and acceleration.
t 0.0001 := Update period. The update period must be smaller
as the system response get faster.
Controller gains.
Ki 0.5 := Integrator gain
Kp 0.1 := Proportional gain
Kd 0.001 := Derivative gain
Kv_ext
1
vss_ext
:= Kv_ext 0.016 = Velocity feed forward
Kv_ret
1
vss_ret
:= Kv_ret 0.022 =
Ka 0.00018 := Acceleration feed forward
Control output goes from -1 to 1
PID u xt , vt , at , x , v , a , ( ) Kv Kv_ext vt 0 > if
Kv Kv_ret vt 0 < if
Kv 0 vt 0 = if
u' Ki Kp Kd ( )
xt x
vt v
at a
|

\
|
|
|


u u u' t + Kv vt + Ka at +
u 1
u'
1 u Kv vt Ka at
t

u 1 > if
u 1
u'
1 ( ) u Kv vt Ka at
t

u 1 < if
u
u'
|

\
|
|

:=
(c) 2010 Delta Computer Systems, Inc. 16/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
The Simulation Using Runge-Kutta.
Execute the equations simultaneously by putting the equations and results in a matrix.
There are now eight differential equations that are computed simultaneously.
ActAcc t Pa , Pb , x , v , xt , vt , ( )
Pa Aa Pb Ab ( ) Kf v Fl t x , ( )
mass
:= Calculate the actual
acceleration
Initial spool position
initial spool velocity
Initial A port pressure
Initial B port pressure
Initial velocity
Initial position
Initial control output
Initial accumulator gas volume
y
0
0
Pa0
Pb0
0
x0
0
Qp 0
Vg0
|

\
|
|
|
|
|
|
|
|
|
|
|
|

:=
(c) 2010 Delta Computer Systems, Inc. 17/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
D t y , ( )
xt
vt
at
|

\
|
|
|

r t MoveTime , MoveDist , ( )
x
s
v
s
Pa
Pb
v
x
u
Qp
Vg
|

\
|
|
|
|
|
|
|
|
|
|
|
|

y
a ActAcc t Pa , Pb , x , v , xt , vt , ( )
u
u'
|

\
|
|

PID u xt , vt , at , x , v , a , ( )
v
s

s
2
u x
s

( )
2
s

s
v
s

Va
min
x Aa +
Qa Pa x
s
, Vg ,
( )
v Aa
( )

Vb
min
CylLen x ( ) Ab +
Qb Pb x
s
, Vg ,
( )
v Ab +
( )

a
v
u'
1
p
max min
Ps0 Ps Vg ( )
PPB
1 ,
|

\
|
|

0 ,
|

\
|
|

GPM
231
60
Qp
|

\
|
|

Q
pa
Pa x
s
, Vg ,
( )
Q
pb
Pb x
s
, Vg ,
( )
+ Qp

(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(
(

:=
SimTime MoveTime 1 + := Simulation time
N
SimTime
t
:= N 30000 = Number of iterations
S rkfixed y 0 , SimTime , N , D , ( ) :=
(c) 2010 Delta Computer Systems, Inc. 18/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
t S
0

:= x
s
S
1

:= Vg S
3

:= Pa S
3

:= Pb S
4

:=
v S
5

:= x S
6

:= u S
7

:= Qp S
8

:= Vg S
9

:=
n 0 N .. :=
xt
n
vt
n
at
n
|

\
|
|
|
|
|

r n t MoveTime , MoveDist ,
( )
:=
a
n
ActAcc t
n
Pa
n
, Pb
n
, x
n
, v
n
, xt
n
, vt
n
,
( )
:=
CO
n
PID u
n
xt
n
, vt
n
, at
n
, x
n
, v
n
, a
n
,
( )
0
:=
(c) 2010 Delta Computer Systems, Inc. 19/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
t xs vs Pa Pb v x u Qp
S
0 1 2 3 4 5 6 7 8
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
0 0 0 345.269 654.731 0 4 0 0
0 -11 6.11810 -6 1.8310 345.58 654.794 0 4 -8 -2.75810 -8 2.9610
0 -10 4.85510 -6 7.24310 345.892 654.857 0 4 -7 -1.10610 -7 1.18310
0 -9 1.62510 0 346.203 654.92 0 4 -7 -2.49610 -7 2.6610
0 -9 3.82110 0 346.513 654.983 0 4 -7 -4.44910 -7 4.72610
0.001 -9 7.40310 0 346.822 655.046 0.001 4 -7 -6.9710 -7 7.37910
0.001 -8 1.26910 0 347.131 655.109 0.001 4 -6 -1.00610 -6 1.06210
0.001 -8 1.99810 0 347.438 655.173 0.001 4 -6 -1.37210 -6 1.44410
0.001 -8 2.95810 0 347.744 655.236 0.002 4 -6 -1.79610 -6 1.88510
0.001 -8 4.17610 0 348.049 655.3 0.002 4 -6 -2.27810 -6 2.38410
0.001 -8 5.68110 0 348.352 655.364 0.003 4 -6 -2.81810 -6 2.94110
0.001 -8 7.49810 0 348.653 655.429 0.003 4 -6 -3.41610 -6 3.55710
0.001 -8 9.65210 0 348.952 655.494 0.004 4 -6 -4.07210 -6 4.2310
0.001 -7 1.21710 0 349.25 655.559 0.005 4 -6 -4.78610 -6 4.96110
0.001 -7 1.50710 0 349.545 655.625 0.005 4 -6 -5.55910 -6 5.74910
0.002 -7 1.83710 0 349.837 655.691 0.006 4 -6 -6.3910 -6 6.59510
0.002 -7 2.21110 0 350.128 655.757 0.007 4 -6 -7.27910 -6 7.49910
0.002 -7 2.62910 0 350.415 655.824 0.008 4 -6 -8.22710 -6 8.4610
0.002 -7 3.09410 0 350.7 655.892 0.009 4 -6 -9.23210 -6 9.47810
0.002 -7 3.60710 0.001 350.982 655.96 0.01 4 -0 0
0.002 -7 4.1710 0.001 351.261 656.029 0.011 4 -0 0
0.002 -7 4.78510 0.001 351.536 656.098 0.012 4 -0 0
0.002 -7 5.45310 0.001 351.809 656.168 0.013 4 -0 0
0.002 -7 6.17610 0.001 352.078 656.239 0.014 4 -0 0
0.002 -7 6.95510 0.001 352.343 656.311 0.016 4 -0 0
0.003 -7 7.79210 0.001 352.604 656.383 0.017 4 -0 0
0.003 -7 8.68610 0.001 352.862 656.456 0.018 4 -0 0
0.003 -7 9.6410 0.001 353.116 656.53 0.02 4 -0 0
0.003 -6 1.06610 0.001 353.365 656.604 0.021 4 -0 0
=
(c) 2010 Delta Computer Systems, Inc. 20/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
The first Spool Response graph shows the control signal, valve spool position and as a function
of time.
0 0.5 1 1.5 2 2.5 3
0.05
0
0.05
0.1
0.15
0.2
0.25
5
0
5
10
15
Control Signal
Spool Position
Velocity
Spool Response to Control Signal
Time
C
o
n
r
o
l

S
i
g
n
a
l

a
n
d

S
p
o
o
l

P
o
s
i
t
o
n

-
1

t
o

+
1
V
e
l
o
c
i
t
y

i
n

i
n
/
s
(c) 2010 Delta Computer Systems, Inc. 21/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
0 0.5 1 1.5 2 2.5 3
0
5
10
15
20
25
0.05
0
0.05
0.1
0.15
0.2
0.25
Actuator Position
Spool Position
Hydraulic Cylinder Response to Spool Position
Time
P
o
s
i
t
i
o
n

i
n

I
n
c
h
e
s
S
p
o
o
l

P
o
s
i
t
i
o
n

-
1

t
o

1
(c) 2010 Delta Computer Systems, Inc. 22/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
0 0.5 1 1.5 2 2.5 3
5
0
5
10
15
0
500
1000
1500
2000
2500
Velocity
Pressure Port A
Pressure Port B
Supply Pressure
Velocity and Pressure Response
Time
V
e
l
o
c
i
t
y

i
n

i
n
/
s
e
c
A
,

B

a
n
d

S
u
p
p
l
y

P
o
r
t

P
r
e
s
s
u
r
e
,

p
s
i
The load can induce a large pressure difference across the piston.
The supply pressure is plotted to compare with the A and B port pressure. When the valve
shut quickly pressure spikes are induced and these pressure spikes can cause the oil to
flow back into the accumulator. This is why the code for flow must use
sign Ps Vg ( ) Pa ( ) Ps Vg ( ) Pa
when computing the flow. This avoids errors caused by taking the square root of a negative
number.
(c) 2010 Delta Computer Systems, Inc. 23/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
0 0.5 1 1.5 2 2.5 3
1000
0
1000
2000
3000
Cylinder Force
Friction Force
Load Force
Net Force
Force Response
Time
F
o
r
c
e
,

l
b
f
0 0.5 1 1.5 2 2.5 3
4.6
4.65
4.7
4.75
4.8
1850
1900
1950
2000
2050
Gas Volume
Presssure
Accumulator Gas Volume and Accumulator Pressure
Time
A
c
c
u
m
u
l
a
t
o
r

G
a
s

V
o
l
u
m
e
,

g
a
l
A
c
c
u
m
u
l
a
t
o
r

G
a
s

P
r
e
s
s
u
r
e
,

p
s
i
(c) 2010 Delta Computer Systems, Inc. 24/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
0 0.5 1 1.5 2 2.5 3
30
20
10
0
10
20
30
40
50
0
500
1000
1500
2000
2500
A Port Flow
B Port Flow
Pump Flow
A Port Pressure
B Port Pressure
Supply Pressure
A and B Port and Pump Flow and Pressures
Time
C
u
b
i
c

I
n
c
h
e
s

p
e
r

S
e
c
o
n
d
P
r
e
s
s
u
r
e
s
,

p
s
i
The pump flow is not as great as the flow into the cylinders A port. This can happen because the
extra oil comes from the accumulator.
(c) 2010 Delta Computer Systems, Inc. 25/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
0 0.5 1 1.5 2 2.5 3
0
5
10
15
20
25
5
0
5
10
15
Target Position
Actual Position
Target Velocity
Actual Velocity
Control Output -10 to 10
Target and Actual Positions and Velocities
Time
T
a
r
g
e
t

a
n
d

A
c
t
u
a
l

P
o
s
i
t
i
o
n

i
n

i
n
c
h
e
s
T
a
r
g
e
t

a
n
d

A
c
t
u
a
l

V
e
l
o
c
i
t
y

i
n

i
n
/
s
e
c
Ki 0.5 = Integrator gain
Kp 0.1 = Proportional gain
Kd 0.001 = Derivative gain
Kv_ext 0.016 = Velocity feed forward extend
Kv_ret 0.022 = Velocity
Ka 0.00018 = Acceleration feed forward
Normalized sum of squared errors.
Adjust gains to minimize
n
r n t MoveTime , MoveDist ,
( )
0
x
n

( )
2
N

0.002674 =
(c) 2010 Delta Computer Systems, Inc. 26/27 1/16/2013 10:10 AM
Hydraulic Cylinder Simulation
(c) 2010 Delta Computer Systems, Inc. 27/27 1/16/2013 10:10 AM

You might also like