|
Autonomous: Mixing Drive Distance PID's with Turn Angle PID's.
I'm curious how other teams attack their autonomous drivetrain commands.
In the past, 1718 has followed this pattern:
1. Tune a PID loop so the robot can drive a distance to +/-1 inch.
2. Tune a second "Turning" PID loop so the robot can turn to an angle +/- 1 degree.
Then we have used seperate states for each command - drive a distance, then turn, then drive, then turn. Sometimes we add in a 'drive straight' pid that mixes with the "drive a distance" pid so that the robot drives straight. This is usually just a cludged together system like this:
Left Drive = "Drive Distance" PID + "Drive Straight" PID
Right Drive = "Drive Distance" PID - "Drive Straight" PID
This usually results in only one side of the drivetrain helping to 'drive straight' because one side is usually greater than 1 (or less than -1), which gets limited to 1.
I'd like to be able to combine these into a single system where the robot is able to drive 'curves' to it's destination point. However, I really don't know how to start mixing the Drive-distance and Turn PID's except in a silly cludge like I showed above. In addition, I assume we'd have to look at some sort of gain scheduling with the turn PID due to the difference between turning while not moving and turning while moving.
Of course this all assumes tank drive.
How have other teams handled this mathematically? (Please try to keep it simple - system engineering was never my strong point).
|