530 likes | 1.57k Views
Analog and Digital Control 1. Lecture 3 Kirsten Mølgaard Nielsen Based on lecture notes by Jesper Sandberg Thomsen. Outline. Discrete equivalents Overview (emulation – finding a discrete equivalent to the continuous system) Numerical integration Zero-Pole matching (mapping)
E N D
Analog and Digital Control 1 Lecture 3 Kirsten Mølgaard Nielsen Based on lecture notes by Jesper Sandberg Thomsen
Outline • Discrete equivalents • Overview (emulation – finding a discrete equivalent to the continuous system) • Numerical integration • Zero-Pole matching (mapping) • Hold equivalents • Design by emulation • Evaluation of design • Nyquist stability criterion • Continuous case • Discrete case
Discrete Equivalents - Overview r(t) e(t) controller D(s) u(t) plant G(s) y(t) + - Translation to discrete plant Zero order hold (ZOH) Translation to discrete controller (emulation) Numerical Integration • Forward rectangular rule • Backward rectangular rule • Trapeziod rule (Tustin’s method, bilinear transformation) • Bilinear with prewarping Zero-Pole Matching Hold Equivalents • Zero order hold (ZOH) • Triangle hold (FOH) Emulation Purpose: Find a discrete transfer function which approximately has the same characteristics over the frequency range of interest. Digital implementation: Control part constant between samples. Plant is not constant between samples.
Numerical Integration • Fundamental concept • Represent H(s) as a differential equation. • Derive an approximate difference equation. • We will use the following example • Notice, by partial expansion of a transfer function this example covers all real poles. Example Transfer function Differential equation
Numerical Integration • Now, three simple ways to approximate the area. • Forward rectangle • approx. by looking forward from kT-T • Backward rectangle • approx. by looking backward from kT • Trapezoid • approx. by average kT-T kT kT-T kT kT-T kT
Numerical Integration • Forward rectangular rule (Euler’s rule) • (Approximation kT-T)
Numerical Integration • Backward rectangular rule (app kT)
Numerical Integration • Trapezoid rule (Tustin’s Method, bilinear trans.) • (app ½(old value + new value))
Numerical Integration • Comparison with H(s)
Numerical Integration • Transform s ↔ z • Comparison with respect to stability • In the s-plane, s = jw is the boundary between stability and instability.
Numerical Integration - stability (Trapezoid) Region of s-LHP (Forward) Region of s-LHP (Backward) Region of s-LHP
Numerical Integration • Some conclusions • Higher distortion with the forward and backward rule. • The forward rectangular rule could cause a stable continuous filter to be mapped into an unstable digital filter. • The trapezoid rule maps the stable region in the s-plane exactly into the stable region of the z-plane. Though, the jw-axis is compressed into the unit circle with length 2p. • The trapezoid rule appears superior. But, let us make some further investigations..... let us calculate the power |H(jw)|2 at, for example, w = a – the change in frequency response.
Numerical Integration • What about HT(z) ? • at which frequency is |HT(z)|2 = 0.5 ?
Numerical Integration HT(z) as before but re-formulated (page 194) I.e. high sampling frequency
Numerical Integration • Trapezoid with pre-warping • maintain the power at some specified frequency • Choose a critical frequency w1 • Replace w1 by a´ such that new a = a’, • and insert in H(s). a’ = (2/T) tan(w1 T/2) • Find the discrete filter H(z) based on the modified continuous transfer function H(s).
Numerical Integration Plots for T = 0.1 ws ≈ 60 wb
Numerical Integration Plots for T = 1 ws≈ 6 wb Notice, prewarp
Numerical Integration Plots for T = 2 ws ≈ 3 wb Notice, prewarp
Zero-Pole Matching • Exact map between poles (z = esT) exists. • Basic idea, simply use same map for zeros. • Rules 1. All poles are mapped by z = esT. • For example, s = -a maps to z = e-aT 2. All finite zeros are mapped by z = esT. • For example, s = -b maps to z = e-bT 3. Basically, zeros at jw = infinity maps to z = ejp = -1 (representing the highest frequency) 4. Identical gain at some critical freq. (typically, s=0) • H(s) at s=0 = H(z) at z=1
Zero-Pole Matching Example (1) Compute the discrete equivalent by zero-pole matching
Zero-Pole Matching s-plane z-plane
Zero-Pole Matching Including delay in computer Notice, u(k) depends on e(k). This comes from rule 3 Solution, first zero for s=infinity is mapped to z=infinity (as in Matlab). This gives
e(t) e(k) eh(t) u(t) u(k) Sampler Hold H(s) Sampler Hold Equivalents • Purpose, design a discrete filter H(z), such that • input e(k) is samples of e(t) • H(z) has an output u(k) • u(k) approximates the output of the continuous filter H(s) whose input is the continuous signal e(t). Zero order hold (ZOH) (step invariant), approach below
e(t) e(k) eh(t) u(t) u(k) Sampler Hold H(s) Sampler Hold Equivalents Hold operation Q(s)
e(t) e(k) eh(t) u(t) u(k) Sampler Hold H(s) Sampler Hold Equivalents • ZOH transformation • Notice, we can find H(z) by • Take inverse Laplace to find a continuous signal. • Sample this continuous signal to find a discrete signal.
Hold Equivalents Continuous output signal Discrete output signal and transfer function H(z)
Hold Equivalents • Triangle hold equivalent • Extrapolate the samples to connect sample to sample in a straight line. • Impulse response for triangle hold Hold System
Hold Equivalents Same third order filter as before + Zero-pole o ZOH x Triangle T = 1 (next T=2)
Hold Equivalents Same filter as before + Zero-pole o ZOH x Triangle T = 2
Hold Equivalents • Concluding remarks • Methods, we have looked at • Numerical integration methods • Zero-pole matching (mapping) • Hold equivalents • All methods works fine for high sample frequency • Matlab
Evaluation of Design • Discrete controller by emulation • Can be calculated using one of several techniques. • Evaluation discrete equivalent (design) • We need to analyze in the z-domain. • Process expressed in z-domain (ZOH) • Notice, other eval. might be necessary (simulation)
Evaluation of Design • Example, using Matlab sysD_c = tf([10 1],[1 1]); T = 0.2; % around 30*wn. Also use, T = 1 sysD_d = c2d(sysD_c,T,’matched’); % zero-pole matched sysG_c = tf([1],[10 1 0]); sysG_d = c2d(sysG_c,T,’zoh’); % zero order hold sysCL_c = feedback(sysD_c*sysG_c,1); sysCL_d = feedback(sysD_d*sysG_d,1); step(sysCL_c); hold on; step(sysCL_d);
Evaluation of Design T = 0.2 (ws≈ 30 wn)
Evaluation of Design T = 1 (ws≈ 6wn) The sample delay gives phase lag. Thus, less PM which gives higher overshoot
Nyquist Stability Criterion • Check closed loop stability • with controller KD(s) and plant G(s) Characteristic equation (CE) Notice, number of poles in CE equals number of open-loop poles in D(s)G(S). (known) Notice, zeros in CE are closed-loop poles! (unknown)
Nyquist Stability Criterion • Approach, check characteristic equation • Let us follow a contour encircling the RHP. • Basic idea: Evaluate CE = 1+KD(s)G(s) at the contour, and draw image. (We can just as well evaluate KD(s)G(s) and look at -1 ) Notice, poles or zeros gives encirclements
Nyquist Stability Criterion • Criterion (continuous case) • Z = P + N • Z = number of unstable closed-loop poles. Thus, for stability we want Z=0. (unknown) • P = number of unstable open-loop poles of KDG (known). • N = total number of encirclements of the point -1 by evaluation of KDG (taken in same direction as s. Thus, N might be negative).
Nyquist Stability Criterion • Interpretations and explanations • If the s-plane contour encircles a zero of 1+KDG in a certain direction, the image contour will encircle the origin in the same direction. (related to Z) • If the s-plane contour encircles a pole of 1+KDG in a certain direction, the image contour will encircle the origin in the opposite direction. (related to P) • The net number of same-direction encirclements, N, equals the difference N = Z- P. • Actually, we should investigate 1+KDG and encirclements around the origin, but easier to investigate KDG and encirclements around -1.
Nyquist Stability Criterion • Discrete case • Same approach, almost... • Unstable region is outside the unit circle. • Easier to evaluate using the stable region.
Nyquist Stability Criterion • Discrete case • CE: 0 = 1+KD(z)G(z) • Total number of poles = n • Number of stable zeros of 1+KD(z)G(z) is n-Z • Number of stable poles of 1+KD(z)G(z) is n-P • Criterion (discrete case) • Z = (n-Z) – (n-P) or Z = P – N
Nyquist Stability Criterion • Discrete case • Determin the number P of unstable poles of KDG • Plot KD(z)G(z) for the unit circle. This is the counter-clockwise path around the unit circle. • Set N equal to the number of Counter-clockwise encirclements of the point -1 on the plot • Compute Z=P-N. • The system is stable if and only if Z=0
Nyquist Stability Criterion Example (7.9) Evaluate the stability of the unity feedback discrete system with the plant G(s) with sampling time T=2 and ZOH. Use controller KD(z) = K. K=1 Solution (matlab) sysC = tf([1],[1 1 0]); sysD = c2d(sysC,2); nyquist(sysD); The system is openloop stable and there are no encirkelments of -1 => the system is closed loop stable for K=1