Click to see the message board for discussions!

Showing posts with label PID Controller. Show all posts
Showing posts with label PID Controller. Show all posts

Wednesday, December 1, 2010

How to implement PID controller !

So here it is guys!

PID Controller Implementation.

Lets start with the implementation assuming that all of you have good knowledge of PID theory. If not, then there are lots of book and material available on the internet.

There are two ways to build a controller:

-Analog controller
-Digital Controller

Lets just stick to analog controllers at this moment.


Analog controllers

Analog controllers are usually build using traditional operational amplifiers

Design 1: Ideal PID algorithm

Below is a simple inverting amplifier.




The equation (transfer function) of this amplifier is

 V2 / V1 = – Z2 / Z1

Now replacing Z1 and Z2 with a resistor and capacitor, we have the following op amp below.


Using some ECA (Electrical Circuit Analysis) , we have

V2 / V1 = – {(Rf / Ri + Ci / Cf) + (1 / RiCfD) + (RfCi) * D} = – {Kp + Ki / D + Kd D}

Hence the PID controller is :

PROPORTIONAL GAIN is Kp = (Rf / Ri + Ci / Cf),
INTEGRAL GAIN is Ki = (1 / RiCf), and
DERIVATIVE GAIN is Kd = RfCi.
Choosing the right values of the resistors and capacitors will lead to a better controller.


Design 2: Parallel PID algorithm

This is the best method to implement the controller since it is very robust and easily tunable. Below image summarizes how it works.



This is how it is implemented,


PROPORTIONAL GAIN is KP = (R2p / R1p),
INTEGRAL GAIN is KI = 1 / (R1i C1i), and
DERIVATIVE GAIN is KD = (R1d C1d), and
CASCADED GAIN is KC = (R2C / R1C).

You can easily use variable resistors and capacitors to get a tuned response.

Design 2: Series PID algorithm

Here the controller is a product of PI controller and PD controller. Following is the diagram:


The PID controller:
PROPORTIONAL GAIN is KP = (R2i R2d / R1i R1d + R2d C1d / R1i C1i),
INTEGRAL GAIN is KI = R2d / (R1d R1i C1i), and
DERIVATIVE GAIN is KD = (R2i R2d C1d) / R1i.
---------------------------------------------------------------------------------------------------------------

So guys, this was short tutorial on how to implement a PID controller using an op amp.
For detailed information, derivation and an implemented example please see this.

Please let me know what you think about this post! Do comment.


Have fun.

 
  • About the author

    Hi , thank you very much for visiting my blog. I'm Qaiser, creator of Mechatronics Heaven. This blog is meant to help mechatronics engineers and provides a free knowledge sharing portal. Contact me if you have any questions or suggestions.
  • Consectetuer

    Hello
  • Popular

  • Comments