MAVLINKHUD

Overview

The STR parameter group (often appearing as ATC_STR_ in newer versions) provides the core tuning for the Lateral Steering Controller in ArduRover.

Key Concepts

1. Steering Limits

  • STR_RAT_MAX: Maximum rotation rate (deg/s) the vehicle is allowed to request during a turn.
  • STR_ACC_MAX: Maximum lateral acceleration (m/s²) allowed. This is critical for preventing rovers from tipping over in high-speed sharp turns.

2. Throttle-to-Steering Mix (STR_THR_MIX)

Used on Skid-Steer vehicles (tracked or differential drive).

  • Function: Defines how much throttle is reduced when turning. This ensures the vehicle has enough power to pivot without stalling the motors.

Developer Notes

  • Library: libraries/AR_AttitudeControl.
  • See Also: STEER2SRV for related servo gains.

STR_ACC_MAX

$deg/s^2$
Default 120
Range 0 1000

Steering control angular acceleration maximum (STR_ACC_MAX)

Description

This parameter limits the angular acceleration (rotational jerk) of the steering control loop. It essentially smoothens the steering response by preventing the vehicle from trying to change its turn rate too instantly.

This is particularly useful for preventing "twitchy" behavior or mechanical stress on steering servos/linkages during aggressive maneuvers.

The Mathematics

The controller limits the rate of change of the desired turn rate.

$$ |\Delta \text{Rate}| \le \text{ACC\_MAX} \times dt $$

If the desired change in turn rate exceeds this limit, the requested rate is clamped to the maximum allowable step for that time step.

The Engineer's View

In AR_AttitudeControl::get_steering_out_rate, _steer_accel_max is used to calculate change_max.
The current _desired_turn_rate is constrained to be within +/- change_max of the previous time step's rate.
This acts as a slew rate limiter on the target yaw rate.

Tuning & Behavior

  • Default Value: 120 $deg/s^2$ (Rover default, may vary by frame).
  • Range: 0 to 1000.
  • 0: Disabled (Unlimited acceleration).
  • Lower Value: Smoother, lazier steering starts.
  • Higher Value: Snappier response, potentially causing overshoot or mechanical strain.
  • Dependency: This works in conjunction with STR_RAT_MAX (which limits the speed of the turn) and STR_ANG_P (which determines the aggressiveness of the correction).

STR_RAT_MAX

deg/s
Default 120
Range 0 1000

Steering control rotation rate maximum (STR_RAT_MAX)

Description

This parameter sets the hard limit on how fast the vehicle is allowed to turn (yaw) in degrees per second. Ideally, this should match the physical capability of the vehicle to turn without sliding or rolling over.

This acts as a "speed limit" for the steering controller. Even if the navigation system demands a sharp turn, the controller will not request a turn rate higher than this value.

The Mathematics

The controller clamps the desired turn rate.

$$ |\text{Rate}\_{cmd}| \le STR\_RAT\_MAX $$

If STR_RAT_MAX is 0, this check is skipped.

The Engineer's View

In AR_AttitudeControl::get_steering_out_rate:

  1. The code converts _steer_rate_max to radians.
  2. It checks if _desired_turn_rate exceeds this limit.
  3. If it does, it clamps the value and sets the _steering_limit_left or _steering_limit_right flags, which tells higher-level navigators (like the L1 controller) that the steering is saturated.

Tuning & Behavior

  • Default Value: 120 $deg/s$
  • Range: 0 to 1000 $deg/s$
  • Effect of Decreasing: Makes the vehicle turn slower. Useful for preventing rollovers on high-CG rovers.
  • Effect of Increasing: Allows faster turns.
  • 0: Disabled. The vehicle will try to turn as fast as the steering geometry and P-gain allow.

STR_THR_MIX

null
Default 0.5
Range 0.2 1.0

Motor steering vs throttle prioritisation (STR_THR_MIX)

Description

This parameter manages the "Saturation Mixer" logic for skid-steer Rovers.
In a skid-steer vehicle (like a tank), turning is achieved by speeding up one side and slowing down the other. If you are already at 100% Throttle, you cannot speed up one side further to turn.

STR_THR_MIX decides what to sacrifice when the driver requests both full speed and a turn:

  • High Value (> 0.5): Sacrifice Speed to ensure Turning (Slows down to turn).
  • Low Value (< 0.5): Sacrifice Turning to maintain Speed (Turns less sharp to keep moving fast).

The Mathematics

The mixer checks if Throttle + |Steering| > 1.0 (Saturation).
If saturated, it calculates a scaling factor based on STR_THR_MIX ($\alpha$).

If $\alpha \ge 0.5$ (Prioritize Steering):
$$ \text{Steering} = \text{Steering}{cmd} \times \text{FairScaler} $$
$$ \text{Throttle} = \text{Throttle}
{cmd} \times \text{interpolate}(\text{FairScaler}, 1.0, 0.5 - \alpha) $$
(Effectively reduces throttle to make "headroom" for the steering command)

If $\alpha < 0.5$ (Prioritize Throttle):
$$ \text{Throttle} = \text{Throttle}{cmd} \times \text{FairScaler} $$
$$ \text{Steering} = \text{Steering}
{cmd} \times \text{interpolate}(\text{FairScaler}, 1.0, \alpha) $$
(Effectively reduces steering command)

The Engineer's View

In AP_MotorsUGV::output_skid_steering:
The code calculates max_output = throttle + |steering|.
If max_output > 1.0, it enters the saturation handling logic described above.
This ensures that the output to the motors never exceeds the physical limits while attempting to respect the user's priority preference.

Tuning & Behavior

  • Default Value: 0.5 (Balanced)
  • Range: 0.2 to 1.0
  • 1.0 (Steering Priority): The vehicle will slow down significantly to ensure it hits the requested turn rate. Recommended for autonomous missions where path tracking is critical.
  • 0.2 (Throttle Priority): The vehicle will prioritize speed, potentially missing a turn radius if moving fast. Useful for racing or manual FPV driving where flow is more important than precision.