Documentos de Académico
Documentos de Profesional
Documentos de Cultura
ME1404
REC
LIST OF EXPERIMENTS
A.
Simulation
15
30
01
Software
ANSYS Version 7 or latest
C / MATLAB
15 licenses
15 licenses
LIST OF EXERCISES
Analysis (Simple Treatment only)
Ex. No: 1
Ex. No: 2
Ex. No: 3
Ex. No: 4
Ex. No: 5
Ex. No: 6
Ex. No: 7
Ex. No: 8
Ex. No: 9
Ex. No: 10
Simulation
Ex. No: 11 Simulation of Air conditioning system with condenser temperature and
evaporator temperatures as input to get COP using C /MAT Lab.
Ex. No: 12 Simulation of Hydraulic / Pneumatic cylinder using C / MAT Lab.
Ex. No: 13 Simulation of cam and follower mechanism using C / MAT Lab.
REC
REC
INTRODUCTION
What is Finite Element Analysis?
Finite Element Analysis, commonly called FEA, is a method of numerical analysis. FEA
is used for solving problems in many engineering disciplines such as machine design,
acoustics, electromagnetism, soil mechanics, fluid dynamics, and many others. In
mathematical terms, FEA is a numerical technique used for solving field problems
described by a set of partial differential equations.
In mechanical engineering, FEA is widely used for solving structural, vibration, and
thermal problems. However, FEA is not the only available tool of numerical analysis.
Other numerical methods include the Finite Difference Method, the Boundary Element
Method, and the Finite Volumes Method to mention just a few. However, due to its
versatility and high numerical efficiency, FEA has come to dominate the engineering
analysis software market, while other methods have been relegated to niche applications.
You can use FEA to analyze any shape; FEA works with different levels of geometry
idealization and provides results with the desired accuracy. When implemented into
modern commercial software, both FEA theory and numerical problem formulation
become completely transparent to users.
Who should use Finite Element Analysis?
As a powerful tool for engineering analysis, FEA is used to solve problems ranging from
very simple to very complex. Design engineers use FEA during the product development
process to analyze the design-in-progress. Time constraints and limited availability of
product data call for many simplifications of the analysis models. At the other end of
scale, specialized
analysts implement FEA to solve very advanced problems, such as vehicle crash
dynamics, hydro forming, or air bag deployment. This book focuses on how design
engineers use FEA as a design tool. Therefore, we first need to explain what exactly
distinguishes FEA performed by design engineers from "regular" FEA. We will then
highlight the most essential FEA characteristics for design engineers as opposed to those
for analysts.
FEA for Design Engineers: another design tool
For design engineers, FEA is one of many design tools among CAD, Prototypes,
spreadsheets, catalogs, data bases, hand calculations, text books,
etc. that are all used in the design process.
FEA for Design Engineers: based on CAD models
REC
Modern design is conducted using CAD tools, so a CAD model is the starting point for
analysis. Since CAD models are used for describing geometric information for FEA, it is
essential to understand how to design in CAD in order to produce reliable FEA results,
and how a CAD model is different from FEA model. This will be discussed in later
chapters.
REC
REC
products dates back to 1982, Solid Works Simulation has been specifically developed for
Windows and takes full advantage this of deep integration between Solid Works and
Windows, representing the state-of-the-art in the engineering analysis software.
REC
It is important to mention that we do not always simplify the CAD model with the sole
objective of making it meshable. Often, we must simplify a model even though it would
mesh, correctly "as is", but the resulting mesh would be too large and consequently, the
analysis would take too much time. Geometry modifications allow for a simpler mesh
and shorter computing times. Also, geometry preparation may not be required at all;
successful meshing depends as much on the quality of geometry submitted for meshing
as it does on the
sophistication of the meshing tools implemented in the FEA software.
Having prepared a meshable, but not yet meshed geometry we now define material
properties. (these can also be imported from a Solid Works model), loads and restraints,
and provide information on the type of analysis that we wish to perform. This procedure
completes the creation of the mathematical model (figure 1-2). Notice that the process of
creating the mathematical model is not FEA-specific. FEA has not yet entered the
picture.
REC
REC
Errors in FEA
The process illustrated in figures 1-2 and 1-3 introduces unavoidable errors. Formulation
of a mathematical model introduces modeling errors (also called idealization errors),
discretization of the mathematical model introduces discretization errors, and solving
introduces numerical errors. Of these three types of errors, only discretization errors are
specific to FEA. Modeling errors affecting the mathematical model are introduced before
FEA is utilized and can only be controlled by using correct modeling techniques.
Solution errors caused by the accumulation of round-off errors are difficult to control, but
are usually very low.
Solid elements
The type of geometry that is most often used for analysis with Solid Works Simulation is
solid CAD geometry. Meshing of this geometry is accomplished with tetrahedral solid
elements, commonly called "tets" in FEA jargon. The tetrahedral solid elements in Solid
Works Simulation can either be first order elements (draft quality), or second order
elements (high quality). The user decides whether to use draft quality or high quality
elements for meshing. However, as we will soon prove, only high quality elements
should be used for an analysis of any importance. The difference between first and
second order tetrahedral elements is illustrated in figure 1-4.
10
REC
Figure 1 -4: Differences between first and second order tetrahedral elements
First and the second order tetrahedral elements are shown before and after deformation.
Note that the deformed faces of the second order element may assume curvilinear shape
while deformed faces of the first order element must remain fiat.
First order tetrahedral elements have four nodes, straight edges, and flat faces. These
edges and faces remain straight and flat after the element has experienced deformation
under the applied load. First order tetrahedral elements model the linear field of
displacement inside their volume, on faces, and along edges. The linear (or first order)
displacement field gives these elements their name: first order elements. If you recall
from the Mechanics of Materials, strain is the first derivative of displacement. Therefore,
strain and consequently stress, are both constant in first order tetrahedral elements. This
situation imposes a very severe limitation on the capability of a mesh constructed with
first order elements to model stress distribution of any real complexity. To make matters
worse, straight edges and flat faces cannot map properly to curvilinear geometry, as
illustrated in figure 1-5.
Figure 1-5: Failure of straight edges and flat faces to map to curvilinear geometry
11
Second order tetrahedral elements have ten nodes and model the second order (parabolic)
displacement field and first order (linear) stress field in their volume, along laces, and
edges. The edges and faces of second order tetrahedral elements before and after
deformation can be curvilinear. Therefore, these elements can map precisely to curved
surfaces, as illustrated
in figure 1-6. Even though these elements are more computationally demanding than first
order elements, second order tetrahedral elements are used for the vast majority of
analyses with Solid Works Simulation.
Shell elements
Besides solid elements, Solid Works Simulation also offers shell elements. While solid
elements are created by meshing solid geometry, shell elements are created by meshing
surfaces. Shell elements are primarily used for analyzing thin-walled structures. Since
surface geometry does not carry information about thickness, the user must provide this
information. Similar to solid elements, shell elements also come in draft and high quality
with analogous consequences with respect to their ability to map to curvilinear geometry,
as shown in figure 1-7 and figure 1-8. As demonstrated with solid elements, first order
shell elements model the linear displacement field with constant strain and stress while
second order shell elements model the second order (parabolic) displacement field and
the first order strain and stress field.
12
REC
13
REC
Figure 1-9: Plate modeled with solid elements (left) and shell elements
The plate shown can be modeled with either solid elements (left) or shell elements
(right). The actual choice depends on the particular requirements of analysis and
sometimes on personal preferences
Figure 1-10, below, presents the basic library of elements in Solid Works Simulation.
Elements like a hexahedral solid, quadrilateral shell or other shapes are not available in
Solid Works Simulation.
14
REC
REC
Everything else, such as strains and stresses, are calculated based on the nodal
displacements. Consequently, rigid restraints applied to solid elements require only three
degrees of freedom to be constrained. Rigid restraints applied to shell elements require
that all six degrees of freedom be constrained. In a thermal analysis, which finds
temperatures and heat flow, the primary unknowns are nodal temperatures. Since
temperature is a scalar value (unlike the vector nature of displacements), then regardless
of what type of element is used, there is only one unknown (temperature) to be found for
each node. All other results available in the thermal analysis are calculated based on
temperature results. The fact that there is only one unknown to be found for each node;
rather than three or six, makes thermal analysis less computationally intensive than
structural analysis.
16
REC
Figure 1-11: General state of stress represented by three normal stresses: x, y, z and
six shear stresses xy = yx, yz = zy, zx = xz
Two components of shear stress and one component of normal stress act on each side of
an elementary cube. Due to equilibrium requirements, the general 3-Dstate of stress is
characterized by six stress components: x, y, z and xy = yx, yz = zy, zx = xz
Note that von Mises stress is a non-negative, scalar value. Von Mises stress is commonly
used to present results because structural safety for many engineering materials showing
elasto-plastic properties (for example, steel) can be evaluated using von Mises stress. The
magnitude of von Mises stress can be compared to material yield or to ultimate strength
to calculate the yield strength or the ultimate strength safety factor.
Principal stresses
By properly adjusting the angular orientation of the stress cube in figure 1-11, shear
stresses disappear and the state of stress is represented only by three principal stresses: o:,
o2, and 03, as shown in figure 1-12. In Solid Works simulation, principal stresses are
denoted as 1, 2, and 3.
17
REC
Units of measurements
Internally, Solid Works simulation uses the International System of Units (SI).However,
for the user's convenience, the unit manager allows data entry in three different systems
of units: SI, Metric, and English. Results can be displayed using any of the three unit
systems. Figure 1-13 summarizes the available systems of units.
18
REC
However, we may be asked to prepare data or interpret the results of other FEA software
where we do not have the convenience of the unit manager. Therefore, we will make
some general comments about the use of different systems of units in the preparation of
input data for FEA models. We can use any consistent system of units for FEA models,
but in practice, the choice of the system of units is dictated by what units are used in the
CAD model. The system of units in CAD models is not always consistent; length can be
expressed in [mm], while mass density can be expressed in [kg/m3].Contrary to CAD
models, in FEA all units must be consistent. Inconsistencies are easy to overlook,
especially when defining mass and mass density, and they can lead to very serious errors.
SI, Metric, and English systems of units can be interchanged when entering data or
analyzing results in Solid Works simulation
Experience indicates that units of mass density are often confused with units of specific
gravity. The distinction between these two is quite clear in SI units: Mass density is
expressed in [kg/m3], while specific gravity in [N/m3].However, in the English system,
both specific mass and specific gravity are .expressed in [lb/in.3], where [lb] denotes
either pound mass or pound force. As Solid Works simulation users, we are spared much
confusion and trouble with systems of units. However, we may be asked to prepare data
or interpret the results of other FEA software where we do not have the convenience of
the unit manager. Therefore, we will make some general comments about the use of
different systems of units in the preparation of input data for FEA models. We can use
any consistent system of units for FEA models, but in practice his choice of the system of
units is dictated by what units are used in the CAD model. The system of units in CAD
models is not always consistent; length can be expressed in [mm], while mass density can
be expressed in [kg/m3].Contrary to CAD models, in FEA all units must be consistent.
Inconsistencies are easy to overlook, especially when defining mass and mass density,
and they can lead to very serious errors.
In the SI system, which is based on meters [m] for length, kilograms [kg] for mass and
seconds [s] for time, all other units are easily derived from these basic units. In
mechanical engineering, length is commonly expressed in millimeters [mm], force in
Newton [N], and time in seconds [s]. All other units must then be derived from these
basic units: [mm], [N], and [s].Consequently, the unit of mass is defined as a mass
which, when subjected to a unit force equal to IN, will accelerate with a unit acceleration
of 1 mm/s2.Therefore, the unit of mass in a system using [mm] for length and [N] for
force, is equivalent to 1,000 kg or one metric ton. Consequently, mass density is
expressed in metric tonne [tonne/mm3]. This is critically important to remember when
defining material properties in FEA software without a unit manager. Notice in figure 114 that an erroneous definition of mass density in [kg/m3] rather than in [tonne/mm3]
results in mass density being one trillion (1012) times higher (figure 1-14).
19
REC
20
Ex. No: 1
REC
AIM:
To perform displacement and stress analysis for the given beams
(Simply supported, Cantilever& Fixed ends) using solid works simulation
and analytical expressions.
Problem Description:
(i)
A distributed load & Point load will be applied to a solid steel beam
with a rectangular cross section as shown in the figure (1.1) below. The
cross-section of the beam is 132mm x 264mm while the modulus of
elasticity of the steel is 210GPa. Find reaction, deflection and stresses in the
beam.
Fig.1.1
(ii) A distributed load & Point load will be applied to a solid steel beam
with a rectangular cross section as shown in the figure (1.2) below. The
cross-section of the beam is 150mm x 300mm while the modulus of
elasticity of the steel is 210GPa. Find reaction, deflection and stresses in the
beam.
Fig.1.2
21
REC
(iii) A distributed load & Point load will be applied to a solid steel beam
with a rectangular cross section as shown in the figure (1.3) below. The
cross-section of the beam is 572mm x 1144mm while the modulus of
elasticity of the steel is 210GPa. Find reaction, deflection and stresses in the
beam.
Fig.1.3
Problem (I)
Creation of solid model
Solid part 1:
Sketch module:
Open a new part file select the right plane select normal view
draw rectangular shape select smart dimensions modify the dimensions as
132 X 264 mm
Feature Module:
Select the sketch1 select extruded boss extrude with a length
3000mm ok.
Solid part 2:
Sketch module:
Select the right end face select normal view draw rectangular
shape select smart dimensions modify the dimensions as 132 X 264 mm
Feature Module:
22
REC
23
REC
Static Study:
Right click on the Static study - Treat the solid part 1 & 2 as a beam
separately.
Apply Materials:
To apply material to the Simulation model, right-click the solid
part folder in the simulation study select Apply/Edit Material from
the pop-up menu This action opens the Material Select From
library files in the Select material source area Select Alloy Steel.
24
REC
25
REC
Apply Fixtures:
26
REC
Apply loads:
We now define the load by selecting Force from the pop-up menu.
This action opens the Force window. The Force window displays the
portion where point load & uniformly distributed load is applied
UDL:
27
REC
Point Load:
Right click the load folder Select forces
select the reference point select the top surface as reference
plane to represent the direction of the force select the force
direction which is normal to the selected reference button in order
to load the beam with 20,000 N of point load on the selected point
ok.
28
REC
Results:
With the solution completed simulation automatically creates Results
folder with several new folders in the study Manager Window like Stress,
Displacement, and Strain & Deformation. Each folder holds an
automatically created plot with its respective type of results. The solution
can be executed with different properties.
Select one of the following analyses you want to see:
Stress distribution
Displacement distribution
Deformed shape
29
REC
Make sure that the above plots are defined in your configuration, if not,
define them. Once the solution completes, you can add more plots to the
Results folder. You can also create subfolders in the Results folder to group
plots.
To display stress results, double-click on the Stress1 icon in the
Results folder or right-click it and select Show from the pop-up menu.
Problem (ii) & (iii)
Follow the same procedure with required changes.
Result:
The analysis of the beam was carried out using the solidworks
simulation and the software results were compared with theoretical or
analytical results.
30
Ex. No: 2
REC
Aim:
To perform displacement and stress analysis for the given rectangular
plate with holes using solid works simulation and analytical expressions.
Problem description:
A steel plate with 3 holes 3mm, 5mm & 10 mm respectively is
supported and loaded, as shown in figure. We assume that the support is
rigid (this is also called built-in support or fixed support) and that the 20 KN
tensile load is uniformly distributed on the end face, opposite to the
supported face. The cross section is 15 mm x 25 mm. length is 100mm.
Material (Alloy steel)
T = 15mm
D=3mm
D=5mm
D=10mm
H = 25mm
P = 20kN
Uniformly
distributed
L = 100mm
31
REC
Feature Module:
Feature (1) > Select the sketch (!) Select extruded boss extrude
with thickness 100mm.
Sketch module:
Sketch (2) select the front surface select normal view Draw
three circles as 3mm, 5mm & 10 mm with 25mm distance.
Feature Module:
Feature (2) > Select the sketch (2) select extruded cut extrude
with thickness 15mm ok
Analysis of the solid model
Simulation Module:
Verify that simulation mode is selected in the Add-lens list. To start
Simulation, Once Solid Works Simulation has been added, Simulation
shows in the main Solid Works tool menu. Select the simulation Manager
tab.
New Study:
REC
Apply Fixtures:
To define the Fixtures Right-click the Fixture folder in Static study
select fixed geometry as Fixture type select the left end face ok
Apply loads:
We now define the load by selecting Force from the pop-up menu.
The Force window displays the selected face where tensile force is applied
Select use reference geometry Select the right plane as reference plane
to represent the direction of the force. Select the force direction which is
normal to the selected reference plane button in order to load the Model with
20,000 N of tensile force uniformly distributed over the end face.
Create the mesh:
33
REC
The analysis of the rectangular plate was carried out using the solid
works simulation and software results were compared with theoretical or
analytical values.
Ex. No: 3
Stress analysis of a Rectangular L Bracket
Aim:
To perform displacement and stress analysis for the given rectangular
L Bracket (Wall Bracket) using solid works simulation and analytical
expressions.
Problem description:
An L-shaped bracket is supported and loaded as shown in figure 3-1.
We wish to find the Displacements and stresses caused by a 5,000 N which
is 60 inclined. In particular, we are interested in stresses in the corner where
the 5 mm round edge (fillet) is located. Material Grey Cast Iron.
300mm
90mm
70mm
5000N
150mm
60
Thickness 35mm
70mm
REC
Feature Module:
Select the sketch select extruded boss select midplane option
extrude with thickness 17.5mm.
Sketch Point:
Select the front plane normal view draw a line (sketch 2)
from the centre of the hole which is 60 inclined to the vertical.
Select the front plane locate the intersection point of 60
inclined line & sketch 3 ok.
Reference point:
Select reference point geometry select sketch 3 point &
inner surface of the hole ok.
35
REC
folder in simulation study and select Apply/Edit Material from the pop-up
menu This action opens the Material Select From library files in the
Select material source area Select Grey Cast Iron.
Apply Fixtures:
To define the Fixtures Right-click the Fixture folder in Static study
In Fixtures select fixed geometry as Fixture type select the model face
(left end face) where Fixture is to be applied ok.
Apply loads:
Right-click the Force folder Select force Select the reference
point select the reference plane to represent the direction of the force in
order to load the Model with 5000 N of which is 60 inclined.. This
illustration also shows symbols of applied restraint and load
Create the mesh:
We are now ready to mesh the model Right-click the Mesh
folder create mesh
Run the analysis:
Right-clicking the simulation mode Select Run to start the solution.
When the solution completes successfully, Simulation creates a Results
folder with result plots which are defined in Simulation Default Options.
Results:
With the solution completed simulation automatically creates Results
folder with several new folders in the study Manager Window like Stress,
Displacement, and Strain & Deformation. Each folder holds an
automatically created plot with its respective type of results. The solution
can be executed with different properties.
Stress1 showing von Misses stresses
Displacement1 showing resultant displacements
Once the solution completes, you can add more plots to the Results folder.
You can also create subfolders in the Results folder to group plots.
To display stress results, double-click on the Stress1 icon in the
Results folder or right-click it and select Show from the pop-up menu.
36
REC
Result:
The analysis of the L - Bracket was carried out using the
solidworks simulation and the software results were compared with
analytical values.
Ex.Mo.4
Stress analysis of an axi-symmetric component
Aim:
To perform stress analysis for the given axi-symmetric component.
Problem description:
Creation of the solid model
Sketch module:
Open a new part file select the top plane select normal view
draw the rectangular shape select smart dimensions modify the
dimensions 1000mm x 15mm ok.
Select sketch draw centre axis ok.
Feature Module:
Select the sketch select revolve select the centre axis
revolution angle 90.
Surface Module:
Select surface mid surface select the two outer faces ok.
Right click the surface model edit definition enter thickness
15mm ok.
REC
38
Ex. No: 5
Ex. No: 6
REC
Ex. No: 7
Ex. No: 8
40
REC
Ex. No: 9
AIM:
Ex. No: 10
41
REC
MATLAB
Overview of the MATLAB Environment
REC
INTRODUCTION:
42
REC
SIMULINK
INTRODUCTION:
Simulink is a graphical extension to MATLAB for modeling and
simulation of systems. In Simulink, systems are drawn on screen as block
diagrams. Many elements of block diagrams are available, such as transfer
functions, summing junctions, etc., as well as virtual input and output
devices such as function generators and oscilloscopes. Simulink is integrated
with MATLAB and data can be easily transferred between the programs. In
these tutorials, we will apply Simulink to the examples from the MATLAB
tutorials to model the systems, build controllers, and simulate the systems.
Simulink is supported on Unix, Macintosh, and Windows environments; and
is included in the student version of MATLAB for personal computers.
The idea behind these tutorials is that you can view them in one window
while running Simulink in another window. System model files can be
downloaded from the tutorials and opened in Simulink. You will modify and
43
REC
extend these system while learning to use Simulink for system modeling,
control, and simulation. Do not confuse the windows, icons, and menus in
the tutorials for your actual Simulink windows. Most images in these
tutorials are not live - they simply display what you should see in your own
Simulink windows. All Simulink operations should be done in your
Simulink windows.
1.
2.
3.
4.
5.
Starting Simulink
Model Files
Basic Elements
Running Simulations
Building Systems
Starting Simulink
Simulink is started from the MATLAB command prompt by entering the
following command:
>> Simulink
Alternatively, you can hit the Simulink button at the top of the MATLAB
window as shown below:
REC
Open the modeling window with New then Model from the File menu on the
Simulink Library Browser as shown above.
This will bring up a new untitiled modeling window shown below.
45
REC
Model Files
In Simulink, a model is a collection of blocks which, in general, represents a
system. In addition to drawing a model into a blank model window,
previously saved model files can be loaded either from the File menu or
from the MATLAB command prompt.
You can open saved files in Simulink by entering the following command in
the MATLAB command window. (Alternatively, you can load a file using
the Open option in the File menu in Simulink, or by hitting Ctrl+O in
Simulink.)
>> filename
The following is an example model window.
46
REC
A new model can be created by selecting New from the File menu in any
Simulink window (or by hitting Ctrl+N).
Basic Elements
There are two major classes of items in Simulink: blocks and lines. Blocks
are used to generate, modify, combine, output, and display signals. Lines are
used to transfer signals from one block to another.
Blocks
There are several general classes of blocks:
Continuous
Discontinuous
Discrete
Look-Up Tables
Math Operations
Model Verification
Model-Wide Utilities
Ports & Subsystems
Signal Attributes
Signal Routing
Sinks: Used to output or display signals
Sources: Used to generate various signals
User-Defined Functions
Discrete: Linear, discrete-time system elements (transfer functions, statespace models, etc.)
Linear: Linear, continuous-time system elements and connections
(summing junctions, gains, etc.)
Nonlinear: Nonlinear operators (arbitrary functions, saturation, delay,
etc.)
Connections: Multiplex, Demultiplex, System Macros, etc.
Blocks have zero to several input terminals and zero to several output
terminals. Unused input terminals are indicated by a small open triangle.
Unused output terminals are indicated by a small triangular point. The block
shown below has an unused input terminal on the left and an unused output
terminal on the right.
47
REC
Lines
Lines transmit signals in the direction indicated by the arrow. Lines must
always transmit signals from the output terminal of one block to the input
terminal of another block. One exception to this is a line can tap off of
another line, splitting the signal to each of two destination blocks, as shown
below.
Lines can never inject a signal into another line; lines must be combined
through the use of a block such as a summing junction.
A signal can be either a scalar signal or a vector signal. For Single-Input,
Single-Output systems, scalar signals are generally used. For Multi-Input,
Multi-Output systems, vector signals are often used, consisting of two or
more scalar signals. The lines used to transmit scalar and vector signals are
identical. The type of signal carried by a line is determined by the blocks on
either end of the line.
Simple Example
48
REC
The simple model (from the model files section) consists of three blocks:
Step, Transfer Fcn, and Scope. The Step is a source block from which a step
input signal originates. This signal is transferred through the line in the
direction indicated by the arrow to the Transfer Function linear block. The
Transfer Function modifies its input signal and outputs a new signal on a
line to the Scope. The Scope is a sink block used to display a signal much
like an oscilloscope.
There are many more types of blocks available in Simulink, some of which
will be discussed later. Right now, we will examine just the three we have
used in the simple model.
Modifying Blocks
A block can be modified by double-clicking on it. For example, if you
double-click on the "Transfer Fcn" block in the simple model, you will see
the following dialog box.
49
REC
This dialog box contains fields for the numerator and the denominator of the
block's transfer function. By entering a vector containing the coefficients of
the desired numerator or denominator polynomial, the desired transfer
function can be entered. For example, to change the denominator to
s^2+2s+1, enter the following into the denominator field:
[1 2 1]
and hit the close button, the model window will change to the following:
REC
The default parameters in this dialog box generate a step function occurring
at time=1 sec, from an initial level of zero to a level of 1. (in other words, a
unit step at t=1). Each of these parameters can be changed. Close this dialog
before continuing.
The most complicated of these three blocks is the "Scope" block. Double
clicking on this brings up a blank oscilloscope screen.
51
REC
When a simulation is performed, the signal which feeds into the scope will
be displayed in this window. Detailed operation of the scope will not be
covered in this tutorial. The only function we will use is the autoscale
button, which appears as a pair of binoculars in the upper portion of the
window.
Running Simulations
To run a simulation, we will work with the following model file:
simple2.mdl
Download and open this file in Simulink following the previous instructions
for this file. You should see the following model window.
Before running a simulation of this system, first open the scope window by
double-clicking on the scope block. Then, to start the simulation, either
select Start from the Simulation menu (as shown below) or hit Ctrl-T in the
model window.
52
REC
The simulation should run very quickly and the scope window will appear as
shown below. If it doesn't, just double click on the block labeled "scope."
Note that the simulation output (shown in yellow) is at a very low level
relative to the axes of the scope. To fix this, hit the autoscale button
(binoculars), which will rescale the axes as shown below.
Note that the step response does not begin until t=1. This can be changed by
double-clicking on the "step" block. Now, we will change the parameters of
the system and simulate the system again. Double-click on the "Transfer
Fcn" block in the model window and change the denominator to
53
REC
[1 20 400]
Re-run the simulation (hit Ctrl-T) and you should see what appears as a flat
line in the scope window. Hit the autoscale button, and you should see the
following in the scope window.
Notice that the autoscale button only changes the vertical axis. Since the
new transfer function has a very fast response, it compressed into a very
narrow part of the scope window. This is not really a problem with the
scope, but with the simulation itself. Simulink simulated the system for a full
ten seconds even though the system had reached steady state shortly after
one second.
To correct this, you need to change the parameters of the simulation itself. In
the model window, select Parameters from the Simulation menu. You will
see the following dialog box.
54
REC
55
REC
Building Systems
In this section, you will learn how to build systems in Simulink using the
building blocks in Simulink's Block Libraries. You will build the following
system.
First you will gather all the necessary blocks from the block libraries. Then
you will modify the blocks so they correspond to the blocks in the desired
model. Finally, you will connect the blocks with lines to form the complete
system. After this, you will simulate the complete system to verify that it
works.
Gathering Blocks
Follow the steps below to collect the necessary blocks:
Create a new model (New from the File menu or Ctrl-N). You will get a
blank model window.
56
REC
57
REC
Drag the Step block from the sources window into the left side of your
model window.
58
REC
From the Simulink Library Browser, drag the Sum and Gain from "Math
Operations" option found under the Simulink title.
Switch to the "Continuous" option and drag two instances of the Transfer
Fcn (drag it two times) into your model window arranged approximately as
shown below. The exact alignment is not important since it can be changed
59
REC
later. Just try to get the correct relative positions. Notice that the second
Transfer Function block has a 1 after its name. Since no two blocks may
have the same name, Simulink automatically appends numbers following the
names of blocks to differentiate between them.
Click on the "Sinks" option then drag over the "Scope" icon
60
REC
Modify Blocks
Follow these steps to properly modify the blocks in your model.
Double-click your Sum block. Since you will want the second input to
be subtracted, enter +- into the list of signs field. Close the dialog box.
Double-click your Gain block. Change the gain to 2.5 and close the
dialog box.
Double-click the leftmost Transfer Function block. Change the
numerator to [1 2] and the denominator to [1 0]. Close the dialog box.
Double-click the rightmost Transfer Function block. Leave the
numerator [1], but change the denominator to [1 2 4]. Close the dialog box.
Your model should appear as:
61
REC
Change the name of the first Transfer Function block by clicking on the
words "Transfer Fcn". A box and an editing cursor will appear on the block's
name as shown below. Use the keyboard (the mouse is also useful) to delete
the existing name and type in the new name, "PI Controller". Click
anywhere outside the name box to finish editing.
62
REC
Similarly, change the name of the second Transfer Function block from
"Transfer Fcn1" to "Plant". Now, all the blocks are entered properly. Your
model should appear as:
63
REC
The resulting line should have a filled arrowhead. If the arrowhead is open,
as shown below, it means it is not connected to anything.
You can continue the partial line you just drew by treating the open
arrowhead as an output terminal and drawing just as before. Alternatively, if
64
REC
you want to redraw the line, or if the line connected to the wrong terminal,
you should delete the line and redraw it. To delete a line (or any other
object), simply click on it to select it, and hit the delete key.
Draw a line connecting the Sum block output to the Gain input. Also
draw a line from the Gain to the PI Controller, a line from the PI Controller
to the Plant, and a line from the Plant to the Scope. You should now have the
following.
65
REC
Now, the open arrowhead of this partial line can be treated as an output
terminal. Draw a line from it to the negative terminal of the Sum block in the
usual manner.
66
REC
Now, you will align the blocks with each other for a neater appearance.
Once connected, the actual positions of the blocks does not matter, but it is
easier to read if they are aligned. To move each block, drag it with the
mouse. The lines will stay connected and re-route themselves. The middles
and corners of lines can also be dragged to different locations. Starting at the
left, drag each block so that the lines connecting them are purely horizontal.
Also, adjust the spacing between blocks to leave room for signal labels. You
should have something like:
Finally, you will place labels in your model to identify the signals. To
place a label anywhere in your model, double click at the point you want the
label to be. Start by double clicking above the line leading from the Step
block. You will get a blank text box with an editing cursor as shown below
67
REC
Type an r in this box, labeling the reference signal and click outside it to end
editing.
Label the error (e) signal, the control (u) signal, and the output (y) signal
in the same manner. Your final model should appear as:
68
REC
To save your model, select Save As in the File menu and type in any
desired model name.
Simulation
Now that the model is complete, you can simulate the model. Select Start
from the Simulation menu to run the simulation. Double-click on the Scope
block to view its output. Hit the autoscale button (binoculars) and you
should see the following.
REC
Close this dialog box. Notice now that the Gain block in the Simulink model
shows the variable K rather than a number.
Now, you can re-run the simulation and view the output on the Scope. The
result should be the same as before.
70
REC
71
REC
A mass on a spring with a velocity-dependant damping force and a timedependant force acting upon it will behave according to the following
equation:
The model will be formed around this equation. In this equation, 'm' is the
equivalent mass of the system; 'c' is the damping constant; and 'k' is the
constant for the stiffness of the spring. First we want to rearrange the above
equation so that it is in terms of acceleration; then we will integrate to get
the expressions for velocity and position. Rearranging the equation to
accomplish this, we get:
72
REC
To build the model, we start with a 'step' block and a 'gain' block. The gain
block represents the mass, which we will be equal to 5. We also know that
we will need to integrate twice, that we will need to add these equations
together, and that there are two more constants to consider. The damping
constant 'c' will act on the velocity, that is, after the first integration, and the
constant 'k' will act on the position, or after the second integration. Let c =
0.35 and let k = 0.5. Laying all these block out to get an idea of how to put
them together, we get:
73
REC
Once we have added places and corrected the signs for the sum block, we
need only connect the lines to their appropriate places. To be able to see
what is happening with this spring system, we add a 'scope' block and add it
as follows:
74
REC
The values of 'm', 'c' and 'k' can be altered to test cases of under-damping,
critical-damping and over-damping. To accurately use the scope, right-click
the graph and select "Autoscale".
The mdl-file can now be saved. The following is a sample output when the
model is run for 30 iterations.
75
76
REC
REC
REC
REC
79
REC
Examining the diagram shown above we can see that as some external
turning force is applied to the shaft (for example: by motor or by hand) the
cam rotates with it. The follower is free to move in the Y plane but is unable
to move in the other two so as the lobe of the cam passes the edge of the
follower it causes the follower to move up. Then some external downward
force (usually a spring and gravity) pushes the follower down making it keep
contact with the cam. This external force is needed to keep the follower in
contact with the cam profile.
Displacement Diagrams:
80
REC
Note: Angular displacement is the angle through which the cam has
rotated.
If we examine the diagram shown below we can see the relationship
between a displacement diagram and the actual profile of the cam. Note
only half of the displacement diagram is drawn because the second half of
the diagram is the same as the first. The diagram is correct from a
theoretical point of view but would have to changed slightly if the cam was
to be actually made and used. We will consider this a little more in the the
following section - Uniform Velocity.
81
REC
Uniform Velocity:
Uniform Velocity means travelling at a constant speed in a fixed direction
and as long as the speed or direction don't change then its uniform velocity.
In relation to cam and follower systems, uniform velocity refers to the
motion of the follower.
Now let's consider a typical displacement diagram which is merely a plot of
two different displacements (distances). These two displacements are:
1. the distance travelled up or down by the follower and
2. the angular displacement (distance) of the cam
Let us consider the case of a cam imparting a uniform velocity on a follower
over a displacement of 30mm for the first half of its cycle.
We shall take the cycle in steps. Firstly if the cam has to impart a
displacement of 30mm on follower over half its cycle then it must impart a
displacement of 30mm180 for every 1 turned by the cam i.e. it must
move the follower 0.167mm per degree turn. This distance is to much to
small to draw on a displacement diagram so we will consider the
displacement of the follower at the start, at the end of the half cycle, the end
of the full cycle and at certain other intervals (these intervals or the
length of these intervals will be decided on later).
82
REC
83
REC
To conclude this:
A cam can impart three types of motion on its follower:
Uniform velocity
84
85
REC
86
REC
87
REC
88
REC
89
REC
90
REC
91
REC
92
REC
93
REC
94
REC
95
REC
96
REC
97
REC
98
REC