Multirotor Position Control

For automatic position control of multirotor the following apps should be used:

  • position_estimator_inav - Inertial model position & velocity estimator, that uses GPS, baro and accelerometers as inputs and provides vehicle_local_position topic
  • multirotor_pos_control - Position controller that uses position & velocity from vehicle_local_position and sets desired attitude and throttle

Flying

Order of SAS modes on switch (it changed against master branch to more safe):

  1. STABILIZED - only attitude stabilization
  2. ALTITUDE - attitude stabilization and altitude hold
  3. SIMPLE - attitude stabilization, altitude and position hold

STABILIZED mode must be on extreme switch position. In case of emergency it should be very easy to switch into this mode.

ALTITUDE mode

When using ALTITUDE mode controller holds altitude that was at moment of switching to this mode. Throttle stick used to move altitude setpoint, it has large deadzone. Maximal rate in m/s of moving altitude setpoint controlled by MPC_ALT_RATE_MAX parameter.

PID controller has no “setpoint rate” component. Responce to throttle stick movements is much more slower. And when throttle stick centered back, copter will not try to stop immediately, but will slow down smoothly. This behavor is under review and maybe will be changed.

Note, that when you switch back to STABILIZED mode throttle stick can be on new position and copter will jump or fall. To avoid this special radio configuration with auto-centered throttle stick can be used: http://www.diydrones.com/forum/topics/futaba-8fg-alternative-controls-settings. It's also very convinient for manual flying.

SIMPLE mode

SIMPLE mode is the same as ALTITUDE but with position stabilization. Position can be ajusted with Pitch/Roll controls. Maximal rate in m/s of moving position setpoint controlled by MPC_POS_RATE_MAX parameter.

PID controller for position acts like altitude PID, i.e. responce to controls is much slower than in manual attitude mode.

Tuning

Default parameters for position estimator and controller shoud be safe, but depending on frame can be tuned to get better performance. Meaning of the parameters:

position_estimator_inav

  • INAV_USE_GPS - if disabled (0), only altitude will be estimated and position control will not work
  • INAV_W_ALT_BARO - weight for baro in altitude estimator
  • INAV_W_ALT_ACC - weight for accelerometer in altitude estimator
  • INAV_W_POS_GPS_P - weight for GPS position in altitude estimator
  • INAV_W_POS_GPS_V - weight for GPS velocity in altitude estimator (because of velocity-specific problems in current ubx driver or u-blox module itself should not be used now)
  • INAV_W_POS_ACC - weight for accelerometer in altitude estimator

multirotor_pos_control

  • MPC_THR_MIN - minimal throttle limit, for fail-safe
  • MPC_THR_MAX - maximal throttle limit, for fail-safe
  • MPC_ALT_P - P coefficient for altitude controller
  • MPC_ALT_I - I coefficient for altitude controller
  • MPC_ALT_D - D coefficient for altitude controller
  • MPC_ALT_RATE_MAX - maximal rate of altitude setpoint moving, i.e. speed of climbing/decending at extremal stick positions
  • MPC_POS_P - P coefficient for position controller
  • MPC_POS_I - I coefficient for position controller (integration performed in NED frame, so it should compensate constant wind, not tested yet)
  • MPC_POS_D - D coefficient for position controller
  • MPC_POS_RATE_MAX - maximal rate of position setpoint moving, i.e. horisontal speed at extremal stick positions
  • MPC_SLOPE_MAX - maximal pitch/roll limit, for fail-safe
Translations of this page:


Quick Links

QR Code: URL of current page