|
Re: Maintaining perfect control of mecanums using encoders?
Start by learning about PID... there's a good paper you can google, "PID without a PhD". Once you understand how it all works, implement it using the PIDController class. Basically, you set the various values, give it the input and output, and tell it how fast you want the motor to turn. If set up properly, it does the rest and "figures out" how fast to tell the controller to go in order to get the desired final speed, per the encoder feedback.
Also a small note... the bias you saw wasn't due to the controllers. It was caused by forward bias in the motors themselves. Every motor has a direction it "prefers" to travel in (based on the design of the motor). As a result, when you set up a robot so that driving forwards involves sending some motors in a clockwise fashion and some in a counter-clockwise fashion, even if you apply the exact same power to every motor you won't go perfectly straight.
For this reason, PID can be helpful with driving for all sorts of drive trains, not just Mecanum (although I think it's most noticeable with Mecanum).
__________________
2007 - Present: Mentor, 2177 The Robettes
LRI: North Star 2012-2016; Lake Superior 2013-2014; MN State Tournament 2013-2014, 2016; Galileo 2016; Iowa 2017
2015: North Star Regional Volunteer of the Year
2016: Lake Superior WFFA
|