You are on page 1of 35

MH504: Modelling and Simulation of

Mechatronic Systems

Atul Thakur, Ph.D.


Department of Mechanical Engineering
IIT Patna

Ref. Chapter 5 of D.C. Karnopp, D.L. Margolis and


R.C. Rosenberg, “System Dynamics: A Unified
Approach”, 5th Edition.
Syllabus
 Physical Modelling: Mechanical and electrical systems, physical laws,
continuity equations, compatibility equations, system engineering concept,
system modelling with structured analysis, modelling paradigms for
mechatronic system, block diagrams, mathematical models, systems of
differential-algebraic equations, response analysis of electrical systems,
thermal systems, fluid systems, mechanical rotational system, electrical-
mechanical coupling
 Simulation Techniques: Solution of model equations and their interpretation,
zeroth, first and second order system, solution of 2nd order electro-
mechanical equation by finite element method, transfer function and
frequency response, non-parametric methods, transient, correlation,
frequency, Fourier and spectra analysis, design of identification experiments,
choice of model structure, scaling, numeric methods, validation, methods of
lumped element simulation, modelling of sensors and actuators, hardware in
the loop simulation (HIL), rapid controller prototyping, coupling of
simulation tools, simulation of systems in software (MATLAB, LabVIEW)
environment
State-Space Equations
State space representation

Where, 𝑥𝑖 are the state variables, 𝑢𝑖 are the inputs, and 𝜙𝑖 are a set of static algebraic functions

For linear systems

For time invariant systems, 𝑎𝑖𝑗 and 𝑏𝑖𝑗 are constants while for time varying systems 𝑎𝑖𝑗 and
𝑏𝑖𝑗 vary with time
Recall This?
 Expressed as ordinary differential equations in terms of state variables
 State of a system is a set of variables that along with the input and dynamics equation can
predict the future state and output of the system
Example of spring mass damper system
𝑑 2 𝑥(𝑡) 𝑑𝑥(𝑡)
𝑀 +𝑏 + 𝑘𝑥(𝑡) = 𝑢(𝑡)
𝑑𝑡 2 𝑑𝑡
𝑑𝑥 𝑡
Let, 𝑥1 𝑡 = 𝑥 𝑡 and 𝑥2 𝑡 =
𝑑𝑡
0ሶ 1 𝑥1 0
𝑥ሶ 1 𝑘 𝑏 1 𝑢
= 𝑥2 +
𝑥ሶ 2 − −
𝑀 𝑀 𝑀
If we are
In general, for linear systems interested in
𝑋ሶ = 𝐴𝑋 + 𝐵𝑈 displacement
And for nonlinear systems 𝑥(𝑡) as output
𝑋ሶ = 𝑓(𝑋, 𝑢) then
Input Output 𝑌(𝑡) = 𝑥(𝑡)
Variables Dynamic System, 𝑆
Variables
𝑈 State variable, 𝑋
𝑌
This method may not be easily applicable for more complex systems – Bond graph may be used
Preparing the Bond Graph
Augmenting the Bond Graph
Steps
 Name all the bonds in the graph by numbering them consecutively
 Assign to each bond a reference power direction
 Assign to each bond a causal sense for the pair of variables 𝑒 and 𝑓
Other Perspective - Directed Bond
Graph and Oriented Circuit
A Few Notes
 For a graph with 𝑁 bonds there are 2𝑁 bond variables
 𝑁 efforts and 𝑁 flows
 Each 𝑛-port implies 𝑛 constraints
 Each bond is adjacent to two multiports
 Number of bond variables constraints are always equal

Example 𝑁=6 bonds


12 bond variables (𝑣1 , 𝑣2 , 𝑣3 … 𝑣6 , 𝑖1 , 𝑖2 … 𝑖6 )
Constraints
• SE1 imposes 1,
• I2 imposes 1,
• R3 imposes 1,
• 1,1,2,3,4 imposes 4 (three identities and one summation),
• 0,4,5,6 imposes 3 (two identities and one summation)
• C5 imposes 1
• R6 imposes 1
Overall 12 equations
Assignment of Causality
 Every source element must have its appropriate causal form assigned
to it
 Every TF and GY must have one of its two allowable causal forms
assigned to it
 Each 0 and 1 must have one of its causal forms assigned to it
Examples of Invalid Causality

Incompatible situations
Causality on C, I and R elements
 Energy variables (p on I and q on C) are the basis of state variables
 Energy variables will help in determining system energy
 Bond graph structural constraints serve to define powers that cause the
energy to flow subject to input conditions
 For R elements assignment of any causality is alright

Integration
causality
preferred
Causal Assignment Procedure
1. Choose any source SE, SF and assign its required causality
and extend it as far as possible through the graph
2. Repeat 1 until all sources have been used
3. Choose any storage C or I and apply preferred integration
causality and extend through the graph
4. Repeat 3 to cover all C and I
5. Choose any remaining R and assign arbitrary causality
6. Repeat 5 to cover all R
7. Choose any remaining unassigned bond and assign arbitrary
causality
8. Repeat 7 to complete the assignment
Example 1 – Assignment of Causality
1. Choose any source SE, SF and assign its
required causality and extend it as far as
possible through the graph
2. Repeat 1 until all sources have been used
3. Choose any storage C or I and apply
preferred integration causality and extend
through the graph
4. Repeat 3 to cover all C and I
5. Choose any remaining R and assign arbitrary
causality
6. Repeat 5 to cover all R
7. Choose any remaining unassigned bond and
assign arbitrary causality
8. Repeat 7 to complete the assignment
Example 2 – Assignment of Causality
Formulation
 For simple systems, state-space equations can be written
