With states coming up in about three weeks we want to re-do our skills auto to make it better. We have no experience with PID and want to know if its worth the time to learn how to code it, or use Double Inertial.
Here’s a good resource on PID:
introduction_to_pid_controllers_ed2.pdf (400.2 KB)
PID = move fast when far, move slow when close, plus move farther the more error you have accumulated, plus move farther when error is changing fast
Double inertial → where am i turning?
They do different things. Without context it’s hard to say which is the better investment.
My team and I utilize a PID loop for both our linear movements and our angular movements. However, the primary difference between the two is that for linear movements we use the integrated motor encoders, and for angular movements, we average 3 inertial sensors together.
To answer your question why not both? Use the inertial sensors to track the robot’s angle and use the PID loop to calculate how much voltage to send to the motors.
One of the primary resources I utilized while learning how to integrate a PID loop is this: C++ Implementation
The page in addition to showing how a simple PID loop works also shows how to integrate an anti-integral windup, output clamping, and derivative filtering if you are interested in improving the loop further.