Modeling and Simulation of Mechatronic Systems

Download as pdf or txt
Download as pdf or txt
You are on page 1of 161

Prepared by: Gordana Janevska

WARNING: This material is for educational (teaching) purposes only and should be used according to the
copyright and “fair use” rules. No further reproduction or distribution of this material is permitted. Any further
reproduction or distribution of the material or some parts of the material may require prior approval from the
copyright owner. If the use of this material excess the “fair use” rules, the user may be responsible for copyright
violations.
Gordana Janevska

MODELING AND SIMULATION OF MECHATRONIC SYSTEMS

Contents

1. INTRODUCTION TO MECHATRONICS
DEFINING MECHATRONICS
KEY ELEMENTS OF MECHATRONICS
APPLICATIONS OF MECHATRONIC SYSTEMS
THE PURPOSE OF MODELLING AND SIMULATION OF MECHATRONIC
SYSTEMS

2. BASICS
MODELS AND SIMULATION: THE VIRTUAL REALITY
SYSTEMS AND MODELS
TYPES OF MATHEMATICALMODELS
Input-output model versus state space model
Static versus dynamic systems
A (loose) classification of dynamic models
Lumped versus Distributed parameters
Linear versus nonlinear models
Continuous versus discrete models
Continuous-time versus discrete-time models
Deterministic versus stochastic models
Summary
MODEL VALIDATION
MODEL AND SIMULATION

3. INTRODUCTION TO MATLAB, Simulink and LabVIEW


INTRODUCTION TO MATLAB
MATLAB Environment
Vectors
Functions
Plotting
Polynomials
Matrices
Script Files or M-Files
Getting help in MATLAB
INTRODUCTION TO SIMULINK
Starting SIMULINK
Basic Elements
Simple Example
INTRODUCTION TO LABVIEW

1
VI Front Panel
Block diagram
Icon and connector pane
Three LabVIEW Palettes
Status Toolbar
Show context Help
Help Options

4. THEORETICAL MODELING
MODEL PARAMETERS AND SIGNALS
PHASES OF MODELING
Phase 1: Structuring the Problem
Phase 2: Setting up the Basic Equations
Phase 3: Forming the final model
SOME BASIC RELATIONSHIPS IN PHYSICS
Electrical Systems
Mechanical Systems
Translational Mechanical Systems
Rotational Mechanical Systems
Fluid Systems
Thermal Systems
Analogies between physical sub-areas
MODEL SIMPLIFICATION

5. BOND GRAPHS
INTRODUCTION
EFFORTS AND FLOWES
JUNCTIONS
SIMPLE BOND GRAPHS
TRANSFORMERS AND GYRATORS
SYSTEMS WITH MIXED PHYSICAL VARIABLES
CAUSALITY: SIGNALS BETWEEN SUBSYSTEMS
STATE EQUATIONS FROM BOND GRAPHS
CONCLUSIONS

6. EXPERIMENTAL MODELING - IDENTIFICATION


INTRODUCTION
BASICS OF EXPERIMENTAL MODELING
SIMPLE PRELIMINARY IDENTIFICATION
PARAMETER ESTIMATION
IDENTIFICATION IN CLOSED LOOP
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

7. SIMULATION
USING MODELS FOR SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

2
SCALING OF THE MODEL EQUATIONS
BLOCK DIAGRAMS AND SUBSYSTEMS
SIMULATION LANGUAGES

TRANSLATIONAL MECHANICAL SYSTEM WITH MASSES, SPRING AND


FRICTION (Train system - EXAMPLE)
Physical Modeling
Mathematical Modeling
MATLAB representation
Building the Model in SIMULINK
Running the Model
Obtaining MATLAB Model
Building the Model in LABVIEW
Running the Model in LABVIEW

DC MOTOR – EXAMPLE
MODELING DC MOTOR POSITION
Physical Modeling
Mathematical Modeling
MATLAB representation and open-loop response
Building the Model in SIMULINK
LabVIEWrepresentation and open-loop response
LABVIEW SIMULATION OF DC MOTOR

FLUID FLOW RESERVOIR MODELING – EXAMPLE


FLUID FLOW RESERVOIR
Physical Modeling
Mathematical Modeling
Step response

Modeling and Simulation of a Pneumatic Servosystem for Position


Control

3
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
1. INTRODUCTION TO
MECHATRONICS

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MECHATRONICS

DEFINING MECHATRONICS

™ The word mechatronics as a compositon of mecha from mechanics and


tronics from electronics originated in Japan around 1970 to describe the
integration of mechanical and electronic components in consumer products.

MECHANICS
ELETRONICS

™ The meaning of this word continuously evolves after the original definition.
Today it has come to mean multidisciplinary systems engineering. The
definition that mechatronics is simply the combination of different
technologies is no longer sufficient to explain mechatronics

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

4
INTRODUCTION TO MECHATRONICS

DEFINING MECHATRONICS

™ Integration is the key element in mechatronic


design as complexity has been transferred
from the mechanical domain to the electronic
and computer software domains.
™ Mechatronics, as an engineering discipline, is
the synergistic combination of mechanical
engineering, electronics, control engineering,
and computers, all integrated through the Aerial Venn diagram from Rensselaer Polytechnic
Institute (Troy, New York) website describes the various
design process. ffields that make upp Mechatronics

™ Mechatronics is the integration of the different technologies to obtain the best


solution to a given technological problem, which is the realization of a product.
It is really nothing but good design practice. It means using modern, cost-
effective technology to improve product and process performance and flexibility.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MECHATRONICS

DEFINING MECHATRONICS

™ Mechatronics gained legitimacy in academic


circles with the publication of the first
refereed
f d journal:
j l IEEE/ASME
/AS Transactions
on Mechat ronics, where the following
definition was given:
Mechatronics is the synergistic
combination of precision mechanical
engineering, electronic control and systems
Aerial Venn diagram from Rensselaer Polytechnic
thinking in the design of products and Institute (Troy, New York) website describes the various
manufacturing processes
processes. fields that make up Mechatronics

™ Mechatronics is an evolutionary design development that demands horizontal


integration among the various engineering disciplines as well as vertical
integration between design and manufacturing. It is the best practice for
synthesis by engineers driven by the needs of industry and human beings.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

5
INTRODUCTION TO MECHATRONICS

DEFINING MECHATRONICS

™ All of the known definitions and statements about mechatronics are


accurate and informative, yet each one in and of itself fails to capture the
totality of mechatronics.

™ Although, an all-encompassing definition of mechatronics does not exist,


but in reality, engineers understand from the known definitions and from
their own personal experiences the essence of the philosophy of
mechatronics.

™ It should be understood that mechatronics is a way of life in modern


engineering practice.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MECHATRONICS

KEY ELEMENTS OF MECHATRONICS

™ The conception of mechatronics arises from the integration of knowledge


from different areas of physics and technical disciplines. The purpose of
mechatronics is to use this integration in order to achieve a synergic effect,
i.e. to obtain a product with highest possible technical and economical
parameters. In this light, the study of mechatronic systems can be divided
into the following areas of specialty:
¾ Physical Systems Modeling;
¾ Sensors and Actuators;
¾ Signals and Systems;
¾ Computers and Logic Systems;
¾ Software and Data Acquisition

RPI (Troy, New York) website

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

6
INTRODUCTION TO MECHATRONICS
KEY ELEMENTS OF
MECHATRONICS

Bishop, ed, The Mechatronics Handbook

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MECHATRONICS

KEY ELEMENTS OF MECHATRONICS

™ The key elements of the mechatronics approach are presented in the figure:

Mechatronics is the result of applying information systems to physical


systems. The physical system, the rightmost dotted block, consists of
mechanical, electrical, and computer (electronic) systems as well as
actuators, sensors, and real time interfacing. Sensors and actuators are
used to transduce energy from high power, usually the mechanical side,
to low power, the electrical and computer or electronic side. The block
labeled mechanical systems frequently consists of more than just
mechanical components and may include fluid, pneumatic, thermal,
acoustic, chemical, and other disciplines as well.
RPI (Troy, New York) website
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

7
INTRODUCTION TO MECHATRONICS

APPLICATIONS OF MECHATRONIC SYSTEMS

™ Today, mechatronic systems are commonly found in homes, offices,


schools, shops, and of course, in industrial applications.
¾ M
Machine-tool
hi t l construction
t ti andd equipment
i t for
f automation
t ti off
technological processes
¾ Robotics (industrial and special)
¾ Aviation, space and military techniques
¾ Automotive (climate control, antilock brake, active suspension, cruise
control, air bags, engine management, safety, etc.)
¾ Office equipment (for example, copy and fax machines)
¾ Computer facilities (for example, printers, plotters, disk drives)
¾ Home appliances (microwave ovens,
ovens washing machines
machines, vacuum
cleaners, dishwashers, air conditioning units, security systems).

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MECHATRONICS

THE PURPOSE OF MODELLING AND


SIMULATION OF MECHATRONIC SYSTEMS

™ There two different purposes for modeling of a physical system:


¾ To predict the dynamic behavior of the system as accurately as possible
¾ To gain insight into the dynamic behavior qualitatively instead of exact response prediction,
i.e., knowledge of stability margin, controllability and observability of states, and sensitivity
of response to parameter changes.
The mathematical models are need because:
™ Do not require a physical system ™ Support safety
¾ Can treat new designs/technologies
without prototype ¾ Experiments may be dangerous
¾ Do not disturb operation of existing ¾ Operators need to be trained for extreme
system situations
™ Easier to work with than real world ™ Help to gain insight and better understanding
¾ Easy to check many approaches, ™ Analogous Systems
parameter, values, ... ¾ Can have the same mathematical model
¾ Flexible to time-scales though different types of physical systems
¾ Can access un-measurable quantities ¾ Common analysis methods and tools can be
used.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

8
INTRODUCTION TO MECHATRONICS

THE PURPOSE OF MODELLING AND


SIMULATION OF MECHATRONIC SYSTEMS

™ Mechatronic systems' behavior is determined by interdependencies between different


components. Therefore, an integrated and interdisciplinary engineering approach is
necessary. Communication
i i across theh traditional
di i l boundaries
b d i between
b mechanical,
h i l
electrotechnical and computational engineering has to take place in an early design
process stage.

The importance of modeling and analysis in the design process has never been more
important.
™ Designs are usually the result of the improvement of an existing system, the innovative
combination of existing systems, or the application of new technology or new
k
knowledge
l d tot an existing
i ti system.
t In
I all
ll this,
thi understanding
d t di what h t exists
i t is
i paramountt
and modeling is essential to that understanding.
™ Once a concept has been developed in the conceptual phase of design it is evaluated
through modeling , not by building and testing the physical system, sensors, actuators,
and controls, all integrated into the design concept.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MECHATRONICS

THE PURPOSE OF MODELLING AND


SIMULATION OF MECHATRONIC SYSTEMS

™ Mechatronics design is more than just the combination of mechanical, electronic


and software design, so the mechatronic designer must optimize a design solution
across these disparate fields.
fields This requires a sufficient understanding of each of
these fields to determine which portions of an engineering problem are best solved
in each of these domains given the current state of technology. In turn, this
requires the ability to model the problem and potential solutions using techniques
that are domain independent or at least permit easy comparison of solutions and
tools from different domains.
™ Through system modeling and simulation, the Mechatronic System Design Process
facilitates:
¾ understanding
d di theh bbehavior
h i off the
h proposed d system concept;
¾ optimizing the system design parameters;
¾ developing optimal control algorithms, both local and supervisory;
¾ testing control algorithms under various scenarios;
¾ and qualifying the production controller with a simulated version of the plant running in
real time (hardware-in-the-loop testing), before connecting it to the real plant.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

9
INTRODUCTION TO MECHATRONICS

THE PURPOSE OF MODELLING AND


SIMULATION OF MECHATRONIC SYSTEMS

™ More and more, simulation is being used to detect and eliminate integration issues.
Simulation has been used on individual components and subsystems for quite some
time,
i bbut the
h reall value
l becomes
b apparent with
i h the
h ability
bili off virtual
i l integration
i i off those
h
individual systems. The tremendous cost savings of finding problems before you
commit to hardware are well-known. What's more important, however, is being able to
optimize system performance. That's something you can only achieve in simulation
when you can combine those different domains with the controllers in a single
simulation environment.
™ By running simulations early in the design process, engineers can try out new
technologies and see if they will improve the design.
™ Experimental study on physical prototypes is expensive and time consuming. Virtual
prototyping, as a new way of dynamic simulation of the controlled machine, is more
compliant with time and budget constraints of R&D industrial centers. If design choices
on the mechanical as well as on the electronic side can be tested before assembling the
physical prototype, the time to market is shortened and the knowledge of the system is
improved, obviously as long as the simulation plant is a reliable replication of reality
and the simulation tool is reasonably easy to use for people coming from different areas.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

10
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
2. BASICS

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASICS
MODELS AND SIMULATION: THE VIRTUAL REALITY

™ Many technical problems can not be resolved by observations or experiments:


¾ Process is not yyet exists,, or
¾ It can not be carried out without financial or technical risk.
™ In order to save time and money and not taking any unnecessary risks, it is
desirable to get answers on the basis of a model instead of carried out
experiments.
™ The model has the form of a mathematical description that allows performing a
numerical simulation on the computer.
™ The modeling of mechatronic systems plays an important role in the development
process of a mechatronic product. Generally, a model is required for:
¾ Simulation purposes,
¾ Analyzing the system,
¾ Designing a controller.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

11
BASICS
MODELS AND SIMULATION: THE VIRTUAL REALITY

™ Through system modeling and simulation, the engineers have a powerful tool
which allows them to:
¾ Answer essential issues and also examine the border areas without risk
¾ Test in advance the characteristics and modify if necessary, when the system is a
concept in the design process.

™ Besides their advantages, the modeling and simulation also have some pitfalls:
¾ Too simple model can not describe all aspects of the real system (process)
¾ Too complex
p model requires
q too much time and effort in the creation and
simulation
¾ A model can also be not valid
¾ Selection of appropriate integration algorithm is very important and only in this
way a correct simulation is ensured.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASICS
MODELS AND SIMULATION:
THE VIRTUAL REALITY

™ Reality is initially an entity, situation or system


to be investigated by simulation. Its modelling
can be viewed as a two-stage process:
¾ Establishing a conceptual model through
analyzed and modeled the reality by using
verbal descriptions, equations, relationships or
laws of nature;
¾ Transforming the conceptual model into an
Model generation, simulation, validation and
executable model (model that can be used for verification in context (Georg Pelz,
simulation)) as ppart of implementation.
p Mechatronic Systems)
y )

™ Model verification investigates whether the executable model reflects the


conceptual model within the field of application.
™ Model validation should tell us whether the executable model is suitable for
fulfilling the envisaged task within its field of application.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

12
BASICS
MODELS AND SIMULATION: THE VIRTUAL REALITY

™ There are actually two distinct models of an actual dynamic physical system and the
distinction between them is most important
¾ Ph
Physical
i l model
d l – an imaginary
i i physical
h i l systemt – a slice
li off reality,
lit which
hi h isi an approximation
i ti
of the actual system capturing the essential elements in as much detail as the need for the
model requires. In modeling dynamic physical systems we use engineering judgment and
simplifying assumptions to develop a physical model.
¾ Mathematical model – The laws of nature (physics, chemistry, biology) are applied to the
physical model (not the physical system) and the mathematical equations describing the
system are derived.
Hierarchy of Models, depending on the particular need for the model  
p , , y
more‐complex, more‐realistic, less‐easily‐solved

Truth Design
Model Model

less ‐complex, less‐realistic, more‐easily‐solved
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASICS
MODELS AND SIMULATION: THE VIRTUAL REALITY

™ There are two basic approaches to build mathematical modes:


¾ Th
Theoretical
ti l modeling
d li - carried
i d outt from
f th
the physical-technical
h i l t h i l basic
b i
equations
¾ Experimental modeling - carried out from measured input and output
data (Need prototype or real system!)

™ Simulation: Calculation of the behavior of a system model in dependence


on time, and the state of a system and environment. The simulation
provides projections about the behavior of the real system with the aid of a
model, which can be executed in a computer.
Simulation is thus an inexpensive and safe way to experiment with the
system. However, the value of the simulation results depends completely
on the quality of the model of the system.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

13
BASIC CONCEPTS

SYSTEMS AND MODELS

System: set of elements, which are interconnected in different interactions.


A system is a combination of components which are coordinated together
f
to perform ifi objective.
a specific bj i
Disturbance Inputs
Subsystem System Outputs

System

Control
C l Inputs
I
Subsystem: a component of a larger system
A system is a defined part of the real world. Essential for defining a system is
the system boundary to the environment. Interactions with the environment are
described by system inputs and system outputs.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS

SYSTEMS AND MODELS

™ For the modeling it is necessary to abstract the given real problem, i.e. to
y
define a suitable system, which can then be used as a model for the original
g
problem. It can be noted here that the experience is playing a great role in
model development

™ Model: A description of the system. The model should capture the


essential information about the system.

™ The model, which defines a system, must also give a mathematical


description of the internal and external interactions. Although some
software already provides graphical elements, the mathematical formula is
the basis for numerical implementation and interchangeability of
information (regardless of computer platforms!). This step can be done
easier with experience, but a systematic approach is recommended from the
very beginning.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

14
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Input--output model versus state space model
Input
Inputs, u: External influences on the
system
y ((force, current, …))
Outputs, y: Variables of interest to
be calculated or measured (position,
velocity, …)
Input‐output  system model 
Input-output models, regardless of the complexity of the context, described the output
variables y directly by the inputs u. A system is considered as a device that
transformed inputs to outputs.
The state space
p model includes additional internal variables – state variables,, x
State variables, x: Represent the status or memory of the system.
The state is a collection of variables that summarize the past of a system for the
purpose of prediction the future.
Initial states x(t0) and inputs u(t) completely determine future outputs y(t) and
states x(t), t≥t0 .
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Static versus dynamic systems
™ In a static system, the outputs are defined by algebraic combinations of the inputs.
Dependencies of variables upon one another are fixed (independent of time).
Example: V=i R
and even V(t) =i(t)R
that is, the fact that current must be multiplied by resistance to
give voltage (the dependency) is independent of time.
™ In dynamic systems, the output variables due to memory effects show complex
dependencies. The present output of the system depends on past inputs.
Dependencies of variables upon one another change with time.
A slightly narrower definition: A dynamic system is a system that is described by
differential and/or difference equations.
Example:
A capacitor connected to a resistor with an external voltage V
The voltage over the capacitor depends on the charge and thereby
on earlier values of the current and voltage V
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

15
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
A (loose) classification of dynamic models

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Lumped versus Distributed parameters

Both properties are related to systems of dynamic nature.


™ In a lumped-parameter model, system dependent variables are assumed uniform
over finite regions of space. Time is the only independent variable and the
mathematical model is an ordinary differential equation. The events are described
by a finite number of changing variable

™ In a distributed-parameter model, time and spatial variables are independent


variables and the mathematical model is a partial differential equation. The
events in the system are so to speak dispersed over the space variables.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

16
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Linear versus nonlinear models

™ Th
The mathematical
th ti l description
d i ti off a linear
li model
d l consists
i t off a li
linear combination
bi ti
of inputs and outputs. Linear models, both analytically and numerically, are
much more efficient to deal with, especially stability analysis can be performed
easily and closed. Unfortunately, linearity is only one ideal shape, real systems
are almost always non-linear.

™ All other models are called nonlinear. Nearly all physical elements or systems
are inherently nonlinear if there are no restrictions at all placed on the
allo able values
allowable al es of the inp
inputs,
ts ee.g.,
g sat
saturation,
ration dead-zone,
dead one sq square-law
are la
nonlinearities

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Linear versus nonlinear models
A linear system satisfies the properties of superposition and homogeneity
™ The superposition property states that for a system initially at rest with zero energy
the response to several inputs applied simultaneously is the sum of the individual
responses to each input applied separately
When the system at rest is subjected to an excitation x1(t), it provides a response
y1(t). Furthermore, when the system is subjected to an excitation x2(t), it provides a
corresponding response y2(t). For a linear system, it is necessary that the excitation
x1(t) + x2(t) result in a response y1(t) + y2(t). This is usually called the principle of
superposition.
™ The property of homogeneity: the magnitude scale factor must be preserved, i.e.
multiplying
lti l i theth inputs
i t by
b any constant
t t multiplies
lti li the
th outputs
t t byb the
th same constant.
t t
For a system with an input x(t) that results in an output y(t), the response of a linear
system to a constant multiple β of an input x must be equal to the response to the
input multiplied by the same constant so that the output is equal to β y
Non-linear systems do not satisfy both these criteria
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

17
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Linear versus nonlinear models
™ Often, the theoretical modeling goes through a nonlinear model, which is then linearized
around an operating point. If the values of the inputs are confined to a sufficiently small range,
th original
the i i l nonlinear
li model
d l off the
th system
t may often
ft bbe replaced
l d bby a lilinear model
d l whose
h
response closely approximates that of the nonlinear model. A linear approximation is as
accurate as the assumption of small signals is applicable to the specific problem.