down directly
 For larger and more complex systems, an organized
procedure is required

Three steps
Step#1: Select input, energy, and co-energy variables
Step#2: Formulate the initial set of system equations
Step#3: Reduce the initial equations to state-space form
Step#1: Select Input, energy, and co-energy variables
 For each source element write input
variables
 Represented as 𝑈
 State variables are formed by energy
variables for each storage element in
the graph
 𝑝-variable on 𝐼-elements and 𝑞-
variable on 𝐶-elements – list of state Input Assignment
variables will be represented as 𝑋
 Co-energy set consists of the 𝑓 on
𝐼 and 𝑒 on 𝐶
 These appear on initial part of Energy variables
formulation and eliminated in the
reduction process

Co-energy variable
Step#2: Formulate the initial set of system equations
State:

Input:

For a linear system:

For a nonlinear system:


Step#3: Reduce the initial equations to state-space form
Write co-energy variables in terms of energy variables

Using 0-junction constraint and causality


Another Example Input
𝑈 contains 𝑉1 (𝑡)
Energy Variable
𝑋 contains 𝜆2
Co-energy Variable
𝑖2 and 𝑣5

Constitutive laws 1-Junction


0-Junction
Recall
Generalized Mechanical Mechanical Hydraulic Port Electrical Port
Variables Translation Port Rotation Port
Effort, 𝑒 Force, 𝐹 (N) Torque, 𝜏 (N-m) Pressure, 𝑃 (N/m2) Voltage, e, (V or N-
m/C)
Flow, 𝑓 Velocity, 𝑉 (m/s) Angular velocity, Volume flow rate, 𝑄 Current, I, (A or
𝜔 (rad/s) (m3/s) C/s)
Momentum, Momentum, 𝑃 (N-s) Angular Pressure momentum, Flux linkage, 𝜆(V-s)
𝑝 Momentum, 𝑝𝜏 𝑝𝑝 (N-s/m2)
(N-m-s)
Displacement, Displacement, 𝑋 (m) Angle, 𝜃 (rad) Volume, 𝑉 (m3) Charge, q (A-s)
𝑞
Power, 𝑃 𝐹(𝑡)𝑉(𝑡) (N-m/s) 𝜏 t 𝜔(𝑡) (Nm/s) 𝑃(𝑡)𝑄(𝑡) (Nm/s) e 𝑡 𝑖(𝑡) (V-A or W
or Nm/s)

Energy, 𝐸 ‫𝑥𝑑𝐹 ׬‬, ‫( 𝑃𝑑𝑉 ׬‬N- ‫𝜃𝑑𝜏 ׬‬, ‫𝑉𝑑𝑃 ׬‬, ‫) 𝑝𝑝𝑑𝑄 ׬‬ ‫𝑞𝑑𝑒 ׬‬, ‫( )𝜆𝑑𝑖 ׬‬V-A-
m) ‫( ) 𝑢𝑎𝑡𝑝𝑑𝜔 ׬‬N- (N-m) s, or W-s or N-m)
m)
Further Aspects
Part#1: If causality is not completed by source and storage
elements alone
Part#2: Treating differentiation causality
Part#3: Expressions for expressions other than energy
variables
Part#1: If causality is not completed by
source and storage elements alone
Example
Input and energy variables Constitutive equations

Energy variable derivative


Part#2: Treating differentiation causality
Example

General rule: Energy variable for storage elements in integration causality can serve as state variable
Hence, in this example state variable will be 𝑞2
Energy variable Derivative of qሶ 2
Example
Part#3: Expressions for expressions
other than energy variables
Output Variable Formulation
 Output variables (typically expressed as Y) are derived in terms of state and input variables
 For linear systems
𝑦1 = 𝑐11 𝑥1 + 𝑐12 𝑥2 + ⋯ + 𝑐1𝑛 𝑥𝑛 + 𝑑11 𝑢1 + ⋯ + 𝑑1𝑟 𝑢𝑟
𝑦2 = 𝑐21 𝑥1 + 𝑐22 𝑥2 + ⋯ + 𝑐2𝑛 𝑥𝑛 + 𝑑21 𝑢1 + ⋯ + 𝑑2𝑟 𝑢𝑟
.
.
.
𝑦𝑚 = 𝑐𝑚1 𝑥1 + 𝑐𝑚2 𝑥2 + ⋯ + 𝑐𝑚𝑛 𝑥𝑛 + 𝑑𝑚1 𝑢1 + ⋯ + 𝑑𝑚𝑟 𝑢𝑟
Example: To find volume drawn from the pressure supply

Let us assume following constitutive relations, 𝜙8 resistance and 𝜙3


capacitance function

𝑄1 is expressed as a function of state variable 𝑉3 and input 𝑃1


Example: Power delivered to a resistive load
State Input Constitutive relations

Structure Equations

State Space Form


Power delivered to load

You might also like