frc2399 / 2022-Season

This is our NEW repository for the 2022 Season.
Other
0 stars 5 forks source link

Calibrate drivetrain encoders #106

Open edf42001 opened 2 years ago

edf42001 commented 2 years ago

Two methods:

1) Using gear ratio, wheel radius, and encoder ticks per rotation, calculate inches per encoder tick 2) Gently push the robot a known distances, with a tape measure. Record the change in encoder ticks from the start-end. Use this to calculate inches per encoder tick.

Method two is better, because it takes into account things like wheel squish, slight inaccuracies in wheel radius, etc.

The value for inches / encoder tick can be set with the SparkMax or SparkMax Encoder methods, not sure which.

Currently the getRightEncoderPosition and left, convert rightEncoder.getPosition() from meters to inches, but if we calibrate it in inches, that is not needed. (Still needed for sim though)