Diseño Mecatrónico
Mathematical Modeling Based on Physics
Laws
MCTG1013
Marcelo Fajardo-Pruna, PhD
[email protected] Carlos Saldarriaga, PhD
[email protected]Mathematical Modeling Based on Physics
Laws
• As a first example let us consider a dc motor with a
mechanical load that we’d like to control either in speed or
in position. The dc motor represents the actuator that is
mostly used in the position control servomechanism. It is the
means by which the electrical energy is converted to
mechanical energy. The block diagram of the dc motor
driving the load of our example is illustrated below. If we let
u(t), i(t) and ω(t) denote respectively the voltage of the
armature, the current in the armature and the speed of the
shaft at time t, based on the basic electrical and mechanics
laws we have the following:
• where R, Lm, Kw, Kt represent respectively the electric resistor of
the armature, the inductance of the armature, the electromotive
force constant, the torque constant (in the international system
(IS) these both constants are equal), J and b are defined by:
• with Jm and Jc are the moments of inertia of the rotor and the load
respectively, and bm and bc are the damping ratios of the motor
and the load, and n is the gear ratio.
Block diagram of a DC motor
Concept of Transfer Function
• If we use the Laplace transform with zero initial conditions, we get:
• where U(s), I(s), and Ω(s) are respectively the Laplace transform
of u(t), i(t) and ω(t).
• Combining these relations and the definition of the transfer
function between the velocity Ω(s) and the voltage U(s), we get:
• If the armature inductance Lm can be neglected, the transfer
function becomes:
• With
• Remark 1. When the armature inductance Lm can be neglected the mathematical
model can be simplified to a first order system, otherwise we have a second order
one. It may happen in some applications that the dynamics of the driven load is too
slow compared to the actuator one and in this case, the dynamics of the actuator
is reduced to a simple gain.
• Remark 2. The parameters of the dc motor are in general available in its data
sheet. Once the inertia of the load and the gear ratio are known, all the data of the
model are then known. It is also important to mention that the data sheet contains
the average data for a sample that has been tested to get these parameters.
Therefore, it may happen that the considered actuator may have uncertainties in its
model that can be compensated by the choice of the appropriate controller.
• Notice also that the position, θ(t), of the dc motor is obtained from
the velocity, ω(t), by using:
• where Θ(𝑠) = ℒ [𝜃(𝑡)].
• Using this and the simplified model between the voltage and the
velocity, we get the following relationship between the voltage and
position:
• Notice that the previous relations of the mathematical model
between the voltage and the velocity can be rewritten as follows:
State Space Description
• Now if we let x1(t) = i(t), x2(t) = ω(t) and y(t) = x2(t) we get:
• that gives the following standard form:
• where
• Remark 3. In this example we assumed that we have access only to the velocity
which implies that that C = [0 1]. If we have access only to the current or to both
variables the corresponding output matrices become respectively C = [1 0], C = [1
1].
• For the state space representation that gives the position, notice
that the previous relations of the mathematical model between the
voltage and the velocity and the relation that links the velocity and
position can be rewritten as follows:
• Now if we let x1(t) = i(t), x2(t) = ω(t), x3(t) = θ(t) and y(t) = x3(t) we
get:
• that gives the standard form with:
• To use these models, we need to know the different parameters in
each one. This may be in some circumstances difficult to measure
and therefore another alternative is required. In the next sessions,
the situation will be overcome by using identification techniques.
• Remark 4. It is important to mention that the state space description is not unique,
which means that for a given system, we can find many state space descriptions.
This matter will be explained later.
• Remark 5. Notice that in general, the manufacturer of dc motors provides the data
sheet in which we can find all these parameters that correspond to a sample that
was chosen for test. These parameters may not be identical to those of the dc
motor we are using and this may cause some error in modeling. The feedback
control will cope with such errors.
Segway
Segway
• The dynamics of this system is composed of two models that will
be decoupled under some appropriate assumptions. We assume
that the Segway remains close to its vertical position when moving
with small speed and the wheels remain in touch with the ground
and don’t slip.
• Under these assumptions the dynamics of our Segway will be
partitioned into two parts.
• The first one gives the behavior of the tilt and linear displacement
dynamics while the second one governs the heading angle
dynamics.
Variables definition
• and noticing that the following relations always hold:
• we have the following relations:
• motor’ dynamics
Tilt dynamics free body diagram
Wheels and linear displacement free body
diagram
• torque applied to the wheels
• robot tilt dynamics
• If we assume that ψ(t) is small we get sin(ψ(t)) ≈ ψ(t) which implies
in turn:
• robot wheels and linear displacement dynamics,
• which in turn gives:
• and finally, we obtain:
• If we define and , we get
the following state space representation:
• Where
• We will now establish the model representing the heading angle
dynamics of the robot taking into consideration that an equal but
opposite torque has to be applied by the two motors in order to
induce a purely rotational motion on the robot without affecting its
tilt and linear position. Therefore, an equal but opposite voltage
has to be applied to the two motors and this voltage is taken as
the input of this system. Here, we are taking the assumption that
the robot is staying in the vertical position and that its moment of
inertia around the vertical axis is not changing. If we introduce the
additional variables of following Table and noticing again that the
following hold:
Variables definition
• we have the following relations:
• From the robot wheels and linear displacement dynamics, solving
for F(t), we have:
• now making reference to left and right, we get:
Heading dynamics free body diagram
• referring to figure we get:
• which in turn gives:
• and finally, we obtain:
• If we define and , we get the following
state space representation:
• where
Transfer Function to Space State
𝒙ሶ = 𝑨𝑥 + 𝑩𝑢
𝒚 = 𝑪𝑥 + 𝑫𝑢
Laplace transform
𝑠𝑿(𝒔) = 𝑨𝑿(𝒔) + 𝑩𝑈(𝑠)
𝑌(𝑠) = 𝑪𝑿(𝒔) + 𝑫𝑈(𝑠)
𝑠𝑰 − 𝑨 𝑿(𝒔) = 𝑩𝑈(𝑠)
𝑠𝑰 − 𝑨 −1 = 𝜱 𝒔
𝑿(𝒔) = 𝜱 𝒔 𝑩𝑈(𝑠)
𝑌 𝑠 = 𝑪𝜱 𝒔 𝑩𝑈 𝑠 + 𝑫𝑈 𝑠 = 𝑪𝜱 𝒔 𝑩 + 𝑫 𝑈 𝑠
𝑌 𝑠
𝐺 𝑠 = = 𝑪𝜱 𝒔 𝑩 + 𝑫
𝑈 𝑠
−1
1 𝑇
𝜱 𝒔 = 𝑠𝑰 − 𝑨 = 𝐴𝑑𝑗 𝑠𝑰 − 𝑨
det 𝑠𝑰 − 𝑨
det 𝑠𝑰 − 𝑨
Magnetic levitation system
• The data of the system are
• Let x(t) denote the position of the object at time t measured from
the bottom of the coil. The dynamics of the moving object is
described by the following differential equation:
• where g is the gravity, Fc and Fp are the magnetic forces
generated respectively by the coil and the permanent magnet.
• Remark 6 It is important to notice that the direction of the magnetic force Fc is
linked to the direction of the current in the coil.
• If we denote by i(t) the current at time t that gives a force Fc
pointing down at time t with the following expression:
• The permanent force Fp is given by the following expression:
• Using these expressions we get:
• From the other side, we have the following relation between the
current i(t) and the applied voltage u(t):
• If we neglect the effect of the coil, this relation becomes:
• and the dynamics become:
• For the output equation notice that we have a Hall effect sensor
that generates a voltage that is function of the position, x(t) of the
object and therefore it is function of the magnetic field B (sum of
the two fields (the one due to the coil and the one due to
permanent magnet)). If we denote by y(t) this voltage and using
the data sheet of the sensor, we get:
• where B is measured in Gauss ( 1 Tesla = 1000 Gauss).
• This gives the following one:
• where B is measured in Tesla.
• It can be shown that the expression of the total magnetic field is
given by:
• Where
• In conclusion the output of the sensor is then given by:
• It can be seen that the model is nonlinear and the theory we will
present will not help. Therefore a linearization around an
equilibrium point is required.
• At the equilibrium point the speed and the acceleration of the
object are equal to zero and the current is constant in time and the
total force is equal to the gravitational force. Using this and the
previous dynamics, we get:
• Using these conditions and some appropriate experiments, we
can determine the values for kc and kp and these values are given
by:
• At the equilibrium point, the object occupies a fixed position xe that
corresponds to the voltage ue (ue = Rie). The corresponding
voltage delivered by the sensor is ye.
• In the neighborhood of this equilibrium point (xe, ue, ie, ye), the
system has a linear behavior. The linearized model is given by:
• where