This page (revision-25) was last changed on 2021-11-08 09:09 by Murray Altheim

This page was created on 2019-12-22 08:01 by Murray Altheim

Only authorized users are allowed to rename pages.

Only authorized users are allowed to delete pages.

Page revision history

Version Date Modified Size Author Changes ... Change note
25 2021-11-08 09:09 8 KB Murray Altheim to previous
24 2021-06-24 22:52 8 KB Murray Altheim to previous | to last
23 2021-01-23 22:25 8 KB Murray Altheim to previous | to last
22 2020-09-27 01:11 8 KB Murray Altheim to previous | to last
21 2020-09-27 01:11 8 KB Murray Altheim to previous | to last

Page References

Incoming links Outgoing links

Version management

Difference between version and

At line 11 added one line
On a typical robot with a motor on the left and a motor on the right side, to go forward one motor will be going clockwise, the other motor counter-clockwise. It's entirely typical of DC brushed motors to have a difference in performance in each direction, so it's entirely typical that such a robot will not run in a straight line. So having motor encoders and a PID controller is __exactly__ how one fixes this problem.
At line 13 added 3 lines
See: [PID Rug Bump Challenge|PIDRugBumpChallenge], [Robot Chassis Dynamometer|RobotChassisDynamometer]
At line 25 changed 2 lines
|| Integral Term | integrates the error value into the correction over time so that it minimises this overshoot and pushes the output towards the target value. | the amount of integral applied to the formula needs to be carefully tuned, otherwise this can create its own form of oscillation. Given this tuning is quite tricky to get right, there is generally some overshoot and therefore oscillation in a PI controller.
|| Derivative Term | projects the rate of change of the corrective value, and reduces its amount as the system nears the target. This allows the controller to move towards its Set Point as fast as possible, with as little oscillation as possible. | the Derivative Term is intended to smooth the operation of a PI Controller, but the value of the Derivative must also be tuned.
|| Integral Term | integrates the error value into the correction over time so that it minimises this overshoot and pushes the output towards the target value. | the amount of integral applied to the formula needs to be carefully tuned, otherwise this can create its own form of oscillation. Given this tuning is quite tricky to get right, there is generally some overshoot and therefore oscillation in a PI controller. If the PID controller is used for position control the I term is used; for a motor controller the value is set to 0 since it actually represents the position of the motor if we're sampling at a fixed rate.
|| Derivative Term | projects the rate of change of the corrective value, and reduces its amount as the system nears the target. This allows the controller to move towards its Set Point as fast as possible, with as little oscillation as possible. | the Derivative Term is intended to smooth the operation of a PI Controller, but the value of the Derivative must also be tuned. If either the P or D are too high it can cause the system to oscillate.
At line 28 changed one line
The more I read about PID controllers the more I found that tuning the Integral and Derivative control terms is considered something of a black art. There are a number of constants in the formula, and tweaking them is done by trial and error, in other words: guessing.
The more I read about PID controllers the more I found that tuning the control terms is considered something of a black art. There are a number of constants in the formula, and tweaking them is done by trial and error, in other words: guessing. I did
learn one rule of thumb for a PD controller: start at three zeros, then turn up the P until it oscillates, then back off to half that value. Then do the same thing with D.
At line 53 added one line
* __[PID Controller|https://en.wikipedia.org/wiki/PID_controller]__ from Wikipedia (note the animation of adjusting P,I,D values in the ''Manual tuning'' section)
At line 49 changed one line
* [PID Autotune|https://platformio.org/lib/show/3/PID-AutoTune] by Brett Beauregard
* __[PID for Dummies|https://www.csimn.com/CSI_pages/PIDforDummies.html]__
At line 57 added one line
* [PID Autotune|https://platformio.org/lib/show/3/PID-AutoTune] by Brett Beauregard (C++)