Page 1
09/09/12 − Page 1
EE 4314 Lab 2 Handout for Workbench #2 Modeling and Identification of the Double-Disk-Torsion-Spring System
Fall 2012
IMPORTANT!
This handout is for those who are assigned to Workbench #2.
Please check your lab schedule to see which workbench you are assigned to.
1. Lab Information
a) Date, Time, Location, and Report Due
Please check your lab schedule on Blackboard for your lab date, time, and workbench. The lab
will be held at NH250. Your lab report is due on Wednesday at 11:59 pm two weeks after your
lab session.
b) Preliminary Work
You are required to complete the Preliminary Work given in the next section of this handout
and to read the rest of the handout before you come to the lab for the experiment. At the
beginning of the lab, the TA will check your preliminary work. Get a printout of your
answers and results and show it to the TA when you go to your lab session.
c) Lab Report
After the lab, you will work on the problems at the end of the handout on your own and are
required to submit a report on that. Please check the information about the assignment in the lab
report section at the end.
d) Some Notes and Rules
- Do not forget to sign the attendance sheet.
- Login to the account created for EE4314 and use the folders provided to save your work.
- Do not change the experiment hardware setup unless instructed by the TA or by the lab
procedure in the handout.
- Cooperate with your group mates to increase your efficiency in performing the experiment.
- Bring a USB memory device to get a copy of the experiment data at the end of the lab.
- Keep clear from the moving parts of the experiment setup when it is running.
Page 2
09/09/12 − Page 2
2. Preliminary Work
This part of the handout provides the preliminary information that you need to understand the
experiment, conduct it, and interpret the results. Follow the steps below to complete the preliminary
work. Provide your answers and results on a paper and present it to the TA when you go to your lab
session.
The block diagram of the double-disk-torsion-spring (DDTS) system that will be used in this lab is
shown in Figure 1. Applications of motors driving rotary inertias attached to flexible axes can be found
commonly in industry. A typical example is a motor connected to a load through a long shaft.
The following are the parameters of the system:
Table 1 Physical parameters of the double-disk-torsion-spring system
Combined inertias attached to disks J1 = 0.0108 (kg.m2) J2 = 0.0034 (kg.m
2)
Damping constants for the viscous friction at disks c1 (kg.m2/s) c2 (kg.m
2/s)
Elasticity coefficient (stiffness) of the torsion spring k (kg.m2/s
2)
Motor voltage to torque generation constant f (C)
The goal of this lab is to present a simple method for identification of systems that can be split into
a set of second-order subsystems with complex-conjugate poles. Starting from the physical principles, a
set of second-order transfer functions will be created for the experimental system. The response of the
system to zero input and nonzero initial conditions will be observed and used to determine the
unknown parameter values c1, c2, k, and f.
Using the differential equations and the identified parameters, a state-space model for the system
will be built. The validation of the model will be done by providing the same input to the real system
and to the model and by comparing their outputs. This model will be used in the fifth lab to design a
state-feedback controller.
Figure 1 Double-disk-torsion-spring system setup
The physical system shown in Figure 1 can be modeled with the diagram shown in Figure 2. The
damping of the motion in the system is approximated with c1 representing the viscous damping acting
on disk 1 and c2 representing the viscous damping acting on disk 2. In reality, however, there is also
nonlinear Coulomb friction that is neglected in this model.
TORSION SPRING
k MOTOR
DISK 1
J1
DISK 2
J2
ENCODER 1 ENCODER 2
MASS m1 MASS
m2
MASS
m1
MASS
m2
DAMPING
c1
DAMPING
c2
d1
d2 l1
l2
MOTOR INERTIA
JM
Page 3
09/09/12 − Page 3
The inertia J1 represents the combined inertias of the disk 1, masses on disk 1, encoder 1, and the
motor. Similarly, J2 represents the combined inertias of the disk 2, massed on disk 2, and encoder 2. T
is the torque applied by the motor and x1 and x2 are angular positions of the disks in radians. Finally, k
is the stiffness of the torsion spring.
Figure 2 System model diagram
The dynamical equations that model the system in Figure 2 are as follows:
ufTxcxxkxJxcxxkTxJ ,)(,)( 222122112111 (1)
a) Using free body diagrams and Newton’s law of motion, derive the first two equations in (1).
Deriving the equations in (1) means that you have to start with the fundamental laws of physics
and eventually arrive at the form of equations given in (1). For instance, the rotational
acceleration of Disk 1 is due to the net torque acting on it which can be found based on the free
body diagram of the disk. The same is true for Disk 2 as well.
b) Apply Laplace transform to the first two differential equations in (1) assuming zero initial
conditions. You can replace T in the first equation with the expression in the third equation.
Obtain the s-domain equations in the following form
)()()(
)()()()()(
122
2311
sXsGsX
sXsGsUsGsX
(2)
where G1, G2, and G3 represent second order transfer functions. Figure 3 shows block diagram
representation of the system.
Figure 3 Separating the transfer functions of the system
c) Think about a way to identify the parameters, c1, c2, k, and f, of the DDTS system. The idea in
this experiment is to analyze the natural responses of parts of the system represented by G1 and
G2. Analyzing one part of the system alone requires fixing the other to a zero state. For instance,
the natural response of the part of the system represented by G2 can be observed through x2(t) if
G1(s) G2(s)
G3(s)
+
U(s) X2(s) X1(s) +
k T J1
x1 x2
c1 c2
J2
Page 4
09/09/12 − Page 4
Disk 1 is fixed to its zero state (i.e. by not letting Disk 1 move such that x1(t) = 0) and Disk 2 is
let go with its initial state. Similarly, the natural response of the part of the system represented
by G1 can be observed through x1(t) if Disk 2 is fixed to its zero state (i.e. by not letting Disk 2
move such that x2(t) = 0) and Disk 1 is let go with its initial state.
Assuming that the disks are initially stationary, the input is zero, and x1(0) is nonzero
while x2(t) = 0 for all t, express X1(s) in terms of s, J1, c1, k, and x1(0).
Similarly, assuming that the disks are initially stationary, the input is zero, and x2(0) is
nonzero while x1(t) = 0 for all t, express X2(s) in terms of s, J 2, c2, k, and x2(0).
d) Rewrite each of the transfer functions in the following standard form, by making sure that s2 on
the denominator has a coefficient of 1:
22
20
2)(
nii
niii
ss
gsG
(3)
where g0i is the DC gain, ωni is the natural frequency, and αi is the rate of decay of the transfer
function.
e) By identifying and comparing the coefficients of the different powers of s in (3) and in the Gi’s
you found, write k, c1, and c2 in terms of J 1, J 2, ωn1, ωn2, α1 and α2. For instance, you should be
able to find
.
f) In MATLAB Simulink, do the simulation of a second order system that can be represented with
a transfer function as in (3) assuming zero input and nonzero initial conditions. Note that
although the input is zero, the output of the system will not be identically zero due to the
nonzero initial conditions. This is called natural response. Assume that the constants of the
transfer function Gi are as follows: ωni = 10, αi = 0.5, and g0i =1. Also, choose an initial
condition of 1 for the output and zero for everything else. Refer to Example 9 in Lab 1 Handout
to see what kind of a Simulink model you need to create. Observe the output and get a plot of it.
Think about how you could analytically solve for this output. Would the analytical solution be
similar to the inverse Laplace transform of X1(s) or X2(s) in part (c)?
g) Create the state space model of the system in (1) by using the following definition:
zyzzz C
z
zBuA
z
z
z
z
xzzxzxzzxz
3
1
4
3
2
1
2342311211
,,
,,,
(4)
Specify what A, B, and C matrices are in terms of J 1, J 2, c1, c2, k, and f.
Page 5
09/09/12 − Page 5
3. Setting up the Experiment (by TA)
Figure 4 Picture of the double-disk-torsion-spring experiment setup
This part will have been done by the TA before the lab begins. This section is for your
information. The computer runs a Simulink model in real-time. The information from the encoders is
sent to the computer and is processed by the model. The command to the motor is a voltage that is
amplified by the Input/Output Electronic Unit and sent to the plant.
There are two incremental rotary shaft encoders. Each has a resolution of 4000 pulses per
revolution. The encoders are all optical type whose principle of operation is depicted in Figure 4. A
low power light source is used to generate two 90 degrees out of phase sinusoidal signals on the
detectors as the moving plate rotates with respect to the stationary plate. These signals are then squared
up and amplified in order to generate quadrate logic level signals suitable for input to the
programmable gate array on the real-time controller. The gate array uses the A and B channel phasing
to decode direction and detects the rising and falling edge of each to generate 4x resolution. The
Simulink model will receive 16000 counts per revolution from the encoders. The encoders are
coupled to the disks through a belt that had 1:1 ratio. Therefore, the number of counts is translated to
the corresponding angular displacement of the disks through the 2pi/16000 (rad/count) gain.
The motor receives a (variable) voltage from the I/O Electronic Unit and transforms it into motion.
For small speeds, it can be considered with relatively good approximation that the torque the motor acts
upon the system is proportional with the input voltage. You will see in other labs that the motor has
some nonlinearities, for example the deadband, but this is not important for the current lab.
The Simulink model for the experiment is shown in Figure 6. The green block represents the
physical DDTS system. It has one input and one vector output. The input represents the voltage that the
motor receives. The output is a vector that contains the two encoder readings. These readings represent
counts or the number of pulses since the simulation has started. When you connect to the target, the
readings are reset to zero. The number of counts is translated to the corresponding angular
displacement of the disks through the 2pi/16000 (rad/count) gain. The vector signal is demultiplexed
Input/Output
Electronic Unit
Simulink Model
Commands for
the motor
Readings of
the positions of
the masses
Amplified
drive signal to
the motor
Encoder
readings
Not used in
our setup
Page 6
09/09/12 − Page 6
to individual signals x1 and x2 and these are displayed on the oscilloscopes and sent to the Matlab
workspace for further processing if needed. The Protection block makes sure that the motor is not
driven with a high voltage that could damage the plant. Do not change the parameters of the
protection block!
Figure 5 Operation principle of optical encoders
Figure 6 Simulink model for the experiment
The “Final Value” of the Step block specifies the voltage applied to the motor. For most of the
experiment, the motor will not be driven so the Final Value can be set to zero.
Click on the Tools menu in the Simulink diagram and, in the Real-Time Workshop submenu, select
Build Model. You will see the build process will be displayed in Matlab command window. Once the
build is successfully completed click the “Connect to Target” button and after the connection is
established click on the Run arrow that appears in the Simulink diagram. This will start running the
Simulink code for a number of seconds specified.
Note: For real-time applications, Simulink compiles the model into a fast executable code that
handles the data acquisition and processing. Anytime a change is made in the Simulink file, except
changing the value of the step input or the Slider Gain, the file must be rebuilt.
Page 7
09/09/12 − Page 7
Check the scopes to save the signal data to the Matlab Workspace. By clicking on the “parameters”
button in the Scope window a new window containing the scope parameters will open up. In this
window in the “Data history” tab you will see that the data will be saved to workspace under the
following names: x1 and x2.
Note: The data is saved in the “Array” format. In this case the data will be saved in the workspace
as a two column matrix. The first column is the time column and specifies the moments in time at
which the signal values were collected. The second column is the data collected.
To plot the data in x1 and x2, you can plot the second column of the data array versus the first
column.
>> plot(x1(:,1), x1(:,2))
The experiment results can be saved to the “results” folder by selecting and right clicking on the
matrices in the workspace and saving them as a new .mat file.
Page 8
09/09/12 − Page 8
4. Doing the Experiment
The objective of this experiment is to identify the unknown parameters, c1, c2, k, and f, of the
system as introduced in section 2. Then, a state space model of the system will be created. The
identification procedure requires you to analyze the response of the G1 and G2 transfer functions in (2)
with nonzero initial conditions and zero input. This means that you have to measure the output of the
transfer function after you force its input to zero and force a nonzero value on at least one of the states.
From the diagram in Figure 3, you can see that the output of the G1 transfer function is not available for
measurement. Still, it is possible to measure it through x1 if x2 is forced to be zero. This means that if
you block Disk 2 and do not allow it to move, the G3 transfer function will not have any effect on x1
and you will see the output of G1 on the x1 measurements. The exact formula for the response can be
calculated using the Laplace transforms and considering nonzero initial conditions as discussed in
section 2. To experimentally obtain the response, follow the steps below:
Identification of the model:
a) Let Disk 1 free to move while Disk 2 is blocked by screwing to the frame of the plant. Connect
to the target and run the model with the slider gain set to zero initially. Slowly increase the
slider gain value and note on the first scope window that Disk 1 starts moving only when the
input exceeds a small value such as 0.05V. You can call this input level as the deadband voltage
udb. Then apply a test voltage utest such as 1V. You will see a displacement of Disk 1 that
stabilizes after some time to a steady-state value x1ss. As a result, the DC gain of G1 can be
calculated as
test
ss
u
xg 1
01 (5)
b) While you keep Disk 2 blocked, connect to the target again and run the model with the slider
gain set to zero. Slowly turn Disk 1 with your hand until the signal reaches 0.15 (about 10
degrees) in the scope and suddenly release the disk. After the oscillations cease, stop Simulink.
Observe the response if it looks similar to Figure 7. Note that α comes from equation (3).
Figure 7 Zero input, nonzero initial state response used for identification
c) Choose n consecutive cycles (e.g. n = 5) in the higher amplitude range of the response such that
they are not affected too much by the nonlinear friction effects. Divide the number of cycles by
0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1515-0.025
-0.02
-0.015
-0.01
-0.005
0
0.005
0.01
0.015
0.02
0.025
time (sec)
x1 (
m)
Initial angle
t0 , x1(t0)
t1 , x1(t1)
t5 , x1(t5)
te t sin
te
Page 9
09/09/12 − Page 9
the time taken to complete them (tn – t0) being sure to take beginning and end times from the
same phase of the respective cycles (it is best to look at the peaks). You may need to zoom into
the graph or see the data in a table in the Matlab workspace. The following calculation gives
you the period of oscillations T in seconds and the associated frequencies β in radians.
0
11
10
122
,tt
n
Tn
ttT
n
n
(6)
d) Measure the initial cycle amplitude x1(t0) and the last cycle amplitude x1(tn) for the n cycles
measured in the previous step. Use the relationships associated with the logarithmic decay to
obtain :
1
1
01
1
011
0
1
01
11
01
ln
2
lnln
1
01
nT
tx
tx
n
tx
tx
tt
tx
tx
e
e
tx
tx nn
n
n
t
t
n n
(7)
e) Calculate ωn1 with the following formula:
21
211 n (8)
f) Using the formulas you derived in part 2(e) of the Preliminary Work, calculate the values for k
and c1. Also, find the value of f.
g) Repeat steps (b) – (f) for Disk 2. In this case, block Disk 1 by screwing it to the frame of the
plant. Calculate the values k and c2 again by referring back to your Preliminary Work results.
Validation of the model:
h) Replace the constant parameters, J1, J 2, c1, c2, k, and f, in your state space model of part (g) of
the Preliminary Work with the numerical values you found through the experiment.
i) Open the Simulink block diagram named “simulation.mdl” Figure 8. Configure the State-Space
block with the values of the A, B, and C matrices of your model. Use the two Step sources to
create an input signal that has a pulse width of 1 second and amplitude of 1V.
j) Copy the blocks before the State-Space block in Figure 8 to the experiment model and rebuild
it. Make sure that the two Simulink diagrams are functionally the same except you have a
simulation model in Figure 8. Also, free both disks in the setup. Then, run both models. If the
responses are similar it means that the model that you just identified for the DDTS system is
fairly good. If the two responses are not similar then you have to go back and find out where
you might have made a mistake.
Page 10
09/09/12 − Page 10
Figure 8 Simulation model of the DDTS system in Simulink
Page 11
09/09/12 − Page 11
5. Lab Report
Submit your individual report for the following problems via EE4314 Blackboard
(https://elearn.uta.edu) in one of the following file formats: .doc, .docx, or .pdf. Your report should
include –if any– your formulations, listings of MATLAB code, pictures of Simulink block diagrams,
and resulting graphs for each problem. Make sure that you show all your work and provide all the
information needed to make it a standalone and self-sufficient submission. Have an appropriate report
format for your submission. This lab handout is a good example as to how you should format your
report. Make sure that you include the following information in your report:
- Report title, your name, ID number, lab section, submission due date and time.
- Answers to the problems with your
o Mathematical derivations and formulations. It is highly recommended that you use the
Equation Editor of Microsoft Word, MathType, or a similar editor to write your
equations. You can also scan handwritten equations and merge them into your report.
o Pictures of Simulink block diagrams and property windows of important blocks in the
simulation.
o Listings of MATLAB codes with inline comments and explanation in text.
o Pictures of data plots with appropriate axis labeling, titles, and clearly visible axis
values. Screen printing is not well accepted.
- Comments –if any– to let us know how we can make your learning experience better in this lab.
Note that you will need to use the results presented in this lab report for the experiment in Lab 4.
Below is the assignment policy:
This assignment is due on Wednesday at 11:59 pm two weeks after your lab session.
You must upload a single file in .doc, .docx, or .pdf format via the “Lab Report Submission”
link at EE4314 Blackboard (https://elearn.uta.edu).
Late reports will get 20% deduced score from the normal score for each late day (0-24 hr)
starting right after the due date and time. For example, a paper that is worth 80 points and is 2
days late (24hr – 48hr) will get 80 – 80 × 2 × (20/100) = 48 points. A paper that is late for 5 or
more days will get 0 score.
You will have two chances of attempt to submit your report via Blackboard and only the last
submission will be considered.
Grading is out of 100 points and that includes 20% (20 points total) for the format. A nice format
refers to a clear, concise, and well organized presentation of your work.
Page 12
09/09/12 − Page 12
Question 1 (35 pts):
Provide your answers to the preliminary work. The following rubric will apply for parts (a) to (g) of
the preliminary work.
(a) 5 pts (b) 5 pts (c) 5 pts (d) 5 pts (e) 5 pts (f) 5 pts (g) 5 pts
Question 2 (55 pts):
Show your results, calculations, and plots that you obtained in parts (a) – (j) of the experimental
procedure. What are the parameters k, c1, c2, and f that you found from the experiment? Show your
calculation steps and measurements on the plots. Give the state space model that you found with the
real values plugged in. Find the poles of your model. For the validation part of the model, compare
your simulation and experimental results on the same plot. Discuss the differences between the two.
Question 3 (10 pts):
a) (5 pts) Assuming that the masses are initially stationary, the input is zero, and x1(0) = 0.025m
while x2(t) = 0 for all t and using the expression you found for X1(s) in terms of s, m1, c1, k, and x1(0) in
part (c) of the Preliminary Work, find the time domain expression for x1(t). Plug in the values of the
system parameters and plot x1(t) in MATLAB. Comment on whether it looks similar to your
experimental observation of x1(t) in part (b) of the experiment.
b) (5 pts) Similarly, assuming that the masses are initially stationary, the input is zero, and x2(0) =
0.025m while x1(0) = 0 for all t and using the expression you found for X2(s) in terms of s, m1, c1, k,
and x1(0) in part (c) of the Preliminary Work, find the time domain expression for x2(t). Plug in the
values of the system parameters and plot x2(t) in MATLAB. Comment on whether it looks similar to
your experimental observation of x2(t) in part (b) of the experiment.