Example:
The normal operating point of the system consists of mass M sitting on a nonlinear spring is
the equilibrium position that occurs when the spring force balances the gravitational force M g
(g is the gravitational constant). Thus, f0 = M g.
For the nonlinear spring with f = y 2, the equilibrium
position ( g))1/2. The
i i iis y0 = (M h li
linear model
d l ffor small
ll
deviation is
∆f = m ∆ y, where
Thus, m = 2 y0.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Continuous versus discrete models
™ The distinction continuous – discrete dates back to the controversy between analog
((=continuous)) and digital
g ((=discrete)) simulation. However, use of these attributes
without further precision may causes confusion, so it should be avoid. Both, dynamic
systems and models have dependent and independent variables and one, several or all
may change continuously or in discrete way.
™ The contrast continuous-time and discrete-time is not a precise. Systems may change
at discrete instants of time in a deterministic manner or, such changes may occur
stochastically. Therefore, it is better to make distinction between three properties:
continuous-time and discrete-time − discrete-event − hybrid: There are systems
which change continuously with time.time Other systems change only at certain instants
of time or during rather short intervals. Moreover, there are systems subjected to a
sequence of countable events where it can be assumed that nothing of interest take
place between them (discrete-event system or model, respectively). Furthermore,
there are systems where both continuous time and discrete-events are present (hybrid
systems).
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

18
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Continuous--time versus discrete-
Continuous discrete-time models
™ A mathematical model that describes the relationship between time continuous signals
is called time continuous. Differential equations
q are often used to describe such a
relationship.
™ A model that directly expresses the relationships between the values of the signals at
the sampling instants is called a discrete time or sampled model. Such a model is
typically described by difference equation.

For processing by digital computers, all


signals are, both, quantized value and
discretized in time (sampling time Ts).
I practice,
In ti theth signals
i l off interest
i t t are
most often obtained in sampled form,
which is a result of discrete time
measurements.

Sampling a continuous signal: a) continuous-time signal,


b) time-discretized (sampled) signal.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Continuous--time versus discrete-
Continuous discrete-time models
Example
A continuous-time model of a damped linear oscillator is given by the differential equation

The discretization of this model with a sampling time Ts =0.25 s results in a difference
equation of the form

where k is an abbreviated form for all time points t = k Ts .


The numerical coefficients of the discrete model depend not only on the continuous model, but
the choice of sampling time Ts also plays an important role! In Figure, the step responses of both
models are shown. Note that the discrete-time model output is a constant on a sampling interval,
which means a loss of information compared to the continuous model.

Step response of a damped oscillator.


Left: continuous-time model.
Right: time-discrete model with a sampling
time Ts =0.25 s

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

19
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Deterministic versus stochastic models
™ Deterministic system - all system inputs are explicitly known during the time and the
system parameters are either constant or their variations are also known
known. A model is
called deterministic if it works with an exact relationship between measurable and
derived variables and expresses itself without uncertainty. Deterministic systems
show in principle predictable behavior, if modeled exactly; the future behavior can
be computed from its present state and the known influence on it.
™ Stochastic system – the system inputs or parameters are known only from statistical
measurements or can be specified only probabilistically. A model is stochastic if it
works with uncertainty or probability concepts. A stochastic, mathematical model
contains quantities that are described using stochastic variables or stochastic
processes.
The stochastic models are especially important because in every measurement
noise occurs. To get models or to estimate optimal experimental conditions from these
noisy measurements, the stochastic system theory must be considered. The important
area of system identification is therefore also dependent on stochastic models.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS
Summary
™ The most realistic physical model of a dynamic system leads to differential equations
of motion that are:
¾ nonlinear, partial differential equations with time-varying and space-varying
parameters
¾ These equations are the most difficult to solve.

™ The simplifying assumptions lead to a physical model of a dynamic system that is less
realistic and to equations of motion that are:
¾ linear, ordinary differential equations with constant coefficients
¾ These
Th equations
ti are easier
i tot solve
l andd design
d i with
ith

This dilemma between easy-to-handle and realistic has been formulated very nicely
by Pindyck already in 1972: ‘Our preoccupation with linear time-invariant systems is not
a reflection of a belief in a linear time-invariant real world, but instead a reflection of the
present state of the art of describing the real world’.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

20
BASIC CONCEPTS
TYPES OF MATHEMATICAL MODELS

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BASIC CONCEPTS

MODEL VALIDATION
Model validation procedure After the model creation, it must be examine whether the
model fulfills its purpose well, i.e. whether the model reflects
the reality sufficiently well. A model is not useful until its
validity has been tested and established.
Models have been developed to help in solving certain
problems. We call a model that is useful in this way valid with
regard to the purpose in mind. Deciding if a certain model is
valid is called model validation.
The model validation is not a one step, but an iterative process
that is closely associated with the actual modeling task.

Test of the validity

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

21
BASIC CONCEPTS

MODEL AND SIMULATION

Simulation models are a special subset of mathematical or physical models that allow
the user to ask "what if" questions about the system. Changes are made in the physical
conditions
diti or their
th i mathematical
th ti l representation
t ti andd the
th modeld l is
i run many times
ti to
t
"simulate" the impacts of the changes in the conditions. The model results are then
compared to gain insight into the behavior of the system.
The form in which a model must be brought for a simulation crucially depends on the
simulation software that is used. In graphical interfaces, a block diagram representation
is sufficient (e.g. Simulink), other programs require a specific mathematical description
of programming (Matlab, ACSL). Nevertheless, the essential core of a simulation is
the mathematical description which is completely platform independent.
The simulation provides a numerical experiment on a suitably prepared model.
Each experiment must provide the same result under the same conditions regardless of
experimenter, time and place of performing. But all experiment defining parameters
must be known. Therefore, it is particularly important the simulation parameters such
as initial conditions, integration algorithm, step size, tolerances, etc. to be saved and
reproducible.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

22
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
3. INTRODUCTION TO
MATLAB, Simulink
and LabVIEW

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
MATLAB Environment
™ MATLAB, coined from MATrix LABoratory, is a mathematical computing
software developed by MathWorks.
MathWorks MATLAB is supported on Unix,
Unix Macintosh,
Macintosh
and Windows environments; a student version of MATLAB is available for
personal computers. For more information on MATLAB, contact the MathWorks
™ Simply speaking, MATLAB can be thought as a calculator which is powerful in
matrix operations. To a further extent, it is a powerful programming language
equipped with various built-in functions and (optional) tool boxes and can be used
to build a customized program.
™ MATLAB is an interactive system
y and pprogramming
g g language
g g for ggeneral scientific
and engineering computation. Its basic element is a matrix (array). It excels at
numerical calculations and graphics.
™ MATLAB has tools (functions) to solve common problems plus toolboxes
(collections of specialized programs) for specific types of problems.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

23
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
MATLAB Environment
Command window
Variable browser
Click on the MATLAB
icon/start menu initialises
the Matlab environment:
The main window is the
dynamic command
interpreter which allows
the user to issue Matlab
commands
The variable browser
shows which variables
currently exist in the
workspace

Command history
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
Vectors
™ Let's start off by creating something simple, like a vector
™ Enter each element of the vector (separated by a space) between brackets
brackets, and set it
equal to a variable.
• For example, to create the vector a, enter 
into the MATLAB command window
a = [1 2 3 4 5 6 9 8 7]
MATLAB should return:
a=
123456987
• Let's say you want to create a vector 
with elements between 0 and 20 evenly 
ih l b 0 d 20 l
spaced in increments of 2 (this method is 
frequently used to create a time vector):
t = 0:2:20
t=
0 2 4 6 8 10 12 14 16 18 20
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

24
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
Vectors
™ Basic operations on vectors:
Manipulating vectors is almost as easy as creating them.
• For example, suppose you would like to add a constant (e.g. 3) to each of the elements in 
vector 'a'. The equation for that looks like:
b=a+3
MATLAB should return:
b=
4 5 6 7 8 9 12 11 10
• Now suppose, you would like to add two 
vectors together. If the two vectors are 
the same length, it is easy. Simply add the
the same length, it is easy. Simply add the 
two as shown below:
c=a+b
c=
5 7 9 11 13 15 21 19 17
• Subtraction of vectors of the same length works exactly the same way
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
Functions
™ To make life easier, MATLAB includes many standard functions. Each function is
a block of code that accomplishes a specific task
™ Matlab contains all of the standard functions such as sin, cos, log, exp, sqrt, as well
as many others.
™ Commonly used constants such as pi, and i or j for the square root of -1, are also
incorporated into Matlab.

sin(pi/4)
ans =
0.7071
™ To determine the usage of any function, type help [function name] at the
Matlab command window.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

25
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
Plotting
™ Suppose you wanted to plot a sine wave
as a function of time.
¾ First make a time vector
t=0:0.25:7;
¾ compute the sin value at each time
y = sin(t);
plot(t,y)
™ The plot command has extensive add-on capabilities
Recommendation: visit the plotting page to learn more about it
™ Two Useful Symbols:
¾ Semicolon ; (If a semicolon is typed at the end of a command, the output of the command
is not displayed).
¾ Percent Sign % (When the % is typed in the beginning of a line, the line is designated as a
comment. Comments are frequently used in programs to add explanations or descriptions).

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
Polynomials
™ In MATLAB, a polynomial is represented by a vector. To create a polynomial in
MATLAB, simplyp y enter each coefficient of the ppolynomial
y into the vector in
descending order.
x = [1 3 -15 -2 9]
x=
1 3 -15 -2 9

™ If the polynomial is missing any coefficients, you must enter zeros in the
appropriate place in the vector.
y = [1 0 0 0 1]

™ polyval function - gives the polynomial value at certain value of independent


variable. For example, the value of the above polynomial at s=2
z = polyval([1 0 0 0 1],2)
z =
17
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

26
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
Polynomials

™ The pproduct of two ppolynomials


y is found byy
taking the convolution of their coefficients. x = [1 2];
MATLAB's function conv is doing this. y = [1 4 8];
z = conv(x,y)
z =
1 6 16 16

™ The deconv function is using to divide


two polynomials. It will return the Let's divide z by y and see if we get x.
remainder as well as the result
result.
[xx, R] = deconv(z,y)
xx =
1 2
R =
0 0 0 0

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
Matrices
™ Entering matrices into MATLAB is the same as entering a vector,
p each row of elements is separated
except p byy a semicolon (;) or a return
B = [1 2 3 4;5 6 7 8;9 10 11 12]
B =
1 2 3 4
5 6 7 8
9 10 11 12
B = [ 1 2 3 4
5 6 7 8
9 10 11 12]
B =
1 2 3 4
5 6 7 8
9 10 11 12
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

27
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
C = B'
Matrices
C =
™ Transpose 1 5 9
2 6 10
The transpose of a matrix can be found 3 7 11
using the apostrophe key 4 8 12
E = [1 2;3 4]
™ Matrix Inverse X = inv(E)
In MatLab, we execute inv(E) to
X =
find the inverse of the matrix E
-2.0000 1.0000
1 5000
1.5000 -0.5000
-0 5000

™ Determinant E = [1 2;3 4]
In MatLab, we execute det(E) to det(E)
find the determinant of the matrix E ans =
-2
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
B = [1 2 3 4;5 6 7 8;9 10 11 12]
Matrices C = B’
D = B * C
™ Matrix Multiplication
D =
Remember that order matters 30 70 110
when multiplying matrices 70 174 278
110 278 446
F = C * B
Another option for matrix manipulation is
that you can multiply the corresponding F =
107 122 137 152
elements of two matrices using the .* 122 140 158 176
operator (the matrices must be the same 137 158 179 200
size
i tot do
d this).
thi ) E = [1 2;3 4]; 152 176 200 224
G = [2 3;4 5];
M = E.* F
M =
2 6
12 20
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

28
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
E = [1 2;3 4];
Matrices E.^3 % element-by-element cubing
ans =
™ Matrix Powers 1 8
If E is a matrix
matrix, the operation E. 2 squares
E ^2 27 64
each element in E. To square the matrix, E^3 % multiply matrix by itself
i.e., compute E*E, E must be a square ans =
matrix and we use the operation E^2. If you 37 54
81 118
have a square matrix, like E, you can also eig(E)
multiply it by itself as many times as you ans =
like by raising it to a given power. -0.3723
5.3723
™ You can also find the eigenvalues of a matrix.
p = poly(E)
™ The "poly" function creates a vector that p =
includes the coefficients of the characteristic 1.0000 -5.0000 -2.0000
polynomial. Remember that the eigenvalues roots(p)
of a matrix are the same as the roots of its ans =
characteristic polynomial. 5.3723
-0.3723
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO MATLAB
Script Files or M
M--Files

™ Rather than entering commands in the non-interactive command window,


where the commands cannot be saved and executed again, it is better to first
create a file with a list of commands (a program), save it, and then run
(execute) the file.
™ Commands in the file can be corrected or changed and the file can be saved
and run again. The commands in the file are executed in the order listed.
™ Files used for this purpose are called script files or m-files (extension .m is
used when the file is saved).
™ To create a M-File: File →New →M-File.

™ The file must be saved before it can be executed. To execute it, chose the Run
icon, or type the file name in the Command Window and press Enter.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

29
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO MATLAB
Getting help in MATLAB

™ MATLAB has a fairly good on


on-line
line help; type:
help commandname
for more information on any given command. You do need to know the
name of the command that you are looking for.

™ MatLab includes extensive help tools, which are especially useful for
interpreting function syntax.

™ There are 3 ways


y to get
g help
p from within MatLab:
¾ Command-line help function – help
¾ Windowed help screen – Help →MatLab Help
¾ MatLab’s Internet help

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO SIMULINK

™ Simulink is a graphical extension to MATLAB for modeling and simulation


y
of systems. Simulink is supported
pp on Unix, Macintosh, and Windows
environments; and is included in the student version of MATLAB for
personal computers. For more information on Simulink, contact the
MathWorks.
™ Simulink is an extension to MatLab that allows engineers to rapidly and
accurately build computer models of dynamic physical systems using block
diagram notation.
™ In Simulink, systems are drawn on screen as block diagrams. Many elements
off bl
blockk diagrams
di are available,
il bl suchh as transfer
t f functions,
f ti summingi
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.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

30
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO SIMULINK
Starting SIMULINK

™ Simulink is started from the


MATLAB command prompt by
entering the command:
simulink

™ Alternatively, you can hit the


New Simulink Model button at
the top of the MATLAB
command window.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO SIMULINK
Starting SIMULINK
™ When it starts, SIMULINK brings up two windows.
¾ The first is the main Simulink window
¾ The second window is a blank, untitled, model window. This is the
window into which a new model can be drawn

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

31
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO SIMULINK
Basic Elements
™ There are two major classes of items in Simulink:
¾ Blocks are used to ggenerate,, modify,
y, combine,, output,
p , and display
p y signals;
g ; and
¾ Lines are used to transfer signals from one block to another.
™ Blocks - There are several general classes of blocks:
¾ Sources: Used to generate various signals
¾ Sinks: Used to output or display signals
¾ Discrete: Linear, discrete-time system elements (transfer functions, state-space
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.
™ 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.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO SIMULINK
Basic Elements

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

32
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO SIMULINK
Simple Example
The simple model consists of three blocks: Step, Transfer Fcn, and Scope. The Step
is a source block from which a step input signal originates.
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.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO SIMULINK
Simple Example
™ Modifying Blocks
A block can be modified by double-clicking on it.
F example,
For l if you double-click
d bl li k on theth "Transfer
"T f
Fcn" block in the simple model, you will see the
following dialog box.

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].
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

33
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO SIMULINK
Simple Example
™ Modifying Blocks

The "step" block can also be double-clicked, bringing up


the following dialog box.
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.

The most complicated of these three blocks is the "Scope"


Scope block.
block
Double clicking on this brings up a blank oscilloscope screen.
When a simulation is performed, the signal which feeds into the
scope will be displayed in this window.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO SIMULINK
Simple Example

™ Running Simulations

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 or Start
click the “Start simulation” button in the model Simulation
window. The simulation should run very quickly
and the scope window will appear as shown.

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.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

