Simulation_task_1_2014.pdf

Some tools and methods for determination of
dynamics of hydraulic systems
A warm welcome to the course in Hydraulic servo-techniques! The purpose of the
exercises given in this material is to make you aquatint with the analysis tools you will have
use of later on in the courses given at FluMeS and in industry.
The rod does not move
Figure 1.
Equations describing the static behaviour of some hydraulic components.
There are a number of ways of analysing the behaviour of a hydraulic system. The most
common way is to ignore its dynamics (transients), see figure 1, and this can often be
2(12)
performed by hand. In the figure, q is flow, p pressure, V volume, x position and remaining
quantities are parameters.
Sometimes it is not sufficient to calculate only the statics. Maybe it is interesting to know
the response of a system, e.g. how long it takes for a cylinder to begin to move after a sudden
change to the input signal to the control valve. The risk for instability, when having a closed
loop as in servo systems could also be interesting to calculate. Examples of equations
describing the dynamical behaviour of hydraulic components can be found in figure 2.
At such occasions, computer simulations are used as a complement to analytical
solutions. In the following exercises you will study two ways of analysing the dynamic
behaviour; numerical simulation in the time domain and frequency domain analysis. The
simulation package Matlab will be used in both cases.
p L AL  p0 A0  Mx  Bx p  kxp  T
X p 
AL PL  A0 P0  T
Ms 2  Bs  k
qin  qut 
P 
dV V dp

dt  e dt
Qin  Qut  sV
V
s
e
q  C q wv xv
2

( pin  put )
Q  K q X v  K c (Pin  Put )
Kq 
Figure 2.
q
q
, Kc 
xv
( pin  put )
Examples of equations describing the dynamical properties of hydraulic systems in time- as
well as the frequency domain
3(12)
TOOLS USED FOR ANALYTICAL DETERMINATION OF DYNAMICAL
PROPERTIES
Since one of the equations in figure 2 is non-linear (the flow-equation of a turbulent
orifice), it is very difficult and sometimes impossible to analytically determine dynamical
properties if not the equations are linearised. On the other hand, numerical simulations can
almost always be carried out without linearising non-linear equations.
Linearisation of a continuous function f(x1, x2, x3, …, xk) is performed using the first
term in its Taylor series as below
k
 f
f   
i 1  xi


 xi
 working_ po int
