Report Anna
Report Anna
MODEL OF A DC MOTOR:
diA(t)
ELECTRIC DYNAMICS (armature): VA(t) = RA ∗ iA(t) + LA ∗ + VM(t)
dt
1
Laboratory of Automation Systems 2021/2022
This are all linear differential equations, therefore we can apply the Laplace transformation.
Assuming b≈0 we obtain the transfer function that describes the motor dynamics. It is a second
order system with two poles.
𝑘𝑚
Gω(s) = 2
s ∗ LA ∗ J + s ∗ RA ∗ J + 𝑘𝑚2
We cab compute two poles: if LA is sufficiently small then the two poles are real and negative
(stability of the system).
𝑘𝑚2 𝑅𝐴
p1 ≈ − p2 ≈ −
RA∗J LA
From the equations of the two poles we obtain the mechanical and electrical time constants.
RA∗J L
τm = >> τe = RA
𝑘𝑚2 A
Typically there is one order of magnitude of difference between the two constants.
In order to have null steady state errors and to obtain a desired dynamics we choose a PI controller
1 𝐾𝑝𝑖 1 + 𝑇𝑖𝑖 ∗ 𝑠
𝑅𝑖 (𝑠) = 𝐾𝑝𝑖 ∗ (1 + )= ∗( )
𝑇𝑖𝑖 ∗ 𝑠 𝑇𝑖𝑖 𝑠
The open loop transfer function will be Fi (s)
𝐾𝑝𝑖 1 + TII ∗ S 1/RA
𝐺𝑖 (𝑠) = 𝑅𝑖 ∗ Ge = ∗( )∗
𝑇𝑖𝑖 𝑠 1 + s ∗ τA
We can use choose first degree of freedom 𝑇𝑖𝑖 = τA to cancel the electric pole. The open loop
transfer function results
𝐾𝑝𝑖
𝐺𝑖 (𝑠) = 𝑅𝑖 ∗ Ge =
RA ∗ 𝑇𝑖𝑖 ∗ 𝑠
While the second degree of freedom Kpi can be used to determine the desired time constant of the
system. From the closed loop transfer function, we get
Gi 1 1
𝐹𝑖 (𝑠) = = =
1 + Gi 1 + RA ∗ 𝑇𝑖𝑖 ∗ 𝑠 1 + τ𝑖 ∗ 𝑠
𝐾𝑝𝑖
2
Laboratory of Automation Systems 2021/2022
𝑅𝐴𝑇𝑖𝑖
We can now assign a desired time constant for the current loop τ𝑖 = = 1𝑚𝑠, as typical for
𝐾𝑝𝑖
electric drives.
L LA
𝑇𝑖𝑖 = τA = A 𝐾𝑝𝑖 =
𝑅 𝐴 τi
2 1 − 𝑧 −1
𝐾𝑝𝑖 1 + 𝑇𝑖𝑖 ∗ ∗
𝑇 1 + 𝑧 −1
𝑦= ∗( )∗𝑥
𝑇𝑖𝑖 2 1 − 𝑧 −1
∗
𝑇 1 + 𝑧 −1
1 − 𝑧 −1 𝑇 1 − 𝑧 −1
𝑇𝑖𝑖 ∗ ∗ 𝑦 = (𝐾𝑝𝑖 ∗ ∗ +𝐾𝑝𝑖 ∗ 𝑇𝑖𝑖 ∗ )∗𝑥
1 + 𝑧 −1 2 1 + 𝑧 −1
𝑇 −1 −1
𝑇𝑖𝑖 ∗ 𝑦 𝑇𝑖𝑖 ∗ 𝑦 ∗ 𝑧 −1 𝐾𝑝𝑖 ∗ 2 ∗ 𝑥 ∗ (1 + 𝑧 ) + 𝐾𝑝𝑖 ∗ 𝑇𝑖𝑖 ∗ 1 − 𝑧 ∗ 𝑥
− =
1 + 𝑧 −1 1 + 𝑧 −1 1 + 𝑧 −1
𝐾𝑝𝑖 𝑇
𝑦= 𝑥(1 + 𝑧 −1 ) + 𝐾𝑝𝑖 ∗ (1 − 𝑧 −1 )𝑥 + 𝑦 𝑧 −1
𝑇𝑖𝑖 2
𝐾𝑝𝑖 𝑇 𝐾𝑝𝑖 𝑇 −1
𝑦= 𝑥+ 𝑥𝑧 + 𝐾𝑝𝑖 𝑥 − 𝐾𝑝𝑖 𝑧 −1 𝑥 + 𝑦 𝑧 −1
𝑇𝑖𝑖 2 𝑇𝑖𝑖 2
𝑇 𝐾𝑝𝑖 𝑇 𝐾𝑝𝑖
𝑦=( + 𝐾𝑝𝑖)𝑥 + ( − 𝐾𝑝𝑖)𝑥𝑧 −1 + 𝑦𝑧 −1
2 𝑇𝑖𝑖 2 𝑇𝑖𝑖
𝑦 = 𝑎 𝑥 + 𝑏 𝑥 𝑧 −1 + 𝑐 𝑦 𝑧 −1
𝑇 𝐾𝑝𝑖+2 𝑇𝑖𝑖 𝐾𝑝𝑖 𝑇 𝐾𝑝𝑖−2 𝑇𝑖𝑖 𝐾𝑝𝑖
With 𝑎= ; 𝑏= ; 𝑐=1
2 𝑇𝑖𝑖 2 𝑇𝑖𝑖
Where y=y(k), x=x(k), 𝑥 𝑧 −1 = 𝑥(𝑘 − 1) and 𝑦 𝑧 −1 = 𝑦(𝑘 − 1), Kpi is the proportional action
and Tii the time constant for the integral one.
3
Laboratory of Automation Systems 2021/2022
We used this to create the Matlab function of our PI controller, which has four inputs:
Kpi,
Tii,
Ts (the sampling time),
In (the input of the regulator, which is the error between the desired current and the measured one)
In order to have null steady state errors and to obtain a desired dynamics controlling the time
constant we choose a PI controller
1 𝐾𝑝𝑣 1 + 𝑇𝑣𝑖 ∗ 𝑠
𝑅𝑣(𝑠) = 𝐾𝑝𝑣 ∗ (1 + )= ∗( )
𝑇𝑣𝑖 ∗ 𝑠 𝑇𝑣𝑖 𝑠
Since the electric part is much faster, we assume it’s dynamics negligible.
The open loop transfer function becomes
𝐾𝑝𝑣 ∗ 𝑘𝑚 1 + TVI ∗ S 1/b
𝐺𝜔(𝑠) = 𝑅𝑣 ∗ 𝐹𝑖 ∗ 𝑘𝑚 ∗ Gm ≈ ∗( )∗
𝑇𝑣𝑖 𝑠 1 + s ∗ τm
4
Laboratory of Automation Systems 2021/2022
We can use choose first degree of freedom 𝑇𝑣𝑖 = τm to cancel the mechanical pole. The open loop
transfer function results
𝐾𝑝𝑣 ∗ 𝑘𝑚
𝐺𝜔(𝑠) = 𝑅𝑣 ∗ Gm =
b ∗ 𝑇𝑣𝑖 ∗ 𝑠
While the second degree of freedom Kpv can be used to determine the desired time constant of the
system, which must be higher than the electrical one (τ𝜔 = 4 − 8τi). From the closed loop transfer
function, we get
𝐺𝜔 1 1
𝐹𝑣(𝑠) = = =
1+𝐺 b ∗ 𝑇𝑣𝑖
𝜔 1+ ∗ 𝑠 1 + τ𝜔 ∗ 𝑠
𝐾𝑝𝑣 ∗ 𝑘𝑚
We obtain
J
𝑇𝑣𝑖 = τm 𝐾𝑝𝑣 = τ𝜔∗Km
The blue block on the top left allows the analog reading. It has two outputs which are the measured
current, necessary for the current loop, and the supply voltage.
The PWM block is needed for supplying the motor. The output TensioneRichiesta comes from our
control system, and it represents the voltage we have to give to the motor to follow a certain desired
speed.
The encoder allows to read the measured velocity.
5
Laboratory of Automation Systems 2021/2022
We choose to limit the voltage (output of the current loop) to 20V, because the DC motor nominal
voltage is 24V, and the current output of the velocity loop to 1.5, because the nominal current is
1.9A