CONTROL SYSTEMS
Laboratory Manual
EEE/ECE F242
Exp.No.2: BUMP TEST MODELING
Prepared by
Faculty, PhD Scholars and Laboratory Staff
Department of Electrical Engineering
BITS Pilani, Hyderabad Campus
Date: January 2024
1
Purpose of the document
This document is intended to be used by the students for enhancing their learning while performing the
experiments. The learning is imparted by way of posing a set of questions on each of the experiments and
the student is expected to answer these questions either before performing the experiments or by
experimentation.
The document does not give details on step by step procedure for performing the experiments. It is
expected that the student acquires this information, prior to the experimentation, by referring to the books
or documents, referred below.
It is advised that the student need not constrain oneself to the set questions given in this document and can
generate one’s own set of additional questions to enhance the learning process. The authors of this
document will be highly appreciative of those who can add additional questions.
References:
1. QUBE user manual.
2. Control System Text books.
Note
This document will serve as Control Systems Lab manual, observation and
record book. Please maintain the book neat and clean. The copy of the
document has to be brought by each student to the Lab. The observations will be
noted down in the Lab session. Further answers and results to the questions
should be incorporated as required and submitted in the next class. Failure of
which, the student will not be allowed into the Lab. Please maintain a folder file
to hold the document.
2
Contents
EXPERIMENT NO. 2 ............................................................................................................................. 4
2.1 Background: ............................................................................................................................................................ 4
2.2 Applying this to the QUBE-Servo ............................................................................................................................ 5
2.3 In-Lab Exercises ...................................................................................................................................................... 6
LIST OF FIGURES
Figure 2.1: Input and output signal used in the bump test method .............................................................................................. 4
Figure 2.2: Applies a step voltage and measures corresponding servo speed .............................................................................. 4
Figure 2.3: QUBE-Servo Bump Test Response ......................................................................................................................... 7
Figure 2.4: Validating bump test model .................................................................................................................................... 8
Name of the student:
ID No. :
3
EXPERIMENT NO. 2
BUMP TEST MODELING
Topics Covered
• First order transfer functions.
• Obtaining the QUBE-Servo model.
• Model validation
Prerequisites
• QUBE-Servo Integration Lab
• Filtering Lab.
Aim: Linear time-invariant dynamical systems are categorized under first-order systems, second-order systems,
and higher-order systems. The transfer function of all first-order systems has a standard form. This
enables us to investigate the response of first-order systems collectively, for any specific input. The
response of a first-order system depends on its DC gain, K, and time constant,. Both K and are
function of system parameters. The bump test is a simple test based on the step response of a stable system.
2.1 Background:
The standard form of transfer function of a first-order system is:
where Y(s) and U(s) are the Laplace transforms of the output and input variables, respectively, K is the
DC gain, and is the time constant. For a unit step input U(s) 1/s , the response of the system is:
It is clear from (2.3) that y K as t .
The DC gain can therefore be interpreted as the final value of the output for a unit step input. The time
constant is the time required for y(t) to reach 63.2% of its final value. Indeed, at t = τ, y(t) = 0.632K
for a unit step input. For a unit step input, the change in input is one. In general, for a step input of
magnitude A at t = τ, y(t) = 0.632KA.
4
Construct a Simulink block diagram having a transfer function described in Equation 2.1.
A step input as shown in Figure 2.1 is given to it and the response of the system is observed in a
scope. The step response shown in Figure 2.1 is generated using this transfer function with
K = 5 rad/V-s and τ= 0.05 s. Attach sample responses at the end with details.
The step input begins at time t0. The input signal has a minimum value of umin and a maximum
value of umax. The resulting output signal is initially at y0. Once the step is applied, the output tries
to follow it and eventually settles at its steady-state value yss. From the output and input signals, the
steady-state gain is:
where ∆y = yss − y0 and ∆u = umax− umin. In order to find the model time constant τ, we can
first calculate where the output is supposed to be at the time constant from:
5
Then, we can read the time t1 that corresponds to y(t1) from the response data in Figure 2.1. From
the figure we can see that the time t1 is equal to:
t1 = t0 + τ
From this, the model time constant can be found as:
τ = t1 − t0 (2.6)
Figure 2.1: Input and output signal used in the bump test method
Applying these equations (2.4 to 2.6), obtain the model time constant and gain from the response.
Observation / Result:
6
2.2 Applying this to the QUBE-Servo
Going back to the QUBE-Servo system, a step input voltage with a time delay t0 can be expressed as
follows in the Laplace domain:
where Av is the amplitude of the step and t 0 is the step time (i.e. the delay).
The voltage-to-speed transfer function is:
where K is the model steady-state gain, τ is the model time constant , ωm (s) = L[ωm (t)] is the
load gear rate, and Vm (s) = L[vm (t)] is the applied motor voltage. If we substitute Equation 2.7
into the system transfer function 2.8, we get:
We can then find the QUBE-Servo motor speed step response, ωm (t), by taking inverse Laplace of
this Equation 2.9
Here we need to be careful with the time delay t 0 and note that the initial condition is:
ωm (0− ) = ωm (t0)
7
2.3 In-Lab Exercises:
Based on the models already designed in QUBE-Servo Integration and Filtering labs, design
a Simulink model that applies a step of 2 V to the motor and reads the servo velocity using the
encoder as shown in Figure 2.2. To apply your step for a certain duration (e.g., 2.5 s), set the
Simulation stop time of the Simulink model. Using the saved response, the model parameters can
then be found as discussed in Section 2.1.
Figure 2.2: Applies a step voltage and measures corresponding servo speed
Add the HIL-1 Initialize from Simulink Library/QUARC Targets/Data
Acquisition/Generic/Configuration.
Add a Step Signal from Simulink Library / Simulink / Sources.
Set the Step Signal to output a step voltage 2 V.
HIL Write Analog from Simulink Library/QUARC Targets/Data
Acquisition/Generic/Immediate I/O.
HIL Read Encoder from Simulink Library/QUARC Targets/Data
Acquisition/Generic/Immediate I/O
Add the Inverse Modulus block: Simulink Library / QUARC Targets / Discontinuous
category into the Simulink diagram. Set the field to 65536 to the Modulus terminal.
QUBE-Servo DAQ has 16-bit counters, the valid count range is 216 = 65536.
Add the Gain from Simulink Library / Simulink / Commonly used.
To measure the gear in radians, set the gain to 2π/2048 = 0.003068 (instead of 360/2048).
Add the Scope from Simulink Library / Simulink / Commonly used.
Add a Transfer Function Block from the Simulink Library / Simulink / Continuous.
Set the Transfer Function block to 150s/(s + 150).
8
Hardware Settings:
Hardware Implementation: Hardware board / Determine by code generation system target file.
Device type: x86-64(windows64)
Click on system target file and browse and select:
quarc_win64.tlc
Solver:
Simulation time: Set the start time is ‘0’ and stop time is ‘2.5’ sec.
Solver selection: Fixed-step and Solver: ode1(Euler)
Solver details: Fixed-step size is 0.002
Click on apply and ok.
Click on Hardware and Run the Simulation.
Blocks used in this exp., & paths:
HIL-1 Initialize: Simulink Library/QUARC Targets/Data Acquisition/Generic/Configuration.
Step Signal: Simulink Library / Simulink / Sources.
Gain: Simulink Library / Simulink / Commonly used Blocks.
Scope: Simulink Library / Simulink / Commonly used Blocks.
HIL Write Analog: Simulink Library/QUARC Targets/Data Acquisition/Generic/Immediate I/O
HIL Read Encoder: Simulink Library/QUARC Targets/Data Acquisition/Generic/Immediate I/O
Inverse Modulus: Simulink Library / QUARC Targets / Discontinuous.
Transfer Function: Simulink Library / Simulink / Continuous.
Mux: Simulink Library / Simulink / Commonly used Blocks.
9
1. Run the QUARC controller to apply a 2 V step input to the servo. The scope response should
be similar to Figure 2.3.
(a) Motor Voltage (b) Load Speed
Figure 2.3: QUBE-Servo Bump Test Response
2.Plot the response in Matlab figure. For example, you can setup the scopes to save the
measured load/disc speed and motor voltage to the Matlab workspace in the variables
data_wm and data_vm, where the data_wm(:,1) is the time vector and data_wm(:,2) is the
measured speed. Attach sample responses at the end with details.
If the measured data is saved to the variables wm_meas and vm, the following command lines
will generate the figure shown in Figure
subplot(2,1,1)
plot(t,wm_meas,'r-','linewidth',2); ylabel('\omega_m (rad/s)');
subplot(2,1,2)
plot(t,vm,'r-','linewidth',2);
ylabel('V_m (V)');
xlabel('time (s)')
3. Find the steady-state gain using the measured step response. Hint: Use the Matlab ginput
command to measure points off the plot.
Observation / Result:
ωm (t0 ) =
ωm,ss =
Av =
K =
4. Find the time constant(τ) from the obtained response.
Observation / Result:
τ = t1 − t0 =
10
5. To check if your derived model parameters K and τ are correct, modify the Simulink diagram to
include a Transfer Fcn block with the first-order model in Equation 2.1, as shown in Figure 2.4.
with K=10 and time constant =0. 1. Connect both the measured and simulated QUBE-Servo
responses to the scope using a Mux block (from the Signal Routing category). Build and run your
QUARC controller. Attach a Matlab figure displaying both the measured and simulated
response in one plot, as well as in the input voltage.
Figure 2.4: Validating bump test model
Observation / Result:
11
6. Modify the Simulink diagram to include a Transfer Fcn block using the correct model
parameters as shown in fig: Substitute K and τ calculated values in QUBE-Servo Model:
Attach a Matlab figure displaying both the measured and simulated response in one plot,
Observation / Result:
7. Did you derive the model parameters K and τ correctly? Explain.
Conclusion:
Summarize the lessons learned in this lab.
End of session
12