# More Z transforms.

I was trying to convert a transfer function from the s to the z domain. The transfer function is (G*a*b*c*d)/((s+a)*(s+b)*(s+c)*(s+d))
I tried partial fractions using Mathcad but the result is too big on the worksheet. I have tried some tricks to keep the expression simple so it would fit on the work sheet, but it still is big and complex. It seems that the simple way to do this is to use cascaded first order single pole filters with the ZOH applied to the first filter only.
Does anyone have a better idea? Are there tables with all the different conversions up to fourth order. Tim Wescott said that with partial fractions, each equation can be broken down to first order equations if one is will to use complex poles, but I have found that to be impractical. What about applying the ZOH to the first filter only. I used matched z transforms for the other stages. Otherwise there is a delay in the output for each filter which doesn't seem right. So what is right?
The text books don't say too much about higher order transfer functions.
Peter Nachtwey
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Peter Nachtwey wrote:

So _that's_ why my ears were burning.
When you get very large at all the symbolic results get very unwieldy (as you just found out).
If your cascading scheme is to find the z transform of the first filter/ZOH combination, then tack on the direct z-transform of the next, etc., then it won't work. When you do direct z transforms the poles of the system are preserved, but the ZOH plus the transform make the zeros move around in strange and mysterious ways (or at least mathematically complex ones).
If you can stand not getting symbolic results you can do this numerically. Matlab will do this for you if you spring for the control system toolbox, MathCad will do a fine job of this in state-space but 2000 won't do it nicely with transfer functions. There's a nice Matlab-like application called SciLab that is free, and does a very good job -- you describe a system with a transfer function, convert it to continuous-time SS, then you can discretize it, then back to a transfer function.
The text books don't say much partially because if you can do it with 1st- and 2nd-order functions then you have the tools to do it with any discrete-state system and partially because the generalizations aren't easy any more.
--

Tim Wescott
Wescott Design Services
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>

on
way
to
different
complex
So what is the solution? What is wrong with appling ZOH to the first stage and using a matched Z for the other poles. A matched z transform does not add any zeros or delays but then why should it in this case as the other 3 stages are not sampling?

State space works in the text books. In my applications the sample time is 1 millisecond or shorter. Using the state space solution is similar to implementing the filter in one big filter instead of biquads. This results in rounding or precision errors. The zeros of a state space solution have coefficients that are very low compared to the pole coefficients. There are round off errors when using a 32 bit DSPs when the order of magnitudes be the pole and the zero coefficients are big. I think the cascaded one or two pole filter is much more error resistant.

That isn't an answer. They mention only partial fractions and those solutions get to be to big. I will try up scilab. DSP programmers know that filters should not be bigger than a biquad to avoid the errors. Mathcad can work out solutions that can't be implented as it will provide 20 digits of precision which a real DSP can't.
What I really want to know is should the ZOH be applied to only the first filter that does the sampling and what should be done with the other cascaded stages?
Peter Nachtwey
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
Peter Nachtwey wrote:

What are you trying to do? If you're designing controllers in the s-domain and implementing them in the z-domain then you aren't going to get exactly the right behavior anyway, and you'll have to tune it up when you're done, so you may as well use some approximation, and yours is as good as any other.
The exact transform method that I described works for finding the z-domain behavior of a plant when you have it's s-domain model. It does _not_ give you a prescription for translating an s-domain controller to the z-domain -- that can only be done by approximation.

(a) I'm only talking about extracting the plant behavior, not finding a filter. The SS step is only a mathematical tool, not an implementation. (b) You can design your state-space controller so that numerically it is a series of biquads, if you feel so motivated. (c) Biquad implementations that feed both states back into the first have numerical problems, too. For highly resonant filters you're best with a state-space with a state matrix that goes like [d w; -w d]. This gives you numerical sensitivity equivalent to a pair of 1st-order filters in cascade.

Yes, but you can get transfer functions and then get partial fractions numerically.

Again: What are you trying to do? Applying a ZOH and doing a conversion is what you do to get a _plant model_, then you do your design in the z domain and everyone is happy. Taking an s-domain controller model and transforming into a z-domain controller will be an approximation no matter what you do, you'll need to fine-tune anyway, so why sweat it?
--

Tim Wescott
Wescott Design Services
<% if( /^image/.test(type) ){ %>
<% } %>
<%-name%>
I am not an engineer, so do not see any problem. Let your function be expanded as A/s+a + etc and obtain A(s+b)(s+c)(s+d) + etc = Gabcd; set s=-a, A=Gabcd/(b-a)(c-a)(d-a) and similarly obtain B, C, D. Then, all you need to know is how to transfer K/(s+k) to the z-domain, which is in all your tables.
Am I being naive here? Assumed is that all of a,b,c,d are distinct. Have I used, in my working, the equivalent of cascaded first order single pole filters (the expansion) and then put the ZOH, whatever that is, to the first filter only (s = -a)?
Cordially, Phil
PS I teach large engineering classes and try to get them to think "outside" their software packages and do a bit of "preprogramming", AKA commonsense and thinking.

-- ############################################################################### Dr Phil Diamond snipped-for-privacy@maths.uq.edu.au Department of Mathematics, University of Queensland, Brisbane,AUSTRALIA 4072. Tel +61 7 3365 3253 Fax +61 7 3365 1477