Pico Does PID
By Al Williams
If you wanted to, say, control a temperature you might think you could just turn on a heater until you reach the desired temperature and then turn the heater off. That sort of works, but it is suboptimal — you’ll tend to overshoot the goal and then as the system cools down, you’ll have to catch up and the result is often a system that oscillates around the desired value but never really settles on the correct temperature. To solve that, you can use a PID — proportional integral derivative — loop and that’s what [veebch] has done with a Rasberry Pi PICO and Micropython.
The idea is to control an output signal based on the amount of difference between the actual temperature and the desired temperature (the proportional error). In addition, the amount is adjusted based on the long term error (integral) and any short term change (the derivative). You can also see a video about using the control loop to make a better sous vide burger, below.
PIDs are useful for things other than temperature control, of course. They generally apply to any (usually linear) process where a control value influences some other value. For example, we’ve seen robots use PIDs to follow a line. Some use them for balance, too, or you can balance a ball.
January 14, 2022 at 07:00AM
via Blog – Hackaday https://ift.tt/3rbOiVE