The function is linearised at a working point that has static conditions. The linearisation
tells that f varies f if its variables x1, x2, x3, …, xk vary x1, x2, x3, ..., xk round this
working point. Linearisation doesn’t work for discontinuous non-linearities like e.g.
hysteresis.
It is possible to make analytical calculations on dynamics in the time-domain, e.g. in
mechanical vibrations, rotor dynamics etc. When it comes to control and hydraulics,
analytical solutions are preferably derived in the frequency domain. When a time-domain
variable is transformed into the frequency domain using Laplace, its capital is used to denote
that it is now within the frequency domain. The variable f(t) then becomes F(s) where s is the
so called Laplace-operator with unit rad/s.
All this means that if you want to study bandwidth, stability etc of a hydraulic system,
you must first linearise the equations and then Laplace-transform them. After that you can
choose between making an analytical solution or a computer calculation in the frequency
domain. In figure 2, not only the equations in the time-domain are shown but also their
linearised and Laplace-transformed equalities. Try to do the linearisation and Laplacetransforming yourself so that you understand these tools.
To simplify the linearised and Laplace transformed equations into one expression it is
useful to make use of block diagram reduction as explained in the formula collection of
“Fluidmekanisk systemteknik grundkurs” as well as in the Servo course itself of which this
exercise is part. When preparing a block diagram is important to figure out what input and
output signals the system has (without feedbacks) as well as what disturbance signals exist.
An input signal that can be controlled is often a valve position, while the output signal can be
speed or position of a cylinder rod or motor shaft. The disturbance could be an external force
on a cylinder rod or motor shaft. Then draw the block diagram by using the equations
4(12)
describing the system (figure 2 shows how to find them). The diagram is to be drawn
causally, i.e. first input, then the state that directly depends on that signal, etc. and finally the
output signal. Reduce the diagram if possible without eliminating any states that are to be
used in feedbacks. Finally any feedbacks are drawn. In figure 3a and 3b the general structure
of two diagrams are shown.
Disturbance
Hydraulic system (after reduction)
Output signal
Input signal
Figure 3a. General structure of a block diagram. The position control of the load can be performed
electro-hydraulically or hydro-mechanically. The system is drawn causally.
Disturbance
Hydraulic syst
after reduction
Output
Input
Hydraulic feedback
Figure 3b. General structure of a block diagram. The hydraulic system has a hydro-mechanical
feedback.
5(12)
TIME-DOMAIN SIMULATION – INSTABILITY IN THE NUMERICAL
SOLVER
Before starting your time-domain simulation we’d like to issue a warning. It is easy to
fail when simulating. Therefore it is of vital importance always to critically look at the results.
Simulation in the time-domain is performed so that all variables are calculated for a
particular time point and then the variables for the next time point are calculated using the
former variable values.
One of the most common sources of numerical problems is the numerical solver itself.
Consider an ordinary differential equation (ODE) of the form:
x (t )   0 x(t )  0
(1)
The value of o is here treated as known and doesn’t change. If this ODE is to be
numerically integrated in order to find the time trajectory of x, then the time derivative of x
needs to be computed as follows
SX=-W0*X
(2)
where SX  x (t ) , X  x(t) and W0 = o in equation (1). This means:
at time point i-1:
at time point i:
etc.
SXi-1 = -W0*Xi-1
SXi = -W0*Xi
(3-4)
Here can be seen that if the value of Xi-1 is known at time point (i-1) then SXi-1 can be
calculated. But to calculate Xi from this time point so that SXi can be calculated you need to
integrate SXi-1 since no other equations are at hand.
Now there are a number of explicit numerical integration methods to choose between.
Suppose we choose the Euler-method to calculate Xi for an ODE:
Xi = Xi-1+Ts*SXi-1
(5)
Ts is the size of the time step. From this equation one interesting thing can be seen; Xi is
calculated from the old value Xi-1. This means that the Euler-method is a closed loop system
and can therefore become unstable!
6(12)
To study the stability of the Euler-method applied on the mentioned ODE, the quotient
between Xi and Xi-1 is used. The equations (4) and (5) yield:
Xi
 1  TS W0  X i  (1  TsW0 ) i
X i 1
(6)
For positive W0 this means that TsWo<2 gives a stable solution.
EXERCISE 1 – SIMULATION STABILITY
In the first exercise, the task is to model the system in figure 4 with parameter
values as in case 1 and 2 as well as study the influence of the time step on the results.
Put up the equations needed to describe the system in the time domain (pressure build-up
in the volume and flow created from pressure difference across the orifice). All equations are
given in this material. A number of ODE:s will then have to be solved. This is to be
accomplished by creating a Matlab script where no calls are made to built-in Matlab
solvers.
Start the simulation with the pressure 0,1 MPa (atmospheric pressure) in the volume.
Simulate until the pressure p(t) has found its stationary level with the time step Ts = 1
ms. Reduce and increase the time step 10 times and see what happens. For the time step
0.1 ms, decrease the size of the volume 100 times.
Why are the results different for different time steps? Show analytically which time
step that gives instability.
Figure 4.
System for studying integration stability.
Case 1. Laminar orifice where q(t) = Kc•(po - p(t)). Use following parameters:
po = 10 MPa
Kc = 8•10-10 m5/N s
V = 1 litre
e
= 1000 MPa
Case 2. The orifice has turbulent flow q(t) (see equation in figure 1), has sharp edges and
diameter d. (HINT: what happens if p(t) becomes higher than po?)
po = 10 MPa
d = 2 mm
V = 1 litre
Cq = 0,67
e
= 1000 MPa
 = 860 kg/m3
