1 / 38

“True” Digital Control

“True” Digital Control. .. or using the fact that we are sampling the signals to our advantge. More on the z-transform. We need to examine the z-transform in more detail.

miach
Télécharger la présentation

“True” Digital Control

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. “True” Digital Control .. or using the fact that we are sampling the signals to our advantge

  2. More on the z-transform • We need to examine the z-transform in more detail. • First, we look at two of the elements we have considered before -- SAMPLERS and the ZERO-ORDER HOLD (often referred to just as a HOLD).

  3. The sampler • When the switch (sampler) closes, the signal at A proceeds to B. • No signal reaches B except when the sampler closes. • This idea represents the action of a digital controller in that it only calculates its output at the sampling instants. A B

  4. The Hold • But the ‘plant’ will need to be given an input all the time -- just a ‘punch on the nose’ at the sampling instants is unlikely to work well. • This is where the Zero-Order Hold comes into action ...

  5. The Zero-Order Hold • This is the idea: • The value of the signal at C is ‘caught’ by the hold and held constant until the sampler closes again. C A Hold B

  6. Why a ‘Zero-Order Hold’ ? • Because it just catches the value of the signal at C. • A ‘First-Order Hold” would also catch the rate of change of the signal ... • ... and keep it changing at that rate. • But that is complicated, so the Zero-Order Hold is invariably used !

  7. What will it consist of ? • Normally a latching-type output port on the control computer attached to a D-A converter.

  8. Now for the z-transform • It only tells us what happens at sampling intervals • Consider this diagram: y y(4Ts) y(Ts) Time ( t) Ts 3Ts 5Ts etc

  9. The z-transform -- Continued • Suppose the switch closes for a time Tc at each sampling instant • We have a series of impulses • Each has a Laplace Transform equal to its area (‘strength’) times e-nTs to allow for the time at which it occurs • So the Laplace Transform of the complete sampled signal will be:

  10. ..and continues further ... • Tc(y(0) + y(Ts)e-sTs + y(2Ts)e-2sTs + ...) • or • We now put z = esTs and it simplifies ...

  11. So working them out looks heavy going ... • But fortunately, like Laplace Transforms, they can be looked up in tables ... • ... or converted by MATLAB using the ‘c2dm’ function. • This time, we leave the ‘tustin’ out... • [npd,dpd]=c2dm(num,den,ts,’zoh’) • The ‘zoh’ can be omitted.

  12. Rules for converting Block Diagrams to z • If blocks are separated by a sampler, convert the TFs to z and then combine the blocks. • If they are not, combine them in s and then convert to z. • This sounds complicated but it is actually easier than it looks ...

  13. An Example • The samplers close at each sampling instant • We must first combine the zero-order hold and the plant in s ... • ... and then convert to z. Plant Zero-order + -- hold G(s)

  14. Send for MATLAB ! • ‘c2dm’ will convert the hold-plant combination to z for us. • In order to determine the required D(z), we then specify the required closed-loop performance as a C.L.T.F. in z ... • ... and work out what D(z) will have to be in order to provide it. • We will find that a problem arises but it is not insurmountable.

  15. An example situation • We will re-examine our plant of transfer function • 40/(s2 + 10s + 20) • and we will try to work out a controller D(z) which will produce a unit step-response following a nice gentle first-order exponential. • We will use a time constant of 0.4 second.

  16. Our intended step-response 1 0.8 0.6 Amplitude 0.4 0.2 0 0 0.5 1 1.5 2 Time (secs)

  17. Converting the plant T.F. to z • We enlist the aid of MATLAB and ‘c2dm’, entering • num=40; • den=[1 10 20]; • [npd,dpd]=c2dm(num,den,.1) • and we obtain

  18. The digitised plant T.F. • npd = • 0 0.1449 0.1038 • dpd = • 1.0000 -1.2435 0.3679 • So the TF of plant + hold is • (0.1449z + 0.1038)/(z2 - 1.2435z + 0.3679)

  19. The digitised plant TF - Continued • or since it is (apart from MATLAB) usually more convenient to use negative powers of z • (0.1449z-1 + 0.1038z-2)/(1 - 1.2435z-1 + 0.3679z-2)

  20. The required closed-loop T.F. • Input = unit step converting to z/(z - 1) (from tables) • Output = 1 - e-t/0.4 • Another ‘bout’ with the tables produces • Output(z) =

  21. The required C.L.T.F. -- Continued • Which becomes with Ts = 0.1 second • And we divide by the input z/(z - 1) to give the CLTF • 0.2212/(z - 0.7788)

  22. Now for the required D(z) • We do a DG/(1 + DG) act again: • DG/(1 + DG) = 0.2212/(z - 0.7788) • and by rearranging • DGz - 0.7788DG = 0.2212 + 0.2212DG • and • D = 0.2212/[(z - 1)G]

  23. And now for D(z) ... • G(z) was • (0.1449z + 0.1038)/(z2 - 1.2435z + 0.3679) • so by rearranging, D(z) becomes • 1.5267 - 1.8985z-1 + 0.5616z-2 • ------------------------------------- • 1.0000 - 0.2833z-1 - 0.7167z-2 • We will try this in SIMULINK ....

  24. The resulting step-response 1.5 1 0.5 0 1 2 3 4 Time (second)

  25. Not quite as intended ! • Oh dear ! There is a slight wobble on the plant output ... • ... and a much worse one from the controller. • Let us examine D(z) again.

  26. The Ringing Pole • The denominator of the controller transfer function was calculated by: • (z - 1)(0.1449z-1 + 0.1038z-2) • The second bracket is zero when z = - 0.72 • So the controller has a pole at z = - 0.72 • This is a Ringing Pole .. a Bad Thing

  27. The s- and z-planes • We remember that in s ... • ...poles with positive real parts meant unstable systems, and .. • ...poles with non-zero imaginary parts meant systems with overshoot. • What is the situation in z ?

  28. This one may be ignored by non-mathematicians ... • We think of s as a + jw • Normally a > 0 means instability • For z, e(a + jw)Ts = eaTs x ejwTs • De Moivre: ejwTs = cos(wTs) + j sin(wTs) • so its magnitude is 1. • And |z| > 1 if a > 0 • So for stability |z| < 1.

  29. Rules of the z-plane • Systems with all their poles inside a circle of radius 1 unit centred on the origin -- the Unit Circle -- are stable. • Again, poles off the real axis indicate step overshoot. • Additionally, poles with negative REAL parts indicate oscillatory behaviour at half the sampling frequency. • We avoid them at all costs !!!

  30. “Oh, my controller is ringing !” • What we need to do to stop it is to replace the offending bracket by an equivalent static gain. • Not as difficult as it sounds • Calculate the gain by putting z = 1 ... • ... and keep the most positive (or least negative) power of z.

  31. “The bell is removed ... ” • We start from 0.1449z-1 + 0.1038z-2 • Putting z = 1 gives 0.2487 • Reinstating the z-1 gives 0.2487z-1 • The complete controller T.F. becomes • 0.8894 - 1.1062z-1 + 0.3273z-2 • ------------------------------------ • 1 - z-1 • This one works much better

  32. Response - no ringing pole 1 0.8 0.6 0.4 0.2 0 1 2 3 4 Time (second)

  33. The Kalman Controller • “Back to basics !” • nth-order systems can be made to settle in n sampling intervals • For a second-order, we could regard the first interval controller action as the “accelerator” and the second one as the “brakes”.

  34. Producing a Kalman Controller • We start with the plant transfer function in z ... in our example: • (0.1449z + 0.1038)/(z2 - 1.2435z + 0.3679) • and we make the coefficients in the numerator add up to 1 (known as ‘normalising’ the T.F.) • We do this by adding the 0.1449 and the 0.1038 together, giving 0.2487 ...

  35. The Kalman -- Continued • ... and dividing top and bottom of our T.F. by that number. • The plant T.F. becomes • 0.5825z-1 + 0.4175z-2 • ------------------------------------ • 4.020 - 4.9995z-1 + 1.4790z-2 • and we regard it as P(z)/Q(z).

  36. Nearly to the Kalman ! • It turns out that the controller TF should be Q(z)/[1 - P(z)] ! • So it will be • 4.020 - 4.9995z-1 + 1.4790z-2 • ----------------------------------- • 1 - 0.5825z-1 - 0.4175z-2 • and we duly test with SIMULINK ...

  37. The response with the Kalman 4 3 2 1 0 -1 0.2 0.4 0.6 0.8 1 Time (second)

  38. Why don’t we always use the Kalman ? • It depends on a good plant model being available (and the plant dynamics not changing) in order to work well • A heavy controller action is usual unless we sample slowly enough to encounter aliasing problems -- we will revisit this problem in the lecture on ‘Practicalities’

More Related