How do PIDs work?

Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum

Help Support Homebrew Talk - Beer, Wine, Mead, & Cider Brewing Discussion Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

rocketman768

Supporting Member
HBT Supporter
Joined
Feb 5, 2008
Messages
1,083
Reaction score
28
Location
Evanston, IL
So, I am very familiar with PID control since I've taken a graduate course in control theory, but the outputs of the theoretical systems we play with are always analog values (continuously variable voltage or whatever else you want to imagine the units are). On the PID controllers I see, it seems the output is a relay of some sort, which tells me it's either full on or full off. Is this right? If I bought a PID controller, would I just rig it up with a relay to turn my mini fridge on and off?
 
I believe these controllers just turn on and off to control. I guess in that sense the proportional part of the controller is just on or off, but its been a few years since I did anything with a PID. I think a lot of consumer type products work like this because the circuitry to do true proportional control is a little more involved, i.e. a PWM output to vary motor speed on the compressor. And plus, I think most fridges are set up to run at their maximum efficiency and just cycle on and off anyway.
 
Yes, it is quite simply PWM output. Since things like refrigerators and heaters have very long time constants, the time scale of the output cycling is on the order of seconds (fine for a heater) to minutes (better for a fridge compressor)
 
Without knowing the specifics of your application or the specific controller you are looking at, I can only speak in general terms. PID controllers are analog devices which produce analog outputs (like you learned in class). To build an actual control system for an industrial application you would need to process the output in some way to run the output device typically an amp or a relay. If you were to build your own control system (i.e. purchasing the appropriate IC's and what not) then you could do whatever you wanted with the output. If you are buying something off the shelf the output will be processed in some way depending on the intended application of the device.

If you want to do temperature control on a fridge, PID control seems like a poor choice to me for a few reasons.

1. The compressor on a fridge should be run at 100% capacity or 0% capacity. This is a digital (binary) output. To do this you need to convert your analog output from the PID into a binary output which seems silly since there are other control systems which produce binary output as a default. You could do PWM, but this would be less efficient than running at 100%.

2. PID controllers can become unstable or oscillate if they are not tuned well. Repeatedly cycling a compressor can shorten the lifespan of the device. To effectively run the fridge you would need to really tune the control system well and I think you would still have problems (that is just my opinion based on building lots of control systems)

3. There are better, cheap, digital systems available to accomplish the desired task. For this type of temperature control, I personally would use an embedded microcontroller (there are many different systems available). Most systems have a built in ADC to convert your analog temperature input. You can easily customize you control system software to give better temperature control with minimal compressor cycling. Third your output is already binary (on/off), so you should only need a minimal amount of output signal processing to run you device. While I have never used the Arduino controller, but it looks like lots of people on this board are using it. I think there is even a thread were someone implemented a fridge temperature controller with it.

I noticed on your profile you have a Ph.D. in electrical engineering so I assume you realize there are many ways to implement a control system. I personally consider PIDs solely analog devices because that is how we treat them theoretically and that is how they were originally implemented. On the other hand, PID is also a control theory, where errors are corrected based on the current error, the sum of past errors, and the rate of change of error. The theory can be implemented easily on a digital device, but in my opinion this is not a true PID controller.

In any case I would love to hear more about you systems and if I can be of any help let me know.

Jake
 
Without knowing the specifics of your application or the specific controller you are looking at...

Thanks man. I agree that PID control is wrong for the fridge since I now know for certain that the compressor should be full on or full off. I should have opened up the thermostat on my fridge sooner, cuz now I can see it's just a relay that switches the compressor on or off...there is no in-between. I also know about stability issues and how to tune via root locus and bode plots. Thanks for offering help with a microprocessor too, but the reason I was looking at a PID controller is because I've found some on ebay for like $38 which also do on/off control (which is what I was confused about in my first post). I have made a temperature probe with display with an Atmega16 for maybe $15, and from there it is a short step to make any kind of controller you want, but the extra $20 it would cost to get the professional controller is worth all the soldering and packaging work I would have to do for my custom version to look nice and have a nice interface.

Now I just have to figure out how to rip my mini fridge apart to make it larger...dremel?
 
I have a strong hunch that most of the PID controllers which are advertised are actually not PID controllers. They are probably all microprocessor based given how they function and the fact that the cost of microprocessor based controls are probably less than actual analog PID controllers. The one downside to buying the control on Ebay is that you may spend more time and money getting it working in your system than it would cost to extend you existing device. I personally build almost all of my stuff from scratch, but I am very type A and I want (and need) control over every aspect of what we build. That and I have access to a very nice prototyping lab to cut my circuit boards.

Good luck with your project.

Jake
 
First, even analog PID controllers are only approximations to PID control, so microprocessor-based "PID" control doesn't really bother me. But secondly, you have a prototyping lab? If I sent you the PCB design, you could print the board? :)
 
Back
Top