I really appreciate that DigiKey is paying for videos like this to be made, it doesnt directly support sales of a particular product or even a direct tie in with DigiKey themselves. Just informative videos to garnish good will and brand recognition. This sorta stuff makes me want to purchase from DigiKey and/or refer to colleagues more than any product/brand specific videos would. As usual, another great video from Shawn Hymel
I have been doing a PID controller for a reflux system for the last year. This is a great intro. There is only one more item I would add, being 'windup' handling. It can be the difference between controllable and not at all. I have never used a derivative but it is meant to be handy for speeding the approach to setpoint. For my use, a slow and steady approach with a well tuned integral wins by a long way.
A usefully instructive video for getting from theory to practice. As an aside... Float variables are quite slow on AVR Arduino. Scaled integers are much faster, which can be significant in reducing controller loop delays. Such delays can wreak havoc in real world systems as they are significantly variable, depending on the values of variables and therefore difficult to tune out.
Good to know there's interest. It should be fairly straightforward to implement in micropython--the Python code for the PID controller should be the exact same. The only think you need to change is the encoder reading and stepper motor control.
This was great, but I would have expected you to disturb the pendulum while it was stable, by giving it little bumps, and see how it reacted. Also would have been nice for a bigger screen to see the pendulum better.
Thank you Shawn and Digikey. The two part series was very good. Question: what if the PID controller is to operate the supply of CO2 within a Grow Tent (CO2 can help plants grow 30% more)? Here we deal with not only fans blowing around, but the distribution of CO2 through a cylinder within a room distributed with plants ?
If the CO2 and fans operate together, you can use a single PID controller that has one output. If they need to operate separately, then you likely need two different controllers or look for a more advanced Single Input Multiple Output (SIMO) or Multiple Input Mulitple Output (MIMO) control scheme.
Integral sums the errors as a term. Proportional is error times a constant as a term. Sampling interval being equal make it easy to calculate integral with just a summation.
@@rasimbot Someone else in the comments mentioned integral windup. If your system never reaches your target value the integral term just keeps getting larger and larger and this is know as windup.
@@rasimbot That is one possibility. I don't know how well it would work. Worst case your buffer contains a bunch of huge error values. Looks like there are many ways to handle integral windup based on Google searches. In some cases, the techniques are proprietary and not published. Ultimately, you could try a bunch of different techniques and plot your system response to see how quickly it settles.
Does anybody just want to get out there bat 🏏and pretend this guy is the printer in office space? I've received this advertisement on my RUclips feeds at least 100 times..
I really appreciate that DigiKey is paying for videos like this to be made, it doesnt directly support sales of a particular product or even a direct tie in with DigiKey themselves. Just informative videos to garnish good will and brand recognition. This sorta stuff makes me want to purchase from DigiKey and/or refer to colleagues more than any product/brand specific videos would. As usual, another great video from Shawn Hymel
Honestly some of the best ads I've ran across. I appreciate them too!
Thank you, Digikey team and Shawn Hymel for this nice introductory instruction guide for PID controllers tuning.
Thanks Digikey for these educational videos! This tips the balance of why I will buy parts for work from Digikey as opposed to the competitors.
I have been doing a PID controller for a reflux system for the last year. This is a great intro. There is only one more item I would add, being 'windup' handling. It can be the difference between controllable and not at all. I have never used a derivative but it is meant to be handy for speeding the approach to setpoint. For my use, a slow and steady approach with a well tuned integral wins by a long way.
While derivative can speed up reaction time, it is not well suited with high frequent errors going up and down. It needs a clean signal to work well.
A usefully instructive video for getting from theory to practice.
As an aside...
Float variables are quite slow on AVR Arduino. Scaled integers are much faster, which can be significant in reducing controller loop delays.
Such delays can wreak havoc in real world systems as they are significantly variable, depending on the values of variables and therefore difficult to tune out.
What a complete introduction to PID control. Thanks!
Nice little "Great Scott" shout-out at the beginning 🙂
this is such a great video! you explained the concepts so well! great effort :D
Well presented tutorial Shawn, very informative. Question, what if Kp was a negative number, what would be the effect of the PID?
It would be fun to replace the rotary encoder with imaging. Great video!
Thank you for the great content ❣
So cool! Will we ever see a micropython version?
Good to know there's interest. It should be fairly straightforward to implement in micropython--the Python code for the PID controller should be the exact same. The only think you need to change is the encoder reading and stepper motor control.
This was great, but I would have expected you to disturb the pendulum while it was stable, by giving it little bumps, and see how it reacted. Also would have been nice for a bigger screen to see the pendulum better.
I love you. I like to watch all your videos
Cool!!!
Would you mind sharing the python code?
Thank you Shawn and Digikey. The two part series was very good. Question: what if the PID controller is to operate the supply of CO2 within a Grow Tent (CO2 can help plants grow 30% more)? Here we deal with not only fans blowing around, but the distribution of CO2 through a cylinder within a room distributed with plants ?
If the CO2 and fans operate together, you can use a single PID controller that has one output. If they need to operate separately, then you likely need two different controllers or look for a more advanced Single Input Multiple Output (SIMO) or Multiple Input Mulitple Output (MIMO) control scheme.
This is so good
Is integral just another proportional if intervals are equal?
Integral sums the errors as a term. Proportional is error times a constant as a term. Sampling interval being equal make it easy to calculate integral with just a summation.
@@danhtrinh1769 | Is it possible integral is drifting away due to floating point error?
@@rasimbot Someone else in the comments mentioned integral windup. If your system never reaches your target value the integral term just keeps getting larger and larger and this is know as windup.
@@danhtrinh1769 | What if you stored a certain number of recent errors in a buffer and calculated the integral over only the most recent data?
@@rasimbot That is one possibility. I don't know how well it would work. Worst case your buffer contains a bunch of huge error values. Looks like there are many ways to handle integral windup based on Google searches. In some cases, the techniques are proprietary and not published. Ultimately, you could try a bunch of different techniques and plot your system response to see how quickly it settles.
👍👍👍
Thanks so much for this great video! Top quality!
Does anybody just want to get out there bat 🏏and pretend this guy is the printer in office space?
I've received this advertisement on my RUclips feeds at least 100 times..
I am so so sick of your stupid inverted pendulum ad make a new one