Download Automatic Control System

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Ohm's law wikipedia , lookup

Thermal copper pillar bump wikipedia , lookup

Thermal runaway wikipedia , lookup

Lumped element model wikipedia , lookup

Transcript
Automatic Control System
Modelling
Modelling dynamical systems
Engineers use models which are based upon mathematical
relationships between two variables.
We can define the mathematical equations:
• Measuring the responses of the built process (black model)
Not interested in the number and the real value of the time constants of the process,
only it is enough that the response is similar sufficient accuracy
• Using the basic physical principles (grey model).
In order to simplification of mathematical model the small effects are neglected and
idealised relationships are assumed.
Developing a new technology or a new construction nowadays it’s very
helpful applying computer aided simulation technique.
This technique is very cost effective, because one can create a model
from the physical principles without building of process.
Grey box model
Modelling mechanical systems
Newton’s law one-dimensional translation and rotational systems.
d 2s
 F  m dt 2 ;
ds
d 2
 M  I dt 2 ; FD  C  v  C dt ; Fs  ks
velocity
d

dt
ds
a
dt
acceleration
d 2s
a
2
dt
d 2

2
dt
F: force [N]; FD: absorber’s force; Fs: spring’s force
M: moment about centre of mass of body [Nm]
I: the body’s moment of inertia [kgm2]
s, : displacement [m; rad]
v, ω: velocity [m/sec; rad/sec]
a, : acceleration [m/sec2; rad/sec2]
C: friction constant [Nsec/m]
k: spring constant [N/m]
•Assign variables and sufficient to describe an arbitrary position of the object.
•Draw a free-body diagram of each components and indicate all forces acting.
•Apply Newton’s law in translation and rotational form.
•Combine the equations to eliminate internal forces.
Modelling mechanical systems
Road surface
y
t
m2
k2
C
x
t
m1
k1
r
t
The car’s wheel vertical motion is assumed onedimensional and the mass hasn’t got extension.
The sock absorber is represented by a dashpot
symbol with friction constant C.
The force from the spring acts on both masses
in proportional their relative displacement with
spring constant k.
The equilibrium positions of the two mass are
offset from the spring’s unstretched positions
because of the force of gravity.
Nowadays the mathematical programs allow one to
create a better model.
The system can be approximated by the simplified
system shown in left.
Modeling mechanical systems
d 2s
 F  m dt 2
y
t
m2
k2
C
Fs  ks
d ( y  x)
d2y
C
 k2 ( y  x)  m2 2
dt
dt
d( y  x )
d2x
C
 k 2 ( y  x )  k1 ( x  r )  m1 2
dt
dt
x
t
m1
k1
ds
FD  C
dt
r
t
The positive displacements or velocity of
mass, and so the positive force are signed by
up arrows.
Simulating the system by MATLAB
k2
C

1
m2
d 2 y (t )
dt 2
 dt
y (t )
 dt
dy (t )
dt
k2
C
2
r (t )
k1

1
m1
d x(t )
dt 2
 dt
k1
dx (t )
dt
 dt
x(t )
Difference equations
y7
y(i)  y(iT0 )
y6
y5
y4
y3
y2
y1
y0
0
T0
2T0 3T0 4T0 5T0 6T0 7T0
dy (t )
y (i )  y (i  1)

dt
T0
A block input is energised by x(t), and the response
is y(t). Because of the response needs any time or in
simulation the calculation of the response also
needs any time, and so y(iT0) can be calculated
from previous value than x(iT0). The sampled block
has a delay time (T0).
Example:
dy (t )
T
 y (t )  bx(t )
dt
d 2 y (t )
y (i)  2 y (i  1)  y(i  2)

dt 2
T02
d 3 y (t )
y (i)  3 y (i  1)  3 y (i  2)  y (i  3)

dt 3
T03
iT0
i
 y(t )dt  T  y(i)
0
0
0
T
y (i )  y (i  1)
 y (i )  bx(i  1)
T0
T  T0
T
y (i )  y (i  1)  bx(i  1)
T0
T0
y (i ) 
T
T
y (i  1)  0 bx(i  1)
T  T0
T  T0
Using difference equation
d 2x
dx
dy
m1 2  C  k2 x  k1x  C  k2 y  k1r
dt
dt
dt
d2y
dy
dx
m2 2  C  k2 y  C  k2 x
dt
dt
dt
r (0)  r0 , x(0)  y(0)  0, and r (1)  r1 , x(1)  x1 , y(1)  0
m1
C
{
x
(
i
)

2
x
(
i

1
)

x
(
i

2
)}

