Digital Control of Electric...
Transcript of Digital Control of Electric...
Czech Technical University in Prague – Faculty of Electrical Engineering
Digital Control of Electric Drives
Ver.1.01
Digital Controller
J. Zdenek 2017
BE1M14DEP Digital Control of Electric Drives - 10 2
Digital vs. Analog Control
DIGITAL CONTROL – ADVANTAGES:
• Possible implementation of complex control algorithms (adaptive regulation), program solution
• Long-term stability of parameters and high accuracy - it does not depend on temperature and aging of components (this only applies to digital parts, not analogue control units).
• Modification (upgrade) of the control algorithm only by changing software (SW), hardware (HW) does not change (updating, enhancement of properties, removal of defects from development without change of HW).
• Easy communication interconnection with other blocks of distributed control system from multiple computers
• Easier set-up of serial product parameters (the debugged program works in the same piece of the controller as always - if HW is OK).
• Easy connection to human communication devices (control and display panels, visualization).
BE1M14DEP Digital Control of Electric Drives - 10 3
Digital vs. Analog Control (Cont.)
DIGITAL CONTROL – ADVANTAGES:
• Easily connect to global computer networks (Internet).• Remote diagnostics, parameter modification and data transfer (over the
Internet or radio digital networks - mobile phone systems).• The ability to customize properties by changing the software even after
delivery to the customer.
• The fast-expanding option (price and function) digital control can be implemented in HW gate arrays of the FPGA using Hardware Description Language (HDL) programming languages - a high FPGA speed and the ability to customize the necessary digital blocks.
• Lower price of the final product.
BE1M14DEP Digital Control of Electric Drives - 10 4
Digital vs. Analog Control (Cont.)
DIGITAL CONTROL – DISADVANTAGES:• For the development of digital control systems, additional knowledge of the
staff (beyond knowledge of control technology), ie design of HW control computers, digital signal processing, real-time programming, and program debugging methodology are required.
• For the development of digital control systems, appropriate instrumentation and software equipment (compilers and debuggers, code and HW simulatorsand emulators, logic analyzers, run-time monitors, etc.) are required.
• The view into the control computer operation is very poor (compared to the analog signal oscilloscope).
• The dynamic properties of the control algorithm depend on the sampling period T (see below). With its shrinking, the dynamic properties improve (closer to the analog solution), but there is a rapid increase in computer computational demands and the size of its data memory. This led to the establishment of a special class of computers - the so-called Signal Processors (DSP). These computers include features typically used in digital control technology.
BE1M14DEP Digital Control of Electric Drives - 10 5
Digital vs. Analog Control (Cont.)
ANALOG CONTROL – ADVANTAGES:
• Good dynamic properties.• For the development of analogue control, knowledge of the construction of
computer technology is not required.• View into an analog controller operation more prominent (oscilloscope).
• Simpler development equipment required (oscilloscope, multimeter, ...).
BE1M14DEP Digital Control of Electric Drives - 10 6
Digital vs. Analog Control (Cont.)
ANALOG CONTROL – DISADVANTAGES:
• Complex and may be impossible implementation of complex control algorithms (adaptive control).
• Poor long-term stability of the parameters and lower accuracy - depends on the temperature and aging of the components.
• The control algorithm is defined by interconnection of components, it can not be easily changed.
• Difficult connection to computer systems.
• For more complicated solutions, it is difficult to set the parameters of individual pieces of product (each piece must be set individually).
• Remote diagnostics and customization are impossible.
• For more sophisticated systems, a higher price
BE1M14DEP Digital Control of Electric Drives - 10 7
Transition of analog LTI to digital LTI
BE1M14DEP Digital Control of Electric Drives - 10 8
Digital controller (regulator)
...)3()2()1(...)2()1()()( 321210 −−−−−−−+−+−+= kubkubkubkeakeakeaku
Difference equation
...))((...)1()( 22
110
33
22
11 +++=+++ −−−−− zazaazEzbzbzbzU
After Z-transformation
After modification – Transfer function:
...1
...
)(
)()(
33
22
11
22
110
−−−
−−
++++++==zbzbzb
zazaa
zE
zUzC Discrete transfer function C(z)
makes possible to analyze propertiesof discrete systems in
z – complex plane
BE1M14DEP Digital Control of Electric Drives - 10 9
Digital controller (regulator)
• k – sample serial number, actual time is kT if sampling period is T,• t – time of continuous signals,• w(k), w(t) – required value,• e(k(, e(t) – error (control deviation),• u(k), u(t) – action value,• y(k), y(t) – regulated (controlled) value,
Simplification:Transfer function
of sensor is 1
BE1M14DEP Digital Control of Electric Drives - 10 10
Digital controller (regulator)
M005-PO1-dig-analPS-one-step-ovsh-euk
Timer
One Step Scope-01
F(s) - Plant
den(s)num(s)
Sum
+
-
Num: 1Num: 1Den: 1 + 0.1*sDen: 1 + 0.1*s
FOH
S/H
ADC
S/H
C(z) - Controller
den(z)num(z)
Mux
(2)(2)(1)(1) (3)(3) (4)(4) (5)(5) (6)(6)(7)(7) (8)(8)
(9)(9)
Digital PS Controller, Analog Plant (LR)Digital PS Controller, Analog Plant (LR)
Model: Scilab/Scicos
Example -> runFunction blocks of regulator and controlled process (plant)
are defined by transfer functions invariable z (controller) and s (controlled process).
BE1M14DEP Digital Control of Electric Drives - 10 11
Digital controller (regulator)
Model with disturbance variable
Disturbance variable is used for modeling of process changes(e.g. loading torque changes) or for modeling
of random noise is system (e.g. noise of sensor)
BE1M14DEP Digital Control of Electric Drives - 10 12
Discrete controller design
Two methods:
Controller structure and its parameters are unknown beforehand and they are defined duringsynthesis by using of mathematical methods. This approach requires sufficiently accuratemathematical model of controlled process.
Controller structure is known beforehandand design task is to define its parameters. Thisapproach does not necessarily require mathematical model of controlled process. A processparameters are identified by measurement under specified conditions. Such a method is calledcontroller “tuning“.Such a methods for PID regulator structure are:Method of stable oscillation – Ziegler, Nichols (1952)Method of transition response – originally also Ziegler,Nichols
BE1M14DEP Digital Control of Electric Drives - 10 13
Discrete controller design
To design controller in continuous area(s-complex plane, Laplace transformation).The designed controller to digitize and using suitable sampling period T to reach similarbehavior as in designed analog controller.
Two methods:
To design controller in discrete area(z – complex plane, Z-transformation). Using this methodit is possible in some cases to implement discrete controller for large sampling periods too(with respect to time constants of controlled process (plant))
BE1M14DEP Digital Control of Electric Drives - 10 14
Discrete controller monitored properties
• controlled variable y(t) ability to trace required variable w(k) by suitable manner,
• ability to suppress influence of disturbance variable d(t) on the controlled variable y(t)
• regulation loop stability, i.e. its immunity against y(t) variable oscillations in the case theprocess or controller parameters are changed.
Similarly as in continuous controllers these are mainly:
Note to the regulator stability problem:
Discrete controller parameters inside computer (variables) are totally stable, there is no driftand no offset. But implemented algorithm could be for some parameter values unstable(influence of used algorithm and finite accuracy of used variable types). In the discrete control system is moreover range of analog parts (parts of ADC and DAC controllers, analog filter, sensors etc.) which parameters are changed with temperatureand ageing.
BE1M14DEP Digital Control of Electric Drives - 10 15
Continuous PID controller
Continuous PID controller is often use beforehand known structure of regulation block:
Complete PID controller consists of proportional (P), integral (I) a derivative (D) terms. Relation between u(t) (action variable) and e(t) (error variable) has basic form in time(parallel form):
++= ∫
t
DI dt
tdeTdrre
TteKtu
0
0
)()(
1)()(
PID (L-transformation):
)(1
1)( 0 sEsTsT
KsU DI
++=
PID transfer function:
++== sT
sTK
sE
sUsC D
I
11
)(
)()( 0
Ko – regulator gain,Ti – integral constant,Td – derivative constant.
BE1M14DEP Digital Control of Electric Drives - 10 16
PSD controller by discretization of PID differential equation
Derivative approximation by backward difference:
T
kxkx
dt
txd )1()()( −−≈
Integral approximation by numerical integration (sum of trapezoids)
[ ]∫ ∑=
−+≈kT k
i
ixixT
dttx0 0
)1()(2
)(
By substitution to the PID equation:
perioda vzorkovací−T
[ ] [ ])1()(()(1
0 −−+++= ∑ kekeT
TKieie
kD1)-
T2
TKe(k)Ku(k)
I00
T – sampling period
BE1M14DEP Digital Control of Electric Drives - 10 17
PSD controller by discretization of PID differential equation
PSD incremental form (calculates ) (trapezoidal integration)
)1()()( −−=∆ kukuku
[ ] [ ])2()1(()1(1
10 −−−++−+= ∑
−
kekeT
TKieie
kD2-
T2
TK1)-e(kK1)-u(k
I00
After grouping of coefficients with the same time samples:
)2()1()(
)2((2
1
210 −+−+=
=−+
−+−+
++==∆
keqkeqkeq
keT
Tie
T
T
T
T DDD0
I0
I0 K1)-
T2
TKe(k)
T2
T1K1)-u(k-u(k) u(k)
T
Tq
T
TKq
T
TKq
D
D
D
0
I
I
K
T2
T
T2
T1
=
+−−=
++=
2
01
00
21
)(ku∆
BE1M14DEP Digital Control of Electric Drives - 10 18
PSD controller by discretization of PID differential equation
Final PSD difference equation (suitable for recurrent calculation in computer):
)2()1()()1()( 210 −+−++−== keqkeqkeqkuku
After Z-transformation:
22
110
1 )()()()()( −−− +++= zzEqzzEqzEqzzUzU
PSD controller transfer function:
1
22
110
1)(
)()( −
−−
−++==
z
zqzqq
zE
zUzC
BE1M14DEP Digital Control of Electric Drives - 10 19
PSD controller by Bilinear (Tustin) transformation
Bilinear transformation uses substitution:
)1(
)1(
2 −+=
z
zTs
Substitution is used in PID controller Laplace s-domain:
perioda vzorkovací−T
)(1
1)( 0 sEsTsT
KsU DI
++=
Result of Bilinear transformation is identical to approximation of PID controllerdifferential equation using trapezoidal integration method and difference.
T – sampling period
BE1M14DEP Digital Control of Electric Drives - 10 20
PSD controller by discretization of PID differential equation
PSD positional form (calculates u(k) ) (trapezoidal integration) :
[ ] [ ]
[ ] [ ] [ ])1()(()(()(
)1()(()(
1
10
10
−−+++++
=−−+++=
∑
∑−
kekeT
TKieieieie
kekeT
TKieie
kD
kD
1)-T2
TK1)-
T2
TKe(k)K
1)-T2
TKe(k)Ku(k)
I0
I00
I00
After grouping of coefficients with the same time samples:
[ ]∑−
−+++
++=
1
1
(()(k
DD keT
TKieie
T
T1)-
T2
T1)-
T2
TKe(k)
T2
T1Ku(k)
II0
I0
To define:
[ ]∑−
+=1
1
()(k
ieie 1)-1)-sum(k
BE1M14DEP Digital Control of Electric Drives - 10 21
PSD controller by discretization of PID differential equation
PSD positional form (calculates u(k) ) (trapezoidal integration) cont:
And we get the expression suitable for repeated calculation by computer:
1)-q1)-sum(ke(k)u(k) 2 keqq (10 ++=
Where:
−=
=
++=
T
T
T
TKq
T
TKq
T
T
T
TKq
D
I
I
D
I
2
2
2
02
01
00 1
And:
[ ]∑−
+=1
1
()(k
ieie 1)-1)-sum(k
BE1M14DEP Digital Control of Electric Drives - 10 22
PSD controller by discretization of PID differential equation
PSD incremental form (calculates ) (backward rectangular integration))(ku∆
)2()1()()1()( 210 −+−++−= keqkeqkeqkuku
T
TKq
T
TKq
T
T
T
TKq DDD
I020100 ,
21, =
+−=
++= 1
Where:
PSD positional form (calculates u(k) ) (backward rectangular integration)
1)-keq)sum(k-qe(k)qu(k) (1 210 ++=
∑−
=1
1
)(1k
ie)sum(k-
−−==
++=
T
T
T
TKq
T
TKq
T
T
T
TKq DD
I
D
I 2,
2,
2 020100 1
Where:
BE1M14DEP Digital Control of Electric Drives - 10 23
PSD controller setting
Unit step function response method for controlled process in open loop:
• Disconnect feedback.• Bypass regulator (switch off regulator).• Generate unit step to the controlled process input.• Record unit step controlled process response.• In the inflection point of curve draw tangent line.• From graph read following values:
• K – static gain,• Tu – delay time,• Tn – rise time.
• Based on the formula (according relevant author) calculate initial PID parameters:• K0 – gain, • Ti – integral constant,• Td – derivative constant.
• Select sampling period T of discrete (digital) controller.
Approximate T value may by selected as , where is maximumtime constant of regulated system. 10
maxτ≈T maxτ
BE1M14DEP Digital Control of Electric Drives - 10 24
PSD controller setup (cont.)
• Based on selected PSD controller formula calculate q0, q1 and q2 coefficients itsdifference equation from K0, TI, TD a T values.
• Connect feedback loop and setup calculated q0, q1 a q2 coefficient to the PSD algorithm
• Tune PSD coefficients based on regulated system response on the unit step functionto be quality of PSD behavior near the required one.(aperiodic, faster with overshoot, …).
Unit step function response method for controlled process in open loop:
BE1M14DEP Digital Control of Electric Drives - 10 25
PSD setup (Unit step function response )
0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 1.6 1.8 2.0
0.0
0.2
0.4
0.6
0.8
1.0
One Step Response Ziegler-Nichols Method
t [s]
y (t
) [1
]
Unit step function response
Inflection point
Tangent line Unit step
Static gain
Delay time Rise time
BE1M14DEP Digital Control of Electric Drives - 10 26
PSD setup (Unit step function response )
Ziegler-Nichols: [1],[2]PI:
,3,1
9,00 uIu
n TTT
T
KK ==
Ziegler-Nichols-Seborg: [1],[2]PID (overshoot):
uDuIu
n TTTTT
T
KK 32,1,2,
2
133,00 === π
[1] O’Dwyer A.: A Summary of PI and PID Controller Tuning Rules for Processeswith Time Delay. Part 2: PID Controller Tuning Rules. IFAC Workshop’00,Terrassa, Spain April 2000, str.242-247
And range of more formulae for PID controller parameters calculation
BE1M14DEP Digital Control of Electric Drives - 10 27
Discrete system stability
Continuous linear system (LTI) with feedback is stable if transfer function poleswith closed feedback are in complex left s-half plane
Relation between complex plane sand complex plane zis defined as:
vzorkováníperiodaTez sT −= ,
Position of poles in complex z-plane depends on sampling period T. A change of samplingperiod will influence position of poles in z-plane and therefore it changes discrete systemresponse and stability
T – sampling period
BE1M14DEP Digital Control of Electric Drives - 10 28
Transformation of s-plane to z-plane by formula sTez =
Komplexní rovina s Komplexní rovina z
Re{z}
Im{z}
1
σ
jω
σ < 0 0 0
-1
j
- j
z = esT
|z| = eσT
< 1
Imaginary axis of s-plane (i.e. σ = 0) is transformed to the boundary of unit circle |z| = 1.
Complex s-plane Complex z-plane
BE1M14DEP Digital Control of Electric Drives - 10 29
Discrete system stability analysis (Hint of method)
BE1M14DEP Digital Control of Electric Drives - 10 30
Discrete system stability analysis (Hint of method) cont.
Transfer function of closed loop linear discrete system is defined as (see previous page):
)(1
)(
)(
)()(
zH
zH
zW
zYzG
+==
System stability is assessed from pole positions of transfer function G(z) i.e. from rootsof characteristic equation of G(z)denominator.
0)(1 =+ zH
Linear discrete system is:• stable– if all characteristic equation roots (closed loop transfer function poles) are inside
of unit circle in z-plane. • critically stable– if one characteristic equation root is equal to 1 or complex conjugate rootspair is on the unit circle.
BE1M14DEP Digital Control of Electric Drives - 10 31
Damped oscillating process (example)
Damped oscillating process, poles are inside unit circle (Oscillating is discrete PC controller)
0.00 0.05 0.10 0.15 0.20 0.25
0.0
0.2
0.4
0.6
0.8
1.0
1.2
Root Locus - Stability, F(z) K = 4.2
t [t]
y (t
) [1
]
)()()( sFsFzC FOH ++
3.4=K
BE1M14DEP Digital Control of Electric Drives - 10 32
Stability limit (example)
0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10
0.0
0.5
1.0
1.5
2.0
2.5
Root Locus - Stability, H(z) = C(z)*Z[F(s)], K = 4.7
t [s]
y (t
) [1
]
[ ])()()( sFsFZzC FOH+7.4=K
BE1M14DEP Digital Control of Electric Drives - 10 33
Unstable system (example)
0.00 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.10
0.0
0.5
1.0
1.5
2.0
2.5
Root Locus - Stability, H(z) = C(z)*Z[F(s)], K = 4.7
t [s]
y (t
) [1
]
85.4=K
[ ])()()( sFsFZzC FOH+
BE1M14DEP Digital Control of Electric Drives - 10 34
Influence of action element limitation
Action element limitation
BE1M14DEP Digital Control of Electric Drives - 10 35
Influence of action element limitation (No limitation)
No limitation
BE1M14DEP Digital Control of Electric Drives - 10 36
Influence of action element limitation – Wind-up effect
With limitation
BE1M14DEP Digital Control of Electric Drives - 10 37
Anti-Wind-up schema
BE1M14DEP Digital Control of Electric Drives - 10 38
Influence of action element limitation – Wind-up effect
With limitation, no Anti-Wind-up
BE1M14DEP Digital Control of Electric Drives - 10 39
Action element limitation and Anti Wind-up schema
With limitation, with Anti-Wind-up
BE1M14DEP Digital Control of Electric Drives - 10 40
Anti-Wind-up schema (possible solution)
Digital Control of Electric Drives
Digital controller
END
Czech Technical University in Prague – Faculty of Electrical Engineering