MATLAB
Β Hello i have homework that need to solve using MATLABΒ
Assignment6: Simulink
Solve this equation using the Simulink.
– (optional) πΉ =
3π₯3+|π₯|
π₯1/2
– (optional) π = β« sin(π‘) + 5 cos(π‘) ππ‘ where y(0)=0,
– π = β« sin(π‘) + 5 cos(π‘) ππ‘ where y(0)=1,
– (optional) π¦ = 10 β sin(2π‘) + ππππ π
–
ππ¦
ππ‘
= π‘4 + 10π¦ + ππ’ππ ππ
– οΏ½ΜοΏ½ = β30οΏ½ΜοΏ½ β 4π¦2 + 10 β sin(5π‘) + 5
Assignment5: transfer function for solving ODE
Derive the differential equation for the following mass spring damper mechanism, Find the transfer
function; find its step input. Find the max overshoot, settling time, rise time.
π = 10, π2 = 3 πππ π‘βπ πππππππ ππππππππππ‘ ππ π = 1
Determine the transfer function of the following diagram using MatLab, where
πΊ1 = πΊ2 = πΊ3 = πΊ5 = πΊ5 = πΊ6 =
1
2π + 10
And π»1 = π»2 =
1
π +0.1
Find the block reduction using matlab commands, then ind the step response of the system.
Assignment5: transfer function for electrical system:
– Find the transfer function for the following RC circuit. π = 1 π πβπ and πΆ = 220 ππ
Find the step input,
Find the transfer function for the RC circuit with the step input response as shown in the following plot.
If the π = 1000, What is the value of the C .
(optional question):
Find the differential equation of the following RLC circuit.
Find the transfer function of ππ(π )
Find the step input with π = 1 ππβπ πΏ = 1 ππ» πΆ = 1 ππ
Assignment 9:
Disturbance signals represent unwanted inputs which affect the control-system’s output, and result in an
increase of the system error. It is the job of the control-system engineer to properly design the control
system to partially eliminate the affects of disturbances on the output and system error.
Overview for disturbance input problem:
The construction of the tunnel under the English Channel from France to the Great Britain began in December
1987. The first connection of the boring tunnels from each country was achieved in November 1990. The tunnel
is 23.5 miles long and bored 200 feet below sea level. Costing $14 billion, it was completed in 1992 making it
possible for a train to travel from London to Paris in three hours.
The machine operated from both ends of the channel, bored towards the middle. To link up accurately in the
middle of the channel, a laser guidance system kept the machines precisely aligned. A model of the boring
machine control is shown in the figure, where Y(s) is the actual angle of direction of travel of the boring
machine and R(s) is the desired angle. The effect of load on the machine is represented by the disturbance,
Td(s).
Figure: A block diagram model of a boring machine control system
Transfer function from R(s) to Y(s)
Assume Td(s) = 0 then the block diagram will be
Due to unit step β r(s) for K=20
% Response to a Unit Step Input R(s)=1/s for K=10
numg=[1];deng=[1 1 0];plant=tf(numg,deng);
K =10;
num=[11 K]; den=[0 1];
contr=tf(num,den);
sys_s=series(contr,plant)
sys=feedback(sys_s,[1]);
stepinfo(sys)
Repeat this for K=20, 50 and 100.
Gc(s)
Controller
K + 11s
G(s)
Plant
1
s(s + 1)
–
+ R(s)
Desired
Angle
Y(s)
Angle +
+
Td(s)
Gc(s)
Controller
K + 11s
G(s)
Plant
1
s(s + 1)
–
+ R(s)
Desired
Angle
Y(s)
Angle
Transfer function from Td(s) to Y(s)
Assume R(s) = 0 then the block diagram will be
Due to unit disturbance β Td(s) for K=20
% Response to a Unit Step Input R(s)=1/s for K=10
numg=[1];deng=[1 1 0];plant=tf(numg,deng);
K =10;
num=[11 K]; den=[0 1];
contr=tf(num,den);
sys=feedback(plant,contr);
stepinfo(sys)
Repeat this for K=20, 50 and 100.
Exercise 3:
a) For each case find the percentage overshoot(%O.S.), rise time, settling time, steady state of y(t)
Unit Step Input Unit Step Disturbance
Overshoot Rise Time
Setting
time
Steady
state
Overshoot Rise Time
Setting
time
Steady
state
K=10
K=20
K=50
K=100
b) Compare the results of the two cases and investigate the effect of changing the controller gain on the
influence of the disturbance on the system output
G(s)
Plant
1
s(s + 1)
–
+ Td(s) Y(s)
Angle
Gc(s)
Controller
K + 11s
Assignment8:
Ex1: Control systems open loop and closed loop:
For the following RC circuit find its transfer function. R=10 000 ohm, C= 500*10-6 f .
–
Find the open loop time constant.
– Design a control system to drive this circuit such that the control algorithm is
π£π = π β π, where π
=
π£ππ β π£π and π£ππ is the set point.
– Find k that makes the closed loop time constant is 2 sec.
– Find k that makes the system pole at -10 ;
– Draw the root locus plot for the system.
– Find the final value for the closed loop system with step input.
– Use Matlab to show the step response for both the open loop and closed loop systems.
– Use Simulink to simulate the closed loop system and the open loop system.
ππ = ππ =
4
πππ
π. π. = 100πβππ/β1βπ
2
Overview Second Order Systems:
Consider the following Mass-Spring system shown in the Figure 2. Where K is the spring
constant, B is the friction coefficient,
x(t)
is the displacement and F(t) is the applied force:
Figure 2. Mass-Spring syste
m
The differential equation for the above Mass-Spring system can be derived as follows
π
π2π₯(π‘)
ππ‘2
+ π΅
ππ₯(π‘)
ππ‘
+ πΎπ₯(π‘) = πΉ(π‘)
Applying the Laplace transformation we get
(ππ 2 + π΅π + πΎ) β π(π ) = πΉ(π )
provided that, all the initial conditions are zeros. Then the transfer function representation of the
system is given by
ππΉ =
ππ’π‘ππ’π‘
πΌπππ’π‘
=
π(π )
πΉ(π )
=
1
(ππ 2 + π΅π + πΎ)
The above system is known as a second order system.
The generalized notation for a second order system described above can be written as
2
2 2
( ) ( )
2
n
n n
Y s R s
s s
ο·
οΊο· ο·
=
+ +
With the step input applied to the system, we obtain
2
2 2
( )
( 2 )
n
n n
Y s
s s s
ο·
οΊο· ο·
=
+ +
for which the transient output, as obtained from the Laplace transform table (Table 2.3,
Textbook), is
2 1
2
1
( ) 1 sin( 1 cos ( ))
1
nt
n
y t e t
οΊο·
ο· οΊ
οΊ
οΊ
β β
= β β +
β
K
M
B
F(t)
x(t)
where 0 < ΞΆ < 1. The transient response of the system changes for different values of damping
ratio, ΞΆ. Standard performance measures for a second order feedback system are defined in terms
of step response of a system. Where, the response of the second order system is shown below.
The performance measures could be described as follows:
Rise Time: The time for a system to respond to a step input and attains a response equal to a
percentage of the magnitude of the input. The 0-100% rise time, Tr, measures the time to 100%
of the magnitude of the input. Alternatively, Tr1, measures the time from 10% to 90% of the
response to the step input.
Peak Time: The time for a system to respond to a step input and rise to peak response.
Overshoot: The amount by which the system output response proceeds beyond the desired
response. It is calculated as
P.O.= 100%t
p
M
f
f
ο΅
ο΅
β
ο΄
where MPt is the peak value of the time response, and fv is the final value of the response. And it
is approximately equal to
π. π. = 100πβππ/β1βπ
2
Settling Time: The time required for the systemβs output to settle within a certain percentage of
the input amplitude (which is usually taken as 2%). Then, settling time, Ts, is calculated as
4
s
n
T
οΊο·
=
Exercise 2: Effect of damping ratio ΞΆ on performance measures. For a single-loop second order
feedback system given below
Find the step response of the system for values of Οn = 1 and ΞΆ = 0.1, 0.4, 0.7, 1.0 and 2.0. Plot
all the results in the same figure window and fill the following table. Use βstepinfoβ
ΞΆ Rise time Peak Time % Overshoot Settling time Steady state value
0.1
0.4
0.7
1.0
2.0
R(s)
E(s)
Y(s)
+
–
Exercise 3: Design of a Second order feedback system based on performances.
For the motor system given below, we need to design feedback such that the overshoot is limited
and there is less oscillatory nature in the response based on the specifications provided in the
table. Assume no disturbance (D(s)=0).
Table: Specifications for the Transient
Response
Performance Measure
Desired Value
Percent overshoot Less than 8%
Settling time Less than 400ms
Use MATLAB, to find the system performance for different values of Ka and find which value of
the gain Ka satisfies the design condition specified. Use the following table. (hint use βstepinfoβ)
Ka 20 30 50 60 80
Percent
Overshoot
Settling
time
Ka 5
1
π (π + 20)
R(s)
–
+
+
–
Y(s)
Amplifier
Motor
Constant Load
D(s)
(optional) Ex4: second order system: for the following mass spring damper system. k=1, c=0.1, m=10.
The system open loop transfer function is
π =
π₯(π )
ππ(π )
=
1
ππ 2 + ππ + π
– Rewrite the system to be in the form
πΊπππ
π 2+2ππ€ππ +π€π
2
– Find the settling time using the following relation ππ = ππ =
4
πππ
;
– Find the percentage overshoot using the following relation π. π. = 100πβππ/β1βπ
2
.
– Find the steady state value with step input using the final value theorem.
– Find the open loop overshoot, rise time, settling time. Using βstepinfoβ
– Design a control system to drive this circuit such that the control algorithm is ππ = π β π, where π =
π₯π β π₯ and π₯π is the set point. And find its transfer function.
– Find k that makes the settling time less that the half of its value in the open loop.
– Find k that makes the percentage overshoot less than half that in the open loop.
– Draw the root locus plot for the system.
k
m
c
fa(t)
x(t)