{x(i)  x(i  1)}  (k1  k2 ) x(i) 
2
T
T
C
 { y (i )  y (i  1)}  k2 y (i)  k1r (i  1)
T
m2
C
{ y (i  1)  2 y (i)  y (i  1)}  { y (i  1)  y (i )}  k2 y (i  1) 
2
T
T
C
 {x(i)  x(i  1)}  k2 x(i)
T
Using Laplace transform to model
mechanical systems
d ( y  x)
d 2x
C
 k2 ( y  x)  k1 ( x  r )  m1 2
dt
dt
d ( y  x)
d2y
C
 k2 ( y  x)  m2 2
dt
dt
m2
k2
C
Csy(s)  Csx(s)  k2 y(s)  k2 x(s)  k1x(s)  k1r (s)  m1s 2 x(s)
m1
k1
 Csy(s)  Csx(s)  k2 y(s)  k2 x(s)  m2 s 2 y(s)
 m2 s 2 y(s)  k1x(s)  k1r (s)  m1s 2 x(s)
Block modeling mechanical system
 Csy(s)  Csx(s)  k2 y(s)  k2 x(s)  m2 s 2 y(s)
 m2 s 2 y(s)  k1x(s)  k1r (s)  m1s 2 x(s)
m2 s 2 y(s)
k1
r (s )

x (s )
m1s 2 x( s )
1 sx (s )
m1s
1
s
C
k2


1 sy (s )
m2 s
C
k2
1
s
y (s )
Block modeling mechanical system
Block reduction
m2 s 2
k1
m1s 2

r (s )
1
m1s
1
m1s
1
s
k2
C

1
m2 s
C
k2
1
s
s
y (s )
Modeling electromechanical systems
DC motor’s voltages.
dI a
d
;
U E  K e
; UL  L
dt
dt
U R  RI a ;
The electromotive force based on: U E  B  l  
DC motor’s tongues.
d
Tf  C
;
dt
Ta  K a I a
B: magnet field [T: Tesla];
Ia: armature current
UE: electromotive force [V]
UL: voltage on inductance [V]
UR: voltage on resistance [V]
Ta armature torque
Tf friction torque
TL load torque
C: friction constant [Nsec/m]
Modeling DC motor
Ra
La
U dc
Ia
Ue

Ta T f TL
M
Ja
armature inertia
 angular displacement
Ta armature torque
Tf friction torque
TL load torque
Ia armature current
Ra armature resistance
La armature inductance
Generated electromotive force (emf) against the applied armature voltage
U  U dc  U e  U R  U L  0  U dc  Ke
d
dI
 Ra I a  La a
dt
dt
d 2
d
T

J

T

T

T

K

I

C
 TL

a
a
f
L
a
a
2
dt
dt
Ke electromotive force constant
Ka motor torque constant
C rotational friction constant
Simulating the system by MATLAB
Ra

U dc
1
La
dI a
dt
 dt
I a (t )
Ka
d
dt 2
2
TL (t )

1
Ja
C
 dt
d
dt
Ke
 dt
 (t )
Example: Block modeling DC motor
Ra
La
U dc
Ue
Ia
 Ta T f TL
M
U dc  K e
d 2
d
J a 2  Ka  Ia  C
 TL
dt
dt
Ja
TL
La
U dc


dI a
dt
1
dt
La 
d
dI
 Ra I a  La a
dt
dt
d 2
Ja 2
dt
Ta 
Ia
Ka

1
dt
Ja 
Tf
C
Ra
Ke
d
dt
 dt

In time domain using difference equations
Ke
d
dI
 Ra I a  La a  U dc
dt
dt
Ke
L
{ (i )   (i  1)}  Ra I a (i )  a {I a (i )  I a (i  1)}  U dc (i  1)
T
T
La
La
Ke
{Ra  }I a (i )  U dc (i  1)  I a (i  1)  { (i )   (i  1)}
T
T
T
T
La
Ke
I a (i  1) 
U dc (i  2) 
I a (i  2) 
{ (i  1)   (i  2)}
La  RaT
La  RaT
La  RaT
d 2
d
d 2
d
J a 2  Ka  I a  C
 TL  J a 2  C
 K a  I a  TL
dt
dt
dt
dt
Ja
C
{

(
i
)

2

(
i

1
)


(
i

2
)}

{ (i )   (i  1)}  K a  I a (i  1)  TL (i  1)
2
T
T
In operator frequency domain
Ra
La
U dc
Ia
U dc  K e
Ue
 Ta T f TL