34
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO SIMULINK
Simple Example
™ Configuration Parameters
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
[1 20 400]
Re-run the simulation 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 is 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 Configuration Parameters from the
Simulation menu.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO SIMULINK
Simple Example
™ Configuration Parameters
There are many simulation parameter
options; we will only be concerned
with the start and stop times, which
tell Simulink over what time period to
perform the simulation. Change Start
time from 0.0 to 0.8 (since the step
doesn't occur until t=1.0. Change Stop
time from 10.0 to 2.0, which should be
only shortly after the system settles.

After rerunning the simulation and hitting the autoscale


button, the scope window should provide a much better
display of the step response.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

35
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW

™ LabVIEW (Laboratory Virtual Instrument Engineering Workbench) relies on


graphical symbols rather than textual language to describe programming actions.
™ LabVIEW is a software, which uses graphical programming language for data
acquisition, data analysis, presentation of result and instrument control. The
principle of dataflow, in which functions execute only after receiving the necessary
data, governs execution in a straightforward manner.
™ LabVIEW programs are called: Virtual Instruments (VIs) because their appearance
and operation imitate actual instruments, such as oscilloscopes and multimeters.
However, they are analogous to main programs, functions and subroutines from
popular language like C, Fortran, Pascal, . . .
™ Each VI contains three main parts:
¾ Front Panel – an interactive user interface of a VI, so named because it can
simulates the front panel of a physical instrument.
¾ Block Diagram – VI’s source code, constructed in LabVIEW’s graphical
programming language, G. It is the actual executable program
¾ Icon/Connector – means of connecting a VI to other VIs.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO LABVIEW
™ VI Front Panel
¾ The front panel is the user interface of the VI
A front panel contains controls for input and indicators for output or data presentation.
The Front Panel is used to interact with the user when the program is running. Users
can control the program, change inputs, and see data updated in real time.
¾ Controls are knobs, pushbuttons, dials, and other input devices
Controls simulate instrument input devices and supply data to the block diagram of
the VI. Stress that controls are used for inputs- adjusting a slide control to set an alarm
value, turning a switch on or off, or stopping a program.
¾ Indicators are graphs, LEDs, and other displays
Indicators simulate instrument output devices and display data the block diagram
acquires or generates. Indicators are used as outputs. Thermometers, lights, and other
indicators indicate values from the program. These may include data, program states,
and other information.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

36
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW
VI Front Panel Front Panel Icon
Toolbar
• When you run a VI, you must
have the front panel open so Boolean
that you can input data to the Control Graph
executing program. Legend
• The front panel is where you
see your program’s output.
Front Panel Waveform
• Controls = Inputs Graph
• Indicators = Outputs Scale
Plot Legend
Legend
g

In this picture, the Power switch is a boolean control. A boolean


contains either a true or false value. The value is false until the switch is
pressed. When the switch is pressed, the value becomes true. The
temperature history indicator is a waveform graph. It displays multiple
numbers. In this case, the graph will plot Deg F versus Time (sec).
The front panel also contains a toolbar.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO LABVIEW
™ Block diagram
¾ Every front panel control or indicator has a corresponding terminal on the block
diagram When a VI is run
diagram. run, values from controls flow through the block diagram,
diagram
where they are used in the functions on the diagram, and the results are passed into
other functions or indicators.
¾ The block diagram contains this graphical source code. Front panel objects appear
as terminals on the block diagram. Additionally, the block diagram contains
functions and structures from built-in LabVIEW VI libraries. Wires connect each of
the nodes on the block diagram, including control and indicator terminals,
functions, and structures

¾ Block Diagram
• Accompanying “program” for front panel
• Components “wired” together.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

37
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW
™ Block diagram
Block
The block diagram window Diagram
Toolbar Divide
de
h ld the
holds h graphical
hi l source Function
code of a LabVIEW VI – it is SubVI
the actual executable code Graph
Terminal
• You construct the block
diagram by wiring together Wire
Data
objects that perform specific
functions.
While Loop Numeric Timing Boolean Control
• The various components of Constant Function Terminal
Structure
a block diagram are
In this block diagram, the subVI Temp calls the subroutine which retrieves
terminals, nodes and wires. a temperature from a Data Acquisition (DAQ) board. This temperature is
plotted along with the running average temperature on the waveform graph
Temperature History. The Power switch is a boolean control on the Front
Panel which will stop execution of the While Loop. The While Loop also
contains a Timing Function to control how frequently the loop iterates.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO LABVIEW
™ Icon and connector pane
Identifies the VI so that you can use the VI in another VI. A VI within
another VI is called a sub-VI
Provide the connectors for wiring.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

38
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW
™ Three LabVIEW Palettes

¾ The Tools palette is available on the front panel and the block diagram.
A tool is a special operating mode of the mouse cursor.

¾ The Controls palette is available only on the front panel


The Controls palette contains the controls and indicators you use to create
the front panel.

¾ The Functions palette is available only on the block diagram.


The Functions palette contains the VIs and functions you use to build the
block diagram.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO LABVIEW
™ LabVIEW Palettes
¾ The Tools palette is available on the front panel and the block diagram.
A tool is a special operating mode of the mouse cursor.
Select View » Show Tools Palette to display the Tools palette
• Floating Palette
• Used to operate and modify front panel and block diagram objects.

Automatic Selection Tool
Operating Tool Scrolling Tool
Positioning/Resizing Tool Breakpoint Tool
Labeling Tool Probe Tool
Wiring Tool Color Copy Tool
Shortcut Menu Tool Coloring Tool
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

39
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW
™ LabVIEW Palettes
¾ The Controls palette
Use the Controls palette to place
controls and indicators on the front
panel.
• Select View » Show Controls
Palette or right-click the front
panel workspace to display the
Controls palette
• I th
In the front
f t panell mode,
d right
i ht
click any empty place, the
“control palette” will be shown.
After you choose proper screen,
you can pin that screen

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO LABVIEW
™ LabVIEW Palettes
¾ Functions Palette - Use the Functions palette, to build the block diagram.
ƒ Select View » Show Functions Palette or right-click
g the block diagram
g
workspace to display the Functions palette.
ƒ In the Block diagram mode, right click any empty place, the “function palette”
will be shown. After you choose proper screen, you can pin that screen.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

40
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW
™ Status Toolbar

Additi
Additional
l Buttons
B tt on the
th Di
Diagram Toolbar
T lb
Run Button 
Execution Highlighting Button
Continuous Run Button
Retain Wire Values Button
Abort Execution
Step Function Buttons

• Click the Run button to run the VI. While the VI runs, the Run button appears with a black arrow if the VI is a top-level VI,
meaning it has no callers and therefore is not a subVI.
• Click the Continuous Run button to run the VI until you abort or pause it. You also can click the button again to disable
continuous running.
• While the VI runs, the Abort Execution button appears. Click this button to stop the VI immediately.
• Click the Pause button to pause a running VI. When you click the Pause button, LabVIEW highlights on the block diagram the
location where you paused execution. Click the Pause button again to continue running the VI.
• Select the Text Settings pull-down menu to change the font settings for the VI, including size, style, and color.
• Select the Align Objects pull-down menu to align objects along axes, including vertical, top edge, left, and so on.
• Select the Distribute Objects pull-down menu to space objects evenly, including gaps, compression, and so on.
• Select the Resize Objects pull-down menu to change the width and height of front panel objects.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW


INTRODUCTION TO LABVIEW
™ Show context Help

When you point at


any icon (graphical
code), the description
of the icon will be
shown if the “show
context help” is
checked.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

41
INTRODUCTION TO MATLAB, SIMULINK AND LABVIEW
INTRODUCTION TO LABVIEW
™ Help Options

Context Help
• Online help
• Lock help
• Simple/Complex Diagram help
• Ctrl + H

Online reference
• All menus online
• Pop up on functions in diagram to access online info directly

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

42
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
4. THEORETICAL MODELING

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
MODEL PARAMETERS AND SIGNALS

™ A model of a dynamic system contains a number of quantities of


different types.
™ Certain quantities in the model which do not vary in time are called
Constant.
™ Those quantities that vary in time are called variables or signals.
™ It is practical to distinguish two types of constants in models:
¾ System parameters are constants that are considered given by
y
the system and cannot be chosen byy the designer.
g
¾ Design parameters are constants that can be chosen in order to
give the system / model desired properties. The purpose of the
simulation study is often to decide suitable values for the
design parameters.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

43
THEORETICAL MODELING
MODEL PARAMETERS AND SIGNALS

™ In systems/models, there are usually signals and variables that influence other variables
in the system, but are not themselves influenced by the behavior of the system. Those
variables are called external signals
signals. In a block diagram the external signals are always
marked by arrows coming from outside.
™ An external signal can be one of two types:
¾ Input or control signal: An external signal in the system whose time
variations we can choose. Denoted by u1(t), u2(t) ... uR(t). If we
assign these inputs in vector form, we obtain the input vector u(t)
¾ Disturbance signal: An external signal
in the system
y that we cannot influence. Disturbance
Denoted by z1(t), z2(t) . . . zQ(t) , Inputs System
Subsystem Outputs
respectively
Control System
Inputs

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
MODEL PARAMETERS AND SIGNALS

™ A model and a dynamic system always contain a number of variables,


or signals, whose behavior is our primary interest. Such signals are
called
ll d outputs andd usually
ll denoted
d d by
b yl(t),
( ) y2(t),...,
() yM(t).
( ) The
h
individual signals can be combined to form an output vector y(t)
It is important to emphasize that the outputs of a model are not defined by the model itself, but
that can be freely determined depending on the question what is going to be considered as output.

™ Internal variable: A variable in the system that is neither an output nor an external
signal. In a system there is always a (not unique) number of internal or system state
variables that allow a complete description
Disturbance
off system
t dynamics.
d i If we assigni these
th Inputs System
states in vector form, we obtain the state Subsystem Outputs
vector x(t)
Control System
Inputs

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

44
THEORETICAL MODELING
PHASES OF MODELING

™ Modeling is, in common with other scientific and engineering activities, as


much an art as a science. Successful modeling is based as much on a good
f li for
feeling f the
h problem
bl and d common sense as on theh formal
f l aspects that
h can
be taught.
™ In order to achieve purposeful mathematical descriptions the process of
modeling can be divided into three phases:
1. The problem is structured and broken down
2. The basic equations are formulated
3. By rearranging, the state-space or transfer function model will be
achieved
hi d
™ One difficulty is that the modeling sometimes ranges over completely
different types of physical systems. It is then useful to draw on the analogies
that exist between different physical phenomena. The general structuring of
the modeling into three phases will also be relevant in that context.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
PHASES OF MODELING
Phase 1: Structuring the Problem
™ Phase 1 consists of an attempt to divide the system into subsystems, an effort to
determine cause and effect
effect, what variables are important and how they interact.
interact
When doing this work, it is important to know the intended use of the model.
The result of phase 1 is a block diagram or some similar description. This phase
puts the greatest demands on the modeler in terms of the understanding of and
intuition for the physical system. It is also in this phase that the level of
complexity and degree of approximation are determine.
™ In summary, Phase 1 can be formulated by the following requirements:
¾ Determine the external signals and outputs of the system. Decide what
internal variables are important for the system description
¾ Formulate the interaction between external signals, internal variables and
outputs using a block diagram
For more complex systems, it is more efficient to first divide the system into subsystems and
then divide the subsystems further into blocks.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

45
THEORETICAL MODELING
PHASES OF MODELING
Phase 2: Setting up the Basic Equations
™ Phase 2 involves the examination of the subsystems, the blocks, that the
structuringg of pphase 1 pproduced. The relationships
p between constants and variables
in the subsystems have to be formulated. For this purpose, those laws of nature
and basic physical equations that are assumed to hold in the appropriate areas are
used. This often means that certain approximations and idealizations (point mass,
ideal gas, and the like) have to be made in order to avoid too complicated
expressions. For non technical systems, for which generally accepted basic
equations are often lacking, this phase gives the opportunity for new hypotheses
and innovative thinking.
™ A proven approach in formulating the basic equations of a block or subsystem is :
¾ Writing down the conservation laws that are relevant for the particular block
¾ Using appropriate constitutive relations to express the conservation laws by
means of the model variables. A dimension control at this point eliminates
tedious debugging later
¾ It may be possible to carry out a linearization of the equations at this point

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
PHASES OF MODELING
Phase 3: Forming the final model
™ Phase 3 in contrast to the other phases, is a more formal step aiming at the suitable
organization of the equations and relationships left by phase 2. Even if the model in some
sense is
i ddefined
fi d already
l d after
ft phase
h 2,
2 this
thi step
t isi usually
ll necessary to
t give
i a modeld l suitable
it bl
for analysis and simulation. It is not always necessary to carry the work all the way to an
explicit form. For the purpose of simulation it might be enough to achieve state-space
models for the subsystems together with instructions for the interconnection.
™ State-Space Model ™ Transfer Function
1. Suitable choice of state variables 1. Selection of input signal ui(t) and output
(state vector x(t)) signal yj(t)
2. Express the time derivative of the 2. Laplace transform of differential equations
state vector dx(t)/dt by the state 3. Forming the (algebraic) equations with
vector x(t) itself and the input vector elimination of all variables except Ui(s)
u(t) and Yj(s)
3. Express the output vector y(t) by the 4. Formulate the transfer function
state vector x(t) and input vector u(t)

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

46
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Electrical Systems
™ For many engineering applications it turns out that the same type of
equations appear despite the diversity of the physical systems Starting from
these analogies it is possible to do systematic modeling for a broad class of
systems. Because of these analogies, the electrical systems are discussed
here in the first place.
™ Consider electrical circuits consisting of resistors, capacitors, inductors, and
transformers. The basic equations used to describe such circuits consist of
relationships between the fundamental quantities:
¾ Voltage u (volt, V)
¾ Current
C t i (ampere,
( A)
Electrical components are described in
terms of their voltage / current relations.
RLC parallel circuit
RLC series circuit
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Electrical Systems
™ Memory elements
¾ In these (idealized) elements,
elements energy can be stored.
stored
¾ An ideal inductor is described by:
¾ An ideal capacitor is described by:

where u(t) and i(t) are voltage and current at


where C is the capacitance (farad, F) .
time t. The constant L is the inductance (henry,
The relationship can also be written
h). The relationship is sometimes called the
as:
law of inductance and it can also be written as:

Energy stored in a capacity EC


Energy stored in an inductor is expressed by:
EL [J] is defined by:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

47
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Electrical Systems
™ Resistance element
™ Transformer
For a linear resistor with resistance R
An ideal transformer transforms
(ohm, Ω) the relationship between
voltage and current in such a way that
current and voltage is given by the well
their product is constant:
known Ohm's law:

In general, a resistance can also


be a non-linear resistance described
by the form:
where α is the ratio of the number of
In the resistor, energy is lost (as heat). turns on each side
The power is:

(P is measured in watts, 1 W = 1 J/s.)

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Electrical Systems
™ Other basic laws
Kirchhoff's
Ki hh ff' laws
l are basic
b i tto th
the analyses
l off
electrical circuits:
a) Kirchhoff's Current Node Law RLC parallel circuit
In a given node the sum of RLC series circuit
currents must be zero:

b) Kirchhoff's Voltage Loop Law


The summation of voltage drops around a closed loop
must be zero:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

48
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Motion and force are concepts used to describe the behavior of engineering systems
that employ mechanical components aspects that can be taught
taught. Motion is a term
used to describe the movement of a point relative to another and it is described using
the terms distance, velocity, and acceleration.
™ Motion in mechanical systems ™ Mechanical systems can be of two
can be: types:
¾ Translational ¾ Translational systems.
¾ Rotational, or ¾ Rotational system.
¾ Combination of above

™ The three basic mechanical elements are:


¾ Spring (elastic) element
¾ Damper (frictional) element
¾ Mass (inertia) element
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Translational Mechanical Systems
Mechanical translation is governed by the laws of mechanics,
mechanics which are
relationships between the variables:
Force F (newton, N)
Velocity v (meters per second, m/s)
In general, these quantities are three dimensional vectors. Most of the
following relationships can be formulated as vector equations, but for
simplicity here are limited to the representation of scalar relations.

Each of the elements has one of two ppossible energy


gy behaviors:
¾ stores all the energy supplied to it
¾ dissipates all energy into heat by some kind of “frictional” effect
ƒ Spring stores energy as potential energy
ƒ Mass stores energy as kinetic energy
ƒ Damper dissipates energy into heat
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

49
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Translational Mechanical Systems
Memory elements
¾ For an ideal (linear) spring, the reciprocal
¾ Even with mechanical translational elements, value of spring constant 1/k [m/N] can be
energy can be saved; the ideal inductance considered as capacity.
here is obviously the mass m [kg] .
Newton's second law gives:
The spring force is proportional to the
The above equation can elongation (or compression), i.e. it is
also be written as proportional to the integral of the
difference in velocity between the end
points:
i t
In the previous equations, F(t) has to be
understood as a sum of forces acting on a body
Energy stored in a moving mass is Energy stored in a spring is potential
kinetic energy Ek [J] : energy Ep [J] :

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Translational Mechanical Systems
¾ Resistance element ¾ Transformer
At translational motion in real systems, The ideal transformer corresponds to
friction is always present. In general, a rigid lever. For an ideal transformer with
friction is described by: the lever ratio α, therefore, the following
The most common case perhaps is equations can be applied:
dry friction:

Air resistance is often


described by :
and viscous friction :

The power lost as heat through Rigid lever as an


ideal mechanical-
friction is : translational transformer
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

50
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Translational Mechanical Systems
¾ Other
Oth basic
b i llaws
For a translational mechanical system at rest, the sum of
attacking forces is always zero:

This is the equivalent of Kirchhoff's voltage law; an


analogous relationship for the velocities does not exist!
Law of reaction forces (Newton’s 3rd law)
All forces occur in equal and opposite pairs If the ends of two elements are connected
connected,
(action/reaction). Force exerted by an element these ends are forced to move with the same
is equal and opposite to the displacement, velocity, and acceleration
force on the element.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Rotational Mechanical Systems
Mechanical systems with rotational parts like motor and gear
boxes, are very common. For these systems the laws of
mechanics relate the basic variables:
Torque M (newton-meter, Nm) M,θ
Angular velocity ω (radians per second, s-1)
M,θ
¾ Memory elements
The ideal inductance here is the moment of inertia J [Nm/s2], while
the torque on the axis is proportional to the angular acceleration, i.e.:

This can be written as: M,θ

Energy stored in a rotating mass Ek [J] is given by:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

51
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Rotational Mechanical Systems
¾ Memory elements
Torsion is the twisting of an object due to an applied torque.
The torsional stiffness k [Nm] is defined by the relationship
between the angular velocity and the torque: M,θ

M,θ
The torsion of an axis gives rise to
a torque described by:

The integral corresponds to the angular displacement between the ends.


M,θ
Due to torsion, energy is stored as a
potential energy Ep [J] expressed by:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Mechanical Systems
™ Rotational Mechanical Systems
¾ Resistance element
The rotational friction is a function of the angular velocity:
with different functions r analogous to translational friction.
The power dissipation at rotation is:
¾ Transformer
The ideal transformer corresponds to a friction-free
pair of gears. For an ideal transformer with the ratio α,
therefore, the following equations can be applied:

Friction-free pair of gears as an ideal


mechanical-rotational transformer

¾ Other basic laws


For a rotational mechanical system at rest,
the sum of all torques must be zero:
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

52
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Fluid Systems

™ The fluid systems discussed here are limited to flows of incompressible fluids in
pipes and tanks. (Incompressible fluids are those for which the volume is
unaffected by the pressure.)
Typical applications are in chemical industrial systems and hydraulic systems.
The treatment of compressible fluids is more complicated, partly because there
are temperature changes when the volume is altered.

™ Fluid systems are described by two basic quantities:


¾ Pressure p (newtons per square meter, N/m2)
¾ Flow Q (cubic meters per second, m3/s)
Volume flow Q multiplied by the density gives a mass flow in
[kg/s]. For incompressible flows there is no essential difference.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Fluid Systems
™ Memory elements
¾ For a fluid flow through a tube, the pressure difference p between the end points of
the tube results in a force that accelerates the fluid.
fluid
The force is
where A is the cross-sectional area. If the density of the fluid
is ρ, than the mass to be accelerated is ρlA. Newton's force Flow through a tube. p1 and p2 are the
law gives: pressures at the end points of the tube

where v(t) is the velocity of the fluid. The velocity corresponds to a fluid flow Q = v(t)A,
therefore the above equation can be written as:

or in integral notation:
where The frictionless flow through a tube
corresponds to a stored kinetic energy
is the fluid inertia [kg/m4] represents the pipe. E [J] defined by

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

53
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Fluid Systems
™ Memory elements

¾ Consider a fluid that is accumulated in a tank.


The volume V in the tank is the
integral of the flow:

The pressure at the bottom of the tank is equal to the


level h (h = V/A) multiplied by the density ρ and the A tank as a fluid store
gravitational acceleration g :

The parameter: Cf = A/ρg [m4s2/kg] is called the fluid capacitance.


The potential energy E [J] stored in the tank is expressed by:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Fluid Systems ™ Resistance element
When liquid flows through a tube there is normally a loss of power through
friction against
g the walls and internal friction in the fluid. This leads to a ppressure
drop over the tube. Conversely, it can be said that a pressure drop is needed to
maintain a certain flow. The pressure drop depends on the flow. In general it can
be written:
The function r(Q) depends on the tube geometry.
If the tube is thin or filled with a porous medium, d'Arcy's law
applies:
where Rf [kg/m4s] is called the flow resistance. If the tube
contains a sudden change in area (an orifice or a valve), than: p1 Q p2

with a constant H.
p = p1 − p 2
The energy loss through friction Flow through an orifice
phenomena is given by:
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

54
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Fluid Systems
™ Transformer
The ideal transformer
f corresponds
p to a friction-free
double piston. For an ideal transformer with the ratio α,
therefore, the following equations can be applied:

Friction-free double piston as an


ideal flow transformer

™ Other basic laws


F incompressible
For i ibl fluid
fl id completely
l t l analogous
l laws
l apply
l as for
f electric
l t i circuits,
i it so
that Kirchhoff's laws can be adapted accordingly.
The total pressure over a series
When flows are connected in a junction
connected pipes must be the
their sum must be zero:
sum of the pressure drops

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Thermal Systems
Thermal systems involve heating of objects and transport of thermal energy. The laws
governing these phenomena are typically expressed as relationships between the
quantities:
Temperature T (kelvin, K)
Heat flow rate q (watt, W)
™ Other basic laws
™ Memory elements
Heating of a body means that the Heat transfer between two bodies with
temperature increases as heat flows temperatures T1 and T2 is often assumed to
into it. be proportional to the temperature difference
∆T = T2 − T1 :
C [J/K] is the thermal capacity
W [J/Ks] is called the heat transfer coefficient
This relationship
Thi l ti hi can bbe written
itt as:
Furthermore, the sum of all heat flow rates at
one point must be zero:

In thermal systems, the heat flow corresponds to a self-resistance (energy dissipation).


A transformer is indeed realized in thermal systems (heat pumps, refrigeration unit),
but can not be discussed even in a rough approximation as an ideal transformer.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

55
THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Analogies between physical sub-
sub-areas
™ Obviously there are strong analogies between the different areas of modeling. A
common basic structure can therefore be found in all areas:
¾ There are always two variables sufficient to completely describe the systems,
which are commonly used as:
ƒ Effort variables e
ƒ Flow variables f
¾ The relationships between these variables have the following forms:
ƒ Effort storage: ƒ Power dissipation:
ƒ Flow storage:
ƒ S
Sum off fl
flows equall to
t zero:
ƒ Static relationship:
ƒ Sum of efforts (with signs)
ƒ Inductive energy storage:
equal to zero:
ƒ Capacitive energy storage: ƒ Transformation of variables:
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
SOME BASIC RELATIONSHIPS IN PHYSICS
Analogies between physical sub-
sub-areas

Some Physical Analogies


System Effort Flow Inductance Capacitance Resistance
Electrical Voltage Current Inductor Capacitor Resistor
(coil)
Mechanical:
Translational Force Velocity Mass Spring Friction
Rotational Torque Angular Moment of Torsion Friction
velocity inertia spring
Hydraulic Pressure Flow Tube Tank Orifice
Thermal Temperature Heat flow - Heating Heat flow
rate

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

56
THEORETICAL MODELING
MODEL SIMPLIFICATION

™ All models contain simplifications of the real processes. The model must be
manageable for our purposes. A model with thousands of variables is impossible to
use for
f analysis
l i andd requires
i llong executioni times
i ffor simulation.
i l i Simple
i l model
d l
primarily means a model whose order (the dimension of the state vector) is small.
Simple could also mean that the relationships between variables are easily
computable or that the model is linear rather than nonlinear.
™ The model simplification can be done under the first two phases of modeling but
also in the completed model to reduce complexity. The model simplification can
be done by:
1. Neglect of small effects - Approximations
2. Separation of time constants
Hierarchy of Models, depending on the particular need for the model  
3. Aggregation of State Variables more‐complex, more‐realistic, less‐easily‐solved

4. Linearization Truth Design


Model Model
5. Model reduction for linear systems
less ‐complex, less‐realistic, more‐easily‐solved
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
MODEL SIMPLIFICATION

™ Neglect of small effects - Approximations


It is often clear that certain effects are more important
p than others. The decisions
which effects can be neglected may be done after an extensive expertise or after
detailed preliminary investigations.
Many relationships between variables in an engineering system are complicated and
do not fit the idealized situations for which physical laws are formulated. Real gases
are not ideal, real liquids are not incompressible, real flow is not laminar, and so on.
When modeling a nontechnical system, the difficulties of getting a reliable description
are even greater.
In practice,
practice we have to accept working with
approximate relationships. The degree of
Hierarchy of Models, depending on the particular need for the model  
approximation that we can tolerate depends more‐complex, more‐realistic, less‐easily‐solved
on the desired accuracy of the model. We
Truth Design
must also have some balance between Model Model

approximations in different subsystems. less ‐complex, less‐realistic, more‐easily‐solved


TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

57
THEORETICAL MODELING
MODEL SIMPLIFICATION
™ Separation of Time Constant

In the same system there are often time constants of different orders of magnitude. Still,
the interest might be focused on a certain time scale.
The following rules can be applied:
9 Concentrate the modeling on phenomena whose time constants are of interest when
considering the intended use of the model
9 Subsystems whose dynamics are considerably faster are approximated with static
relationships
9 Variables of subsystems whose dynamics are appreciably slower are approximated as
constant
By observing these rules,
rules there are two major advantages:
1. Due to the neglect of very fast and very slow dynamics, the order of the model is lower
2. A model with time constants of the same magnitude is easier to simulate numerically
For some systems there might really be interest in time constants of quite different magnitude.
In such a case, the possibility of using two different models (one for each time scale) should be
considered, and each one of them should be simplified using the preceding procedure.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
MODEL SIMPLIFICATION
™ Aggregation of State Variables

An example of aggregation of state variables:


To mergeg several similar variables into one state variable.
Often this variable plays the role of average or total value.
Aggregation is a very common method for reducing the number of state variables in a model.
A typical example is thermodynamics. To know the state of a volume of gas,
we would strictly speaking have to know the speed and position of every
molecule. Instead we use pressure and temperature when dealing with a gas
on a macro level. Those variables are aggregated state variables connected to
the average distance between molecules and the average velocity.

A number of physical phenomena are described by partial differential equations (PDE). Typical
examples are field equations, waves, flow, and heat conduction problems. In mathematical
models of dynamic systems to be used in simulation, PDEs are often unsuitable. Often partial
differential equations are reduced to ordinary differential equations via difference
approximations of the spatial variables. This corresponds to aggregation.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

58
THEORETICAL MODELING
MODEL SIMPLIFICATION
™ Aggregation of State Variables
Example: Heat Conduction
Consider a metal rod whose left end point is heated by an external source.

