Académique Documents
Professionnel Documents
Culture Documents
Laboratory Manual
Experiment 1
by
Dr.-Ing. Wahju Sediono
Table of Contents
0. Objectives
1. Mathematical review
3. References
4. Procedure of experiment
21
25
2/29
0. Objectives
The objectives of this experiment are:
To model a first-order system and investigate the effect of system parameters on its response
to a step/impulse input.
To model a standard second-order system and to investigate the effect of system parameters
and feedback on its response to a step/impulse input.
1. Mathematical Review
Linear time-invariant dynamical systems are categorized under first-order systems, second-order
systems and higher-order systems.
a0
dy (t )
+ a1 y (t ) = f (t ) with y (0) = y0 ,
dt
(1.1)
where y(t) is the output of the system with initial value y0, f(t) is the input and a1, a0 are constant
coefficients.
The solution to (1.1) consists of two parts, namely a complementary and particular solution. The
complementary solution is the solution of the system when the input function f(t) = 0. It governs the
transient response of the system [1].
We can write the complementary solution as
y(t ) = y0e t .
(1.2)
Regarding the particular solution of the system, it depends on the input function f(t). The particular
solution determines the steady state behavior of the solution. Among many methods to obtain it, the
Laplace transform method is probably the easiest for the student, since it has the advantage of giving
both the complementary and particular solution. The sum of these two solutions gives the whole
solution of the system.
a0
d 2 y (t )
dy (t )
+ a1
+ a 2 y (t ) = f (t ) .
2
dt
dt
3/29
(1.3)
Without any lost of generality, we can divide the above equation throughout by a0 and rewrite the
system as
d2y
dy
+ b1
+ b2 y = g (t ) ,
2
dt
dt
(1.4)
where b1, b2 and g(t) are the corresponding coefficients and input respectively.
To find the complementary solution to the above system, we find the auxiliary equation of the system
as in the first order case. This is given by
2 + b1 + b2 = 0 .
The complementary solution of the above system is given by
y (t ) = C1e1 t + C2e 2 t
(1.5)
G( s) =
Y ( s)
K
=
U ( s) ( s + 1)
(2.1)
where Y(s) and U(s) are the Laplace transforms of the output and input variables, respectively, K is the
DC (steady-state) gain, and is the time constant.
For a unit step input U(s) = 1/s, the response of the system is:
Y ( s ) = G ( s ) U ( s) =
K 1
K
=
( s + 1) s s ( s + 1)
(2.2)
1
t /
y (t ) = L1
= K L1
= K (1 e )
s
(
s
+
1
)
s
(
s
+
1
)
(2.3)
It is clear from (2.3) that the value of y approaches 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. So, for a unit step input, at t= , y(t) = 0.632K. In general, for
a step input of magnitude M, at t= we will have y(t) = 0.632 MK.
Fig. 2.1 shows the response of the first-order system to a unit step input for two cases. For a system
gain K < 1, the systems output change is less than the input change applied. For a system gain K > 1
the systems output change is more than the input change applied.
4/29
G (s) =
Y (s)
Kn2
= 2
U ( s ) s + 2n s + n2
(2.11)
where Y(s) and U(s) are the Laplace transforms of the output and input functions, respectively, n is
the Eigenfrequency (natural frequency), and is the damping ratio. For a unit step input, U(s) = 1/s,
the response of the system in Laplace domain can be written as
Y (s) =
Kn2
s( s + 2n s + n2 )
(2.12)
Assuming poles of G(s) are complex ( < 1) and the DC gain G(0) = K = 1, the time-domain unit step
response can be written as
y (t ) = 1 1 e n t sin( nt + ),
= 1- 2 ,
= arctan( / )
(2.13)
The step response of a second-order system with varying damping ratios is shown in Fig. 2.4. The plot
is normalized by frequency and amplitude. From Fig. 2.4 it is shown that the response of the system is
oscillatory, but damped. The amount of damping is characterized by the damping ratio , and the
frequency of damped oscillation is n.
The settling time of a second order system is defined as the time it takes for the system to settle within
2% of its steady state value. It is given by the expression Ts = 4, where is the time constant, and is
given as = 1/n. Notice how the time constant appears in the exponential term of (2.13).
The peak time, Tp, is the time required for the output to reach its most extreme value, and is given as
Tp =
n 1 2
5/29
(2.14)
Another useful response characteristic, percentage overshoot, is defined as the ratio of the difference
ypeak1 to y(), where ypeak1 is the amplitude of the first peak. Unlike the damped oscillation frequency,
Eigenfrequency, settling time, and peak time, it is independent of n; it is only a function of . The
following relation gives the percentage overshoot:
=
/12
100%
(2.15)
In case that the poles of G(s) are real ( 1), the time domain response can be critically damped ( =
1), or overdamped ( > 1).
3. References
[1] E. W. Kreyszig, Advanced Engineering Mathematics, 9e, John Wiley & Sons, 2006.
[2] R. C. Dorf and R. H. Bishop, Modern Control Systems, 9e, Addison-Wesley, 2000.
[3] C. L. Phillips and R. D. Harbor, Feedback Control Systems, 3e, Prentice Hall, 1996.
[4] Mathworks, R2011a Documentation - MATLAB, 2011. [Online] http://www.mathworks.com/
help/techdoc/ [Accessed: 15 Aug. 2011]
[5] S. T. Karris, Introduction to Simulink with Engineering Applications, 2e, Orchard Publications,
2008.
[6] C. Radcliffe, Control Systems Laboratory. [Online] http://www.egr.msu.edu/classes/me451/
radcliff/lab/index.html [Accessed: 15 Aug. 2011]
6/29
4. Procedure of Experiment
4.1 First-order systems (15 minutes)
a. A first-order system is composed of an amplifier and a plant (Fig. 4.1). Find the system transfer
function in standard first-order form, K/(s+1).
Answer:
b. Sketch, as detailed as possible, the output of the above system (Fig. 4.1) for a unit input.
Answer (use a new blank page if there is not enough space to answer):
7/29
(a)
(b)
Figure 4.2: A simple RC filter.
a. Derive the differential equations for the transient state shown in Fig. 4.2.
Answer:
c. If V0 = 5V, R = 10 k, and C = 100 F, plot the transient curve of vC(t) and vR(t) in MATLAB for
t 8 . Compute the time constant, , of the system. Show your work.
Answer:
8/29
d. What kind of filter does the above circuit represent? Using MATLAB, draw a Bode plot justifying
your answer.
Answer (use a new blank page if there is not enough space to answer):
9/29
e. Now we change the resistor to R = 1 M. What happened to the transient curve and Bode plot?
Write your conclusions.
Answer (use a new blank page if there is not enough space to answer):
10/29
T ( s ) = KT ia ( s )
11/29
The back EMF (counter electromotive force) constant, Ke , models the relationship between the
rotational servomotor speed, & , input and the electrical back EMF, eb , produced by the servomotor:
eb (t ) = K e&(t )
The transfer function of the servomotor, with armature drive potential, ea(s), as input and motor speed,
s(s), as output, can be written as [3]
=
=
+ + +
(2.4)
Typically, the inductance of the motor armature, La, is relatively small. Neglecting La yields the low
speed approximation for the DC servomotor transfer function
G (s) =
s ( s)
KT
=
ea ( s) JRa s + (bRa + KT K e )
(2.5)
G ( s) =
s ( s)
KT /(bRa + KT K e )
=
ea ( s) [ JRa /(bRa + KT Ke )]s + 1
(2.6)
Comparing it with (2.1), we obtain the expression for the servomotors gain:
Km =
KT
(bRa + KT K e )
(2.7)
m =
JRa
(bRa + KT Ke )
(2.8)
Km
ms +1
Figure 4.4: Block diagram of the servomotor and amplifier system.
An amplifier is often used to generate the power required to drive the armature voltage on the
servomotor. The amplifier is modeled as a constant gain, Ka. Together, the servomotor and the
amplifier can be modeled as a single first-order system with steady-state gain:
K = Ka Km
(2.9)
= m
(2.10)
12/29
Modeling DC servomotor
For the model of DC servomotor the following parameters are available:
Simulation interval, 0 3 s
Time step (for simulation), t = 0.1 ms
Rotors moment of inertia, J = 0.01 kg m2
Damping ratio, b = 0.1 Nms
Back EMF constant, Ke = 0.01 Nm/A
Torque constant, KT = 0.01 Nm/A
Amplifier gain, Ka = 25
Armature electric resistance, Ra = 1
Armature electric inductance, La = 0.01 H 0.5 H (varying)
a. For the time being we assume that the armature electric inductance, La 0 (negligible
small). Write a MATLAB routine for simulating the step response of the open-loop DC
servomotor system with amplifier driver, ed, as the input and angular speed, & , as the output.
Answer (use a new blank page if there is not enough space to answer):
13/29
b. Now we apply varying armature electric inductances, La, from 0.5 H, 0.3 H, 0.1 H, 0.05 H
down to 0.01 H to our model. Change your MATLAB routine so that it is suitable for such
conditions.
Answer (use a new blank page if there is not enough space to answer):
14/29
&
The transfer function of the mass-spring-damper system, defined with external torque as input and
angular position of the rotor as output, can be written as
G ( s) =
( s)
T ( s)
1
1
k/J
= 2
Js + bs + k k s + (b / J ) s + k / J
(2.16)
The transfer function above bears close resemblance with the standard second-order transfer function.
By comparing (2.11) and (2.16), the expressions for Eigenfrequency and damping ratio can be
obtained as
n2 = k / J
and
2n = b / J so that =
b
2 kJ
(2.17)
It is clear from (2.17) that n and are functions of system parameters J, b, and k, which are typically
fixed. The block diagram of such a system is shown in Fig. 4.6. This system has a transfer function
closely related to the idealized transfer function with the addition of a motor to provide input torque.
1
k/J
2
k s + (b / J ) s + k / J
15/29
This torsional system has an electromechanical gain, Kx that gives the torque-to-voltage-ratio of the
motor drive. If we build the system in Fig. 4.6, we will have a specific second-order response of the
form
(s)
E (s)
= Kx
(s)
T (s)
= K xG ( s ) =
Kx
K
k/J
= x 2
Js + bs + k
k s + (b / J ) s + k / J
2
(2.18)
The Eigenfrequency and damping ratio for this system are the same as (2.16) with a revised DC gain
of Kx /k.
For studying the effect of system parameters on the response, we must be able to change J, b, and k.
We can achieve this by programming the motor to generate the required torques. The torque generated
by the motor is given by the relation
T = K x K h ( K d d K1 K 2&)
(2.19)
where Kh is the amplifier gain, Kd is a voltage-to-angular-deflection ratio and d is the desired output.
Note that KxKhK1 is the type of torque generated by a spring, and K x K h K 2& is the type of torque
generated by a damper. When these torques are applied on the rotor, the feedback will generate
different apparent stiffness and damping, so that the dynamic equation of the system becomes
J&& + b& + k = T
(2.20)
1
k/J
k s 2 + (b / J ) s + k / J
Js 2 + bs + k + K h K x K 2 s + K h K x K1 = K h K x K d d
(2.21)
The block diagram of the programmed system is shown in Fig. 4.7. The transfer function of this
system, with T as input and as output, is
G (s) =
(KhK x Kd )
( k + K h K x K1 ) / J
(s)
=
2
d ( s ) ( k + K h K x K1 ) s + s (b + K h K x K 2 ) / J + ( k + K h K x K1 ) / J
which has the same structure as that in (2.18). The system DC gain is now
16/29
(2.22)
K=
(Kh K x Kd )
(k + K h K x K1 )
(2.23)
and the systems Eigenfrequency and damping ratio are given by the relations
n2 = (k + K h K x K1 ) / J ;
2n = (b + K h K x K 2 ) / J ;
(b + K h K x K 2 )
(k + K h K x K1 ) J
1
2
(2.24)
One of the objectives of this experiment is to study the effects of varying the Eigenfrequency n and
the damping ratio on step response of the torsional mass-spring-damper system. We will investigate
this by varying the gains K1 and K2.
Modeling torsional mass-spring-damper
For modeling the torsional mass-spring-damper system (Fig. 4.5) the following parameters are
available:
a. Write a MATLAB program to find the step response of the above torsional mass-springdamper system with d(s) as input and (s) as output. Investigate the system behavior by
varying the gains K1 and K2. For each combination of K1 and K2 find the systems
Eigenfrequency n and damping ratio . Describe the effect of K1, and K2 respectively, on the
system.
Answer: Please use an extra sheet/page
b. Use Simulink to study the model behavior of torsional mass-spring-damper (Fig. 4.5).
Compare the result with Problem 4.4a.
Answer: Please use an extra sheet/page
17/29
Answer (use a new blank page if there is not enough space to answer):
Mass, m = 2 kg
Spring constant, k = 300 3,000 N/m (varying)
Damping ratio, b = 10 200 kg/s (varying)
Simulation interval, 0 3 s
Time step (for simulation), t = 0.1 ms
b. Draw the block diagram of your model (Fig. 4.8) and simulate the impulse response of the
system using Simulink.
Answer (use a new blank page if there is not enough space to answer):
18/29
19/29
d. Find the system frequency response, i.e. G(s=j), using Bode plot for
i. k = 300 N/m and b = 10 kg/s
ii. k = 3,000 N/m and b = 200 kg/s
Examine these two Bode plots thoroughly. Write your conclusions.
Answer (use a new blank page if there is not enough space to answer):
20/29
Appendix A
List of Useful MATLAB Commands and Functions (adopted from [4])
This is neither a manual nor a course on MATLAB. The only goal is to enable the reader to use the
necessary commands, with bare essential explanation of their syntax and meaning. For a
comprehensive explanation, referring to the help system and the documentation is mandatory.
where num and den are two vectors containing the coefficients of the numerator and denominator
polynomials, ordered by decreasing power of the complex variable s. Once transfer functions are
defined, the mathematical operators +, -, *, and / can be used with them. For example, to define the
transfer functions
= 5
1+
1
, =
1 + 51 + 10
1 + 2
and compute their series S(s), their parallel P(s), and the closed-loop transfer function F(s) of the
negative feedback system having S(s) in the forward path and P(s) in the feedback path, the following
commands are needed.
>> G1 = tf( 5*[1 1], conv( [5 1], [10 1] ) );
>> G2 = tf( 1, [2 1] );
>> S = G1*G2;
>> P = G1+G2;
>> F = S/( 1+S*P );
Note that the MATLAB conv function computes the convolution of two vectors, i.e., the product of
the polynomials having the elements of those vectors as coefficients.
Some additional arguments can be given, and some are optional (e.g., the time vector can be omitted,
and in that case it is chosen automatically), see the MATLAB documentation and help for full details.
The following example computes the responses yi,s,u(t) of the system
21/29
1
1 + 3
Note that operator ^ to be applied element by element have a preceding dot. Plotting the results can be
done for example as follows (Fig. A.1).
>> subplot( 3, 1, 1 );
>> plot( t, yi );
>> subplot( 3, 1, 2 );
>> plot( t, ys );
>> subplot( 3, 1, 3 );
>> plot( t, yu );
22/29
= , = 5
Then, we compute the open-loop transfer function L(s) = R(s)P(s), the sensitivity S(s) = 1/(1+R(s)P(s)),
the complementary sensitivity T(s) = R(s)P(s)/(1+R(s)P(s)), and the control sensitivity C(s) =
R(s)/(1+R(s)P(s)).
Finally, we plot the Bode diagrams of L(jw), S(jw), T(jw), and the responses of the process output y and
the control signal u to a unit step of the reference signal, sampled at 0.01s, for a length of 20s. The
result is shown in Fig. 10.
>> P = tf(1, [1 2 1]);
>> R = 5*(1+tf(1, [1 0]));
>> L = R*P;
>> S = 1/(1+L);
>> C = R*S;
>> T = C*P;
>> t = 0:0.01:20;
>> y = step(T, t);
23/29
24/29
Appendix B
Modeling Differential Equations with Simulink (adopted from [5])
To run Simulink, we must first invoke MATLAB. Make sure that Simulink is installed in your
system. At the MATLAB command prompt (>>), we type:
>> simulink
d 2vc (t )
dv (t )
= k 2 c + k1vc (t ) + k0u0 (t ) .
2
dt
dt
(B.1)
A block diagram representing Eq. B.1 is shown in Fig. B.2. We will use Simulink to draw a similar
block diagram by performing the following steps:
25/29
1. On the Simulink Library Browser, we click the leftmost icon shown as a blank page
on the
top title bar. A new model window named untitled in which we will enter our block diagram
will appear on the screen. We save this later as model file Equation_1.
This is done from the File drop menu where we choose Save as and name the file as
Equation_1. Simulink will automatically add the extension .mdl.
Figure B.4: Dragging the unit step function into Equation_1 model window
2. With the Equation_1 model window and the Simulink Library Browser both visible, we click
the Sources appearing on the left side list, and on the right side we scroll down until we see
the unit step function block shown as Step block. We select and drag it into the Equation_1
model window (Fig. B.4).
3. Assume that the constants in Eq. B.1 are k0 = 3, k1 = -3 and k2 = -4, and the input u0 is a unit
step function. With reference to block diagram of Fig. B.2, we observe that we need to
connect an amplifier with Gain 3 to the unit step function block. The Gain block is under
Math Operation blocks. If the Equation_1 model window is no longer visible, it can be
recalled by clicking on the white page icon on the top bar of the Simulink Library Browser.
26/29
4. We choose the Gain block then drag it to the right of the Step block (unit step function). The
triangle on the right side of the unit step function block and the > symbols on the left and right
sides of the gain block are connection points. We point the mouse close to the connection
point of the unit step function until it shows as a cross hair, and draw a straight line to connect
the two blocks. We double-click the Gain block, and on the Function Block Parameters we
change the gain from unity to 3 (Fig. B.5).
Figure B.6: File Equation_1 with Add block and connections between the blocks.
5. Next, we need to add a three-input Adder or Sum. The Adder/Sum block appears on the right
side of the Simulink Library Browser under Math Operations. We select it, and we drag it into
the Equation_1 model window. We double click it, and on the Function Block Parameters
window which appears, we specify 3 inputs. We then connect the output of the Step block to
the input of the Gain block, and the output of the of the Gain block to the first input of the
Add block as shown in Fig. B.6.
6. Now, from the Continuous block we choose the Integrator block, drag it into the Equation_1
model window, and connect it to the output of the Add block. We repeat this step to add a
second Integrator block. We click the text Integrator under the first integrator block, and we
change it to Integrator 1. Then, we change the text Integrator 1 under the second Integrator
to Integrator 2 as shown in Fig. B.7.
7. To complete the model, we add the Scope block which is found in the Sink blocks, then
connect it with the Integrator 2. Further we click the Gain block, and we copy and paste it
twice. We flip the pasted Gain blocks by using the Flip Block command from the Format
drop menu, and we label these as Gain 2 and Gain 3. Finally, we double-click these gain
blocks, and in the Function Block Parameters dialog box. We change the gains in Gain 2 and
Gain 3 blocks from unity to -4 and -3 as shown in Fig. B.8.
27/29
Figure
igure B.8:
B. File Equation_1 complete block diagram.
Integrator blocks and entering the values for the first integrator, and for the second integrator
integrator,
respectively.. To obtain a true picture of the output, we double-click the Unit block and in the
Source Block Parameters window.
window We change the Step time value from 1 to 0. We leave all
other parameters in their default state. We also need to specify the simulation time. This is
done by specifying the simulation time to be 10 seconds on the Configuration Parameters
from the Simulation drop menu. We can start the simulatio
simulation
n by clicking the icon
.
Figure
igure B.9:
B. The waveform for the function vc(t).
9. To see the output waveform, we double click the Scope block, and clicking on the Autoscale
icon
. Then we right-click
click near the vertical axis, we click on Axes properties,
properties we specify
Y-min = 0, Y-max = 1.5, we click OK, and we obtain
in the waveform shown in F
Fig. B.9.
(t a ) = 0 for t a .
(t )dt = 1 .
(4.2)
Eq. (4.2) is also known as Dirac delta function. To simulate unit impulse in Simulink, we use
a two-block
block step function set as shown in Fig. B.10.
28/29
29/29
Laboratory Manual
Experiment 2
Experiment 4
by
Dr. Iskandar Al-Thani Mahmood
Table of Contents
1. Objectives
2. Background
3. PID Controller
5. Conclusion
12
2/15
1. Objectives
The objectives of this experiment are:
To tune a PID controller for a system/plant using MATLAB.
To investigate the features of each proportional (P), integral (I) and derivatives (D) controller to the plant.
In this experiment, DC motor speed control is chosen as the system/plant.
2. Background
The plant of DC motor is a good example of a dynamic system that includes both mechanical dynamic due to
inertia and viscous damping and the electrical dynamic due conductance and resistance of the motor. The
resulting model is a second order. The control objectives are to have a fast response to a step input (i.e. speed
change or position change) with small overshoot and small steady-state error
3/15
T ( s) = KT ia ( s)
(1)
eb (t ) = K e&(t )
(2)
In SI units, Kt. is equal to Ke, (KT = Ke = K). From the above figures, the following equations based on
Newtons law combined with Kirchhoffs law can be derived:
(3)
di
+ Ria = ea K&
dt
(4)
s( Js + b ) (s ) = KI a (s )
(5)
(Ls + R )I a (s ) = Ea (s ) Ks (s )
(6)
By eliminating I(s), the open-loop transfer function where the rotational speed ( & ) is the output and the
voltage (Ea) is the input can be obtained as:
s
0.01
(7)
(8)
Note that, we are going to design PID controller for this transfer function in this lab.
3. PID Controller
PID controller is the most popular controller in many applications. The block diagram of a closed-loop control
system is illustrated as:
U
R
4/15
(9)
In some cases only combination of PI or PD controller is sufficient to achieve the required specification.
!
" #
(10)
(11)
The value of the KP, KI and KD can be theoretically calculated or tuned to compensate the plant in order to achieve
the desired performance of the system, in terms of setting time, rise time, steady state error and percentage of
overshoot.
4. Simulation Procedure
Basic requirement of a motor is that it should rotate at the desired speed and the steady-state error of the
motor speed should be small. Other performance requirement is that the motor must accelerate to its
steady-state speed as soon as it turned on. Since any speed faster than the reference speed may damage
the motor, the percentage overshoot is also need to be limited.
For this lab, the motor speed output should have the following desired specifications:
Settling time (Ts) 2 seconds
Percentage overshoot (PO) 5 %
Steady-state error (Ess) 1 %
Note:
For step no. 1 to 6, please include in your answers the relevant MATLAB script, Simulink
In Simulink, the following block diagrams may be used to represent transfer function:
5/15
Tr
PO
Ess
Comments
6/15
2.
Modify the open-loop block diagram to include feedback system with a proportional controller
P with Kp = 100. Obtain the closed-loop step response and give comments on the performance (Ts, PO
and Ess).
Answer:
Tr
PO
Ess
Comments
7/15
3.
Replace the proportional P controller with a proportional-derivative PD controller with KP = 100 and KD
= 1 (small KD). Obtain the closed-loop step response and give comments on the PO and Ess as
compared to the P controlled in step no. 2.
Answer:
Tr
PO
Ess
Comments
8/15
4.
Tr
PO
Ess
Comments
9/15
5.
Tune the PID controller by increasing KI = 200 (KP =100, KD = 1). Obtain the closed-loop step response.
Determine whether all the desired specifications have been satisfied and give comments.
Answer:
Tr
PO
Ess
Comments
10/15
6.
Retune the PID controller by increasing KD = 10 (KP =100, KI = 200). Obtain the closed-loop step
response. Determine whether all the desired specifications have been satisfied and give comments.
Answer:
Tr
PO
Ess
Comments
11/15
5. Experimental Procedure
5.1. Assemble in accordance with the diagram (Fig.
(Fig.3).
5.2. Adjust the setpoint integrator to , S1=Off.
5.3. Adjust the setpoint value to =0o(360o), and the output voltage to U = 0.0v with the "zero" adjuster.
5.4. Adjust the setpoint value to =90o, and U= 5.0 v with the "scale" adjuster.
5.5. Connect the output of the set point potentiometer directly to the input of the DC-Servo
DC
with
amplifier (PID-controller
controller inputs and outputs are disconnected).
5.6. What does control mean?
P Controller
5.7. Make the connections with the PID controller block added and adjust Kp=1.0; Ki=off; Kd=off.
5.8. Record the values for Table 1.
5.9. Start with Kp=1*1, 2*1, 3*1. (Bottom gain adjuster is a multiplier)
5.10.
Then adjust the potentiometer to Kp=5*1 and Kp=1
Kp=10*1
5.11.
Subsequently, set Kp=10*100.
p=10*100. Explain the results!
5.12.
12/15
PI Controller
5.13.
5.14.
5.15.
5.16.
5.17.
Adjust Kp = 1.0 ; Ki=off; Kd=off. S1 = off and the adjusting disc of the servo to = 0o.
Connect S1 to "on". Now set Ki=0.5*1 and turn the Ioff switch up.
Record the step response of the control loop with the help of the oscilloscope, explain how the
integral control operates?
5.18. Make the following adjustments (PID Controller): Kp=200, Ki=0.5, Kd= 0.05.
5.19. Record the step response.
5.20.
5.21.
13/15
6. Conclusion
Answer:
14/15
15/15
MCT 3159
EXPERIMENTS 3: Application of
operational amplifiers and encoders in
control systems.
Part 1 Half wave and full wave precision rectifiers
(Analog Electronics Laboratory)
1.3 THEORY/BACKGROUND
Terms to Learn
Ideal diode a diode with zero forward voltage drop and zero reverse current.
Linearize change a nonlinear characteristic to a linear characteristic. Voltagecurrent characteristic the graph of voltage (X axis) versus current (Y axis) between
two terminals of a device.
A Basic Op-Amp Rectifier
Passive rectifiers those that use diodes in half or full wave configurations are fine for
rectifying large signals if the circuit is forgiving of the diodes forward voltage drop,
VF. For small signals, meaning those much smaller than VF, passive rectifiers dont
work well at all. Wouldnt it be nice if we could order an ideal diode? Vendors are often
out of stock of ideal diodes, but we can make one by using the analog designers
favorite tool, an op-amp. Semiconductor diodes turn on a little slowly before reaching
a relatively constant voltage drop of 0.6 to 0.7 V (silicon) or 0.3 V (germanium). In a
full wave circuit, this causes crossover distortion in the region the signal changes from
forward to reverse current. Signals much smaller than VF are attenuated as well, in both
full and half wave circuits. By using feedback in an active circuit as shown in Figure
1.1, we can use the op-amps high gain to liberalize the non-linear voltage-current (V-I)
characteristics of a diodes PN junction. (A resistors V-I characteristic is a straight line
with a slope of A/V equal to its resistance in ohms.)
1.4 EQUIPMENT:
Oscilloscope
Function Generator
Digital multimeter
15V DC Power Supply
Figure 1.1 The V-I characteristic curves for ideal and real diodes, showing VF
for real
Diodes. At B, a simple half-wave rectifier circuit with an adjustable load
for measurements.
Laboratory Procedure:
NOTE: Set V+ to +15V and V- to -15V. The bypass capacitors can be 0.1NF to 1 NF
ceramic. Use LM741 op-amps and 1N4148 diodes unless directed otherwise.
Display VO vs time on the scope unless directed otherwise.
1. Build the precision half-wave rectifier circuit shown in Fig.1.3. You will need to
replace the diode and op-amp later so try to leave room to do this without having to
rebuild the whole circuit.
2. Apply a 3 Vpp sine wave at 500 Hz as Vin and capture the output waveform
across R1.
3. Use a square wave of 1Vpp and a period of 10 ms. for Vin. Capture VO.
4. Use a triangle wave of 1Vpp and a period of 10 ms. for Vin. Capture VO.
5. Reverse the polarity of D1 and repeat step 2.
6. Display VO versus Vin in x-y mode and capture the waveform.
7.
Increase the frequency from 500Hz to 5MHz in steps of one decade and record VOpeak.
8.
Vplus
Vminus
4
5
D1
1N4148
Vo
2
3
GND
C1
0.1
C2
0.1
LF356
U1
R1
1K to 10K
Va
7
1
Vin
Vminus
GND
Vplus
4
5
V m in u s
D1 1N4148
7
1
C1
0.1
Vplus
V m inu s
R1
2
1K to 10K
C2C 3
0.1 0.1
C4
0.1
4
5
GND
V m in u s
V p lu s
R2 = R1
D2 1N4148
6
LF356
U2
7
1
Vin
6
LF356
U1
Vplus
Vo
R3
1K to 10K
GND
4
5
V m in u s
2
3
V p lu s
R2 = R1
C1
0.1
Vplus
GND
V m in u s
U1
7
1
Vin
D1 1N4148
6
LF356
C2C 3
0.1 0.1
C4
0.1
4
5
V m inu s
R1
2
3
Vo
U2
R3
1K to 10K
7
1
1K to 10K
D2 1N4148
LF356
Vplus
GND
Vplus
R2
2
Vin
2R1
Vminus
R1 1K to 10K
4
5
Vminus
C1
0.1
D1 1N4148
LF356
Vo
U1
GND
7
1
C2
0.1
R3
10K
Vplus
GND
Vplus
7
1
Vplus
Vin
GND
+
LF356
Vminus
6
C1
0.1
C2
0.1
4
5
U1
Vminus
D1-D4
4 * 1N4148
Io
R1
820 to 1.2K
Fig 1.7 Single Op-Amp Precision Full-Wave Rectifier with current output.
Result
1. For the circuit given in Fig 1.3, Fig 1.4, Fig 1.5, Fig 1.6 and Fig 1.7 determine the values of
Vi and VO
DC volt
Vi
Vo
Vi
Vo
0.7
0.8
0.9
1.0
1.5
1.6
-0.7
-0.8
-0.9
-1.0
-1.5
-1.6
Voltage
1.7 1.8
-1.7
-1.8
1.9
2.0
2.5
-1.9
-2.0
-2.5
3.0
-3.0 -4
-5
2. Sketching VO with respect to time given Vin = 10 sin 2ft for the rectifier circuit
shown in Fig. 1.4. Assume f = 200 kHz (6 points).
3. Sketch the VO vs. Vin relationship for both the full wave rectifiers shown in Fig. 1.4 and Fig.
1.5. Compare them. Give the width of the dead zone for both cases. Assume that the open loop
gain of the op amp is 105. (7 points)
Discussion:
1. Explain the operation of one of the circuits tested. Specify the Fig. number of the
circuit you are explaining.
2. Explain what happens when the polarities of the diodes are reversed during parts of the
experiment.
3. Explain why one full-wave rectifier circuit is called "precision". Specify the Fig.
number of the circuit you are explaining.
4. Explain why the single op-amp rectifier output changes with frequency.
5. Explain which component is more important for frequency response in the half wave
precision rectifier circuit. The diode or the op-amp. Why?
6. Could any of these circuits be used to determine VRMS for sine waves? How would you
do that? How about for triangle waves?
Experiment 4
3.1 OBJECTIVES
The objectives of the experiment are to:
3.2 THEORY/BACKGROUND
Background Theory:
An active filter is a type of analog electronic filter, distinguished by the use of one or
more active components i.e. voltage amplifiers or buffer amplifiers. Typically this will
be a vacuum tube, transistor or operational amplifier.
There are two principal reasons for the use of active filters. The first is that the amplifier
powering the filter can be used to shape the filter's response, e.g., how quickly and how
steeply it moves from its pass band into its stop band. (To do this passively, one must use
inductors, which tend to pick up surrounding electromagnetic signals and are often quite
physically large.) The second is that the amplifier powering the filter can be used to
buffer the filter from the electronic components it drives. This is often necessary so that
they do not affect the filter's actions.
A high-pass filter is a filter that passes high frequencies well, but attenuates (or reduces)
frequencies lower than the cutoff frequency. The actual amount of attenuation for each
frequency varies from filter to filter. It is sometimes called a low-cut filter; the
terms bass-cut filter or rumble filter are also used in audio applications. A high-pass
filter is the opposite of a low-pass filter, and a band-pass filter is a combination of a highpass and a low-pass.
3.3 EQUIPMENT:
Equipment/Devices Required
Low Pass and High Pass Filters
Oscilloscope
Multimeter
Breadboard and wire
Power Supply (15 VDC)
Function Generator
Op-amp: LM741
Capacitors: 0.01uF, 0.1uF
Resistors: 1k ohm, 22k ohm, 10kohm
3.4 Laboratory Procedure
1. Using power supply voltages of 15 VDC for the op-amp, construct an inverting
amplifier circuit.
2. Calculate the cutoff frequency (f c ) for the circuit using the measured values of the
components. Add two extra 0.1 F capacitors to the circuit. One should be connected
between the + DC supply (pin 4) and ground the other should be connected between the
- DC supply(pin 11) and ground. These capacitors are to help prevent oscillation in the
amplifier circuit due to interaction between the circuit and the power supply. They
should be placed as close to the Op-Amp itself as physically possible. Make sure that
the circuit is correctly connected before turning on the power supply voltages. Failure
to do so may cause the op-amp to saturate and in some cases cause permanent damage
to the op-amp.
3. Set the signal input, V in, to zero. That is replacing the signal source, Vin, with a short
circuit to ground. Carefully measure the DC output voltage. Make sure you record the
proper sign; It should be between +50 mV and -50 mV, usually very small. This output
with no input is called the output offset voltage. It is an error in the output of the circuit.
It can be treated as an equivalent input offset voltage applied to the non-inverting input
of the op-amp. The equivalent input offset is calculated by dividing the measured output
offset by the gain of the amplifier from the non-inverting input, Av = (1 + R f /R i ). This
offset has no effect on the ac operation of the circuit, but can cause errors in dc
measurements of small voltages.
n
4. Use a signal input voltage, Vin, of 0.1 VDC and connect it to the amplifier signal input as Vin.
Using a digital Multi-meter, measure and record both Vin and Vout as accurately as possible.
Calculate the DC voltage gain both with and without correcting the output
voltage by subtracting the output offset voltage measured in step 2 from the measured
output voltage. Be sure to use the correct sign on the offset voltage. Repeat this
measurement and calculation with Vin = 1.0 VDC.
Vo
70.7% Vo
Pass Region
f
fc
Figure 3.1
A basic first order LPF is as shown in Figure 3.2 below. This is also known as single pole LPF
because it has a pole or intersection with one set of RC components. This LPF can yield a roll of
rate of approximately -20dB/decade above the critical frequency fc, as seen in Figure 3.3.
Figure 3.2
Av (dB)
0
-3
-20db/decade
-20
fc
10fc
Figure 3.3
The critical frequency is given as :
fc = 1/ 2R3C1 (Hz)
The bandwidth :
BW = fc
Av (dB)
0
-40db/decade
-60 _
fc
Figure 3.4
100fc
fc =
1
2
Hz
R2 R3 C1 C2
So, fc =
Hz
2RC
Procedures:
1. Connect the required DC power supply to the 15V, -15V & GND terminals.
2. Consider the 1st order LPF circuit. R1 is set to 1K Ohm.
3. Set RF to 1k Ohm, R3 = 22K Ohm and C1 = 0.01uF. Calculate the critical
frequency for this 1st order LPF. _________________________
4. Calculate the gain
5. Using a function generator, input a sine wave with a frequency below and above the
resonant frequency and observe the two set of output frequencies.
Explain you results. _______________________________
6. Consider the 2nd order LPF circuit. R1 is set to 1K Ohm.
7. Set RF to 1k Ohm, R2 = R3 = 22K-Ohm and C1 = C2 = 0.01uF.
8. Calculate the critical frequency for this 2nd order LPF
9. Calculate the gain
10.
Using a function generator, input a sine wave with a frequency below and above
the resonant frequency and observe the two set of output frequencies using an
oscilloscope.
Explain you results. _______________________________
fc
Figure 3.5
Figure 3.6 shows a standard 1st order HPF (single pole HPF) and its characteristic response plot.
Figure 3.6
Av(dB)
0
-3
-20
fc
A = 1 + Rf/R1
A 2nd order HPF is shown in Figure 3.7 and is used when higher roll off rate is required.
The cut off frequency is given as :
fc = 1/2RC
Where R = R2 = R3
C = C1 = C2
Figure 3.7
Procedures:
Connect the required DC power supply to the 15V, -15V & GND terminals.
Consider the 1st order HPF circuit. R1 is set to 1K Ohm.
Set RF to 1k Ohm, R2 = 10KOhm and C2 = 0.1uF.
Calculate the cut off frequency for this 1st order HPF. ___________________________
Calculate the gain. __________________
Using a function generator, input a sine wave with a frequency below and above the resonant
frequency and observe these two set of output frequencies.
Explain you results. _______________________________
7. Now, consider the 2nd order HPF circuit. R1 is set to 1K Ohm.
8. Set RF to 1k Ohm, R2 = R3 = 10KOhm and C2 = C1 = 0.1uF.
9. Calculate the cut off frequency for this 2nd order HPF. ___________________________
10. Calculate the gain. __________________
11. Using a function generator, input a sine wave with a frequency below and above the resonant
frequency and observe these two set of output frequencies using an
oscilloscope. Explain you results. _______________________________
1.
2.
3.
4.
5.
6.
1. Apply an input of 1V AC and obtain plots for AC response plot of the output for a
frequency range of 1Hz to 1MHz.(Low pass filter)
2. Apply an input of 1V AC and obtain plots for AC response plot of the output for a
frequency range of 1Hz to 1MHz.(High pass filter)
3.4 Discussion:
Items For Discussion:
Questions and answers
1. List five important filter specifications and explain the importance of
each.
2. What are the advantages of active-RC implementations of filters
over passive RC implementations?
3. What happened to the high-pass filter responses at higher
frequencies? Should that happen ideally? If so why? If not explain
which component is responsible and how it is responsible.
Expeerimentt 5
Calibration & Characteriization of Senssors
Objectiive:
The
T purposes of this experiment
e
t are:
To
T acquaintt you with common analog
a
sensor,
To
T demonsttrate you how
h to integrate sensoor to the syystem
To
T familiar you to callibrate the sensor
To
T acquaintt you to ch
haracterize the sensorr
ng outcom
me
Learnin
Desiign and implement op
perational amplifiers in instrum
mentation aapplicationns.
Introdu
uction:
Force Sensing
S
Resistor (FSR
R) is a pollymer thickk film (PTF) device which exhhibits
a decreaase in resisstance with
h an increaase in the force appllied to the active surfface.
Its forcce sensitiviity is optiimized forr use in hhuman touuch controll of electrronic
devices. FSRs arre not a load
l
cell or strain gauge, though theyy have sim
milar
propertiies. FSRs are not suiitable for precision
p
m
measuremeents. Fig. 1 show typpical
construcction of FSR. In gen
neral, FSR
R response approxim
mately folloows an invverse
power-llaw characteristic (ro
oughly 1/R)).
Fig.
F 1 FSR constructio
on
EQUIPMEN
E
NT:
Oscilloscop
O
pe
Function
F
Generator
Digital
D
mulltimeter
15V
DC Power
P
Supp
ply
Laboratory
L
Proceduree:
Construct
C
th
he circuit as
a shown in
n Fig.2.
Value
V
of RM
M is given
n in table 1
Table
T
1:
RM
R
RM
R
RM
R
RM
R
RM
R
RM
R
Koohm
3
10
30
47
100
KULLIYYAH OF ENGINEERING
DEPARTMENT OF MECHATRONICS ENGINEERING
Laboratory Manual
MECHATRONICS
ENGINEERING LAB II
(MCT 3159)
Pneumatic control
EXPERIMENT 6
Pneumatic EXPERIMENTS
6.1
OBJECTIVES
Understand the operation of the single acting cylinder and its direct
control with a way N.C. valve.
DESCRIPTION
A single acting cylinder has to be controlled by a 3/2 way N.C. valve
operated by a push-button in such a way that when pressing it the
cylinder extends and when released the cylinder returns to the starting
position.
IMPLEMENTATION SEQUENCE
1. Make up the diagram with standard symbols.
2. Connect the pneumatic elements in the assembly panel and check
their working order.
3. Describe the sequence of operation.
6.2
OBJECTIVES
-To understand the concept of indirect control
-To understand the concept of OR operation
-To understand the concept of Memory valve
DESCRIPTION
-
A double acting cylinder will move by means of any of the push button
valve
- With the activation of a second 3/2 way valve operated by pushbutton the corresponding signal will be produced in order to activate
the valve that will move the cylinder.
- The cylinder will extend when pressing the push-button and will
retract after reaching the full extension.
IMPLEMENTATION SEQUENCE
1. Make up the diagram with standard symbols.
2. Connect the pneumatic elements in the assembly panel and check
their working order.
3. Describe the sequence of operation.
6.3
OBJECTIVES
-To understand the concept AND operation
-To understand the concept of reciprocating cycle for pneumatic
system
- To understand the use of limit switch valve
DESCRIPTION
-
KULLIYYAH OF ENGINEERING
Laboratory Manual
MECHATRONICS
ENGINEERING LAB II
(MCT 3159)
PLC control
EXPERIMENT 7
PLC EXPERIMENTS
7.1
OBJECTIVES
The objective of these experiments is to understand the concept of
PLC programming and PLC integration with various sensors, switches and
actuator.
DESCRIPTION
Typical PLC hardware connection is shown in Fig. 1 and Fig.2
Program 2:
A. Turn on an output ten second after a NO connection and a NC
connection is executed.
B. Keep an output ON for ten second as a NO connection and a
NC connection is executed.
Program 3:
A. Two inputs need to be true for a TON timer to be enabled.
Timer done bit will execute a double acting cylinder to move
forward. Another push button will cause it to move opposite.
A counter will count no of cycle of the double acting cylinder
and will execute a single acting cylinder move command after
five cycle.
B. Use RTO timer done bit and timing bit to move cylinders.
Describe the difference between RTO and TO timer.
Program 4:
Develop a complex program using several component of PLC which
you have learnt in this experiment.
To
T develop a model for position
p
contrrol for DC m
motor
To
T implemen
nt feedback control
c
for th
he DC motorr position coontrol in simuulation.
To
T implemen
nt op-amp baased DC mottor position ccontrol (clossed loop).
Compare
C
the performancee of the conttrol for P, PII and PID coontrol.
2. Review
w:
2.1. Mod
delling and Simulation
S
The plantt of DC motor is a good example
e
of a dynamic sysstem that inclludes both m
mechanical
dynamic due to inertia
a and viscous
s damping an
nd the electrrical dynamicc due conducctance and
or. The resultting model is
s a second orrder. The con
ntrol objectivves are to havve a
resistance of the moto
onse to a ste
ep input (i.e. speed
s
chang
ge or position
n change) witth small overrshoot and sm
mall
fast respo
steady-sttate error. Ex
xperiment 4 already
a
coverred the DC m
motor position
n control exp
periment for a
an
existing setup.
s
Fig. 1 (from experim
ment 4) show
ws electrical e
equivalent fo
or DC motor ssystem.
a (b) sketch of a DC mo
otor [1]
Figure 1: (a) Schemattic diagram and
em variables of a DC mottor include:
The syste
ea: armature drive potential
p
(V)
k EMF or cou
unter-electromotive-force (V)
eb: back
ia: arma
ature current (A)
T: torqu
ue produced by servomottor (Nm)
: angu
ular position of
o rotor (rad)
ddtsspeed of the
e rotor
: angular speed of rotor (rad/s)
sical parametters of the sy
ystem include
e:
The phys
Ra: arm
mature electric
c resistance ()
La : arm
mature electric
c inductance
e (H)
J: rotors moment off inertia (Nms
s2/rad)
b: damp
ping ratio (Nm
ms)
KT: torq
que constant (Nm/A)
Ke: back EMF consttant (Nm/A)
modeling and
d simulation o
of DC motor
Follow the procedure described in experiment 4 to do the m
c
The physical
p
para
ameters of th
he motor can be known w
when you purcchase the
position control.
compone
ents during ac
ctual implementation.
sical impleme
entation of the controller;
2.2. Phys
E
l setup:
a. Experimenta
sical setup fo
or DC motor position conttrol is describ
bed in Fig. 2.. You are
The approximate phys
t design you
ur system ac
ccordingly. Th
he potentiom
meter (feedba
ack sensor) iss connected to
required to
the motorr through gea
ar.
Fig 2: The
e physical se
etup for DC motor
m
position
n control.
S
Bufferring:
b. Signal
ple shows tha
at iA = 0 and vA = 0. Whicch gives from
m KVL (fig. 3)
Basic Op-AMP princip
And
oltage followe
er
Fig. 3: Vo
S
Subtra
action:
c. Signal
For the op
o amp, we see
s that vN vB , and thee current enteering the op amp inputs is zero.
From KC
CL we get (F
Fig.4)
Fig. 4: Sig
gnal subtracttion
at node vN:
------------------------------(1)
at node vB:
----------------------------------(2)
Assume
and realizing vN vB
Then
d. Signal
S
Gain and
a inversio
on:
uit in Fig. 5 sh
hows signal inversion and
d amplificatio
on.
The circu
Fig. 5: Inv
verting amplifier
aabove then w
we get
Fig.6 : Op
p-amp based
d derivative circuit.
c
es,
KCL and node vN give
Hence,
f. In
ntegration by
b Op-Amp
p circuit:
Fig.7 : Op
p-amp based
d integral circ
cuit.
KCL at node
n
vN givess (Fig. 7)
Hence,
g. Summing Am
mplifier:
Fig.8 sho
ows summing amplifier circuit.
c
Fig. 8: Su
umming amp
plifier
KCl at vN gives,
Realizing
g
h. PID
P Controller:
Fig. 9 sho
ows the com
mplete PID co
ontroller usiing differentt op-amp circcuits.
3. Conclusion:
In your PID controller you will start out by setting up two pots as voltage dividers; one to
represent the set point and the other to represent the process variable (this pot will be replaced by
actual pot geared with the motor as shown in Fig.2). The difference between the
voltage outputs will be the error. Therefore, when both pots are set to the same resistance the
two voltages will be the same, and there will be no error. You will also put buffer op amps in
front of the pots so that changing their resistances does not affect the voltages throughout the rest
of the controller.
Now that your controller is complete, you can hook it up to a motor and have it control a
physical system. However, the op amps you have been using are not designed to output large
currents. You will need to increase the current output of your controller using a power op amp
and a pot.
x: (PID Contro
oller)
Appendix