M
Ja
d
dI
 Ra I a  La a
dt
dt
d 2
d
J a 2  Ka  Ia  C
 TL
dt
dt
x (s )
G(s)
y (s )
Assuming than Udc is constant and
the system is steady-state when
one
change the value of Udc
Examination of dynamic behaviour
can be used the Laplace transform.
U dc (s)  Ke s (s)  Ra I a (s)  La sI a (s)
J a s 2 ( s)  K a  I a ( s)  Cs ( s)  TL ( s)
y( s)
 G ( s )  y ( s )  G ( s ) x( s )
x( s )
Block modeling DC motor
Ra
La
U dc
Ia
Ue
 Ta T f TL
U dc (s)  Ke s (s)  Ra I a (s)  La sI a (s)
M
J a s 2 ( s)  K a  I a ( s)  Cs ( s)  TL ( s)
Ja
TL
U dc
La sI a


1
La s
Ia
Ka
Ta 
J a s 2

1
Jas
Tf
Ra
C
Ke
s
1
s

Simpler block model of DC motor
U dc
Ka
Ra  La s

TL

1
C  Jas

1
s
Ke
TL
TL


U dc
Ra  La s
Ka
U dc 
Ra  La s
Ka
Ka
1
Ra  La s C  J a s
Ke
1
s
Ka
1 
( Ra  La s )(C  J a s )  K e s

Models of electronic circuit
Kirchhoff’s current law: The algebraic sum of current leaving a junction or
node equals the algebraic sum of the current entering that node.
Kirchhoff’s current law: The algebraic sum of all voltages taken around a
closed path in a circuit is zero.
Resistor
Capacitor
du (t )
dt
u (t )  Ri (t )
i (t )  C
U ( s )  RI ( s )
I ( s )  CsU ( s )
Inductor
u (t )  L
di(t )
dt
U ( s)  LsI ( s)
Models of electronic circuit
I
I3
I
2
1
A
B
U1
U
2
U1
G1 ( s)
I
1
Au (s)

I
2
I
3
All resistance equal R and all
capacitance
equal C.
Point “A” is nearly ground and such as a
summing junction for the currents.
“B” is a take off point for U2.
The OpAmp amplitude gain is Au(s)
U1
U2
I2
G2 (s)
I 1( s)
1
1

U1 ( s) 2 R 1  sC R
I
2
1
I 2( s )
sC

U U ( s ) 1  sCR
2
2
G3 ( s)
I3
I 3( s)
1
1

U U 2 ( s) 2 R 1  sC R
2
2
Modeling heat flow
Heat energy flow.
1
q  (T1  T2 );
R
Thermal conductivity:
1 kA

R
l
A: cross-sectional area
l: length of the heat-flow path
k: thermal conductivity constant
Temperature as a function of heat-energy flow:
Specific heat:
dT 1
 q;
dt C
C  m  cv
q: heat energy flow J/sec
C: thermal capacity J/°C
R: thermal resistance °C/J
T: temperature °C
Heat flow models
T0
q2
R0
q1
room T1
C  mcv
m: the mass of the substance
cv: specific heat constant
R1
The net heat-energy flow into a substance:
dT 1
 q
dt C
C
dT
q
dt
The heat energy flows through substances (across the room’s wall):
q
1
1 1
(T0  T1 )  q1  q2  (  )(T0  T1 )
R
R1 R1
The heat can also flow when a warmer mass flow into a cooler mass or vice
dm
versa:
q
cv (T1  T0 )
dt
Heat flow models
The total heat-energy flow:
C
C1
dT
q
dt
q
C
dT dm
1

cv (T1  T2 )  (T0  T1 )
dt
dt
R
1
(T0  T1 )
R
dT1
dm
k A kA
 qm  (q1  q2 ) 
cv (T1  T2 )  ( 2 2  1 1 )(T0  T1 )
dt
dt
l2
l1
sT1 (s)  sm(s)cvT1 (s)  constT1 (s)  T0 (s)  sm(s)cvT2 (s)}
It’s non-linear, except T1=T2.
Modelling a heat exchanger
Ts
dmw
 K w Aw water
dt
Twi
Tw
Treal
dms
dAs

K
s
steam dt
dt
Tsi
The time delay between the measurement
dTs dAs
1