Model with distributed


parameters
The third-order model with lumped parameters

- temperature at time t at the distance x


a - heat conductivity coefficient of the metal
Boundary conditions:

The linear state-space model


- the state vector
The mathematical model does not define a state, but a
continuous function T (x, t) in two variables. Therefore,
systems described by partial differential equations are
often called infinite-dimensional systems.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
MODEL SIMPLIFICATION
™ Linearization

The linearization of a mathematical model is often used simplification when deviations are
viewed from an operating point (steady state, time derivatives equal to zero).
The linearization of a nonlinear dynamical system can be done analytically or numerically.
Analytical linearization
If the analytical description of a nonlinear dynamical system is given by a nonlinear ordinary
differential equation, a Taylor series expansion can be calculated, and than higher derivatives
can be neglected (this applies to the continuous non-linearities).
⎡ ( k1 ) ( k2 ) ( kn )

F ⎢ x1 , x&1 ,..., x1 , x2 , x& 2 ,..., x2 ,......., x& n ,..., xn ⎥ = 0
⎣ ⎦ Linear differential equation: ( k1 )
Taylor series around the operating point is F = a10 ∆x1 + a11 ∆x&1 + . . . . + a1k1 ∆ x1 + ( k )
∂F ∂F ∂F ( k1 ) 2

F = F0 + ∆x1 + ∆x&1 + ........ + ( k1 ) ∆ x1 + + a 20 ∆x 2 + a 21 ∆x& 2 + . . . . + a 2 k2 ∆ x 2 +


∂x1 0 ∂x&1 0 ( kn )
∂ x1 0 + a n 0 ∆x n + a n1 ∆x& n + . . . . + a nk n ∆ x n = 0
∂F ∂F ∂F ( k2 )
+ ∆x 2 + ∆x& 2 + ........ + ( k 2 ) ∆ x 2 +
∂x 2 0 ∂x& 2 0 where the coefficients aij apparently arising from
∂ x2 0
the partial derivatives in the operating point
∂F ∂F ∂F ( kn )
∂F
+ ∆x n + ∆x& n + ........ + ( k ) ∆ x n = 0 a ij =
∂x n 0 ∂x& n 0 n ( j)
∂ x2 0 ∂ xi 0

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

59
THEORETICAL MODELING
MODEL SIMPLIFICATION
™ Linearization

Example

A simple model for an air heating


The formal linearization yields to the equation

T - output temperature
q - supplied heat flux
c - specific heat capacity of air Now we calculate the partial derivatives and
remembering that
- mass flow
Te input temperature
we obtain the linearized differential equation
The implicit form of the equation:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

THEORETICAL MODELING
MODEL SIMPLIFICATION
™ Linearization

Numerical linearization
Prerequisite is the existence of a nonlinear simulation model. The linearization
procedure than is applying to each state and each input of the model as follows:
1. The value of the state vector in the operation point is sets as initial
condition
2. All inputs are equal to zero
3. A single state or input is excited by a disturbance of small amplitude. To do
this, the model should be integrated numerically
4. From the recorded changes in the remaining states, the corresponding
difference quotient between excited variable and the remaining variables is
determined numerically
This process leads to discrete linear state space model describing the dynamics
for small deviations around the operating point.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

60
THEORETICAL MODELING
MODEL SIMPLIFICATION

™ Model reduction for linear systems


For linear, stable and observable systems there is possibility to transform
originally received state-space model into special form so-called ‘balanced
realization’. In this state representation, the system states are treated by an
energy criterion in their meaning, i.e. using a weight the significance of the
individual states can be determine.
This choice of weights is therefore a quantitative criterion for deciding
which states you can omit. Even very large order systems (n> 100) can thus
be efficientlyy reduced to small models ((n <10).
) The choice of those states
whose weight is smaller than a certain limit leads to a reduced-state model of
lower order, which has essentially the same dynamics as the original model.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

61
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
5. BOND GRAPHS

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
INTRODUCTION

™ Similar forms of equations are generated by dynamic systems in a wide


variety of domains. Such systems are analogous. There are far reaching
analogies between electrical, mechanical, hydraulic, and thermal systems.
™ Based on these analogies, a systematic modeling scheme can be found.
One way of doing this is to use bond graphs.
™ In the 1960s Professor H. M. Paynter proposed a method of system modeling
that was both unifying and algorithmic. He called the technique bond graphs,
and it is based on power flow diagrams (as opposed to signal flow) and is
independent
p of physical
p y domain.
™ The bond graph method is a graphical approach to modeling in which
component energy ports are connected by bonds that specify the transfer
of energy between system components. Power, the rate of energy transport
between components, is the universal currency of physical systems.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

62
BOND GRAPHS
EFFORTS AND FLOWES
Graphical format for bonds
Half Arrow
The basic idea of bond graphs is that many
e
models
d l can be
b ddescribed
ib d iin terms off effort
ff t Subsystem 1 Subsystem 2
variables e and flow variables f. f
Bond
Effort and flow

u F p e
i v Q f
electrical mechanical hydraulic general
Efforts and flows

The products ui, Fv, pQ, and e f have the dimension of power.
The horizontal line, the bond, is therefore interpreted as a
connection between subsystems that exchange energy.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
EFFORTS AND FLOWES

™ Flow Storage
Many physical elements can be modeled as flow storage,
storage Fl storage
Flow
for example, a capacitor for electric current or a tank for
water flow. With bond graphs this is represented e
according to figure, where the C denotes the storage C
f
element (C as in capacitive).
The bond symbolizes the energy flow from the rest of e
the system into the element. If the relationship between C:β
f
e and f is linear, then the coefficient β is often
included in the graph.
graph

or

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

63
BOND GRAPHS
EFFORTS AND FLOWES

™ Effort Storage Effort storage


An inductor could be regarded as an effort storage with a
relationship (in the linear case) e
I:α
f
Elements of this type are often called inductive or inertial.
Resistive element
™ Resistive Elements
e
Static relations between effort and flow R: e=h(f)
f
™ Sources
Th are iin generall iinputs,
There t that
th t are, externally
t ll generated
t d signals.
i l Wh When dealing
d li with
ith
bond graphs, they are called sources. They can be of two types, depending on whether
the input is an effort or a flow.
Effort source Flow source
e e
Se System Sf System
f f
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
JUNCTIONS

™ Series Junction
Consider the electric circuit
Regardd voltage
l u as an input
i signal
i l Effort source
The energy flowing into the system is divided between the u
resistor, the capacitor, and the inductor. Se System
i
Resistor
Efforts satisfy the relation: R : R1
u − u1 − u2 − u3 = 0
u1 i
u u2 u1 i
Se s Inductor u u2
i i Se s I : L1
u3 i i i
u3 i
Capacitor
C : C1
s – represents a series connection
Power flow in an electric circuit
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

64
BOND GRAPHS
JUNCTIONS

™ Series Junction
IIn general,
l series
i junction
j ti (an
( s junction)
j ti ) iis characterized
h t i d bby:
¾ The same flow: f1 = f2 = . . . = fn
¾ The sum of efforts equal to zero: e1 + e2 + . . . + en = 0

It is natural to have the convention that an


outward pointing arrow gives a change of sign
for the effort variable. The following graph, for
example, has the equation:
e1 + e2 − e3 = 0

s junction

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
Electric parallel circuit
JUNCTIONS

™ Parallel Junction
Analogously to the previous,
previous it is natural to define a
junction where e and f have changed roles. A parallel Flow source
junction (p junction) is define with the following rules: u
¾ Identical efforts : e1 = e2 = . . . = en Sf System
i
¾ Sum of flow equal to zero: R : R1
f1 + f2 + . . . + fn = 0
u i1
u u
Sf p C : C1
i i2
u i3
It is: i − i1 − i2 − i3 = 0 ,
f1 + f2 − f3 = 0 and there is the same voltage
I : L1 (effort) at all the bonds.
p junction
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

65
BOND GRAPHS
JUNCTIONS
™ Simplifications in Bond Graphs
In a number of cases, bond graphs can be Merging of junctions
simplified.
p For example:
p
¾ Junctions that have only two bonds
(with the half arrows pointing in the
same direction) can be removed.
¾ A direct application of the definitions
shows that two adjacent junctions of the
same kind can be merged.

Removal of junctions

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
SIMPLE BOND GRAPHS

™ Mechanical system
Consider the mechanical system. A body, which is moving without
friction with the velocity v, is pulled with the force F. F is regarded
as the input (effort source). In this case, all energy is stored as
kinetic energy (effort storage, an I element).

v
F
m
Effort source
F
Se System F
v Se I:m
v

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

66
BOND GRAPHS
SIMPLE BOND GRAPHS

™ Mechanical system with spring v


k F
F is represented as an effort source. Now, the
energy is divided between kinetic energy and m
energy stored in the spring. This corresponds to
effort and flow storage, respectively, that is, I
and C elements. Since these elements have the F Kinetic
Se
velocity in common, this is a junction with v energy
common flow - a series junction.

F F1 Energy in spring
Se s I:m
v v
F2 v
F = F1 + F2
C : (1/k)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
SIMPLE BOND GRAPHS

v
™ Mechanical system with spring
k F
and friction
m
In this case, the mass slides along the surface
with a certain friction. It is assumed that the
friction is a nonlinear function of the velocity
Ff (t) = r (v (t)) The energy supplied by F is R : Ff = r (v)
now divided into three components. The
friction loss is an R element. The velocity v is
Ff v
common to all bonds, that is a junction with
common flow - a series junction. F F1
Se s I:m
v v
F2 v

C : (1/k)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

67
BOND GRAPHS
SIMPLE BOND GRAPHS

™ Electrical system
The voltage
g u is regarded
g as input.
p This
corresponds to an effort source.
Effort source
There is a series connection between R1 and L1,
where R1 and L1 are R and I elements u
Se System
respectively.
In the subsystem consisting of R2
I : L1 and C1 the energy is divided between
I : L1 C : C1
R2 (R element) and C1 (C element) in
a p junction (a common voltage).

u u
Se s R2 C1 Se s p

R : R1 R : R1 R : R2
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
TRANSFORMERS AND GYRATORS
™ Transformer

¾ The ideal electrical transformer with the relationships:


u2 = n u1 , i2 = (1/n) i1
also has counterparts for mechanical and hydraulic systems.
In bond graphs it is usually symbolized as shown in figure,
with the relationships: e2 = n e1
f 2 = (1/n) f 1 Ideal transformer

¾ The transformer can be used to describe


connections between different types of physical Area A
v
variables. An example is a hydraulic cylinder. The Q
relationships between the mechanical variables, the F p
force F and the velocity v, and the hydraulic variables,
the pressure p and the flow Q , are
p = F/A and Q=vA F p
(A – the cylinder cross section) TF
v Q
Since p and F are effort variables and Q and v are flow 1/A
variables, this is a transformer. A mechanical-hydraulic conversion
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

68
BOND GRAPHS
TRANSFORMERS AND GYRATORS
™ Gyrator

¾ A gyrator is an element similar to the transformer in which


e1 e2
efforts and flows have a "crosswise“ dependence. It is GY
characterized
h t i d bby th
the equations:
ti f1 f2
r
e2 = r f1 , f2 = (1/r) e1
Note that e2 f2 = e1 f1 , so power is conserved, as in the Gyrator
transformer.
¾ An example of a gyrator – conversion between
electrical and rotational energy in electric motor. A wire
carrying the current i rotates with the angular velocity ω
in a magnetic field. It is turned by a moment M
pproportional
p to the current
M=ki
At the same time an emf proportional to the angular
velocity is generated. u M
GY
u = k’ ω i ω
Since M ω = u i if there are no energy losses, than k = k’ k
An electromechanical example of a gyrator
Thus, the system can be symbolized with a gyrator.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
SYSTEMS WITH MIXED PHYSICAL VARIABLES
™ DC Motor

The motor is controlled by an external


voltage u,
u giving rise to a current i and a
rotation with the angular velocity ω.
Assumption: the windings have a
resistance R1 and an inductance L1. The
rotating parts have a moment of inertia Inductor Rotation
J. There is also some friction.
The supplied energy will be:
¾ partially stored in the inductor, and
¾ partially lost in the resistor,
resistor Source C
Conversion
i
while the remainder will be converted into
mechanical energy. This energy in its turn
will be:
¾ stored as rotational energy, or Resistor Friction
¾ lost by friction
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

69
BOND GRAPHS
SYSTEMS WITH MIXED PHYSICAL
VARIABLES Inductor Rotation
™ DC Motor
The storages in the inductor and also
rotational energygy correspond
p to I
Source Conversion
elements, while the resistor and the
friction are R elements. Both junctions
have common flow variables, so they
are s junctions.
Resistor Friction
The conversion between electrical and
mechanical energy is a gyrator. I : L1 I:J
Assumption: a general nonlinear
relationship for the friction: M f = r (ω) MJ ω
u
Se s GY s
i i k ω
Mf ω

R : R1 R : Mf = r (ω)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
SYSTEMS WITH MIXED PHYSICAL VARIABLES
™ Mechanical – Hydraulic System

The force F acts on a piston with mass


ml and cross section A1.This
This results in
a flow Q1, which is partly stored in a
tank with cross section A3 and partly
goes on as Q2 to a piston with cross
section A2. This piston moves the mass
m2 with velocity v2 over a surface
with friction Ff = r (v2). The pressure
F p
in the connecting tube is p. Starting Se s TF System
with the left cylinder, we see that the v1 Q1
1/A1
energy is partly stored in the mass ml
and partly transferred to the hydraulic
subsystem. This transfer of energy is,
I : m1
as we have seen, represented by a
transformer.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

70
BOND GRAPHS
SYSTEMS WITH MIXED PHYSICAL
VARIABLES

™ Mechanical – Hydraulic
System

F p
The energy flow to the right is partly Se s TF System
v1 Q1
stored in the tank and partly taken to 1/A1
the cylinder on the right. A common
pressure means a p junction.
I : m1

F p
Se s TF p
System
v1 Q1
1/A1

I : m1 C : (A3/ρg)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
SYSTEMS WITH MIXED
PHYSICAL VARIABLES
F p
™ Mechanical – Se s TF p
System
v1 Q1
Hydraulic System 1/A1

At the cylinder to
the right there is are I : m1 C : (A3/ρg)
conversion to
mechanical energy Se R : Ff = r (v2)
which is divided
into kinetic energy F v1 Ff v2
and friction losses.
p p
s TF p TF s
Q1 Q2 v2
1/A1 A2
p v2

I : m1 C : (A3/ρg) I : m2
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

71
BOND GRAPHS
CAUSALITY : SIGNALS BETWEEN SUBSYSTEMS

We regard e as a signal from A to B


and f as a signal from B to A. If e
e
we want to view the bonds in this A f B A B
way, we put a cross stroke on the f
bond adjacent to subsystem B, that
is, adjacent to the subsystem that e
e
has effort as input. A cross stroke at A f B A B
f
the opposite side of the bond,
means that e is regarded as input of Signals between subsystem
A and f as input of B.
This pprocess of assigning
g g inputs
p and outputs
p to subsystems
y is often called causalityy
assignment - the input can be regarded as the cause of the output. The cross strokes are
often called causal strokes.
Effort source Flow source
™ Causality of Sources e e
Se Sf
f f
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
CAUSALITY : SIGNALS BETWEEN SUBSYSTEMS

Causality of Energy Storage


Effort storage is described by

Regarding e as the input gives the block Choosing f as the input gives instead the
diagram shown in the figure following block diagram
e f f e

Causal strokes for I , C and R element


e e e e
I C R R
f f f f
It is natural to let e be the input and then get the causality (fig.a).
Since e and f change roles for a flow storage, the natural choice of input is f (fig.b).
For a resistive element there is a static relationship between e and f. If this is the case than
we are free to choose either e or f as input.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

72
BOND GRAPHS
CAUSALITY : SIGNALS BETWEEN SUBSYSTEMS

Causality of Junction
¾ For an s junction there is a common
fl and
flow d the
h sum off the
h efforts
ff iis zero:
f1 = f2 = . . . = fn and
e1 + e2 + . . . + en = 0
All bonds of an s junction except one
shall have the causal stroke at the s Causality of an s junction
¾ For an p junction the roles of effort and flow change places and the rule
therefore becomes:
Precisely one of the bonds of a p junction shall have the causal stroke at the p.
Causality of Transformers and Gyrator

Possible causalities of a transformer Possible causalities of a gyrator


TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
CAUSALITY : SIGNALS BETWEEN SUBSYSTEMS

Causality of Transformers and Gyrator

¾ For an s junction there is a common


flow and the sum of the efforts is zero:
f1 = f2 = . . . = fn and
e1 + e2 + . . . + en = 0
All bonds of an s junction except one Possible causalities of a transformer
shall have the causal stroke at the s

¾ For an p junction the roles of effort and flow change places


and the rule therefore becomes:
Precisely one of the bonds of a p junction shall have the causal
stroke at the p.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

73
BOND GRAPHS
CAUSALITY : SIGNALS BETWEEN SUBSYSTEMS

Propagating Causality in a Graph


1 Ch
1. Choose a source andd markk its
i automatici causality
li
2. Some adjacent bonds have only one possible causality because of the
rules for junctions, transformers, and gyrators. Mark these causalities
as far into the graph as possible
3. Repeat steps 1 and 2 for all sources
4. Choose an I or C element and mark its natural causality
5. Mark the causalities that are now fixed analogous to step 2
6. Repeat steps 4 and 5 for all I and C elements
7 Choose some R element that has no causality mark and fix an arbitrary
7.
one
8. Do the analogy of step 2
9. Repeat steps 7 and 8 for all remaining R elements

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
CAUSALITY : SIGNALS BETWEEN SUBSYSTEMS
Causality for an Electrical System
Step 5, according to the rule
we must mark causalities at the
l ft junction
left j ti

Finally, step 5, gives causality


to the last bond.
Step 1 in the algorithm by marking
the causality at the effort source
Steps 2 and 3 of the algorithm do not
give anything new.
Step 6, we have to repeat step
Step 4 - causality to the 4 for the C element.
bond at the I element.

Now, causality is given to all


bonds without conflict with the
rules.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

74
BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS

A great advantage of bond graphs is that the choice of state variables is natural.
The memory of the system lies in the I and C elements. It is natural to associate
one state variable with each such element.
element
¾ For an effort storage

It is natural to choose the state variable x as or


¾ For a flow storage

It is natural to choose the state variable x as or

If we introduce above state equations for all I and C elements, we get a state-space description as
soon as all flows of C elements and all efforts of I elements are expressed in states and inputs. We
can then do calculations as if the I elements were flow sources and the C elements effort sources.
We can then propagate the signals through the graph using the causality marks as local
information whether a signal is to be regarded as an input or an output.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS
Relations among variables for an
electrical system

We now know the inputs of


the
h R elements
l with
i h values
l R1
and R2 so that their outputs R1i
and vc/ R2 can be calculated.
Since we now know the three efforts
that are inputs to the s junction, the
fourth one, which is an output, can be
At the s junction we have the flow i as input. computed to be v− R1i − vc. At the p
Then all the other flows are given as outputs junction we analogously calculate the
(=i). In the same way, vc at the p junction current into the capacitor to be
determines all other efforts to be equal to vc . i− vc/ R2.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

75
BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS
Relations among variables for an
electrical system
If we introduce the state variables xl= i and x2= vc,
we get directly,
directly by reading the bonds at the I and C
elements, the equations

or equivalently

This is a state space description with input v. The procedure of this


example can be formalized into analgorithm.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS
Algorithm for Equation Sorting

1. Choose a source and write its input signal in the forward list and the
equation of the other bond variable in the backward list.
list
2. Check adjacent bonds. If some variable is defined in terms of already
calculated variables, write its equation in the forward list and the
equation of the other bond variable in the backward list. Do this as far
into the bond graph as possible
3. Repeat steps 1 and 2 until all sources have been treated
4. Choose an I and write the equation in the forward list and
in the backward list
5. Do the analogy to step 2
6. Repeat steps 4 and 5 for all I elements have been processed
7. Do the analogy of steps 4, 5, and 6 for all C element
8. Do the analogy of step 2
9. Reverse the order of the backward list and put it after the forward list

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

76
BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS
™ DC Motor

State variables:

Step Forward list Backward list Bond graph for a DC motor


1 u 1= u i1=i2 I : L1 I:J
2 i2=(1/L1)x1
u2 i2 M2 ω 2
2 i3=i2 u3=R1i3
u1 u4 M1
2 i4=i2 u4=k ω1 Se:u s GY s
i1 i4 ω1
2 M1=k i4 ω1=ω2 k
u3 i3 M3 ω 3
4 ω2=(1/J) x2

5 ω3=ω2 M3 = r (ω3) R : R1 R : M3 = r (ω3)


TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS
™ DC Motor
u1= u
The complete list of equations is
i2=(1/L1)x1
obtained by putting the reverse backward
list after the forward list giving i3=i2
i4=i2
M1=k i4
Bond graph for a DC motor ω2=(1/J) x2
I : L1 I:J ω3=ω2
M3 = r (ω3)
u 2 i2 M 2 ω2
u1 u4 M1 ω1=ω2
Se:u s GY s
i1 i4 ω1 u4=k ω1
k
u 3 i3 M 3 ω3 u3=R1i3

R : R1 R : M3 = r (ω3) i1=i2 This is a complete description


of the dynamic system.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

