PID sensors/tips

Hello, next year is my last year of vex robotics and I wanted to do it right with some sort of PID on the drivetrain. I’ve never done this before and I was wondering what kind of sensors I would need and any tutorial recommendations would be appreciated. I was also curious what the difference between PID and odometry was?

Thanks

1 Like

So excited to hear you want to do sensors!

You definitely have a few options, although afaik PID is more of a control loop rather than an actual tracking mechanism (it can certainly be paired with sensors of relative information to account for compounding error). You are probably more likely to use PID to make your robot actually stop where it thinks it is.

Odometry uses multiple rotation-tracking encoders (be it the internal motor encoders, quadrature shaft encoders, or rotation sensors) to measure arcs that the robot moves through in small-step intervals of time to track the change in position. This is relative sensing though so watch out for compounding error – ping those sensors fast!

TL;DR: Odometry requires fewer physical sensors but more complex code and is a form of relative sensing

You could also use absolute positioning via vision sensors (risky but go ahead and try it, could be kinda cool), ultrasonic range modules, or distance sensors (have fun with IR absorbance then). This has worked incredibly well for me but requires a ton of ports and absolutely destroys your battery – I easily kill 1% in less than a minute sitting idle.

TL;DR: absolute position tracking is great for avoidance of error but is physically costly.

If you avoid odometry, you will have to still measure the angular position of your robot using something like an inertial sensor or the old yaw rate gyroscope. If used correctly, this can be great with an absolute positioning system.

Whatever you choose, best of luck!

2 Likes

Lots of resources by just searching google or the forum

Odometry

Odometry - BLRS Wiki
What is Odometry? - #19 by DylanMashini
What is Odometry? - #23 by tabor473
https://www.youtube.com/watch?v=GEZBYHVHmFQ
Uses either “odom pods” (extra wheels mounted on your robot connected to rotation sensors) or your built-in motor encoders and an inertial sensor

PID

PID Controller - BLRS Wiki
VEXCode PID Tutorial
https://www.youtube.com/watch?v=_Itn-0d340g

4 Likes

Thanks a lot, I definitely have a lot to read and learn.

2 Likes

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.