control engineering i.docx
TRANSCRIPT
-
7/27/2019 CONTROL ENGINEERING I.docx
1/19
CONTROL ENGINEERING I SIMULATION EXERCISE 1
CONTROL ENGINEERING I
SIMULATION EXERSISE
AICHA EUGENE
EN292-0662/2009
-
7/27/2019 CONTROL ENGINEERING I.docx
2/19
CONTROL ENGINEERING I SIMULATION EXERCISE 2
Table of ContentsTitle Page ................................................................................................................................ 1
Table of Contents ................................................................................................................... 2
1 Objectives of Experiment .............................................................................................. 22 Introduction ................................................................................................................... 2
3 Problem Statement ........................................................................................................ 4
4 Equipment ...................................................................................................................... 4
5 Method ........................................................................................................................... 5
5.1 Mathematical modelling ........................................................................................ 5
5.2 Matlab computations, simulation and results ....................................................... 6
6 Analysis of Results ....................................................................................................... 12
7 Conclusion ................................................................................................................... 14
References ............................................................................................................................ 16
1. ObjectivesTo simulate a second order mass-spring system and study its behavior.
To learn Mathematical Modeling of Mechanical systems and familiarize with
commands in MATLAB that would be used to represent such systems in terms of
transfer function or pole-zero-gain representations.
Learn how to make preliminary analysis of such systems using plots of poles and
zeros locations as well as time response, in this case due to unit step inputs.
To Learn how to do Bode plots and Nyquist plots of such systems to see where
improvements can be done.
2. IntroductionThe mass spring system is a very good example of a second order physical system. The equations
governing the behavior of the system are easily derived from Newtons law. Indeed all mechanical
systems, right from the simple pendulum to the more complicated aircraft are of second order
form; because of the fact that they obey Newtons laws or Lagranges or Hamiltons principle.
Therefore, studying the behavior of the mass-spring system, will give us great insight into the
behavior of many mechanical systems without too much complicated mathematical analysis.
Furthermore, because of the frictional effects on the system, and an additional damping that may
be introduced in the system, the mass-spring system is always a stable system. That is, it representsan energy dissipative system.
An example of the application of this system would be an accelerometer- a sensor that measures
the physical acceleration experienced by an object due to inertial forces or due to mechanical
excitation. In aerospace applications accelerometers are used along with gyroscopes for navigation
guidance and flight control. Conceptually, an accelerometer behaves as a damped mass on a
-
7/27/2019 CONTROL ENGINEERING I.docx
3/19
CONTROL ENGINEERING I SIMULATION EXERCISE 3
spring. When the accelerometer experiences acceleration, the mass is displaced and the
displacement is then measured to give the acceleration [2].
In these devices, piezoelectric, piezoresistive and capacitive techniques are commonly used to
convert the mechanical motion into an electrical signal. Piezoelectric accelerometers rely on
piezoceramics (e.g. lead zirconate titanate) or single crystals (e.g. quartz, tourmaline). They are
unmatched in terms of their upper frequency range, low packaged weight and high temperaturerange. Piezoresistive accelerometers are preferred in high shock applications. Capacitive
accelerometers performance is superior in low frequency range and they can be operated in servo
mode to achieve high stability and linearity. Modern accelerometers are often small micro electro-
mechanical systems (MEMS), consisting of little more than a cantilever beam with a proof-mass
(also known as seismic-mass) realized in single crystal silicon using surface micromachining or bulk
micromachining processes.
The principle of working of an accelerometer can be explained by a simple mass (m) attached to a
spring of stiffness (k) that in turn is attached to a casing, as illustrated in fig 2.1. The mass used in
accelerometers is often called the seismic-mass or proof-mass. In most cases the system also
includes a dashpot to provide a desirable damping effect. The dashpot with damping coefficient (c)
is normally attached to the mass in parallel with the spring. When the spring mass system is
subjected to linear acceleration, a force equal to mass times acceleration acts on the proof-mass,
causing it to deflect. This deflection is sensed by a suitable means and converted into an equivalent
electrical signal. Some form of damping is required; otherwise the system would not stabilize
quickly under applied acceleration.
To derive the motion equation of the system Newtons second law is used, where all real forcesacting on the proof-mass are equal to the inertia force on the proof-mass. Accordingly a dynamic
problem can be treated as a problem of static equilibrium and the equation of motion can be
obtained by direct formulation of the equations of equilibrium. This damped mass-spring system
with applied force constitutes a classical second order mechanical system.
From the stationary observers point of view, the sum of all forces in the z direction is,
-
7/27/2019 CONTROL ENGINEERING I.docx
4/19
CONTROL ENGINEERING I SIMULATION EXERCISE 4
Where
m= mass of the proof-massx= relative movement of the proof-mass with respect to frame
c= damping coefficient
k= spring constant
F= force applied
3. Problem Statement
Given a spring mass system whose dynamic system model is a simple single-degree-of-freedom
(SDOF) second-order system-the mass-spring-dashpot shown in Fig. 2, with value of mass=500kg,
spring constant k=100N/m and the damping coefficient c=80Ns/m. It is required Bode and
Nyquist plots of the system are done and comparisons made to suggest ways of improving the
system e.g. by strategically deciding the best values for m, c and k.
4. Equipment and SoftwareThe following equipment/software is required:
Computer or Laptop Matlab software package
-
7/27/2019 CONTROL ENGINEERING I.docx
5/19
CONTROL ENGINEERING I SIMULATION EXERCISE 5
5. Method
Free Body Diagram (FBD)
The static force due to gravity in this system is irrelevant as it does not vary with time, and hence,
does not appear in the analysis.
5.1 Mathematical modeling: Derivation of an expression for the transmitted force F (t).From the free-body diagram of Fig. 2, it is apparent that this force is the resultant of the forces
acting at the ends of the spring and the dashpot, respectively.
We can refer to( )
odx t
dtas
.
x and2
2
( )o
dx t
dtas
..
x
Hence, applying Newtons second law of motion to a system in translation
Summation of all forcesacting on the system
F m x
F t cx k x m x
Or
Forced Vibration of a second order systemmx c x kx F t For zero Initial Conditions (I.Cs), taking Laplace Transform (LT) of both sides of the above
equation yields
2 0 ( )m s c s k X s F s Where 0 0 X s x tL and F s F tL . From Equation (4-2), the TF for thesystem is
-
7/27/2019 CONTROL ENGINEERING I.docx
6/19
CONTROL ENGINEERING I SIMULATION EXERCISE 6
20 1
Output
( ) Input
X s
F s m s c s k
Next, we shall obtain analytical solution of the response to the unit-step input. Substituting the
given numerical values for the mass, spring and dashpot elements gives
20
2
1 1
500 80 100
Output
( ) Input
X s
F s m s c s k s s
This is the ratio of the Laplace transform of the output (response) to the Laplace transform of the
input (applied force) to the system. It characterizes the system under consideration. This
characterization is independent of the input or driving function. This ratio
0
( )
X s
F s
is defined as
the transfer functionof this system in control analysis (or of this structure in dynamic analysis). The
transfer function can be used to provide analysis of the vibrational properties of the structure as
well as to provide a means of measuring the dynamic response of the structure.
Since the input ( )F t is a unit step function,
1
F ss
The output 0X s becomes
0 2 3 21 1 1500 80 100 500 80 100 X s s s s s s s
5.2 Matlab com putation, simulation and results.
To obtain the inverse Laplace Transform of 0X s , 0X s is expressed in partial fractions.MATLAB is used for that as follows
>> num=[1];
>> den=[500,80,100,0];>> [r,p,k]=residue(num,den)
r =
-0.0050 + 0.0009i
-0.0050 - 0.0009i
0.0100
-
7/27/2019 CONTROL ENGINEERING I.docx
7/19
CONTROL ENGINEERING I SIMULATION EXERCISE 7
p =
-0.0800 + 0.4400i
-0.0800 - 0.4400i
0
k =
[]
0
0
0 005 0 0009 0 005 0 0009 0 01
0 08 0 44 0 08 0 44
0 005 0 0009 0 005 0 0009 0 01
0 08 0 44 0 08 0 44
. . . . .
( . . ) ( . . )
. . . . .
( . . ) ( . . )
i iX s
s i s i s
i iX s
s i s i s
The inverse Laplace Transform of 0X s is obtained as
0
0 08 0 44 0 08
0 0
0 005 0 0009 0 005 0 0009 0 01
0 08 0 44 0 08 0 44
0 01 0 005 0 0009 0 005 0 0009
( . . ) ( .
. . . . .
( . . ) ( . . )
( ) . . . . .i t -1
i iX s
s i s i s
x t X s i e i eL
.
>> sys=tf(num,den)
sys =
1
------------------------
500 s^3 + 80 s^2 + 100 s
Continuous-time transfer function.
This is the transfer function of the system. The transfer functions unit step response can be
plotted, assuming the Initial conditions (I.Cs) are zero. The basic syntax is step(sys), where sys is
the object defined previously.
For 500 kgm , 80 N-s/mc and 100 N/mk . The response 0X t for a unit step input1( ) ( )F t t .
-
7/27/2019 CONTROL ENGINEERING I.docx
8/19
CONTROL ENGINEERING I SIMULATION EXERCISE 8
MATLAB PROGRAM:
>> num=[1];
>> den=[m c k];
>> sys=tf(num,den);
>> step(sys)
>> grid
>> title('Graph plotted For m=500kg,c=80Ns/m and k=100N/m');
>> m=500;c=80;k=100;
>> num=[1];
>> den=[m c k];
>> sys=tf(num,den);
>> step(sys);
>> grid
>> title('Graph of the unit step response plotted For m=500kg,c=80Ns/m and k=100N/m');
-
7/27/2019 CONTROL ENGINEERING I.docx
9/19
CONTROL ENGINEERING I SIMULATION EXERCISE 9
2 2
2 22
11
1
1
2
11 0 01100
500 80 100500 80 100 5 0 8 1100 100 100
;
.
.
m s c s k
kK
km cs sk k
k
m
kc
m
k
s s s ss s
The systems zeta is as calculated and tabulated below. The systems value is 0.178885, which is
under damped. Having noted that, it is essential to improve the stability to a better one with atleast between 0.6-0.8. The ideal is 1 and is achieved as per the constants m, c and k chosen in the
table.
Changing parameters and trying other values holding mass constant
Table 1: sample data
Mass(m) c(Ns/m) k(N/m) m/k c/k k/m w (zeta)
500 80 100 5 0.8 1 0.2 0.447214 0.178885
500 100 85 5.882353 1.176471 1 0.17 0.412311 0.242536
500 120 75 6.666667 1.6 1 0.15 0.387298 0.309839
500 150 61 8.196721 2.459016 1 0.122 0.349285 0.429449
500 200 54 9.259259 3.703704 1 0.108 0.328634 0.608581
500 250 47 10.6383 5.319149 1 0.094 0.306594 0.81541
500 300 45 11.11111 6.666667 1 0.09 0.3 1
Using the code below to draw the plot for each of the situations:
sys=tf([0.01],[5 0.8 1]);step(sys);
-
7/27/2019 CONTROL ENGINEERING I.docx
10/19
CONTROL ENGINEERING I SIMULATION EXERCISE 10
hold on;sys=tf([0.01],[5.882353 1.176471 1]);step(sys);hold on;sys=tf([0.01],[6.666667 1.6 1]);step(sys);hold on;sys=tf([0.01],[8.196721 2.459016 1]);step(sys);hold on;sys=tf([0.01],[9.259259 3.703704 1]);step(sys);hold on;sys=tf([0.01],[10.6383 5.319149 1]);step(sys);hold on;sys=tf([0.01],[ 11.11111 6.666667 1]);step(sys);hold off;title('Step response');
ylabel('Resulting displacement');grid;legend('zeta=0.178885','zeta=0.242536','zeta=0.309839','zeta=0.429449','zeta=
0.608581','zeta=0.81541','zeta=1');hold off
Bode plot
Using these commands:
>> bode(sys)
>> title('Bode plot of Unit step response for m=500kg,c=80Ns/m and k=100N/m');
>> grid;
It was possible to do the following Bode plot:
-
7/27/2019 CONTROL ENGINEERING I.docx
11/19
CONTROL ENGINEERING I SIMULATION EXERCISE 11
The bode plot is most useful because it gives us a way to determine stability. We cannot only
use the Bode plot to determine stability, but it also gives us insight on how to improve the
stability of a system. To fully understand the Bode plot based methods for determining stabilityit is important to first understand the Nyquist plot. This presents some difficulties because the
Nyquist plot uses some rather abstract mathematical techniques.To do the Nyquist plot:
>>nyquist(sys);
>> grid
>> title('Nyquist plot for the Unit step response of a system m=500kg,c=80Ns/m and k=100N/m');
-
7/27/2019 CONTROL ENGINEERING I.docx
12/19
CONTROL ENGINEERING I SIMULATION EXERCISE 12
While zooming in, it was seen that the plot in "L(s)" does not encircle the -1+j0, so the system isstable. We can verify this by finding the roots of the characteristic equation
-
7/27/2019 CONTROL ENGINEERING I.docx
13/19
CONTROL ENGINEERING I SIMULATION EXERCISE 13
METHOD OF STABILITY ANALYSIS USING NYQUIST CRITERIONCounting encirclementsThis is a method of establishing how stable the system is. It is by determining the number of
encirclements of the -1+j0 point is to simply draw a line out from the point, in any directions
By counting the number of times that the Nyquist pathcrosses the line in the clockwise direction (i.e., left to rightin the image, and denoted by a red circle) and subtracting
the number of times it crosses in the counterclockwise
direction (the blue dot), one can get the number ofclockwise encirclements of the -1+j0 point. A negative
number indicates counterclockwise encirclements. In the
image above, there is one crossing in each direction, and
therefore zero encirclements.
Gain and Phase Margins
Using Nyquist Stability Criterion gives us information about the relative stability of a system andgives us clues as to how to make a system more stable. In particular, there are two quantities, the
gain margin and the phase margin, that can be used to quantify the stability of a system. Now bydrawing a unit circle around the origin (using Matlab's "ltiview" command).
-
7/27/2019 CONTROL ENGINEERING I.docx
14/19
CONTROL ENGINEERING I SIMULATION EXERCISE 14
There are two spots on the Nyquist plot that are
emphasized. The first is where the Nyquist plot crosses
the real axis in the left half plane. If we zoom in andput the cursor over this point we get the following
image.
A higher phase margin yields a more stable system. A
phase margin of 0 indicates a marginally stable
system. Note: if you know about the frequencyresponse time delays, recall that a time delay
corresponds to a change in phase.
USING THE NYQUIST STABILITY CRITERION GUIThis is an analysis instrument that made my work very easy, especially using Nyquist criterion.Having used it to experiment on many examples, and being a Mechatronic engineer, I automated
the whole tedious transfer function analysis as detailed above into a very simple process in which
through the code, I could insert a new transfer function and watch as the Matlab does the Nyquist
plot and analysis for me.
NyquistGui (Nyquist Graphical User Interface) is a Matlab program designed to help tounderstand Nyquist Plots. It is not meant to be an accurate, flexible tool for creating Nyquist
diagrams. The GUI has two basic "modes," one for learning about the process of mapping from
one domain to another (i.e., from the "s" domain to the "L(s)" domain), the other for using the
Nyquist plot to check for system stability.
-
7/27/2019 CONTROL ENGINEERING I.docx
15/19
CONTROL ENGINEERING I SIMULATION EXERCISE 15
The figure shows the GUI loading the transfer function
-
7/27/2019 CONTROL ENGINEERING I.docx
16/19
CONTROL ENGINEERING I SIMULATION EXERCISE 16
In this figure, the GUI is processing the transfer function and posting results with a short
explanation of what it has done. From the code, the system is proved to be very stable as per the
calculations using Nyquist analysis method. However, more can be done as seen in the previous
analysis.
-
7/27/2019 CONTROL ENGINEERING I.docx
17/19
CONTROL ENGINEERING I SIMULATION EXERCISE 17
This is a snippet of the GUI code from which I could insert functions that I wanted to test and
analyze. There were a few limitations associated with my GUI application that made it not very
dependable for design purposes:
There was no dynamic scaling of axes, so you must choose systems with poles that fitwithin the axes. Again - this was just a tool for learning, not for design
System time delays were ignored. In the case of a system that is marginally stable (i.e., it passes through the -1+j0 point),
the angles drawn on the "L(s)" plot may be inaccurate, particularly if all poles of theclosed loop system are on the j axis.
Any poles of L(s) that are very near the imaginary axis are placed on the axis.
-
7/27/2019 CONTROL ENGINEERING I.docx
18/19
CONTROL ENGINEERING I SIMULATION EXERCISE 18
6. Analysis of resultsFrom the simulation results it could be seen that 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. Depending on the value of , theresponse can be described asUnder damped:This case occurs if the parameters of the system are such that 0< 1
Critically damped: This case occurs if the parameters of the system are such that =1The top three options specify the details of the step input:
Initial value: input level before the step occurs. This option is grayed out because LTI systems
always have initial value equal to 0.
Step time: time at which the step takes place. This option is grayed out since LTI systems always
have an initial time equal to 0.
Final value: input level after the step occurs
The remaining options specify the characteristics of the response signal. Each of the step response
characteristics is described in the figure below.
Rise time: The time taken for the response signal to reach a specified percentage of the step's
range. The step's range is the difference between the final and initial values.
% Rise: The percentage used in the rise time.
Settling time: The time taken until the response signal settles within a specified region around the
final value. This settling region is defined as the final step value plus or minus the specified
percentage of the final value.
% Settling: The percentage used in the settling time.
% Overshoot: The amount by which the response signal can exceed the final value. This amount is
specified as a percentage of the step's range. The step's range is the difference between the final
and initial values.
% Undershoot: The amount by which the response signal can undershoot the initial value. This
amount is specified as a percentage of the step's range. The step's range is the difference between
the final and initial values.Suitable values of m, c and k to make the system more stableFor a good and efficient system, some of the parameters above have to be accommodated. The
system response is determined by the damping present in the system. A damping factor ()between 0.6 to 1.2 results in high response time, fast settling time, good bandwidth and linearity in
the system. Basing on this, suitable values of m, c and k that would satisfy the functionality are
m=500kg, c=300Ns/m and k=45N/m.
Ways of improving the systemThere are numerous measurement issues that contaminate the expected response of the system. In
order to assist the student in deciphering the data and give a more real world simulation, an
analytical model can be developed and then controlled contamination signals are added to the
known analytical response. The same system if installed in the field would generally be
contaminated by various factors. Such controlled effects should be included in the simulation, to
enable easy identification of the distortions and give a more accurate and precise response. This is
-
7/27/2019 CONTROL ENGINEERING I.docx
19/19
CONTROL ENGINEERING I SIMULATION EXERCISE 19
more easily done using Simulink, the simulation engine in Matlab that could be used to introduce
other distortion and noise blocks just to see how the external factors affect the system. In this way,
the students gain first-hand experience as to how to interpret the information collected and gain a
better understanding as to how to process the data.
The SISO Design Tool:This is a tool that can also be used to improve the design of the system. It is found in Matlab and
can ease the testing of the system though it is mainly a graphical-user interface (GUI) used to
design compensators.
The SISO Design Tool has the following
components:
The SISO Design Task Node in the Control and
Estimation Tools Manager, a user interface (UI)
that facilitates the design of compensators for
single-input, single-output feedback loops
through a series of interactive panes. The
Graphical Tuning Window, a graphical user
interface (GUI) for displaying and manipulating
the Bode, root locus, and Nichols plots for the
controller currently being designed. This window
is titled SISO Design for Design Name. The
Graphical Tuning Window by default displays
the root locus and Bode diagrams for your
imported systems. The two are dynamically
linked; for example, if you change the gain in the
root locus, it immediately affects the Bode diagrams as well. The SISO Design Task-associated
LTI Viewer (For instructions on how to operate the LTI Viewer, see LTI Viewer)
ConclusionThe experiment was good practical experience with Matlab. There is need for more features if a
more efficient system has to be designed for the real world application. A block diagram
representation using Simulink would also help improve system design by reducing coding time and
allow inclusive analysis and testing of more parameters. The exercise in general, was very
instrumental as it pulled together pieces of the other areas like Ordinary Differential equations,
Programming and Control Engineering which are core areas of our curriculum.
References:1. Design and Analysis with Matlab and Simulink by Tewari A2. Rose-Hulman Institute of Technology ECE 205 Dynamic Systems lab manual