Tank Drive - Joystick Control
Revision as of 14:14, 27 January 2019 by Dsteinmark (talk | contribs)
In tank drive, one or two joysticks can be used, but typically two joysticks are used - one joystick is use to control the left half of the drivetrain, and the other joystick is used to control the other half. Only forward and backwards motions of the joystick are used for affecting the drivetrain.
There are a few different control mappings to affect how a certain amount of joystick movement is needed to change the requested speed of the drivetrain:
- Linear The simplest and most straightforward of the control mappings.
- Quadratic Designed to give much finer control over slow movements.
- Linear/Quadratic Average An averaging of linear and quadratic.
- S-Curve Finer control than linear in first half of travel, faster control than linear in second half.
Linear
The simplest and most straightforward of the control mappings.
- y = x
- Advantages: Simple, linear response, easy to program, easy to drive
- Disadvantages: Does not give fine control for slow movements
Quadratic
Designed to give much finer control over slow movements.
- y = x2
- Advantages: Gives very fine control over slow movements
- Disadvantages: Drivers have complained that it feels too dead and sluggish when getting started.
Image: Comparison of Linear, Quadratic, and Linear Quadratic Average
Linear/Quadratic Average
An averaging of linear and quadratic.
- y = (x2 + x) / 2
- Advantages: Gives finer control over slow movements than linear, without feeling dead like quadratic. (At least in theory.)
- Disadvantages: Overall slower feeling compared to linear
S-Curve
Finer control than linear in first half of travel, faster control than linear in second half.
- For x <= 0.5
- y = ((2x2) + x) / 2
- For x > 0.5
- y = 1 - ((2(x-1.5)2) + (x-1.5)) / 2
- For x <= 0.5
- Advantages: Gives finer control for slow movements, without feeling dead like quadratic. Gives faster control than linear in second half. Feels zippy when past about 1/3 or 1/2 travel.
- Disadvantages: Does not feel linear. Could be an issue in feel for driver. They may love it. They may hate it.