77
BOND GRAPHS
STATE EQUATIONS FROM BOND GRAPHS
™ DC Motor
u1= u
i2=(1/L
(1/L1)x1
i3=i2
Eliminating all variables that
i4=i2 are not states gives:
M1=k i4
ω2=(1/J) x2
= u1 −R1i3 −k ω1 = u1 − R1i3 − k ω2
ω3=ω2
= u1 −R1i3 − (k/J) x2 = u1 − R1i2 − (k/J) x2
M3 = r (ω3) = u1 −(R1/L1) x1 − (k/J) x2 = u −(R1/L1) x1 − (k/J) x2

ω1=ω2 = M1 − r (ω3)
u4=k ω1 = M1 − r (ω2) = M1 − r((1/J) x2)
u3=R1i3 = k i4 − r (x2/J) = k i2 − r(x2 /J)
= (k/L1) x1 − r(x2 /J)
i1=i2
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

BOND GRAPHS
CONCLUSIONS

Bond graphs represent a very systematic method for the modeling


of systems in physics and engineering. It is an advantage that the
method is based on a central physical concept – energy –and that
the same methodology is used for different types of systems.
Another advantage is that we work locally, "one junction at a time.“
In this way, complex systems are in principle no more difficult than
simple ones. The bond graph is also a complete description of a
dynamic system. It can automatically be translated into state-space
equations.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

78
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
6. EXPERIMENTAL MODELING
- IDENTIFICATION

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
INTRODUCTION

™ During the process of modeling of a system, there can be system


constants whose values are not known
known. There can also be subsystems
of such characteristics that it is difficult to describe their function by
known physical laws. In such cases, data from the system have to be
used to complete the model. These data consist of measurements of
variables in the system: outputs, inputs and possibly also disturbances.
Such measurements can be used to understand how the system works,
to describe partial systems, and to compute values of system
constants.

™ The technique to build and complement models from


measurements is called identification (system identification) .

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

79
EXPERIMENTAL MODELING
- IDENTIFICATION
BASICS OF EXPERIMENTAL MODELING

Most practical problems dealing with systems with exactly one input or output
(single-input, single-output: SISO systems). Therefore, the majority
of procedures for such systems have been designed.
™ Transfer Function
¾ Continuous-time domain
A linear dynamic SISO system is described by differential equation in
continuous-time domain:
(n) (m)
bn y (t ) + ...... + b1 y& (t ) + b0 y (t ) = a m u (t ) + . . . . + a1u& (t ) + a 0 u (t )
where input signal u(t) and output y(t) are continuous-time functions. If
u(t) and y(t) have the Laplace transforms U(s) and Y(s) respectively, and the
initial conditions are equal
eq al to zero
ero (u(t) (t) = 0 t ≤ 0),
( (t) = y(t) 0) than the Laplace
Transform of the above equation gives:

Now, the transfer function as a rational function of the complex Laplace


variables will be:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
BASICS OF EXPERIMENTAL MODELING

™ Transfer Function
¾ Discrete-time domain
A linear dynamic SISO system in discrete-time domain is described by a
difference equation:

The discrete-time difference equation is converted by the z-transform in:

Quite similarly with definition of transfer function in continuous systems, the


transfer function in discrete-time systems is also defined as pulse-transfer
function of the complex
p variable z:

In both cases (continuous-time and discrete-time), the zeros of the transfer function
numerator are called zeros of the transfer function, and the zeros of the denominator
are called poles of the transfer function. Apparently, a transfer function (and thus the
dynamic system behavior) is fully described through the poles and zeros.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

80
EXPERIMENTAL MODELING
- IDENTIFICATION
BASICS OF EXPERIMENTAL MODELING
™ Transfer Function
¾ Continuous-time domain By the transfer function, the dynamic
Example:
transition behavior of a linear system
A continuous time linear dynamic model is given i described
is d ib d in
i frequency
f domain.
d i
by the differential equation:

To calculate the transfer function, first the Laplace


transform is found: Relationship between input U and
output Y is:
and the above equation is transformed to:
Note: According to the rules of Laplace
transform, under the zero initial
The poles and zeros of the transfer function can
conditions, the following equations are
be immediately read from the factored representation applicable:
of numerator and denominator:
Zero is: q1= −3
Poles are: p1= −1, p2= −2 and p3= −4

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
BASICS OF EXPERIMENTAL MODELING
™ Transfer Function
¾ Discrete-time domain
Example:
A discrete time linear dynamic model is given
by the difference equation:

To calculate the pulse-transfer function, first


the z-transform is computed: Discrete time system, z-transforms

and than it is transformed to:

Here, the representation is already in factored form. Relationship between input U and
Zeros and poles of the transfer function are: output Y is:
No zero point
The only pole at: p1 = 0.5

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

81
EXPERIMENTAL MODELING
- IDENTIFICATION
BASICS OF EXPERIMENTAL MODELING
™ Transfer Function
¾ Weight function and Transition function Continuous-time system

There are two test signals, which are


particularly important as input u(t):
the Dirac-delta pulse δ (t) and
the unit step function σ (t).
The system response to a pulse is
called a weight function or sequence
g(t) and g(k). Discrete-time system
The system response to a unit step
input gives h(t) and h(k) as a
transition function or sequence,
which is also known as a step
response.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
SIMPLE PRELIMINARY IDENTIFICATION

In simple preliminary identification, the model accuracy is not in the foreground,


but rapidly gained an impression of the main characteristics of a dynamic system.

™ Step-response analysis
The first step in modeling (structuring phase) is to decide which
quantities and variables are important to describe what happens in the
system. It is then also necessary to decide, or guess, how the variables
affect each other, which time constants are important and which
relationships can approximately be described as static ones. A simple and
common kind of experiment that shows how and in what time span
various variables affect each other is called step-response analysis or
transient analysis. In such experiments the inputs vary (typically one at
the time) as a step: u(t) = u0, t < t0; u(t) = u1, t ≥ t0. The other measurable
variables in the system are recorded during this time. We thus study the
step response of the system.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

82
EXPERIMENTAL MODELING
- IDENTIFICATION
SIMPLE PRELIMINARY IDENTIFICATION

™ Step-response analysis
The following information can be obtained from consideration of the step response:
• Concerned by the specific input outputs (variables) can be determined, and that
is especially beneficial in MIMO system. This makes it easier to draw block
diagrams for the system and to decide which influences can be neglected.
• The time constants of the system are clearly visible. From this we can see
which parts of the model can be modeled statically (since they are much faster than
the dynamics of interest).
• The system characteristics (oscillatory, weakly damped, a periodic, with dead
time)) is clear. Similarly,
y, one can see the steadyy gain.
g
Because of the easy implementation and immediate information, this method is probably the
most widely used method of identification in industrial practice.
Disadvantage of this method is that the obtained information is somewhat limited. Practical
limits in the amplitude of the input, together with disturbances and measurement errors may
make it difficult to determine quantitative models with a reasonable degree of accuracy.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
SIMPLE PRELIMINARY IDENTIFICATION
™ Step-response analysis
Example
For a step input u(t) = ∆uσ(t) the output
is y(t).
Approaching the system behavior by a
PT1 element with time delay (structural
assumption!), the general form of the
transfer function will be:

The parameters Ks, T and Tt are determined Note: There are also methods
from the step response using the following for model structures as a PT2 element:
rules:
, ,
The parameters ∆u (input step size), ∆y (steady- and as a PTn element
state value of output), Ta (compensation time)
and Tu (delay time) can be read from Figure.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

83
EXPERIMENTAL MODELING
- IDENTIFICATION
SIMPLE PRELIMINARY IDENTIFICATION
™ Frequency Analysis
This relationship is so-called Bode plot
A linear system is uniquely determined by its
clearly presented taking the frequency
impulse response or its frequency response
i ω (x-axis)
axis ( i ) llogarithmic
i h i scale,
l while
hil
G(iω) (the Laplace transform of the impulse
the amplitude gain A (ω) = | G (iω) | is
response evaluated at s = i ω).
measured in decibels. The phase shift
φ (ω) is generally indicated in degrees.
If a linear system has the transfer function In Matlab bode command exists for the
G(s) and the input is: continuous-time systems and discrete-time
systems. An example of a result from
then the stationary output will be: Matlab is shown in Fig.

It is now important that the amplitude gain