7(12)
EXERCISE 2 – TIME DOMAIN ANALYSIS
In this exercise, the task is to model the system in figure 5 in the time domain using
Simulink. The system can be modelled with three differential equations. All parameters
needed for this exercise are given below. The orifice has turbulent flow.
Put up the equations needed to describe the system in the time domain. A number of
ODE:s will then have to be solved. This is to be accomplished by creating a Simulink
model, which uses built-in Matlab solvers. Use the integrator blocks to calculate the
states.
Simulate the system until all states have found its stationary level. Look at the results and
calculate the resonance frequency and the damping of the system. Change parameter
values and show how and explain why each parameter influence the resonance
frequency and the damping.
To avoid problems with integration stability in this exercise, go to “Simulation →
Configuration Parameters” in the Simulink top menu. Change the solver to “ode23s
(stiff/Mod. Rosenbrock)” and change the relative tolerance to “1e-6”.
Figure 5.
The system that is to be analysed in the time domain.
Supply:
ps = 20 MPa
Orifice
xv = 1,0 mm
Cylinder
ω = 10 mm
Cq = 0,67
A1 = A2 = 50 cm2
Vt = 50 litre (piston is assumed to be centered)
e = 1000 MPa
Load
M = 1000 kg
  = 860
kg/m3
F = 50 000 N
Bp = 10 000 Ns/m
8(12)
EXCERCISE 3 – FREQUENCY DOMAIN ANALYSIS
This exercise is an introduction to Matlab when it comes to frequency analysis. In figure 6
the system to be analysed is shown. The orifice has turbulent flow. Find the one transfer
function describing the complete system analytically and show your analysis step by
step. Calculate the static loop gain, the resonance frequency and the damping, with
D(s) (orifice diameter) as input and Nm(s) (motor speed) as output. The motor is
loaded with an inertia moment, viscous friction and an external load torque. Also, make a
non-linear Simulink model and compare the results with the linearzed transfer
function.
Figure 6.
The system that is to be analysed in the frequency domain.
The following parameter values are to be used. The parameter d is the orifice diameter,
Dm is the volume needed by the motor to turn one revolution, Jm is the inertia of the motor
and Bm multiplied by the motor speed gives a torque that opposes the rotational direction.
Your non-linear Simulink model can be used to find the working point needed for the
linearization.
Calculate the bandwidth of the system. Compare the transfer function and the nonlinear simulation model.
Change the external load torque and explain which changes that have to be made in
order for the linearized model to be valid. How will a change in external load torque
influence the dynamics of the system?
Supply:
ps = 15 MPa
Volume
V = 1 litre
 e = 1000 MPa
  = 860 kg/m3
