PX4-Autopilot icon indicating copy to clipboard operation
PX4-Autopilot copied to clipboard

differential: add slew rates for speed, yaw and yaw rate setpoints

Open chfriedrich98 opened this issue 1 year ago • 0 comments

Solved Problem

The yaw, yaw rate and speed setpoint that the differential module attempts to track are currently mostly step inputs. This means there are often large errors between the setpoint and measured value leading to very aggresive behaviour and overshoots. It also ramps up any integrator in the control structure, because these setpoint trajectories are infeasible since they don't account for physical limitations of the system.

Solution

By adding slew rates to the setpoints that have to be tracked by the control system the trajectory can be smoothed and made feasible. Setting these slew rates to the physical limitations of the system (or lower if that is requried) the following is achieved:

  • Overall smoother behaviour because the control system doesn't attempt to track impossible setpoint trajectories.
  • No big errors between setpoint and measured value which would lead to aggressive behaviour.
  • Tuning is made easier because the range of errors between setpoints and measured values is way smaller.

The following slew rates are implemented:

  • Forward speed: The changing rate of the speed setpoint is restricted by an acceleration/deceleration limit.
  • Yaw: The changing rate of the yaw setpoint is restricted by a yaw rate limit.
  • Yaw rate: The changing rate of the yaw rate setpoint is restricted by a yaw acceleration limit.

This adds the following new parameters:

Parameter Description Unit
RD_MAX_DECEL Deceleration limit m/s
RD_MAX_YAW_ACCEL Yaw acceleration limit deg/s^2

The parameters for the acceleration limit RD_MAX_ACCEL and the yaw rate limit RD_MAX_YAW_RATE already exist in the module, but were not used for setpoint slew rates yet.

Test coverage

  • SITL tested
  • Hardware tests will follow

chfriedrich98 avatar Oct 15 '24 09:10 chfriedrich98