Professional Documents
Culture Documents
There are five problems in the word document. I request you to read them
and practice in the Simulink. Some of the ideas will be covered during the
course work.
1
1. Piston- Crank mechanism
Radius of the crank (r) -120 mm; Connecting rod Length(c)= 250 mm. The task
is to simulate the piston movement (x) inside the cylinder. The model is
Simulation steps
1. To find x , We need to know the θ and r and c are already given.
2. Let us assume speed- N (say 2500 RPM)
3. Speed and angular velocity are related by ω = 2*pi* N/ 60 and we can
write a MATLAB function or Simulink blocks to compute ω.
4. Angular velocity ω = dθ/dt
5. To find θ we will have to integrate ω = dθ/dt
2
6. If we continually integrate θ will keep increase for ever.
7. We know that after one full rotation of crank(θ = 360° or 2*pi), again we
need to make it to zero
8. Hence, we will set the wrapped state of integrator upper value to 2*pi;
9. Once we get θ from the above use that signal and write a function to
compute x
3
Simulink model
4
- Create a 1-D lookup table and input the table data
- Input clock block to 1-D lookup table
- Connect the output of lookup table to integrator.
- connect the output of integrator to a scope.
(Note: Lookup table by design will interpolate values for example 2.4 seconds
etc and feed the integrator)
Now experiment with discrete integrator (block KTs/Z-1 ) which takes discrete
values and integrates the velocity
5
Change the sample
time to what you need
if you leave -1, system
will consider default.
Now change it to 1
and see the output.
See the difference of continuous and discrete integrators from scope outputs.
Alternatively you can output the data to matlab workspace and see the data
6
The output should look like this.
7
where Cd=0.6 r=2 m, Diameter of the hole is 2.5 cm (Area A can be computed
from this) and g is 9.81 m/sec2
and the initial height of water is 3 meter.
Construct the following circuit after studying the differential equation.
Alternatively, you can build the equations using MATLAB functions( Like how
we did it in SI engine Control).
8
4) Simple Diode problem
An ideal diode blocks the flow of current in the direction opposite that of the
diode’s arrow symbol. It can be used to make a half-wave rectifier as shown in
Figure. For the ideal diode, the voltage L across the load RL is given by
9
Write a Simulink program to plot the graphs of the input voltage vs diode
voltage.
Solution:
-The voltage VL across the Load resistance is equal to the supplied voltage Vs if
the Vs is >0 (As the diode is forward biased) and is equal to Zero if the Vs is <0
(As the diode is reverse biased).
- We need to generate the supply voltage Vs(t) by using a clock and writing the
equation.
- Vs voltage needs to be passed through an If block which tests the condition
whether Vs is Greater than zero. If so, it passes through If action sub
system(input is Vs and output is merge block.
If Vs is less than Zero, the condition fails and signal passes through the if action
sub system (input is Zero and output is merge block.
10
Input voltage
Output voltage
11
(Please feel free to explore options such as switch etc) to do the same
functionality)
12
By applying Kirchoff’s equations and Torque equations(Euler’s) we can arrive at
following systems of differential equations ( We shall derive this in our theory
class).
We need to study the current (i) and speed (ω) of the model for the applied
voltages. Can use following parameters.
R 0.6 Ω
L 0.002H
Kt 0.04N.m/A
Ke 0.04 V.s/rad
C 0
I 6 * 10^-5 kg./m2
13
Solution:
- We will introduce state space model concept to solve the problem.
- States such as current , speed of system defines it and if we solve the
equations, we can study the behaviour of the system.
- Run a matlab script and type all the parameters into it and run and save
it.
14
and type as under (which should approximate the voltage applied equation) -
Verify!
- You should get the following type of signal (Ignore the nomenclature
signal 4 in this example).
-
15
-
- Open a state space block and type the following in the parameter.
A B
16
and D is the feedback which is zero for the problem.
Now connect as under.
and you should see that red line is the speed(ω) , yellow is the applied voltage
(V) and blue is the current(i). Now you can change the different R,L
parameters and see how the motor responds.
*************
17