Orifice
d = 1,0 mm
Cq = 0,67
Motor
Dm = 20 cm3/rev
Jm = 0,020 Nms2/rad
Bm = 0,13 Nms/rad
Me = 20 Nm
9(12)
EXCERCISE 4 – TO UNDERSTAND BASIC CONTROL CONCEPTS
To check that you have understood basic control concepts etc, we want you in this report
also tell us a little about the follow things (without equations and with you own qualitative
reasoning using your own words. Your explanation must work for any person that has
some technical interest but no knowledge in the courses you’ve read.
•
What’s the difference between static and dynamical calculations? When are
ODE:s used?
•
What is a feedback? Give three widely different examples of how it can look
physically if the system is hydro-mechanical and/or electro hydraulic? Don’t
repeat the information in figure 3a-b
•
What is necessary for instability to occur for any type of system?
•
At what occasions can it be good to use computer analysis for static
behaviour?
•
What dynamic properties are most suitable to study with the help of timedomain simulations and what properties are best to study using frequency
analysis? Give a few examples in each domain.
•
Explain the concepts of stiffness, bandwidth, amplitude marginal and phase
marginal. Also tell what is studied using the open transfer function and the
closed transfer function and why.
10(12)
THE REPORT
This simulation task is presented by writing one report for each group of two persons.
Answer all questions given on the previous pages and attach graphs when appropriate. The
report should be written on a computer. If the report handed in is a copy of another then it will
be rejected, but if you want to it is always allowed to talk to other groups and discuss
problems. Hand in the report to Mikael Axin, room number 213:208, A-building. The latest
day to hand in the report is Wednesday, December 17, 2014. If the report is not approved,
you only have one more chance to hand in the report. The latest day to hand in the
complementary report is Monday, January 19, 2015. Attach the first report to the
complementary report.
11(12)
APPENDIX A. MINI-MANUAL FOR MATLAB.
The file basic_functions.m is available on the course home page and looks as below. There
is also a file called Simulink_example.mdl available. Save those two on your account,
execute it in MatLab and study the figures that appear.
% If you want to execute one exercise separately, press ctrl+enter in the
% desired cell
% Remember to save the script before executing it!
%% Exercise 1 – Simulation stability
clear all
% Everything in the workspace is deleted
% Create a time vector
dt=0.1;
T=1;
t=[0:dt:T];
%
%
%
%
% Create a for loop
x(1)=-5;
The time step is set to 0.1 s
The stop time is set to 1 s
A time vector is created with start time = 0,
time step = dt and stop time = T
% Sets a start value for the x-vector
for i=1:(T/dt)
x(i+1)=x(i)+2;
end
% The next value in the x-vector is the previous
% one plus 2
figure(1)
plot(t,x)
xlabel('Time')
ylabel('x-value')
% The x-vector is plotted a against the time vector
% Defines a name to the x-axis
% Defines a name to the y-axis
figure(2)
plot(t,abs(x),'k')
hold on
plot(t,sign(x),'r')
%
%
%
%
%
Creates a new plot window
plotting the absolute value of x
holds the current plot window
sign returns -1 if x<0 and
1 if x>0
hold off
%% Exercise 2 – Time domain analysis
% Execute this cell and open the Simulink file. You can change values in
% the Simulink file from here.
clear all
ps = 10e6;
V = 1e-3;
beta_e = 1e9;
d = 2e-3;
Cq = 0.67;
rho = 860;
%
%
%
%
%
%
Pa
m3
Pa
m
kg/m3
%% Plotting exercise 2
% This cell cannot be executed before simulating "Simulink_example.mdl"
% Plotting the flow from the block "simout" in Simulink_example
figure(3)
plot(Results.time,Results.signals.values(:,1),'k','LineWidth',2)
grid on
xlabel('Time [s]')
ylabel('Flow [m/s]')
hold on
% The old plot will be kept if you change parmeter values
% and want to plot again
12(12)
% Plotting the pressure from the block "simout" in Simulink_example
figure(4)
plot(Results.time,Results.signals.values(:,2),'k','LineWidth',2)
grid on
xlabel('Time [s]')
ylabel('Pressure [Pa]')
ylim([0 1.1e7])
%Specifying the upper and lower limit of the y-axis
hold on
%% Exercise 3 – Frequency domain analysis
% Create a bode plot
Kv=5;
wh=13;
dh=0.2;
G=tf(Kv,[1/wh^2 2*dh/wh 1]);
figure(5)
bode(G)
% The open loop gain
% The hydraulic resonance frequency
% The hydraulic damping
% Creates the transfer funcion
% G=Kv/(s^2/wh^2 + 2*s*dh/wh +1)
% Creates a bode plot of the transfer function
APPENDIX B. SIMULINK EXAMPLE MODEL.
The file Simulink_example.mdl is available on the course home page and looks as below.
Save it on your account, execute it in Simulink and study how the pressure and flow evolves
with time.