hi im Ranchsauce2456 and our team wants to program our robot for autonomous. I read somewhere taht pid and ODOm are good for doing this. Which ones better?
… is a question I’ve heard many times from newer teams. So let’s have a crack at answering this question. (Spoiler: It’s neither!)
To first answer our question, let’s first take a look at what Odometry and PID actually are.
Odomometry (Shortened to Odom colloqually)
Odometry is some sort of system to keep track of a robot’s position on the field, as well as their heading. Similar to a GPS in a car, the algorithm for odometry should return the position of the robot at a given moment. This is important information for a robot’s program, as knowing this position could allow a program to determine what the robot’s next action is.
#Odometry Implementations
There are a couple different ways to implement odometry, dependant on a team’s needs.
Tracker wheels
(Image courtesy of technik) Position Tracking Wheels Mechanism - #16 by technik3k
Tracker wheels independent of powered wheels are used commonplace as a way to track position in X and Y. 2 tracker wheels with encoders attached to the bottom of a robot can track a position of a robot as a
One question at this point might be, “well, why not just use the integrated motor encoders”? While this may work in an ideal world, there are still physical issues with this integration, as wheel slippage may cause inaccuracies with odometry which have lead teams to develop this method instead.
Here are some good resources on wheel based odometry:
The GPS Sensor
(Image Courtesy of the VEX KB)
The GPS Sensor acts as a plug and play odometry sensor. It requires a field strip to work, but is much more compact of a solution and easier to implement than wheel based odometry. However, it must be noted that one definently learns less from using a GPS sensor and the GPS is much more expensive. Similarly to wheel based odometry, you get a millimeter-accurate coordinate and heading for the robot’s position on the field if configured correctly.
Here’s an article on the GPS Sensor if you want to know more:
https://wiki.purduesigbots.com/vex-electronics/vex-sensors/smart-port-sensors/vex-gps-sensor
PID
PID is a motion control algorithm. It uses 3 different constants (hence the P, I, and D) to speed a robot and slow a robot down as it reaches a certain target position, so it may accurately get to a certain position. This not only can apply to robot drive trains, but also lifts which may require PIDs to slow down gradually instead of suddenly. Back before motor.stop() was available on all v5 programming platforms, PID was also used to hold lifts at a certain position…
… in fact, that’s what VEX’s built in algorithm for stopping the motor at a certain position uses: A PID algorithm (albeit, a bit modified).
For implementation specifics and such, please check out these resources below:
Conclusion
The main difference between PID and Odometry is that PID is a way of controlling the robot, while Odometry is a way of tracking a robot’s position. This makes comparing them a fruitless task, as it is comparing apples to oranges (no pun intended).
With this being said, the reason why PID and Odometry is mentioned so much is because both are usually used together to create an accurate autonomous program. Odometry tracks the position of the robot in the background during autonomous, and a script containing movements that use PID to direct the robot to certain coordinates while using information obtained by the odometry system as feedback.
Hope this post was helpful,
- RanchSuace