On Tue, 24 Mar 2009 19:57:55 -0500, Suet wrote:
> Hi All
>
> I'm trying to implement some digital temperature control using a
> microprocessor, but I'm no DSP expert and I was hoping someone could let
> me know if I'm on the right track. At the moment I'm just using PI
> control, and the transfer function has the form:
>
> H(s)=1+1/s
>
> The way I get to a digital implementation is:
>
> 1) Use bilinear transform: s-> 2(z-1)/(T(z+1))
>
> 2) Rearrange everything into powers of z
>
> 3) Use the time translation property of z trans. (eg z^2 X(z) = x(n+2) )
> so that it's in a form that can be implemented using a recursive
> algorithm.
>
> I have some some simulations of the code and it all seems to work
> reasonably well. Ideally though I would like the transfer function to be
> of the form:
>
> H(s) = (1/s+1/(s+a)+1)
>
> But when I carry out the process above and run the simulation, I get
> rubbish results. Is there anything inherently wrong with the way I
> implemented it ? Or is there some problem with the ideal transfer
> function ?
>
> Thanks
> Fred.
I'm not sure how your results bad, so it's hard to say.
Your transfer function is second-order, but it can be an individual
proportional and integrator block. I'm not sure why you have the low-
pass block in there -- lead-lag?
For a simplified example of how to code a PID, see http://
www.embedded.com/2000/0010/0010feat3.htm.
For information on a book-length treatment that's still designed for the
practicing engineer, see
http://www.wescottdesign.com/actfes/actfes.html.
--
http://www.wescottdesign.com