and phase shift of the output are determined
by the frequency response:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
SIMPLE PRELIMINARY IDENTIFICATION
™ Frequency Analysis
The method of frequency analysis is often
This is a procedure which allows easy
used to build models of systems. The
identification:
following advantages and disadvantages
1. The system has been stimulated by a
can be pointed out:
harmonic function with known frequency,
• Easy to use and requires no complicated
amplitude and phase.
data processing
2. After possible transients have faded away,
• Requires no structural assumptions about
the amplitude y0 and phase φ are measured
the system, other than it being linear
out from the output signal.
• It is easy to concentrate on frequency
3. One point in the Bode diagram is
ranges of special interest (for example
determined with obtained A(ω) and φ (ω),
around resonance frequencies)
q )
i the
i.e. th complex
l numberb G(iω
G(i 1) can bbe
• The basic result is a table or a graph of the
determined.
function G(iωk) k=0,...,M. This cannot be
4. By repeating this procedure for a number of
used directly for simulation.
different ω, we can get a good estimate of
• Frequency analysis may need long periods
the function G(iω).
of experimentation if G(iω) has to be
determined at many frequencies
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

84
EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION

As the name suggests,, the parameter estimation is using to estimate the


numerical values of a parametric model. It is a well-known statistical problem
to estimate parameters in different models. Such methods are also of great
importance when building models of dynamic systems. The lack of knowledge
about specific details or about general subsystems in the system will then be
represented using parameters, whose numerical values have to be determined by
statistical methods.
™ Basics of Parameter Estimation
A linear dynamic SISO system in discrete-time domain is described by a
difference equation:

This equation can be transformed so that the current output y(k) is


represented only by past outputs y(k-i) and inputs u(k-j):

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Basics of Parameter Estimation
The previous equation can be written in vector notation,
which results in:

This equation is valid for all time points k therefore can be


written in matrix notation for all measurement data:

or in a much more compact symbolic notation: y = X·θ


where y is the vector of current outputs, X is the matrix of past outputs
and inputs, and θ is the parameter vector that defines the system behavior.
The last equation can rearranged in the form: θ = X−1· y

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

85
EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Basics of Parameter Estimation

The parameter vector can be obtained by the equation: θ = X−1· y


Note that the inverse matrix is defined only for square matrices. This case occurs if and
only if the number of equations (rows) is the same as the number of unknown parameters.
Then there is a deterministic problem that is occurring in the practical cases always
solvable. Obviously this would make it required for the calculation of the parameter
vector just as many times of measurement as it corresponds to the order of the system.

In practical measurements,
however, measurement noise
al a s occur.
always occ r This problem is
illustrated in Figure. Measurement
noise n(k) always comes from
imperfections, and we only can
measure the real output

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION

™ Least-Squares (LS) algorithm


In ideal case without noise, the system output is determined by the equation:
y = X·θ
Through the influence of the noise, however, there is a deviation from this ideal
equation. To describe this deviation the equation can be written with an additional
error e: y = X·θ + e
How to find out now the parameter vector θ ? An important objective is to
minimize the sum of the squared error (least squares, LS). The corresponding
criterion is

The estimated value of the unknown parameter (LS estimate):


TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

86
EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Least-Squares (LS) algorithm

The best known example of the application of the LS estimator


is the regression
g line. In this one-dimensional p
problem,, there is
a linear dependence of a variable y from the variable x
according to the equation:
y(x) = k x +d
The parameters k (increase) and d (ordinate intersection) are
estimated, although the measured points do not lie exactly on
this line.

In two-dimensional case, the output variable y are linearly


d
dependent
d on two inputs
i y(x
( 1,x2) = k1 x1 + k2 x2 + d
Parameters k1, k2, and d should be estimated in optimal way. The
result corresponds to a plane which optimally approximates the
measured points.
This case corresponds to the first order dynamic system with input
u(k) and the output y(k) = α y(k-1) + β u(k)
where d = 0, and the two linear parameters α and β are estimated.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Least-Squares (LS) algorithm
¾ Model structures
A noise model is necessary to describe the real measurement noise
noise. However,
However the
structure and parameters of this noise model is not a priori, but must first be
determined together with the transfer function of the unknown dynamical system.
The most general model, which includes all others as
special cases, is the Box-Jenkins-Model (BJ-Model).
The output Y(z) is described in the discrete frequency
domain by

where U(z) is the system input, and V(z) is white


noise. Therefore, in this model there are parameters
of 4 different polynomials (A, B, C and D) to
estimate.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

87
EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Least-Squares (LS) algorithm
¾ Model structures
An important special case is when the properties of the
disturbance signals are not modeled, and the noise
model is chosen so that its transfer function is equal to 1.
This special case is known as an output-error model
(OE-Model) since the noise source will then be the
difference (error) between the actual output and the
noise-free output.

Thus, only the polynomials A and B are to be


estimated, the noise model is a priori defined as 1.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Least-Squares (LS) algorithm
¾ Model structures
Another popular variant is the ARMAX model (AutoRegression
with MovingAverage of white noise and eXtra input); a
common denominator for both transfer functions is assumed

and the number of unknown polynomials is 3.


Physically, the difference between ARMAX and BJ models is that the noise and input are subjected to the
same dynamics (same poles) in the ARMAX case. This is reasonable if the dominating disturbances enter
early in the process (together with the input).

A further simplification of the ARMAX model is the


ARX model. Here, the numerator of the noise model is
selected to be D(z-1) = 1, so there are remain only two
unknown polynomials

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

88
EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION
™ Least-Squares (LS) algorithm
¾ Model structures
Regarding
g g the selection of appropriate
pp p model structure, some ggeneral points
p of view can
be listed:
ƒ The ARX model is the easiest to estimate since the corresponding estimation problem
is of a linear regression type. The foremost disadvantage is that the disturbance model
comes along with the system's poles. It is therefore easy to get an incorrect estimate of
the system dynamics because the A polynomial also has to describe the disturbance
properties. Higher orders in A and B than necessary may be required. If the signal-to-
noise ratio is good, this disadvantage is less important
ƒ The OE model has the advantage that the system dynamics can be described separately
andd th
thatt no parameters
t are wastedt d on a disturbance
di t b model.
d l If the
th system
t operatest
without feedback during the data collecting, a correct description of the transfer
function can be obtained regardless of the nature of disturbance. However,
minimization of the criterion function can be more difficult than in the ARMAX case.
ƒ The BJ model is the "complete model“ in which the disturbance properties are
modeled separately from the system dynamics
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION

™ Prediction Error Method (PEM)


IIn the
h case off ARX and d ARMAX model, d l the
h estimation
i i off the
h parameter
vector is found by linear methods. For BJ and OE models, the approach is
not at all by the error e equation. In these models, we must use the general
method of prediction errors ε. In this case, the objective is to minimize
the sum of squared prediction errors

In general, the criterion J(θ) depends nonlinearly on the parameter vector θ,


and thus only a numerical approximation for the optimal estimate ( ) can
be calculated. This is necessary in both cases: OE and BJ models.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

89
EXPERIMENTAL MODELING
- IDENTIFICATION
PARAMETER ESTIMATION

™ Identification in the state space

In contrast to the identification in transfer function model, the


identification in state space model involves estimation of more than
one parameter. Moreover, the choice of states is not unique and the
consideration of measurement noise is very complicated.
An algorithm N4SID (pronounced 'enforce it') is implemented in
Matlab. By using special mathematical methods for this the
parameters of the linear state space model can be calculated without
iteration.
Alternatively, for the identification in the state space also exists a
PEM, using the result of the N4SID algorithm as starting point for the
numerical optimization.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION IN CLOSED LOOP

In closed loop, various problems arise: Identification in closed loop - Indirect identification
• The controller transfer function has a full effect
on the
h iinput-output data
d
• Noise inputs act at first only to the output, but
through the feedback they are returned again to
the input: This results in a correlation between
measurement noise and input signal.
However, closed-loop parameter estimation can be
performed correctly. Two methods can be Identification in closed loop - Direct Identification
distinguished:
1. Indirect identification: Only the output y(k) is
measured, and the control variable must be w(k)=0
2. Direct Identification: Both the output y(k) and the
manipulated variable u(k) are measured, ant there
is no restrictions for the reference variable w(k).

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

90
EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

In the previous a brief overview on methods for model building based on


measurements is given
given. In the following the role of identification as a
practical tool for model building is discussed.
The most important aspect is that there are now many interactive computer
program packages for identification in which the methods and theories are
packaged in a user-friendly way. The focus has thereby moved from
algorithms for identification to understanding of the possibilities and
limitations of identification.
With given data the user's main task is to decide on a suitable model
structure.
Another main task is to construct and carry out experiments that give data
with good information contents for the subsequent identification step.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

™ Program Packages for Identification


Building a model using identification is characterized by the
following steps:
1. Specify a model structure
2. The computer delivers the best model in this structure
3. Evaluate the properties of this model
4. Test a new structure, go to step1.
There are now many commercially available program packages for
identification that supply help to compute the model and to evaluate
its properties
properties. They typically contain the following routine:
• Handling of data, plotting, and the like
• Nonparametric identification methods
• Parametric estimation methods
• Presentation of models
• Model validation
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

91
EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

™ Construction of identification experiments

These three points give guidance for the construction of


identification experiments:
• The experiment should be carried out under conditions that
are as similar as possible to those under which the model is
going to be used
• The inputs should excited all interesting aspects of the system
• The measurement y(t) and the input u(t) should be chosen so
that the prediction will be as sensitive as possible with
respect to θ.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

™ Preparation of the data (pre-processing)

The first step in an identification application is to plot the data to make an


initial inspection. One then often discovers that they have certain deficiencies.
There can also be obvious faulty values (outliers) among the data. There may
also be reasons to enhance certain frequency bands in the data in order to get a
better model fit.
An important aspect of the pre-processing is also to choose a part from the data
that looks good and that thereby is suitable for model fit and model validation.
Under different circumstances it may also be useful to undertake the pre-filtering
of measurement data.
data It is advisable to filter the data through a band-pass
band pass filter
that has a pass band covering the interesting frequencies (breaking points in the
system's Bode diagram). The effects of low-frequency disturbances, drift, and so
on, are thereby reduced. The focus on the model fit is also automatically moved
to the most important frequency bands.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

92
EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

™ Model Structure
The advantages and disadvantages of different model structures (ARX, ARMAX, BJ,
OE state space) have already been discussed above.
OE, above In practice usually there is not
enough information to select a priori the most suitable model. Therefore, we tried
with different model structures to obtain a good result. The validation of the various
models is discussed later.
™ Model Order
To determine the order and delays of a model, the following procedure is quite useful:
• First get a reasonable estimate of the delay. Pick the delay that gives the best model
performance (sum of squared prediction errors on a validation set)
• Then test manyy ARX models of different orders with this delay. y Pick the orders that
give the best model performance
• The model may be of unnecessarily high order to describe the system dynamics, since
the poles of an ARX model also describe the noise properties. Thus plot the zeros and the
poles of the resulting model (with uncertainty regions marked) and look for
cancellations. The surviving numbers of poles and zeros give us indications of the
necessary order for the dynamics from input to output.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

EXPERIMENTAL MODELING
- IDENTIFICATION
IDENTIFICATION AS A TOOL FOR MODEL BUILDING

™ Model Validation
To validate a model is to investigate
g if it can be accepted,
p ggiven its intended use.
This is closely related to the concept of model quality.
Computing models from different measurement records and in different structures
and then evaluating their input-output properties (for example in a Bode diagram
or in simulation) is an important tool for gaining confidence in the model. If
approximately the same model properties are obtained under such varied
conditions, we should feel confident that the model found some significant
features of the system.
A natural test of the model's ability to reproduce the system's behavior is to
simulate the model from input only and then compare the simulated output with
the measured one.
It is important to get as much advice as possible from available validation
possibilities. The final validation criterion is, however, that the model is working
well when it is used for its purpose: simulation, analysis, control design, or
whatever.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

93
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
7. SIMULATION

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
USING MODELS FOR SIMULATION

™ In the previous parts a brief overview on methods for system modeling was
given. These models can be used for a number of purposes, for example:
¾ Increasing the understanding of the system itself
¾ Predicting the future behavior of the system
¾ Carrying a technical computations for control design
¾ Optimizing construction
¾ Studying human-machine cooperation.
™ Regardless of the purpose, we almost always want to study the solutions to the
model equations. The classical way of attacking the problem has been to solve the
equations using analog computers. Today the equations are most often solved
numerically in a computer. Regardless of the method, the solving of the equations,
together with the presentation of the result, is usually called simulation.
™ Modern technology gives a wide range of possibilities for presenting the results
from simulations in such a way so that the real system's behavior is illustrated.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

94
SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

Assumption: no matter how the model was entered by the user, the simulation
language/program has been able to convert it to a standard state-space form.
Matlab for example always uses an internal state space representation even if only one
transfer function is entered.
It should be noted that the intention was not to consider the numerical methods in
details, but rather the most common algorithms with their properties essential for a
simulation are discussed.
™ Fundamentals of numerical methods
A state-space form of a model: The vector of initial conditions is
given, and we are now looking for an
- state
t t vector
t appro imation of the state vector
approximation ector x at
- input vector time points
If the input is fixed to a certain vector , than 0 < t1 < t2 < . . . < tN
the influence of u can be expressed as a time The algorithm will thus generate the
variation off f and write: values x1, x2, . . . , xN, which
approximate x(t1), x(t2), . . . , x(tN)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

™ Euler’s method
The simplest algorithm is obtained by approximating
with a difference ratio:

where:
The term f (tj, xj) thus corresponds to the derivative of
the function x at tj (slope of the tangent in one-
dimensional case). This gives the recursive equation

which is called Euler's method.


An algorithm for differential equations can, more
generally, be described by the equation:

This is known as a k-step method; and the integer k


shows the number of previous steps that are utilized. One-step procedure Three-step procedure
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

95
SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

™ Euler’s method

If xj+1 is not included in the expression for F, xj+1 is obtained directly by evaluating
the right side. The method is then said to be explicit. In other cases the method is
implicit, and an equation system has to be solved to get xj+1. Euler's method is
obviously an explicit one-step method.
It is of course important to know how accurate a method is in solving differential
equations, i.e. the error estimation is important for each numerical method.
The one-step error, or the local error :
ej = x(tj) − zj The fact that the region
g of stabilityy
of a differential equation does not
where: zj = F (t, x(tj–k), x(tj–k+1), . . ., zj) necessarily coincide with the one
For Euler's method it is: valid for the numerical algorithm is
ej+1 = x(tj+1) − xj+1 = x(tj+1) − x(tj) − ∆t f (tj, xj) something to remember when trying
to determine the stability of a
for tj < ξ < tj+1 dynamic system by simulation.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
NUMERICAL INTEGRATION ALGORITHMS
™ Method of Runge-Kutta
Again consider:

which can also be written in integral form (for simplicity here


a scalar notation is used, but all connections are, of
course, also valid for a state vector):

However, this term can be approximated


If we approximate the value of the integral with with Euler's method:
the length of the interval times the value of the
integrand in the center (i.e. using an intermediate
step), we have: Combining the last two equations, we can
write:

The problem here is unknown


simple Runge-
TEMPUS IV Project: 158644 -JPCR
Kutta method
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

96
SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

™ Methods of Adams
The methods of Adams form a family of multistep methods that can be
written in the form:

The coefficients βi are chosen so that the order of accuracy is as high as


possible. If β0 = 0 is chosen, the method will be explicit. This variant is
often called Adams-Bashforth, while the implicit form ( β0 ≠ 0 ) is called
Ad
Adams-Moulton.
M l
For the explicit methods the order of accuracy is equal to k. For the
implicit methods it is of order k + 1 .

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

™ Methods with variable step length

It is often inefficient to use a constant step length when solving


differential equations. A typical solution might contain segments with
rapid changes, where small steps are required, and segments where slow
changes make large steps possible. Methods for automatic step
adjustment are often based on an estimate of the local error.
The algorithm has a tolerance level for the local error (for example,
determined by the user). If the error estimate exceeds the tolerance, the
step length ∆t is decreased
decreased. If it is far belo
below the tolerance
tolerance, the step length
is increased. Ideally, a given accuracy is obtained with a minimum
amount of computational work.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

97
SIMULATION
NUMERICAL INTEGRATION ALGORITHMS
™ Stiff Differential Equations
Stiff differential equations are characterized by the fact that their solutions contain
both fast and slow components and that the difference between their time constants is
large. An example is the differential equation:

which has the solution: x1 = e − t + e −10000 t


x2 = − e − t − 0.0001 e −10000 t

If we want to simulate this equation,


equation we have to start with a very short step length in order to
follow the fast term e −10000 t . This term is, however, soon close to zero, and the solution is
only characterized by the term e − t . Since it is much slower, we would now like to increase
the step length. But then we have to take stability into account. Thus the number of efficient
algorithms is drastically reduced. They must be still implicit algorithms because
they have the same accuracy at a greater range of stability than explicit methods.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
NUMERICAL INTEGRATION ALGORITHMS

™ Choice of the integration method

ƒ For very simple systems, or for a quick overview, Euler's method


can be used, but in any case here not too large step size must be
ensured
ƒ Runge-Kutta methods are most effective when the complexity is
relatively low (when the calculation of the right side of the
equation is not too complex). Procedure of 4. or 5. order offers a
good compromise between accuracy and effort.
ƒ Methods
e ods ofo Adams
d s aree preferable
p e e b e at high
g complexities
co p e es
ƒ Methods for stiff problems are usually ineffective for non-stiff
problems. These methods should thus be reserved for the problems
where they really are needed.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

98
SIMULATION
SCALING OF THE MODEL EQUATIONS

The simulation work is made easier through scaling of the equations. Scaling
means that in the equation

a variable change is made


corresponding to amplitude and time scaling, respectively. Differentiating the
obtained expression gives the differential equations:

The scaling can be used to get the same order of magnitude of the variables and
th b avoid
thereby id numerical
i l problems.
bl Another
A th use off scalingli is
i to
t reduce
d the
th number
b off
cases that we need to simulate.
The amplitude and time scaling are useful as a way of making "standardized
simulations". In addition the scaling can be physically necessary when the simulation
takes place in terms of analog, physical quantities. Scaling can also give
considerably better numerical properties in digital simulation.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
SCALING OF THE MODEL EQUATIONS

¾ Tank with free outflow


A (m2) - tank cross section u ((m3/s)) - inflow u
a (m2) - outflow hole area q (m3/s) - outflow
h (m) - level of the liquid h q
The explicit nonlinear differential equation for the
liquid level is: Tank with free outflow

We want to investigate how an originally empty tank is filled with a constant input
flow u for different values of three parameters (a, A, and u) in the model. If each
parameter has to assume N values, N3 simulations are, in principle, needed. However,
if the model's behavior under scaling is utilized,
utilized only one simulation is needed.
needed
Applying:

where H and T are scaling factors,


we get the scaled model equation:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

99
SIMULATION
SCALING OF THE MODEL EQUATIONS

¾ Tank with free outflow


u

We choose H and T so that : h q


and
Tank with free outflow
i.e.
,
Step response of a tank
then the model is reduced to equation:

All we need to do now is to simulate this equation and


draw the result.
When we then want to utilize the curve for a special problem,
we compute the values of H and T for the case in question and
can then go from scaled time and scaled h to t and h.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
BLOCK DIAGRAMS AND SUBSYSTEMS

Block diagrams give a clear graphical representations of dependencies within and between
dynamical systems. They help to illustrate the basic sub-models and their interaction in
Phase 1 of modeling. On the other hand, many simulation programs perform a simulation
using block diagram presentation (e.g. Simulink).
The order of the system (number of states)
For preparation of detailed block diagrams, it corresponds exactly to the number of integrators.
is helpful to transform the differential
equation:
u x1
f1(x,u) ∫

into an integral representation:


u x2
f2(x,u) ∫

u xn
This system of equations involves two types of operations:
fn(x,u) ∫
static nonlinear transformations and integration
Block structure of a dynamic system
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

100
SIMULATION
BLOCK DIAGRAMS AND SUBSYSTEMS

¾ Block diagram for a linear system

A linear system in a state-space form is Block diagram of a


given by following equations: linear dynamic system of 3. order

The system is of the third order, therefore


it can be realized with three integrators
integrators.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
BLOCK DIAGRAMS AND SUBSYSTEMS
™ Connecting subsytems
¾ Series circuit y=v w
u

These two systems will be interconnected in


u w
a series circuit, i.e. v = y . It follows:

u y=v w
x z

Block diagram of a series connection of


two systems. The replacement u w
system has the sum of the states of the [x z]
original systems
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

101
SIMULATION
BLOCK DIAGRAMS AND SUBSYSTEMS
™ Connecting subsytems
¾ Feedback Block diagram of an algebraic loop

x
u=w y=v
z
Such a structure is hidden in any
dynamic system, and only an
y=v approximate iterative solution
[[x z]] can be found.
found
Algebraic loop in a simulation can
Block diagram of a feedback of two systems presented in state not be resolved directly. Simulink reports
space form. The replacement system also consists of the an algebraic loop in the Matlab Command
sum of the states of the original systems, but the output from Window, simultaneously, an iterative
one is the same as the input in the other subsystem solution of the loop tries.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

SIMULATION
SIMULATION LANGUAGES

To make simulation possible, there must be a systematic way in which the user can
enter a system description into the computer. We may call it a simulation language.
S
Severall approaches
h are possible:
ibl
1. The system is defined by subroutines written in a standard programming
language
2. The system description might be entered graphically in terms of block
diagrams
3. The system description is entered graphically in terms of bond graphs
Basic components of Matlab and Simulink as a simulation tool are already discussed
in previously parts.
In summary it can be point out that modern computer and programming tools turn
simulation into a relatively straight forward procedure compared to the modeling work.
Difficulties can arise with models that are not in state-space form and that have very
stiff systems. Complicated models can demand very large computer resources. In some
cases the problem may need to be attended to on the modeling level, for example, by
model reduction.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

102
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
TRANSLATIONAL MECHANICAL
SYSTEM WITH MASSES, SPRING
AND FRICTION
Train system -
EXAMPLE

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Physical Modeling
We will consider a toy train consisting of an engine and a car. Assuming that the train only
travels in one direction, we want to apply control to the train so that it has a smooth start-up
and stop, along with a constant-speed ride.
The mass of the engine and the car will be represented by M1 and M2, respectively. The
two are held together by a spring, which has the stiffness coefficient of k. F represents
the force applied by the engine, and the Greek letter, µ, represents the coefficient of
rolling friction.
Physical Model Parameters
For this example, we will assume the following values for the physical parameters:
ƒ Mass of the engine M1 (M1 = 1 kg)
ƒ Mass of the car M2 (M2 = 0.5 kg)
ƒ Spring stiffness coefficient k (k = 1 N/m)
ƒ Coefficient of rolling friction µ ( µ = 0.002 s/m)
ƒ Force applied by the engine F – input
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

103
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Mathematical Modeling
The system can be represented by
following Free Body Diagrams:

According to Newton's law, the sum of forces acting on a mass equals the mass times its
acceleration. In this case, the forces acting on M1 are the spring, the friction and the force
applied by the engine. The forces acting on M2 are the spring and the friction. The equations of
motion in the horizontal direction are the following :

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

Transfer Function

Applying Laplace Transforms, the above equations can be expressed in terms of s:

The output is Y(s) = V1(s) = s X1(s). The variable X2 should be algebraically


eliminated to leave an expression for Y(s)/F(s). When finding the transfer function,
zero initial conditions must be assumed. The transfer function will be:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

104
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

State Space

This set of system equations can now be manipulated into state-variable form. The state variables
are the positions, X1 and X2, and the velocities, V1 and V2; the input is F. The state variable
equations will be:

Let the output of the system be the velocity of


the engine. Then the output equation will be:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ MATLAB representation
Transfer Function

m-file

M1=1;
M2=0.5;
k=1;
F=1;
u=0.002;
0 002
g=9.8;
num=[M2 M2*u*g k];
den=[M1*M2 2*M1*M2*u*g M1*k+M1*M2*u*u*g*g+M2*k M1*k*u*g+M2*k*u*g];
train=tf(num,den);

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

105
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ MATLAB representation
St t S
State Space

m-file
M1=1;
M2=0.5;
k=1;
F=1;
u=0.002;
g=9.8;
A=[ 0 1 0 0; -k/M1 -u*g k/M1 0; 0 0 0 1; k/M2 0 -k/M2 -u*g];
B=[ 0; 1/M1; 0; 0];
C=[0 1 0 0];
D=[0];
train=ss(A,B,C,D)

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Building the Model in SIMULINK


We will begin to construct the model simply from the
expressions:
i
Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''
First, we will construct two copies
(one for each mass) of the
expressions sum_F=Ma or
a=1/M*sum_F.

The outputs of each of these Sum


blocks represents the sum of the
forces acting on each mass.
Multiplying by 1/M will give us
the acceleration.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

106
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Building the Model in SIMULINK

Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''

Since velocity is the integral of


acceleration, and position is the integral
of velocity, we can generate these
signals using integrator blocks.
Drag two Scopes into the model and
connect them to the outputs of these
integrators. Label them "View x1" and
"View x2“

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Building the Model in SIMULINK

Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''

Adding the forces acting on each mass:


• 3 forces acting on M1 (so change the
Sum F1 to: +++)
• 2 forces acting on M2
The first force acting on M1 is just the
input force, F. Drag a Signal Generator
block from the Sources library and
connect it to the uppermost input of the
Sum F1 block
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

107
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Building the Model in SIMULINK

Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''

The next force acting on M1 is the


friction force:
F_friction_1=mu*g*M1*v1

This force acts in the negative x1-


direction. Therefore, it must come into
the Sum_F1 block with negative sign.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE

™ Building the Model in SIMULINK

Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''

The last force acting on M1 is the


spring force between masses. This is
equal to: k*(x1-x2)
First, we need to generate (x1-x2)
which we can then multiply by k to
generate the force.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

108
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE


™ Building the Model in SIMULINK

Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''
Forces on M2:
For the first force, we will use the
same spring force we just generated
(k*(x1-x2)
(k (x1-x2) )), except that it adds in
with positive sign.
The last force to add is the friction
on M2 (F_friction_2=mu*g*M2*v2).

Now the model is complete. We simply need to


supply the proper input and view the proper output.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION

TRAIN SYSTEM - EXAMPLE


™ Building the Model in SIMULINK

Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''
The input of the system will be the
force, F, provided by the engine. We
already have placed the function
generator at the input.
input The output of
the system will be the velocity of the
engine. Drag a Scope block from the
Sinks block library into your model.
Tap a line off the output of the "v1"
integrator block to view the output.
Label the scope "View_v1"
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

109
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Running the Model
M1=1;
M2=0.5;
k=1;
m-file
F=1;
mu=0.002;
g=9.8;

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Running the Model
M1=1;
M2=0.5;
m-file
k=1;
F=1;
mu=0.002;
g=9.8;

The last step before


running the simulation is
to select an appropriate
simulation time. To view
one cycle of the .001Hz
square wave, we should
simulate for 1000 seconds.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

110
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Obtaining MATLAB Model

Extracting a MATLAB model


(t t
(state-space or transfer
t f function)
f ti )
from out simulink model: Delete
the View_v1 scope and put an
Out Block (from the Connections
library) in its place. Also, delete
the F function generator block
and put an In Block (from the
Connections library) in its place.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Obtaining MATLAB Model
Enter the following command at the MATLAB command window to extract a state-space
model.
[A B C D]=linmod(‘train2’)
[A,B,C,D]=linmod( train2 )
You should get the following output which shows a state-space model.
A =
-0.0196 0 1.0000 -1.0000
0 -0.0196 -2.0000 2.0000
0 1.0000 0 0
1.0000 0 0 0
B =
1 To obtain a transfer function model, enter the following command at the
0 MATLAB command prompt
0 [num,den]=ss2tf(A,B,C,D)
0 The answer will be:
C = num =
1 0 0 0 1.0000 0.0196 2.0000 0.0000
D = den =
0 1.0000 0.0392 3.0004 0.0588 0.0000
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

111
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

1. Construct two copies (one for each mass) of the


expressions sum_F
sum F=Ma Ma or aa=1/M*sum
1/M sum_F.F Drag two
Summation blocks (from the Signal Arithmetic section
of the Simulation palette) into the Simulation Loop.
Double-click in an empty part of the block diagram to
Sum(forces_on_M1)=M1*x1'' create labels. Label these Summation blocks "Sum F1"
Sum(forces_on_M2)=M2*x2'' and "Sum F2".
This set of system equations can now
be represented graphically, without
further manipulation. Begin by
creating a Simulation Loop,
Loop from the
Simulation section of the Control
Design & Simulation palette.

http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

2. Multiplying
p y g the outputs
p of each of these
Summation blocks by 1/M will give the
acceleration. Drag two Gain blocks into
the model (from the Signal Arithmetic Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''
section of the Simulation palette). Attach
each one with a wire to the outputs of
the Summation blocks. These Gain
blocks should contain 1/M for each of
the masses. Double-click on each Gain
block, and change the Parameter Source
f
from C
Configuration
fi ti DiDialog
l B Box tto
Terminal. Label these two Gain blocks
"a1" and "a2".

http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

112
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

3. Since velocity is the integral of acceleration, and


position is the integral of velocity, we can generate
these signals using integrator blocks. Drag two
Integrator blocks (from the Linear Systems section of Sum(forces_on_M1)=M1*x1''
the Simulation palette) into the model for each of two Sum(forces_on_M2)=M2*x2''
accelerations. Label these integrators "v1", "x1", "v2",
and "x2“,

http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

4. Drag two SimTime Waveform blocks from the


Graph
G h Utiliti
Utilities section
ti off th
the Si
Simulation
l ti palette,
l tt andd
connect them to the outputs of these integrators.
Name them "x1 output" and "x2 output“ Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''
5. Now, add in the forces acting
on each mass. First, we need to
adjust the inputs on each Sum
block to represent the proper
number of forces. There are a
total of 3 forces acting on M1
– double-click on the Sum F1
block and configure it to have
3 inputs (+ + +). here are only
2 forces acting on M2

http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

113
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

6. Input force, F: Insert a Signal Generator block


from the Signal Generation section of the
Simulation palette, and connect it to the uppermost
input of the Sum F1 block. Label the Signal Sum(forces_on_M1)=M1*x1''
Generator "F" Sum(forces_on_M2)=M2*x2''

http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW
7. The next force acting on M1 is the friction force:
F ((friction 1)) = mu*g*M1*v1
g Drag
g a Gain block into the model window. Find the wire coming g from
the v1 integrator and connect it to the input of the Gain block. Connect the output of the Gain block
to the second input of Sum F1. Configure the Gain block so that it uses a Terminal for the
Parameter Source instead of the Configuration Dialog Box. Name this block Friction 1.
The gain of this Gain block will be mu*g*M1.
To achieve this, switch to the front panel and
http://www.ni.com
create 3 Numeric Controls. Name them mu, g,
and M1.
On the block diagram, use a Compound
Arithmetic VI from the Numeric palette to
multiply these 3 variables. Wire the output to
the new Gain block. Also, use the Reciprocal
VI to invert M1, and wire this inverted output
to the terminal of a1.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

114
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

This force, however, acts in the negative x1-direction.


Therefore it must connect to the Sum F1 block with
Therefore,
a negative sign. Double-click on the Sum F1 block, and
change the signs to + - + Sum(forces_on_M1)=M1*x1''
Sum(forces_on_M2)=M2*x2''
The last force acting on M1 is the spring force
between masses. This is equal to k*(x1-x2). http://www.ni.com
First, we need to generate (x1-x2) which we can then
multiply by k to generate the force. Insert a
Summation block below the rest of your model.
Label it "(x1-x2)" and change its list of signs to - +.
Si
Since this
thi summation
ti comes ffrom right
i ht tto left,
l ft we
need to flip the block around. Right-click the block
and select “Reverse Terminals”.
Now, tap off the x2 signal and connect it to the
negative input of the (x1-x2) Summation block. Tap
off the x1 signal and connect it to the positive input.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

Now, we can multiply this position difference


by the spring constant to generate the spring
force. Insert a Gain block into your model to
the left of the Summation blocks. Configure
the Gain block so that its Parameter Source is
a Terminal. http://www.ni.com
On the front panel, create a Numeric Control
and name it k. On the block diagram, connect
this control to the Gain block that you just
created. Label the Gain block "spring".
Connect the output of the (x1-x2) block to the
input of the spring block, and connect the
output of the spring block to the third input of
Sum F1. Change the third sign of Sum F1 to
negative (+ - -).

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

115
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

Apply forces to M2:


For the first force
force, we will use the same
spring force we just generated, except http://www.ni.com
that it adds in with positive sign. Simply
tap off the output of the spring block and
connect it to the first input of Sum F2.
The last force to add is the friction on
M2. This is done in the exact same
manner as the friction on M1: tapping
off v2, multiplying by a gain of
mu*g*M2 and adding to Sum F2 with
negative sign. You will need to create a
Numeric Control for M2 as well.

Now the model is complete. We simply need to


supply the proper input and view the proper output.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Building the Model in LABVIEW

The input of the system will be the force,


F provided by the engine
F, engine. We already
have placed the function generator at the
input. The output of the system will be
the velocity of the engine. Insert another
SimTime Waveform block into the
Simulation Loop, from the Graph
Utilities section of the Simulation palette.
Connect a wire from the output of the
"v1" integrator block to this new
Waveform Graph, p , to view the output.
p

http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

116
TRANSLATIONAL MECHANICAL SYSTEM WITH
MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Running the Model in LABVIEW
Before running the model, we need to
assign
g numerical values to each of the
variables used in the model. For the train
system, use the following values:
M1 = 1 kg
M2 = 0.5 kg
k = 1 N/sec
F= 1 N
u = 0.002 s/m
g = 9.8 m/s^2
Enter these values using the front panel
controls.
l
Now, we need to give an appropriate input to the
engine. Double-click on the Signal Generator (F block).
Select a square wave with frequency .001Hz and
amplitude -1 (positive amplitude steps negative before
stepping positive).
http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

TRANSLATIONAL MECHANICAL SYSTEM WITH


MASSES, SPRING AND FRICTION
TRAIN SYSTEM - EXAMPLE
™ Running the Model in LABVIEW

The last step before running the simulation is to


select
l an appropriatei simulation
i l i time. i To view
i one
cycle of the .001Hz square wave, we should simulate
for 1000 seconds. Double-click on the terminals Sum(forces_on_M1)=M1*x1''
located on the left side of the Simulation Loop. In Sum(forces_on_M2)=M2*x2''
the Simulation Timing section at the top of the
dialog box, set the initial time to 0 seconds, and the
final time to 1000 seconds. Close the dialog box.
Now, switch to the front panel. Right-click on the x-
axis of each Waveform Graph, and select “Auto-
Scale XX”.
Run the simulation and look at the v1 output graph to
examine the velocity output. The input was a square wave
with two steps, one positive and one negative. Physically,
this means the engine first went forward, then in reverse.
The velocity output reflects this behavior. http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

117
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
DC MOTOR -
EXAMPLE

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Physical Modeling
DC motor directly provides rotary motion and, coupled with wheels or drums and
cables, can provide transitional motion.
The electric circuit of the armature and the free body
diagram of the rotor are shown in the figure
Physical Model Parameters
ƒ Moment of inertia of the rotor J (J = 3.2284E-6 kgm2/s2)
ƒ Damping coefficient of the mechanical system b (b = 3.5077E-6 Nms)
ƒ Electromotive force constant K (K=Ke=Kt = 0.0274 Nm/Amp)
ƒ Electric resistance R (R = 4 Ω)
ƒ Electric inductance L (L = 2.75E-6 H)
ƒ Source Voltage V – input
ƒ Position of shaft θ - output
ƒ Assumption: The rotor and shaft are treated as a rigid
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

118
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Mathematical Modeling
The motor torque
torque, T,
T is related to the armature current
current, i,
i by a constant
factor Kt. The back emf, e, is related to the rotational velocity by following
equations:

According to the figure, the following equations


based on Newton's law combined with Kirchhoff's
law can be written:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

Transfer Function

Applying Laplace Transforms, the above


equations can be expressed in terms of s: In case: position to be the output, we
just need to divide the transfer function
by s, because by integrating the rotating
speed we get the position
By eliminating I(s) we can get the following
transfer function, where the rotating speed is
the output and the voltage is an input:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

119
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

State Space

These equations can also be represented in state-space form. If we choose motor


position, motor speed, and circuit current as state variables, we can write the
equations as:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ MATLAB representation and open-loop response


Transfer Function

m-file
J=3.2284E-6;
b=3.5077E-6;
K=0.0274;
R=4;
L=2.75E-6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2)
^ 0];
motor=tf(num,den);

step(motor,0:0.001:0.2)

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

120
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ MATLAB representation and open-loop response


State Space
m-file
fil
J=3.2284E-6;
b=3.5077E-6;
K=0.0274;
R=4;
L=2.75E-6;
A=[0 1 0
0 -b/J K/J
0 -K/L
K/L -R/L];
R/L]
B=[0 ; 0 ; 1/L];
C=[1 0 0];
D=[0];
motor=ss(A,B,C,D);
step(motor)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

