Notices
Results 1 to 5 of 5

Thread: PID controllers

  1. #1 PID controllers 
    Forum Freshman
    Join Date
    Apr 2013
    Posts
    57
    Hi everyone. I need a little help on PID controllers. We have a project that requires us to make a water level sensor using PID controller. We can't use a controller IC and instead have to built one using op amp IC. Unfortunately we have not reached the part of the course where we study PID controllers so it is difficult. I have read on the internet about the theory of the PID but i don't think i understand much of it. What i do know is that the Proportional part multiplies the error signal with a constant, the Integral takes the sum of all previous values of error signal and adds them then multiplies with a constant, and the Differentiator finds the rate of change of error signal and multiplies it with a constant. Now here's my dilemma: how in the world do i use this knowledge to control the water in my tank? I know i will use a sensor along with a reference voltage and sum them up to get the error signal and the output of the PID will control my motor. But how will i adjust the reference voltage? and how do i set the circuits for Proportional Differentiator and Integrator?
    Thanks in advance and have a nice day.


    Reply With Quote  
     

  2.  
     

  3. #2  
    Suspended
    Join Date
    Apr 2007
    Location
    Pennsylvania
    Posts
    8,822
    The reference voltage is the setpoint, which represents the level you want to maintain. When the signal representing the level is equal to the reference voltage, the error is zero. The level control system in a toilet tank is similar to a proportional controller, except it only works to fill the tank, not empty it. The valve is opened wide for maximum flow when the error is great, and flow reduces proportionally as the level approaches the setpoint. This kind of controller takes a fairly long time to reach the setpoint. It could benefit from some integral control which speeds up the response when an error exists for a long time, if you really cared about that. You can also increase the gain to speed up the response (this would be like having a bigger valve).

    The derivative part of your controller reacts to a rate of change. Suppose your controller is controlling the level at a certain setpoint, and there is a sudden change in the process. The controller will react to the rate of change, and turn it around quicker than a straight proportional controller would.

    Here is a reference that might help you tune the PID controller.
    http://en.wikipedia.org/wiki/PID_controller#Stability
    http://www.omega.com/temperature/Z/pdf/z115-117.pdf


    Reply With Quote  
     

  4. #3  
    Forum Isotope
    Join Date
    Feb 2012
    Location
    Western US
    Posts
    2,637
    Quote Originally Posted by fine View Post
    how in the world do i use this knowledge to control the water in my tank? I know i will use a sensor along with a reference voltage and sum them up to get the error signal and the output of the PID will control my motor. But how will i adjust the reference voltage? and how do i set the circuits for Proportional Differentiator and Integrator?
    Thanks in advance and have a nice day.
    You have a tough challenge! Without the necessary background, it's difficult to produce a stable controller. The best we can do is offer generalities. The rest will be "cut and try," I'm afraid. I would recommend reading The Art of Electronics by Horowitz and Hill as one source. There are many, many others on control theory, but their brief treatment is highly readable for beginners.

    In (negative) feedback systems, the higher the gain, the better, until instability sets in. More gain simply means that the system reacts with higher precision to any error between the setpoint and the measured result. But any finite gain allows finite error.

    Integrals, being what they are, give us infinite gain if we wait long enough. That property drives the steady-state error to zero.

    The derivative term provides a first-order extrapolation to the future from the present. This allows your controller to compensate for delays in response associated with any other dynamics, leading to a stable solution.

    These three terms all interact. Increasing the P term reduces error and increases bandwidth, but also increases the likelihood of instability. Increasing the D term can help buy back stability, but since it only performs a first-order extrapolation to the future, it is limited in what it can do.

    Good luck!
    Reply With Quote  
     

  5. #4  
    Forum Professor
    Join Date
    Aug 2013
    Location
    San Diego
    Posts
    1,969
    Quote Originally Posted by fine View Post
    Hi everyone. I need a little help on PID controllers. We have a project that requires us to make a water level sensor using PID controller.
    Well, a sensor can't be a "PID controller." A typical control system senses a process variable (like the level of water in a tank) compares it to a reference and then drives a manipulated variable (like a pump or a valve.) There are a great many ways to do this, and they vary based on sensor (proportional? on/off?) output (on/off pump? proportional control of valve?) design goal (fastest fill? most accurate level control?) and desired design (analog? digital?)

    how in the world do i use this knowledge to control the water in my tank? I know i will use a sensor along with a reference voltage and sum them up to get the error signal and the output of the PID will control my motor. But how will i adjust the reference voltage? and how do i set the circuits for Proportional Differentiator and Integrator?
    Do you want to do this in the analog or digital world? If it's analog, then your setpoint will be a voltage reference, or a pot connected to a voltage reference to make it variable. You can implement all three terms via single op-amps and then sum them with a fourth op-amp. (Schematics to do this are readily available on the net, like this one -> The Op Amp PID Controller

    If it's digital, then choose a microcontroller (Arduino and Raspberry Pi are two popular and easy-to-get controllers) choose an input conditioner (usually an A/D converter with some kind of signal conditioning) and an output means (like a PWM control.) Then it's all software, which again is readily available on-line. http://www.google.com/url?sa=t&rct=j...74115972,d.cGE - good starting point.
    Reply With Quote  
     

  6. #5  
    Forum Freshman
    Join Date
    Apr 2013
    Posts
    57
    Thank u all so much for your help, everything said by everyone is very helpful and reassuring that I can do it. I might ask for more help after I start work. Thank you all
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •