You are on page 1of 7

Laboratory 3

Modelling of dynamic systems in Matlab and


Simulink.
A control engineer has to design an automatic cruise control for a new vehicle model. The cruise
controller should be able to maintain constant speed at all-time despite disturbances such as wind
resistance, friction and changes in terrain. For the first laboratory, let us consider a simple model of the
vehicle dynamics, as seen in the diagram below. A vehicle of mass m is controlled by a force F1 . This
force is an ideal representation of the road/tire interface where high order dynamics (power train, tires,
combustion engine) are neglected. The opposing forces have to do with the friction (rolling resistance)
and wind drag, and are assumed to vary linearly with the velocity of the vehicle and in exact opposition
to the vehicle motion.

Force 2: Friction Force 1: Control Force

ma

bv
Equations

m  a = F1 − F2
dv
m = F1 − b  v
dt
Where:
m is vehicle mass (2000Kg)

b is the damping coefficient (50 N*s/m)

Question 1: What is the transfer function that relates speed of the vehicle with the applied force?

Exercise 1:

1) Deploy the transfer function in Matlab using the “tf()” inline command (eg.
P_vehicle=tf(x,y) )
2) Apply a step of 500 to the transfer function created in 1) using the step() command (eg.
step(500*P_vehicle) )
3) Build a Simulink model of the transfer function using integrators sums and
multiplications only.

( F1 − b  v )dt
Tip   m  dt =  ( F1 − b  v )dt → v = 
dv
 dt  m

Useful Simulink blocks for system deployment. Blocks can be found in the following Simulink
libraries:
1) Commonly used blocks
2) Continuous

3) Create a subsystem of your model by selecting all components and using the Ctrl+G
command. Add a step at the input of the subsystem and a scope a the output of the
subsystem as shown below
provide an appropriate step input of 500 at time equals zero, double-click the Step block and
set the Step Time to "0" and the Final Value to "500".

4) Simulate the system output to the control force step


To simulate this system, first, an appropriate simulation time must be set.
Select Parameters from the Simulation menu and enter "120" in the Stop Time field. 120 seconds
is long enough to view the open-loop response.
5) Simulate the system and compare the oscilloscope plot with the plot of the “step”
command in Matlab.

DC Motor Speed: System Modelling


DC motors provides rotatory motion based in a current input. The equivalent electric and
mechanical systems of the DC motor is shown below.

b 
L R
v e
i
J

Te 

The torque generated by a DC machine Te is proportional to the stator current i and the strength
of the rotor magnetic field. If the rotor magnetic field is provided by a permanent magnet then the
field can be considered constant and the torque turns proportional to the stator current multiplied
by a constant K . This constant is equal to the constant that multiplies the back EMF e of the
machine. The back EMF of the machine is proportional to the angular velocity  of the shaft. The
equations that define this system are listed below

Te = Ki
e = K
d
J + b = Te = Ki
dt
di
L + Ri = v − K 
dt

Question 2: What is the transfer function that relates the angular velocity  of the motor with
the applied voltage V in the stator circuit?

Exercise 2: Using the values in the table below

J moment of inertia of the rotor 0.01 kg.m^2

b motor viscous friction constant 0.1 N.m.s


Ke = K electromotive force constant 0.01 V/rad/sec

Kt = K motor torque constant 0.01 N.m/Amp

R electric resistance 1 Ohm

L electric inductance 0.5 H

1) Deploy the transfer function in Matlab using the “tf()” inline command (eg.
P_motor=tf(x,y) )
2) Apply a step of 500 to the transfer function created in 1) using the step() command (eg.
step(500*P_motor) )
3) Build a Simulink model of the transfer function using integrators sums and
multiplications only.

4) Create a subsystem of your model by selecting all components and using the Ctrl+G
command. Add a step at the input of the subsystem and a scope a the output of the
subsystem as shown below
5) provide an appropriate step input of 10 volts at time equals 0,

6) Simulate the system output to the control force step for 10 seconds
Simulate the system for 10 seconds and compare the oscilloscope plot with the plot of the “step”
command in Matlab.

DC Motor Position: System Modelling


The angular position of the motor shaft can be controlled via discrete inputs from its voltage source.

b 
L R
V e
i
J

Te d
=
dt

The equation defining the position of the motor shaft is given by


d
=
dt

Question 3: What is the transfer function that relates the angular position  of the motor with
the applied voltage V in the stator circuit? Use the equation of previous exercise to find out the
relationship between voltage and angular speed of the motor.

Exercise 3: Using the values in the table below

J moment of inertia of the rotor 0.01 kg.m^2

b motor viscous friction constant 0.1 N.m.s

Ke = K electromotive force constant 0.01 V/rad/sec

Kt = K motor torque constant 0.01 N.m/Amp

R electric resistance 1 Ohm

L electric inductance 0.5 H

1) Deploy the transfer function in Matlab using the “tf()” inline command (eg.
P_thetha=tf(x,y) )
2) Apply a step of 500 to the transfer function created in 1) using the step() command (eg.
step(500*P_motor) )
3) Build a Simulink model of the transfer function using integrators sums and
multiplications only.

4) Create a subsystem of your model by selecting all components and using the Ctrl+G
command. Add a step at the input of the subsystem and a scope to the output of the
subsystem.

5) provide an appropriate step input of 10 volts at time equals 0,

6) Simulate the system output to the control force step for 10 seconds and compare the
oscilloscope plot with the plot of the “step” command in Matlab.

You might also like