ARMS
3.1.1
Documentation for ARMS movement library
|
Figuring out the right ARMS configuration for your robot is not always easy. On this page are guides on some of the more complicated parts of this process. It is recommended to follow these guides in order.
TPI
: While this will require further tuning later, we can calculate TPI initially as TICKS_PER_REVOLUTION / WHEEL_CIRCUMFERENCE
. TICKS_PER_REVOLUTION
is 360 for motors and ADI encoders and is 36000 for rotation sensors. WHEEL_CIRCUMFERENCE
is pi times the diameter of your tracking wheel, if using tracking wheels, or of your drivetrain wheel if otherwise.
MIDDLE_TPI
: If using middle tracking wheel, follow same procedure as for TPI
.
TRACK_WIDTH
: If using left and right tracking wheels, this is the distance between the left and right tracking wheel. If using no tracking wheels, this is the distance between the left and right drivetrain wheels. If using a single parallel tracking wheel, see Using a Single Parallel Tracking Wheel.
MIDDLE_DISTANCE
: If using a middle tracking wheel, this is the distance from the tracking wheel to the center of rotation of the drivetrain. If the middle tracking wheel is in front of the center of rotation, MIDDLE_DISTANCE
has to be negative. If it is behind the center of rotation, it can stay positive.
In order for odometry to work properly, you must have one of the following sensor setups:
A middle tracking wheel may be added to any of the above setups.
Some special tricks are required to use a single parallel tracking wheel with ARMS:
TRACK_WIDTH
to twice the distance from the parallel tracking wheel to the center of the drivetrain. If the parallel tracking wheel is on the left side of the drivetrain, the TRACK_WIDTH
has to be negative. If it is on the right side, it can stay positive.While odometry information is accessible through the PROS terminal by setting ODOM_DEBUG
to 1, it may be preferable to display information on the brain using LLEMU while tuning. Here is some code that will do that:
Before we even start looking at odometry data, we should make sure all of our encoders are configured correctly.
Note: these are the steps for checking that a 3 tracking wheel setup is working correctly. You should modify the procedure according to your specific odometry setup.
OLD_TPI * ODOM_X / FORWARD_DISTANCE
.To tune MIDDLE_TPI
, follow the same procedure as stated above, except move the robot sideways to the left instead of forwards, and record the robot's Y position instead of its X position.
Note: this is the track with tuning procedure for using motor encoders or left and right tracking wheels. If you have an IMU, disable it while tuning this part. For tuning track width for a single parallel tracking wheel, follow a similar procedure as Tuning Middle Distance , but using the X position from odom rather than the Y position.
OLD_TRACK_WIDTH * ODOM_HEADING / TURN_DEGREES
.OLD_MIDDLE_DISTANCE + (ODOM_Y / (ODOM_HEADING * PI / 180))
. (ODOM_HEADING * PI / 180
is the heading of the robot in radians)For drivetrain PID, PD control is generally fine, with a little bit of I if necessary.
When tuning angular PID, it helps to first tune in ASYNC mode to remove interference from the settler.
Once the angular PID looks good in ASYNC mode, remove the ASYNC flag and the delay and check if it's still fine.
Follow a similar procedure as for Angular PID Tuning.
Increase TRACKING_KP
if the robot doesn't reach the target point and decrease it if the robot starts oscillating too much.
Increase LEAD_PCT
to make boomerang more aggressive and decrease it to make boomerang less aggressive.