121
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK


Newton's law and Kirchhoff's law applied to the motor system give the
following equations:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

122
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

123
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK – open loop responce

Since the time scales in this example are very


small, this stiff system integration method is much
more efficient than the default integration method
ode45 (Dormand-Prince)

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK – open loop responce


J=3.2284E-6;
b=3.5077E-6;
K=0.0274;
R=4;
L=2.75E-6;

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

124
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK


¾Extracting a Digital Model into MATLAB

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION
™ Building the Model in SIMULINK
¾Extracting a Digital Model into MATLAB
[A,B,C,D]=dlinmod('motorposmodel',.001)
[num den]=ss2tf(A B C D)
[num,den]=ss2tf(A,B,C,D)
A =
1.0000 0.0000 0.0010
0 0.0000 -0.0065
0 0.0055 0.9425
B =
0.0010
0.2359
2.0589
C =
1 0 0
D =
0
num =
0 0.0010 0.0010 0.0000
den =
1.0000 -1.9425 0.9425 0
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

125
DC MOTOR
EXAMPLE

MODELING DC MOTOR POSITION

™ Building the Model in SIMULINK


¾Extracting a Digital Model into MATLAB
To verify the model extraction, we will generate
an open-loop step response of the extracted
transfer function in MATLAB.
[x1] = dstep(num,den,201);
t=0:0.001:0.2;
stairs(t,x1)

You should see the following plot which


iis equivalent
i l to theh Scope's
S ' output

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


State-Space
p Model in LabVIEW
The state-space equations in LabVIEW can
be represented using either a graphical or a
hybrid graphical/textual approach.

¾ LabVIEW Graphical Approach

1. Begin with a blank VI. Insert the


CD Construct State Space Model
VI from the Model Construction
section of the Control Design palette,
and create controls for each of the
inputs.

http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

126
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


State-Space Model in LabVIEW
¾ LabVIEW Graphical Approach
2. Add the CD Draw State-Space
Equation VI. This will display the
state-space equation on the front panel.
Create an output for the Equation from
the CD Draw State-Space Equation VI.

3. Add the CD Step Response VI from


the Time Response section of the
Control Design palette. Create a
control for the Time Info input and an
indicator for the Step Response Graph
output.

http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


State-Space Model in LabVIEW
¾ LabVIEW Graphical Approach
The previously undertaken steps should result in a front
panel that looks like:

State-Space Front Panel


http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

127
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


State-Space Model in LabVIEW
¾ Hybrid Graphical/MathScript Approach 2. Create a State-Space output from the
Node, and add the CD Draw State-
Alternatively, we can get the same results with a
Space Equation VI and the CD Step
hybrid approach, using the MathScript Node.
Response VI in the same way as it was
1. Begin with a blank J=3.2284E-6; done in the graphical approach.
VI, and insert a b=3.5077E-6;
MathScript Node K=0.0274;
R=4;
from the Structures L=2.75E-6;
palette. Add the
following code to A=[0 1 0
your MathScript 0 -b/J K/J
Node: 0 -K/L -R/L];
B=[0 ; 0 ; 1/L];
C=[1 0 0];
D=[0];
motor=ss(A,B,C,D); http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


Transfer Function in LabVIEW
Another option is to represent the transfer function in
LabVIEW, instead of using the state-space model.
¾ LabVIEW Graphical Approach
1. To represent the transfer function using a LabVIEW
graphical approach, begin by inserting the
CD Construct Transfer Function Model VI (from the
Model Construction section of the Control Design
palette) into a blank VI. Create controls for the
Numerator, Denominator, and Variables inputs.
2. Add the CD Draw Transfer Function
Equation VI to the block diagram, and
create an indicator for the Equation
output. This will display the transfer
function equation on the front panel. http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

128
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


Transfer Function in LabVIEW
¾ LabVIEW Graphical Approach
3. Add the CD Step Response VI from the Time Response section of the Control Design
palette. Create a control for the Time Info input and an indicator for the Step Response
Graph output.

http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


Transfer Function in LabVIEW
¾ LabVIEW Graphical Approach
The previously undertaken steps
should result in a front panel that
looks like:

http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

129
DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


Transfer Function in LabVIEW
¾ Hybrid Graphical/MathScript Approach 2. Create a Transfer Function output from the
Alternatively, we can get the same results with a Node, and add the CD Draw Transfer
hybrid approach, using the MathScript Node. Function Equation VI and the CD Step
1. Begin with a blank VI, and insert a Response VI in the same way as it was
MathScript Node from the Structures done in the graphical approach.
palette. Add the following code to
your MathScript Node:
J=3.2284E-6;
b=3.5077E-6;
b 3.5077E 6;
K=0.0274;
R=4;
L=2.75E-6;
num=K;
den=[(J*L) ((J*R)+(L*b)) ((b*R)+K^2) 0];
motor=tf(num,den);
http://www.ni.com
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE
MODELING DC MOTOR POSITION

™ LabVIEW representation and open-loop response


Step
p Response
p for Open-Loop
p p System
y
Using either the state-space model or the transfer function, you should see the
following step response graph on the front panel when you run the VI:

http://www.ni.com

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

130
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Physical Model Parameters


ƒ Moment of inertia of the rotor J (J = 8.5E-6 kgm2/s2)
ƒ Damping coefficient of the mechanical system b (b = 3.7E-6 Nms)
ƒ Electromotive force constant K (K=Ke=Kt = 0.0424 Nm/Amp)
ƒ Electric resistance R (R = 1.85 Ω)
ƒ Electric inductance L (L = 1.97E-6 H)
ƒ Source Voltage V
ƒ Position of shaft θ

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

“My Computer” →“New” →“VI”


A blank front panel will appear, and
behind that, an empty block diagram.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

131
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

We first need to add a simulation loop within which the


equations will be implemented.
Click “Control
Control Design and Simulation
Simulation”,, then click “Simulation”
Simulation and finally
click the Simulation Loop. Your cursor will change its icon and you can then
click and drag to place the simulation loop onto the block diagram.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Before implementing the equations, click File →Save


Right-click to bring up the functions palette. From the “Programming” group (which is
openedd by
b default),
d f lt) select
l t “Numeric”
“N i ” → “N
“Numerici CConstant”
t t” and
d place
l thi
this on th
the block
bl k
diagram. Next, right-click on this block and select “Change to Control”.
Right-click the control and select “Representation” → “Double Precision”

This will convert the control from its


standard integer to a double (decimal
value). You may also wish to change the
label of this control to “Vapp
Vapp.” Do this by
double-clicking the text, then typing. Once
you’ve done this, repeat the procedure to
create three more constant doubles, Kemf,
R, and L, and one control, “Theta dot”.
Make sure each of these are set to double
precision.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

132
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

The block diagram should now look similar to:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR


Right-click to bring up the functions palette, then select “Control Design and Simulation”
→“Simulation” →“Signal Arithmetic” →“Multiplication”. Place two multiplication blocks
next to the controls and constants you have created. Then, wire the inputs from “Theta dot”
and “Kemf” into the terminals of one block. Wire “R” into the multiplication terminal of the
other block.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

133
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

“Control Design and Simulation” →“Simulation” →“Simulation Arithmetic”.


Double-click on this block to open its properties window. Change the icon shape
to “Rectangle”
Rectangle then click on each of the input signs to change them to “+
+, -, -”

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Wire the output from “Vapp” into the “+” input of the addition block, then
wire the outputs from the two multiplication blocks into each of the “-“ inputs.
Next, add another
multiplication block and change
its terminals to “x” and “÷” by
double-clicking to bring up the
configuration window. Connect
the output of the addition block
to the “x” input and connect
“L” to the “÷” input

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

134
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Right-click on the output of the latest multiplication block and select “Create” →“Indicator”
Re-label this block “di/dt.” We have now completed the basic block diagram for the electrical
portion of our system.
We will now add an integrator
block to compute the value of I(t).
Open the functions palette, select
“Control Design and Simulation”
→“Simulation” →“Continuous
Linear Systems” → “Integrator”
Wire the input to this block to the
output of the last multiplication
block ((to which our “di/dt”
indicator is now connected.).
Create a second indicator. Re-label
it to “I”. Connect the integrator
output to the empty terminal on the
first multiplication block

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR


In order to reduce the complexity of the block diagram, select all of the
blocks that are placed inside the simulation loop by clicking and
dragging a box around them. Then, select “Edit” →“Create Simulation
Subsystem”.
The selected blocks have
now been incorporated into
a separate VI

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

135
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Now we will begin to diagram the equations for the mechanical part of the system.
To do this, first add three constant doubles, three multiplication blocks, and one
addition block.
The three constants will be
“Kt”, “B” and “J”. Wire them
according to the equation
given above.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

“Control Design and Simulation”→ “Simulation” →“Continuous Linear Systems”,


add another integrator block, and connect it to the output of the final multiplication
block.
Right-click on this output and
select “Create” → “Indicator.”
Delete the “Theta dot” control
we created earlier. Connect in
its place the output from the
integrator

Select the mechanical system


blocks, and select
blocks
“Edit”→“Create Simulation
Subsystem” to create the
mechanical subsystem

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

136
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Right-click to open the functions palette then navigate to “Control


Design and Simulation” →“Simulation” →“Graph Utilities.” Select the
SimTime Waveform blocks and place them on the block diagram.
Select them, then while
holding the control key, click
and drag to create copies of
both blocks. Now, connect the
“I” and “omega” outputs to
the inputs of the SimTime
Waveform blocks.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Switch back to the front panel by pressing Ctrl+E. You will notice two
graph windows, one input, and one output.

Replace the default numeric


control, “Vapp”, with a
numeric slider. Right-click
the control and select
“Replace” →“Vertical Pointer
Slide”. Once that is done,
right-click the slider and
select “Visible Items”
→“Digital
g Display”.
p y This will
allow to key in a precise
value.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

137
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Before running the VI, we


needd to
t adjust
dj t the
th simulation
i l ti
parameters. Switch back to
the block diagram, then right-
click on the simulation loop
border and select “Configure
Simulation Parameters.”
Change the Final time to 0.1
seconds, ODE Solver to
“Runge-Kutta 1 (Euler)”, and
Step Size to 0.00001 seconds.
Then, click OK.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Before running the completed VI, you may


wish to adjust the settings for the two graphs.
graphs
Switch back to the front panel, then right-
click on the graphs and select “Chart History
Length.” Enter 50000 for this value.
Right-click the graphs and select
“Properties”. Under the “Format and
Precision” tab, you can adjust the number of
digits which appear on the x and y axes.
You may also want to change
the range for the x-axis. To do this, double-
click the final value and change it to 0.10.
Also change the y-axis on the I(t) plot to
range from 0 to 5, and the y-axis on the
omega plot to range from 0 to 150. You will
also want to uncheck “Autoscale Y Axis”.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

138
DC MOTOR
EXAMPLE

LABVIEW SIMULATION OF DC MOTOR

Click the Run button (or press Ctrl+R) to run the simulation
and get the results.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

139
MODELING AND SIMULATION
OF MECHATRONIC SYSTEMS
FLUID FLOW RESERVOIR
MODELING -
EXAMPLE

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR

™ Physical Modeling
The reservoir (or tank) contains water that
evacuates through an output port. Water is fed
to the reservoir through a pipe controlled by an
input valve. The variables of interest are:
• fluid velocity V [m/s] Tank with free outflow
• fluid height in the reservoir H [m]
• pressure p [N/m2]
We want to construct a model of how the outflow depends on the inflow, i.e. to
establish the system configuration and then obtain the appropriate mathematical
models describing the fluid flow reservoir from an input-output perspective.
The general equations of motion and energy describing fluid flow are quite
complicated (coupled nonlinear partial differential equations). Some selective
assumptions that reduce the complexity of the mathematical model have to be made.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

140
FLUID FLOW MODELING
EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Physical Modeling
Key assumptions:
• The
Th watert iin th
the ttankk is
i incompressible
i ibl with
ith
constant density ρ [kg/m3]
• The flow is inviscid (viscosity can be neglected
in our model development)
• The flow is irrotational (the water in the tank is irrotational). For an inviscid fluid,
an initially irrotational flow remains irrotational
•The water flow in the tank and output port is steady (the velocity does not change
with time). If the output port area is too large, then the flow through the reservoir may
not be slow enough to establish the steady-state
steady state condition that we are assuming exists
and our model will not accurately predict the fluid flow motion.
Physical Model Parameters
The constants for the reservoir
system are:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Mathematical Modeling
To obtain a mathematical model of the flow
within the reservoir, basic principles of
science and engineering (for example, the
principle of conservation of mass) should be
used. The mass of water in the tank at any
given time is: m = ρ A1H
Taking the time derivative, using the fact that we consider uncompressible fluid
(ρ=const.) and tank with area A1, which is not change with time, as well knowing
that the change
g in mass in the reservoir is equal
q to the mass that enters the tank
minus the mass that leaves the tank, we obtain following relation:

Q1 – steady-state input mass flow rate


v2 – exit velocity (it is a function of the water height)

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

141
FLUID FLOW MODELING
EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Mathematical Modeling
From Bernoulli's equation,
q it follows:

where:
v1 - water velocity at the mouth of the reservoir,
p1 and p2 - pressures at the input and output, respectively.
But p1 and p2 are equal to atmospheric pressure, and A2 is sufficiently small (A2=A1/100),
so the water flows out slowly and the velocity v1 is negligible. Thus Bernoulli's equation
reduces to:

Substituting this equation into previous one yields to:

Using equation for v2, the exit mass flow rate will be:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Mathematical Modeling
Introducing:
g

We obtain:

These equations
Th ti representt our model
d l off the
th water
t tank
t k system,
t where
h the th input
i t is
i Q1
and the output is Q2. It is a nonlinear, first-order, ordinary differential equation model.
The nonlinearity comes from the H1/2 term. The model has the functional form :

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

142
FLUID FLOW MODELING
EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Mathematical Modeling
A set of linearized equations
q describing g the
height of the water in the reservoir is obtained
using Taylor series expansions about an
equilibrium flow condition. When the tank
system is in equilibrium, we have:
We can define Q* and H* as the equilibrium input mass flow rate and water level,
respectively. The relationship between Q*and H* is given by :

We can write the water level and input mass flow rate as:

where ∆H and ∆Q1 are small deviations from the equilibrium (steady-state) values.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR
™ Mathematical Modeling
The Taylor series expansion about the equilibrium
conditions is given by:

And from the equation:


it follows: (H*=const.)
f(H*,Q*) is identically zero, by definition of
the equilibrium condition. Neglecting the
higher order terms in the Taylor series, we
have:
We have:
This equation is a linear model describing the
so that: deviation in water level ∆H from the steady-state
due to a deviation from the nominal input mass
flow rate ∆Q1
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

143
FLUID FLOW MODELING
EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Mathematical Modeling
Similarly,
y for the output
p variable Q2 we have:

Therefore, the linearized equation for the output variable Q2 is:

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Transfer function
It is convenient to obtain the input-output
relationship in the form of a transfer function.
Taking the time-derivative of:

and substituting into

yields the input-output relationship:

Taking the Laplace transform (with zero initial conditions), the transfer function
will be: It describes the relationship between the change in the
output mass flow rate ∆Q2(s) due to a change in the
input mass flow rate ∆Q1(s)
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

144
FLUID FLOW MODELING
EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Transfer function
The transfer function relationship between
the change in the input mass flow rate and the
change in the water level in the tank, ∆H(s)
can also be obtained. The Laplace transform
(with zero initial conditions) of:

gives:

™ Step response
Given the linear time-invariant model Consider the step input: ∆Q1(s)(s)=qq0/s ,
of the water tank system: where q0 is the magnitude of the step input,
and the initial condition is ∆Q2(0)=0. Then
from the transfer function ∆Q2/ ∆Q1 , the
the step response can be obtained. The input thank response will be:
∆Q1(s) is actually a change in the input mass
flow rate from the steady-state value Q*.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Step response

The partial fraction expansion gives:

and the inverse Laplace transform yields:


Note that K > 0 , so the term e−Kt approaches zero as t approaches ∞. Therefore, the
steady-state output due to the step input of magnitude q0 is:

We see that in the steady state, the deviation of the output mass flow rate from the
equilibrium value is equal to the deviation of the input mass flow rate from the
equilibrium value.

TEMPUS IV Project: 158644 -JPCR


Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

145
FLUID FLOW MODELING
EXAMPLE
FLUID FLOW RESERVOIR
Tank with free outflow

™ Step response
Similarlyy for the water level it is:

and taking the inverse Laplace transform we


obtain:

The steady state change in water level due to the step input of magnitude q0 is:

The above analytic analysis of the linear system model to step input is a valuable way
to gain insight into the system response to test signals. Analytic analysis is limited,
however, in the sense that a more complete representation can be obtained with
carefully constructed numerical investigations using computer simulations of both the
linear and nonlinear mathematical models.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

FLUID FLOW MODELING


EXAMPLE
FLUID FLOW RESERVOIR

™ Step response

Using the model parameters, the nonlinear model


describing the water level flow rate is given by:

We can use the transfer function


model to obtain the unit step
response. The step response is
shown in Figure for both the
linear and nonlinear models.
With H(0)=0.5m and
Q1(t)=34.77kg/s, we can
numerically integrate the
nonlinear model to obtain the
response of the system.
TEMPUS IV Project: 158644 -JPCR
Development of Regional
Interdisciplinary Mechatronic
MODELING AND SIMULTION OF MECHATRONIC SYSTEMS
Studies - DRIMS

146
THE
MECHATRONICS
HANDBOOK
Editor-in-Chief
Robert H. Bishop
The University of Texas at Austin
Austin, Texas

CRC PR E S S
Boca Raton London New York Washington, D.C.
147
0066_Frame_C20 Page 90 Wednesday, January 9, 2002 5:49 PM

FIGURE 20.122 Scheme of a pneumatic servosystem with two-ways digital valves.

FIGURE 20.123 Scheme of a pneumatic servosystem with three-ways proportional valves.

a flow entering the servochamber 4 (see Fig. 20.120) while the other controls the flow exiting towards
discharge. By means of appropriate action, the control signal is converted into a pressure proportional
signal.

Modeling a Pneumatic Servosystem


The circuitry plan of a pneumatic servosystem capable of controlling the position, speed, or force can
be similar to that shown in Fig. 20.109 for hydraulic actuation. The signal of the transducer of the desired
magnitude must be specially fed back in a closed loop on the regulator depending on the controlled
magnitudes.
In the plan in Fig. 20.122, the axial position of the piston, fed back by means of the position transducer,
is determined by controlling the pressure in thrust chambers 1 and 2 by means of the flow proportional
interfaces. The position reference is compared with the feedback signal and the error is compensated in
a control regulator. On the basis of the valve opening strategy used, the signal is sent to the regulating
valves which feed the chambers of the piston, hypothesized to be symmetrical. The pressure forces acting
on the thrust surfaces of the piston oppose the external force disturbance. The circuitry plan hypothesizes
the use of four digital valves each with two unistable ways, electrically controlled. This solution makes
it possible to use small-sized valves, with resulting high bandwidth, which must be compatible with the
overall bandwidth requested by the pneumatic servosystem. In this solution, the proportionality of the
opening of the valves is obtained by pulse width modulation of the digital signal. Each pair of valves V11,
V12 and V21, V22 constitutes a three-way valve the output of which is connected to a piston chamber, so
that the scheme in Fig. 20.122 can be equivalent to that in Fig. 20.123 with the three-way analogically
controlled valves V1 and V2.
The cylinder model envisages a system with three-differential equations, two of continuity of the air
mass in the chambers and one of dynamic translation equilibrium.
148
0066_Frame_C20 Page 91 Wednesday, January 9, 2002 5:49 PM

The following magnitudes are differentiated (the subscripts 1 and 2 refer, respectively, to the rear 1
and front 2 chambers of the pistons):

A piston thrust section


Fe disturbance of force acting on the piston rod
G mass flow rate of air entering the chamber
M mass of the translating parts of the piston
n air polytropic coefficient
P cylinder chamber pressure
Pi initial cylinder chamber pressure
Pamb ambient pressure
R air constant
Ti initial cylinder chamber air temperature
x rod position measured starting from x0
x0 piston half stroke
xm dead band
γ coefficient of viscous friction

The continuity and equilibrium equations are given by:

dP G 1 nRT 1i P1 n dx
--------1 = ------------------------------------------------------------------------
- – -------------------------------- ------ (20.58)
dt A 1 ( x 0 + x m1 + x ) ( P 1 /P 1i )
( 1 – n )/n ( x 0 + x m1 + x ) dt

dP 2 G 2 nRT 2i P2 n dx
-------- = ------------------------------------------------------------------------ + --------------------------------
- ------ (20.59)
dt A 2 ( x 0 + x m2 – x ) ( P 2 /P 2i )
( 1 – n )/n ( x 0 + x m2 − x ) dt

dx
2
( P 1 – P amb )A 1 – ( P 2 – P amb )A 2 – F e – g dx/dt
-------2- = --------------------------------------------------------------------------------------------------------
- (20.60)
dt M

The flow proportional valve V1 is modeled as a variable section pneumatic resistance. The equations
used for calculating mass flow rate G through a pneumatic resistance, characterized by a conductance C
and by a critical ration b, in accordance with ISO 6358, which connects two environments A and B, with
respective pressures of PA and PB, taken to be positive in the A → B direction, are

P
sonic flow: G = r0 PA C for 0 < -----B ≤ b (20.61)
PA

P B /P A – b 2 P
subsonic flow: G = r 0 P A C 1 –  ----------------------
- for b < -----B ≤ 1 (20.62)
 1–b  PA

P
sonic flow: G = –r0 PB C for 0 < -----A ≤ b (20.63)
PB

2
P A /P B – b P
subsonic flow: G = – r 0 P B C 1 –  ----------------------
- for b < -----A ≤ 1 (20.64)
 1–b  PB
149
0066_Frame_C20 Page 92 Wednesday, January 9, 2002 5:49 PM

Hypothesizing a bipolar reference signal, it can be assumed that the range Vref > 0 corresponds to the
supply–user connection, while the field Vref < 0 corresponds to the user–discharge connection. The
appropriate equation of flow above must be rewritten in the same way.
Calculation of the conductance of the flow proportional valve is made considering the static and
dynamic link between the reference voltage Vref and the opening of the passage aperture A V in accordance
with modeling of the second order of the type:

2
d AV dA
+ 2zs n ---------V + s n A V = K s s n V ref
2 2
-----------
2
(20.65)
dt dt

where ζ is the damping factor, σn is the valve’s natural frequency, and Ks is its area static gain.
Assuming a static relation of the linear type between the opening A V and the conductance C, as an
initial approximation, we get

C = K c A V = K c K s V ref = K V V ref (20.66)

where K V is the flow static gain of the valve, function of the maximum conductance Cmax, and of the
maximum value of the reference voltage Vref max:

C max
K V = --------------
- (20.67)
V ref max

The complete dynamic relation between reference voltage and conductance is, therefore,

2
dC dC
--------2- + 2zs n ------- + s n C = K c s n V ref
2 2
(20.68)
dt dt

The nonlinear model of the pneumatic servosystem with the position reference xset and the force
disturbance Fe as inputs, is made up of a nonlinear system of nine equations, of order eight overall, of
the type:

a) C1 = C1(Vref 1, t) order 2 conductance of valve V1 (see (20.68))


