Difference between revisions of "Tank Drive - Joystick Control"
Jump to navigation
Jump to search
Dsteinmark (talk | contribs) |
Dsteinmark (talk | contribs) |
||
| Line 29: | Line 29: | ||
:::y = x^2 | :::y = x^2 | ||
| − | + | === Image: [https://mort11.com/downloads/mentor.wiki/Programming/Robotics_Joystick_Control_Equation_Maps_LinQuadAvg.png Comparison of ''Linear'', ''Quadratic'', and ''Linear Quadratic Average''] === | |
| − | |||
| Line 50: | Line 49: | ||
:::''For x > 0.5'' | :::''For x > 0.5'' | ||
:::: y = 1 - ((2(x-1.5)^2) + (x-1.5)) / 2 | :::: y = 1 - ((2(x-1.5)^2) + (x-1.5)) / 2 | ||
| + | |||
| + | === Image: [https://mort11.com/downloads/mentor.wiki/Programming/Robotics_Joystick_Control_Equation_Maps_S-Curve.png ''S-Curve'' Mapping] === | ||
[[Category:Programming]] | [[Category:Programming]] | ||
Revision as of 13:30, 27 January 2019
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.
- 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.
- Advantages: Gives very fine control over slow movements
- Disadvantages: Drivers have complained that it feels too dead and sluggish when getting started.
- Linear/Quadratic Average An averaging of linear and quadratic
- 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.
- 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.
Linear
The simplest and most straightforward of the control mappings.
- Advantages: Simple, linear response, easy to program, easy to drive
- Disadvantages: Does not give fine control for slow movements
- y = x
Quadratic
Designed to give much finer control over slow movements.
- Advantages: Gives very fine control over slow movements
- Disadvantages: Drivers have complained that it feels too dead and sluggish when getting started.
- y = x^2
Image: Comparison of Linear, Quadratic, and Linear Quadratic Average
Linear/Quadratic Average
An averaging of linear and quadratic
- 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
- y = (x^2 + x) / 2
S-Curve
Finer control than linear in first half of travel, faster control than linear in second half.
- 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.
- For x <= 0.5
- y = ((2x^2) + x) / 2
- For x > 0.5
- y = 1 - ((2(x-1.5)^2) + (x-1.5)) / 2
- For x <= 0.5