Tài liệu Control Systems Simulation using Matlab and Simulink - Pdf 85

UNIVERSITY OF CALIFORNIA AT BERKELEY
Department of Mechanical Engineering
ME134 Automatic Control Systems
Spring 2002
Report Due: Tuesday, February 26 One report per group is required.
Control Systems Simulation
Using Matlab and Simulink
1 Introduction
In ME134, we will make extensive use of Matlab and Simulink in order to design, analyze and
simulate the response of control systems.
2 Control of Second Order System
We will simulate the open loop and closed loop step response of the dynamic system described by
the state and output equations
d
dt
x
1
= −.1 x
1
+ .1 x
2
(1)
d
dt
x
2
= −.2 x
2
+ .1 u
y = x
1

described by the block diagram in Fig. 2 where the controller is a PID type controller given by the
Figure 2: feedback control system
transfer function
C(s)=K
p
+
K
i
s
+ K
d
s
U(s)=C(s)E(s) .
In the time domain the PID control action can be described by
u
p
= K
p
e,
d
dt
u
i
= K
i
e, u
d
= K
d
d

controller 4 20 1 0
controller 5 20 1 20
Plot all the unit-step output (y(t) vs. t) responses of the system in one plot. Indicate which
response corresponds to which feedback gain selection. Comment on your results and on the effect
that each feedback action has on the response of the control system.
Plot all the unit-step control input (u(t) vs. t) responses of the system in one plot. Indicate
which response corresponds to which feedback gain selection. Comment on your results and on the
effect that each feedback action has on the control input, u. What do you think would occur if the
input u, saturates?
2.3 Discrete Time (D.T.) closed loop unit-step response
Consider now the closed loop unit-step input response of this system under a discrete time PID
controller. The discrete time PID controller is given by
u
p
(k)=K
p
e(k)
u
i
(k)=u
i
(k − 1) + K
i
e(k)
u
d
(k)=K
d
[e(k) − e(k − 1)]
u(k)=u

2
is the velocity of m
1
; x
3
is the position of m
2
, (relative to an inertial frame); and x
4
is the
velocity of m
2
.
3
Figure 3: spring-mass system
The reference trajectory is denoted by ref(t). The objective of the control system is to make
the position of m
2
,whichisx
3
, follow the reference trajectory as close as possible. Hence, we could
defineanerrorateachtimet by
error(t):=ref(t) − x
3
(t)(4)
In a disk-drive system (which we used to motivate this example) the reference trajectory would
be a staircase-like signal, and x
3
would be the position of the read/write head. The read/write
head must be moved to a particular track, and held there for a short time to either read or write,

u = c
c
x
c
+ d
c
(ref − x
1
)
where the gains, a
c
,b
c
,c
c
and d
c
arechosentoachievethetrackingobjective.
The parameters of the two mass vibratory system and the state equations for this system are:
m
1
=1kg
m
2
=0.1 kg
k =5newtons/meter
c =0.1 newtons/meter/sec




k
m
1
c
m
1
0001
k
m
2
c
m
2

k
m
2

c
m
2











u
4
1. The file twomass.m in Simulink contains the model of the mechanical system described above
and the dynamic controller. This file is not complete and has some errors. You are asked
first to check the dimensions of the system matrices and insert some of the missing elements
in the file. Secondly, you are asked to test the response of the feedback control system due
to a unit-step reference input of 1 meter for each of the following 5 control gain selections:
a
c
b
c
c
c
d
c
controller 1 5-41 1
controller 2 5-44 4
controller 3 5-48 8
controller 4 5-41616
controller 5 5-42020
Notice that, for the above control gain selections, the controller transfer function can be
written as follows
C(s)=K
s + b
1
s + a
1
,U(s)=C(s) E(s)
where K = c

second mass x
3
is measured instead of the position of the first mass x
1
.Commentonthe
results obtained.
4 Ball-and-Beam
Consider the Ball-and-Beam system shown in Fig. 4:
Aballofmassm slides on a beam which has moment of inertia J about its center of mass.
The control torque u is applied to the beam at its center of mass. The equations of motion for this
system are:
m¨r − mr
˙
θ
2
+ mg sin(θ)+b ˙r =0
J
T
¨
θ +2mr ˙r
˙
θ + mgr cos(θ) − u =0,
5


Nhờ tải bản gốc
Music ♫

Copyright: Tài liệu đại học © DMCA.com Protection Status