b) C2 = C2(Vref 2, t) order 2 flow rate of valve V1 (see (20.68))
c) G1 = G1(C1, P1) order 0 flow rate of valve V1 (see (20.61)–(20.64))
d) G2 = G2(C2, P2) order 0 flow rate of valve V2 (see (20.61)–(20.64))
e) G1 = G1(P1, Ṗ 1, x, x˙ ) order 1 continuity chamber 1 (see (20.58))
f) G2 = G2(P2, Ṗ 2, x, x˙ ) order 1 continuity chamber 2 (see (20.59))
g) ẋ˙ = ẋ˙(Fe, P1, P2, x˙ ) order 2 piston equilibrium (see (20.60))
h) Vref 1 = Vref 1 (xset , xret) order 0 V1 valve control
i) Vref 2 = Vref 2(xset , xret) order 0 V2 valve control
If we want to carry out a linear analysis, it can be assumed that the equations a), b), g), h), i) are already
written in linear form.
As far as the flow rates of valves c) and d) are concerned, it is hypothesized that the flow rate for each
of them is subsonic in feed, with Vref > 0, and sonic in discharge, with Vref < 0. This means that for valve
V1, for example, the pressure P1 must be within the range bPs < P1 ≤ Ps in feed and in the range P1 ≥ Pamb/b

150
0066_Frame_C20 Page 93 Wednesday, January 9, 2002 5:49 PM

in discharge. This hypothesis is physically acceptable; hypothesizing b = 0.3, Ps = 10 bar, Pamb = 1 bar, we
get that P1 can vary between 3.33 bar and 10 bar. It is the same for P2.
Linearizing the subsonic feed flow rate curve with a secant passing through the points P1 = Ps, G1 = 0

and P1 = b 1Ps, G1 = G1 sonic, of angular coefficient KL1, we get

G 1 = K L1 ( P s – P 1 ) (20.69)

where

G 1sonic rn C1 Ps rn C1
K L1 = -------------------

- = ----------------------

- = -------------

(20.70)
Ps – b1 Ps Ps ( 1 – b1 ) 1 – b1

or

rn ( Ps – P1 )
G 1 = -------------------------

-C 1 (20.71)
( 1 – b1 )

In the neighborhood P1 = P1r and C1 = C1r = 0 (the subscript r indicates of reference), we get

r n ( P s – P 1r )
G 1 = ---------------------------

- C 1 = K 11 C 1 (20.72)
( 1 – b1 )

Equation (20.72) is valid for Vref1 > 0, to which C1 > 0 corresponds analytically.
The flow rate discharge is expressed by

G1 = rn C1 P1 (20.73)

which in the neighborhood P1 = P1r becomes

G 1 = r n P 1r C 1 = K 12 C 1 (20.74)

Equation (20.74) is valid for Vref1 < 0, to which C1 < 0 corresponds analytically.
Calculating a mean of slopes K11 and K12 we get a mean slope Kmean given by


K 11 + K 12 r n ( P s – b 1 P 1r )
K mean = --------------------
- = --------------------------------

- (20.75)
2 2 ( 1 – b1 )

The linearized flow rate as a function of C1 therefore becomes


r n ( P s – b 1 P 1r )
G 1 = --------------------------------

-C 1 = K 1 C 1 (20.76)
2 ( 1 – b1 )
151
0066_Frame_C20 Page 94 Wednesday, January 9, 2002 5:49 PM

FIGURE 20.124 Block diagram of the linearized model of a pneumatic servosystem with position control.

In the same way for the valve V2 we get


r n ( P s – b 2 P 2r )
G 2 = --------------------------------

-C 2 = K 2 C 2 (20.77)
2 ( 1 – b2 )

The continuity equations of the mass in the piston chambers e) and f ), linearized in the reference
neighborhood defined by

x = x r, P 1 = P 1r, P 2 = P 2r ,

Ṗ 1 = Ṗ 1r = 0, Ṗ 2 = Ṗ 2r = 0, x˙ = x˙r = 0

x m1 = x m2 = 0, n = 1

become

P 1r A 1 x0 + xr
G 1 = -------------x
˙ + A 1 --------------
- Ṗ 1 (20.78)
RT RT

P 2r A 2 x0 – xr
G 2 = − -------------x
˙ + A 2 --------------
- Ṗ 2 (20.79)
RT RT

The block diagram of the linearized model is shown in Fig. 20.124.


By applying the Laplace transforms of the system of linearized equations, assuming identical valves,
we get:
2 2 2
sn sA sA
ẋ = ----------------------------------------- -------------------------------------------- - K OLF sF e + C.I.
- G c K OLV e – -------------------------------------------- (20.80)
( s + 2zs n s + s n ) ( s + 2z A s A s + s A ) ( s + 2z A s A s + s A )
2 2 2 2 2 2

where C.I. indicates the initial conditions, K OLV is the static gain in speed, K OLF is the gain of the force
disturbance, σA and ζA are, respectively, the actuator’s natural frequency and the damping factor, and Gc
is the compensator law.
This result is shown in the block diagram in Fig. 20.125. Figure 20.126, on the other hand, shows the
closed loop block diagram with position feedback. Obvious similarities can be seen when this plan is
152
0066_Frame_C20 Page 95 Wednesday, January 9, 2002 5:49 PM

FIGURE 20.125 Block diagram of the open loop model.

FIGURE 20.126 Block diagram of the closed loop model.

compared with that for a hydraulic servosystem.


In particular, hypothesizing that:
P1r = P2r = δ Ps with δ ∈ 0.6 – 0.9
A1 = A2 = A double ended actuator
n = 1 isothermal transformation
we can express the significant parameters of the pneumatic servosystem:


RTr 1 1 ( 1/d – b )
K OLV = -------------n K V -----------------

- --- -----------------------

- (20.81)
2 (1 – b ) A (1 – b )

x 0 [ 1 – ( x r /x 0 ) ]
2
K OLF = ------------------------------------
- (20.82)
2dPs A

2dP s A
sA = -----------------------------------------
- (20.83)
x 0 m [ 1 – ( x r /x 0 ) ]
2

x 0 [ 1 – ( x r /x 0 ) ]
2
z A = g ------------------------------------
- (20.84)
8dP s Am

On the basis of the design specifications, it is possible to choose the size and characteristics of the
servosystem components, operating first on the linearized model, and then checking the complete
effectiveness of the choice made with a complete nonlinear system model.

References
Andersen, B. W., The analysis and design of pneumatic systems, Wiley, New York, 1967.
Bouteille, D., Belforte, G., Automazione flessibile, elettropneumatica e pneumatica, Tecniche Nuove, Milano,
1987.
153
0066_Frame_C20 Page 96 Wednesday, January 9, 2002 5:49 PM

Belforte, G., D’ Alfio, N., Applicazioni e prove dell’automazione a fluido, Levrotto & Bella, Torino, 1997.
Belforte, G., Manuello Bertetto, A., Mazza, L., Pneumatica: corso completo, Tecniche Nuove, Milano,
1998.
Blackburn, J. F., Reethof, G., Shearer, J. L., Fluid power control, MIT Press, Cambridge, 1960.
Dransfield, P., Hydraulic control systems—design and analysis of their dynamics, Springer, Berlin, 1981.
Esposito, A., Fluid power with applications, 5th ed., Prentice-Hall, Upper Saddle River, NJ, 2000.
Gotz, W., Hydraulics. Theory and applications, Robert Bosch Automation Technology Division Training,
Ditzingen, 1998.
Hehn, A. H., Fluid power troubleshooting, 2nd ed., Dekker, New York, 1995.
Introduction to hydraulic circuits and components, The University of Bath, Bath, 2000.
Introduction to control for electrohydraulic systems, The University of Bath, Bath, 1999.
Jacazio, G., Piombo, B., Meccanica applicata alle macchine 3: Regolazione e servomeccanismi, Levrotto &
Bella, Torino, 1994.
Johnson, J. E., Electrohydraulic servo systems, 2nd ed., Penton IPC, Cleveland, 1977.
Johnson, J. L., Design of electrohydraulic systems for industrial motion control, Penton IPC, Cleveland,
1991.
Johnson, J. L., Basic electronics for hydraulic motion control, Penton IPC, Cleveland, 1992.
Lewis, E. E., Stern, H., Design of hydraulic control systems, McGraw-Hill, New York, 1962.
Mang, T., Dresel, W., Lubricants and lubrications, Wiley-VCH, Weinheim, 2001.
McCloy, D., Martin, H. R., The control of fluid power, Longman, London, 1973.
Merritt, H. E., Hydraulic control systems, Wiley, New York, 1967.
Moog, Technical Bulletins, 101–152, Moog, New York.
Muller, R., Pneumatics. Theory and applications, Robert Bosch Automation Technology Division Training,
Ditzingen, 1998.
Nervegna, N., Oleodinamica e Pneumatica, Politeko, Torino, 1999.
Parr, A., Hydraulics and pneumatics: a technician’s and engineer’s guide, 2nd ed., Butterworth Heinemann,
Oxford, 1998.
Shetty, D., Kolk, R. A., Mechatronics system design, PWS publishing company, Boston, 1997.
Tonyan, M. J., Electronically controlled proportional valves: selection and application, Dekker, New York,
1985.
Viersma, T. J., Analysis, synthesis and design of hydraulic servosystems and pipelines, Elsevier, Amsterdam,
1980.
Yeaple, F., Fluid power design handbook, 3rd ed., Dekker, New York, 1996.

20.5 MEMS: Microtransducers Analysis, Design,


and Fabrication*
Sergey Edward Lyshevski

Introduction
In many applications (from medicine and biotechnology to aerospace and security), the use of nano-
and microscale structures, devices, and systems is very important [1–4]. This chapter discusses the
analysis, modeling, design, and fabrication of electromagnetic-based microscale structures and devices
(microtransducers controlled by ICs). It is obvious that to attain our objectives and goals, the synergy
of multidisciplinary engineering, science, and technology must be utilized. In particular, electromagnetic

*
This section is a part of the book: S. E. Lyshevski, MEMS and NEMS: Systems, Devices, and Structures, CRC Press,
Boca Raton, FL, 2001. 154
Modeling and Simulation of a Pneumatic
Servosystem for Position Control
M. A. Sharifi K.

BACKGROUND
The circuitry plan of a pneumatic servosystem capable of controlling position can be similar to that
shown in Fig. 1. in homework 1 for hydraulic actuation. The signal of the transducer of the desired magnitude
must be specially fed back in a closed loop on the regulator depending on the controlled magnitudes.
In the plan in figure 2, the axial position of the piston, fed back by means of the position transducer, is
determined by controlling the pressure in thrust chambers 1 and 2by means of the flow proportional interfaces.
The position reference is compared with the feedback signal and the error is compensated in a control regulator.
On the basis of the valve opening strategy used, the signal is sent to the regulating valves which feed the
chambers of the piston, hypothesized to be symmetrical. The pressure forces acting on the thrust surfaces of the
piston oppose the external force disturbance [1].

Fig. 1.

MODELING

The closed loop block diagram of the linearized model with position feedback is shown in Fig. 2. [1].

Fig. 2.

Parameters of model above are given bellow [1]:

1 (1 𝛿 − 𝑏 )

𝑅𝑇𝜌𝑛 1
𝐾𝑂𝐿𝑉 = 𝐾𝑉
2 (1 − 𝑏 ∗ ) 𝐴 (1 − 𝑏 ∗ )

155
𝑥𝑟 2
𝑥0 [1 − ( 𝑥0 ) ]
𝐾𝑂𝐿𝐹 =
2𝛿𝑃𝑠 𝐴

2𝛿𝑃𝑠 𝐴
𝜎𝐴 = 𝑥
𝑥0 𝑚[1 − ( 𝑟 𝑥0 )2 ]
𝑥𝑟 2
𝑥0 𝑚[1 − ( 𝑥0 ) ]
𝜁𝐴 = 𝛾
8𝛿𝑃𝑠 𝐴
𝐶𝑚𝑎𝑥
𝐾𝑉 =
𝑉 𝑟𝑒𝑓 𝑚𝑎𝑥
𝑃1
𝑏∗ = for 𝐺1 = 𝐺1,𝑠𝑜𝑛𝑖𝑐
𝑃𝑠
𝑃1𝑟
𝛿=
𝑃𝑠
𝑃1𝑟 = 𝑃1 in the reference neighborhood
𝑥𝑟 = 𝑥 in the reference neighborhood.

Used variables in above equations are defined in Table 1.

TABLE I
𝜎𝑛 valve's natural frequency
𝜁 valve's damping factor
R air constant
T cylinder air temperature
𝜌𝑛 air density
C pneumatic conductance of servovalve
𝑉𝑟𝑒𝑓 reference voltage corresponding to 𝑥𝑟𝑒𝑓
G mass flow rate of air entering chamber
A piston thrust section
𝑥0 piston half stroke
m mass of the translating parts of piston
𝛾 coefficient of viscous friction

PARAMETERS

Parameters of servovalve are determined using [2]. Parameters of hydraulic actuator are derived from
[3].

According to [2], the servovalve dynamic can be represented as a second-order transfer function

𝑃 1
𝑠 =𝑘
𝑖 1 + 2𝜁 𝜔𝑛 + (𝑠 𝜔𝑛 )2
𝑠

in which

𝑝𝑠𝑖
ζ = 0.4 , 𝑓𝑛 = 250 𝐻𝑧 , 𝑘 = 125 𝑚𝐴.

Comparing k from above transfer function (TF) to K from presented model, we find out that the output
of above TF is not the same as that of corresponding block in model which is velocity (m/s). From the equations
for 𝐾𝑂𝐿𝑉 in modeling, to make the outputs the same, we have

𝐾𝑂𝐿𝑉 = 𝑘(𝐶 𝐴).

In equation above, 𝐶 = 4.84𝑒 − 9 𝑚3 /(𝑠. 𝑃𝑎) from [4]. Also, according to [1], an acceptable values for 𝛿 is
0.75.

Parameters of actuator are as follows [3]:

156
𝑙
𝐴 = 2.5 𝑐𝑚2 , 𝑥0 = = 5 𝑐𝑚, 𝑃𝑠 = 586 𝑘𝑃𝑎, and 𝑚 = 10 𝑘𝑔
2

According to the fact that 𝛾 shows the influence of viscous friction, while other kinds of friction are
𝑠𝑁
neglected, it is reasonable to say that 𝛾 is the total friction coefficient. So, using [5], we have 𝛾 = 65 .
𝑚
𝑥𝑟
Also, to simplify calculations, I assumed that = 0.75.
𝑥0

Table 2 shows the values of parameters of model shown in Fig. 2 using above values and equations of
previous part.

TABLE II
𝐾𝑂𝐿𝑉 16.94 Pa/mA
𝜎𝑛 1.571e3 rad/sec
𝜁 0.4
𝐾𝑂𝐿𝐹 1.706e-4 m/N
𝜎𝐴 24.21 rad/sec
𝜁𝐴 0.134

SIMULATION

Now that we obtained the parameters of the model, we can simulate the servosystem. Following is the
block diagram of the simulated system (Fig. 4.).

Fig. 4.

In above block diagram:

𝑋𝑆𝐸𝑇 = 0.0375 𝑢 𝑡 − 1

𝐹𝑒𝑥𝑡 = 1000 𝑢 𝑡 − 1

𝐺𝑐 = 𝑘 𝑝𝑟𝑜𝑝𝑜𝑟𝑡𝑖𝑛𝑎𝑙 𝑐𝑜𝑚𝑝𝑒𝑛𝑠𝑎𝑡𝑜𝑟

Followings are results of simulation for different values of k.

Fig. 5: k =1

157
Fig. 6: k = 10

Fig. 7: k = 0.1

Fig. 8: k = 0.01

As results show, for (k = 1) system is unstable and increasing k (k = 10) does not solve this problem.
However, decreasing k (k = 0.1) leads to system's stability and also a good response in which not only the effect
of disturbance 𝐹𝑒𝑥𝑡 is almost completely compensated in steady state response, but also rising time is acceptable
(𝑡𝑟 ≈ 1.25 𝑠𝑒𝑐). More decrease in k (k = 0.01) leads to instability which is not desired.

Finally, a sine wave and a saw-tooth wave with amplitude of 0.0375 and frequency of 0.5Hz are
applied to the model. Fig. 9. and Fig. 10. show the output to sine and saw-tooth wave, respectively.

Fig. 9.

Fig. 10.

158
As you can see the system does not response to periodic inputs above properly, because the frequency
of inputs is big according to settling time of system (𝑡𝑠 ≈ 2.5𝑠𝑒𝑐); so, system cannot follow the input. Following
figures are the output of system to sine and saw-tooth inputs with same amplitude but frequency of 0.25Hz. As
shown, dividing the frequency of input down to 0.25Hz leads to a much better response .

Fig. 11.

Fig. 12.

REFERENCES
[1] THE MECHATRONICS HANDBOOK, pp.603-608
[2] TECHNICAL BULLETIN 103, TRANSFER FUNCTION FOR MOOG SERVOVALVES, pp.3-4
[3] E. J. Barth, J. Zhang, and M. Goldfarb, Control Design for Relative Stability in a PWM-Controlled Pneumatic System,
pp.3
[4] K. Kawashima, Y. Ishii, T. Funaki, T. Kagawa, Determination of Flow Rate Characteristics of Pneumatic Solenoid
Valves Using an Isothermal Chamber
[5] Z. Situm, J. Petric, M. Crnecovic, Sliding Control Applied to Pneumatic Servo Drive, pp. 6

159
Literature
1. Dr. Martin Kozek, Modellbildung und Simulation, Institut für Maschinen- und
Prozessautomatisierung, Technische Universität Wien, Oktober 2000
2. L. Ljung, T. Glad, Modeling of Dynamic Systems, Prentice-Hall information and system
sciences series, 1994.
3. R.C. Dorf, R.H. Bishop, Modern Control Systems, Addison-Wesley, 7th edition, 1995.
4. Georg Pelz, Mechatronic Systems: Modelling and Simulation with HDLs, John Wiley &
Sons Ltd, 2003
5. Robert H. Bishop (Editor), The mechatronics handbook, CRC Press LLC, 2002

160

You might also like