Connect with us

Mixed controller design

Discussion in 'Electronic Design' started by Marco Trapanese, May 10, 2007.

Scroll to continue with content
  1. Hello!

    I measured the step response of a system. Now, I can find the transfer
    function H(s) as a first or second order approximation. Then I'm able to
    select the right gains for the PID controller.

    The PID itself is implemented into a microcontroller, so it has an ADC
    on the input and a DAC on the output.

    I don't understand if I can create the PID transfer function in s-domain
    G(s) and then convert to z-domain to find the new kp, ki, kd or I have
    to convert the whole H(s) to H(z) and then discuss about the PID (in

    Another question: to convert either H(s) to H(z) or G(s) to G(z) may I
    use the Tustin approximation?


    I read this on the "Applied Control Theory for Embedded System" by Tim
    Wescott (who I thank for his suggestion to buy the book!) but I'm not
    sure about "[the Tustin approximation] is generally useful [...] when
    you are converting an inherited analog controller to digital".

    Marco / iw2nzm
  2. Tim Wescott

    Tim Wescott Guest

    You can do either. I prefer to model the system in the s domain, then
    transform it into the z domain. If you do this right it'll take the
    behavior of the DAC into account -- see the section titled "Exact" (which
    should say "Exact Models") starting on page 179 in my book.

    This doesn't matter much if you're sampling really fast, or if you know
    you're going to do tuning once you get the thing into the sampled-time

    You can also find the P, I and D gains in the continuous time domain, then
    construct a controller with those same gains in the sampled time domain.
    This keeps your controller parameterized in terms of its gains, which is
    helpful for future tuning.
    Yes you may. The only downside to converting your plant model is that the
    Tustin approximation always gives you an improper fraction in z, where the
    leading term of the numerator is of the same order as the leading term of
    the denominator. This doesn't matter too much for your controller, but
    the model of the plant would imply an instantaneous response, which is
    absurd given that in reality the write to the DAC happens strictly after
    the read from the ADC. You can fix this by just dividing by an extra 'z',
    or ignoring the fact that the plant polynomial isn't realizable and
    getting on with life.
    That refers to a situation where you may be you may be tasked with taking
    an analog controller that works just fine and converting it to a digital
    controller. In such a case you can extract the analog controller's
    s-domain transfer function, use the Tustin approximation to convert it to
    digital, then implement your digital controller.

    In the early days of digital control, and to a great extent now, the
    procedure was to design a controller in the s domain even though you had
    no intention of implementing a continuous-time controller. When you were
    happy with it, you'd convert it to z. This is the right thing to do
    if you are significantly more comfortable in the s domain than z, but I
    think it's better overall to get comfortable in the z domain and do all
    your design there -- this slant is _quite_ discernible in my book, if you
    know what to look for.

    I'm glad that you're finding the book helpful. I've recently expanded the
    errata, so you may want to check the book's page on my web site. I hope
    to be putting interesting things in the addenda as well, but I'm buried in
    work at the moment -- look at it every month or so for developments.

    Tim Wescott
    Control systems and communications consulting

    Need to learn how to apply control theory in your embedded system?
    "Applied Control Theory for Embedded Systems" by Tim Wescott
  3. Well, so for simple systems it's better to use the 'extact model'.
    Now I understand!

    I'll check on your website for errata and updates, thanks.

    I think your book is very useful because it shows the whole world of the
    system control (for embedded system, of course :) ) using few words for
    each concept. Once one read it, one knows problems and some solutions
    and then can study more detailed books for the specific concept.

    Marco / iw2nzm
Ask a Question
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.
Electronics Point Logo
Continue to site
Quote of the day