K s cvs (Tsi  Ts )  (Ts  Tw )
dt
dt
R
and the exit flow of the water:
Treal  Tw (t   d )
dT
1
Cw w  Aw K wcvw (Twi  Tw )  (Ts  Tw )
dt
R
Cs
As: area of the steam inlet valve,
Aw: area of the water inlet
Ks: flow coefficient of the inlet valve, Kw: flow coefficient of the water inlet
cvs: specific heat of steam,
cvw: specific heat of water
Tsi: temperature of inflow steam,
Twi: temperature of inflow water
Ts: temperature of outflow steam,
Ts: temperature of outflow water
Cs=mscvs thermal capacity of the steam, Cw=mwcvw thermal capacity of the water
R: thermal resistance (average over the entire exchanger)
Simulating heat exchanger
Cs
dT
1
dTs dAs
1

K s cvs (Tsi  Ts )  (Ts  Tw ) Cw w  Aw K wcvw (Twi  Tw )  (Ts  Tw )
dt
R
dt
dt
R

K s cvs
As (t )
d
dt



Cs
Cw
dTs
dt
dTw
dt
Aw K wcvw
1
Cs
1
R
1
Cw
 dt
Tsi (t )
Ts (t )

 dt

Tw (t )
Twi (t )
Laplace form heat exchanger
Cs
dTs dAs
1
dT
1

K s cvs (Tsi  Ts )  (Ts  Tw ) Cw w  Aw K wcvw (Twi  Tw )  (Ts  Tw )
dt
dt
R
dt
R
The equation is nonlinear because the state variable Ts is multiplied by the the control
input As. The equation can be linearized at the working point Ts0, and so Tsi-Ts0=Ts
nearly constant. To measure all temperature from Twi, it’s eliminated Twi=0.
1
(Ts ( s)  Tw ( s ))
R
1
Cw sTw ( s )   Aw K wcvwTw ( s )  (Ts ( s )  Tw ( s ))
R
Cs sTs ( s )  As ( s ) K s cvs Ts 
Ts ( s ) 
Tw ( s) 
RK s cvs Ts
1
As ( s ) 
Tw ( s )
1  sRC s
1  sRC s
Tw ( s ) 
Treal ( s )  Tw ( s )e  s d
1
Ts ( s )
1  RAw K wcvw  sRC w
1
RK s cvs Ts
1
1
As ( s ) 
Tw ( s )
1  RAw K wcvw  sRC w 1  sRC s
1  RAw K wcvw  sRC w 1  sRC s
Tw ( s){ Aw K wcvw  s(Cw  Cs )  sRAw K wcvwCs  s 2 RC wCs }  K s cvs Ts As ( s)
Block model of heat exchanger
Cw sTw ( s )   Aw K wcvwTw ( s ) 
Cs sTs ( s )  As ( s ) K s cvs Ts 
1
(Ts ( s )  Tw ( s ))
R
1
(Ts ( s)  Tw ( s ))
R
Treal ( s )  Tw ( s )e  s d
1
R
As (s )
K s cvs Ts
Cs sTs (s)
1
C s sR
RTs (s )
Cw sTw (s)
1
Cw s
1  Aw K wcvw
Tw (s )
e  s
Black box model
Modeling by reaction curve
Feedback control
plant
GW(s)
controller
GA(s)
GC(s)
A/M
GP2(s)
GT(s)
Process field
When auto / manual switch is manual
position (open), then GC(s)=1
R0+r
GP1(s)
GC(s)
A/M
W
U0+u
YM0+yM
GA(s)
GT(s)
GW(s)
GP(s)
Modelled the process from reaction curve
by dead-time proportional first order transfer function HPT1
1
yM
 sTu
G p ( s)  K P
e ; Kp 
1  sTg
u
yM , u
yM
u
Tu
Tg
t
The error of the model
The principle of the less squares:

2
{
x
(
i
)

x
(
i
)
}
 measured
mod el
i 0
The better model the less sum of value of the squares.
The error of the model:
N
| y
i 0
M
(i ) measured  yM (i ) mod el |
100%
N
| y
i 0
M
(i ) measured |
A better model of process from reaction curve
by dead-time second order transfer function HPT2
ym , u
G p (s)  K P
1
1
e  sTt
1  sT1 1  sT2
ym u
It needs computer! The beginning parameters:
T1  T2 
Tf
2
,..Tt
t
Modelled the process from reaction curve
ym , u
by “n” order transfer function PTn
1
G p ( s)  K p
(1  sT )n
70%
ym u
30%
10%
t10
t30
t
t70
Modelled the process from reaction curve
by dead-time integral first order transfer function HIT1
1 1
G p ( s) 
Ti 1  sTg
ym , u
u
Tg
Ti
t