Controller Architecture

原文地址: https://pixhawk.org/dev/controller_architecture

The PX4 middleware uses a set of standardized interfaces to read control inputs, to output control outputs and to mix those onto actuators.

The top-level inputs can be a number of things, typically its radio control values sent by a pilot flying in simple / assisted mode, a waypoint / setpoint or a velocity vector the system is trying to follow.

All names in capital letters, such as INPUT_RC, are uORB topics.

Overview

This diagram shows how input from the pilot or ground control station is processed in the onboard control architecture. Individual control blocks (in most cases tasks or threads) are colored, the involved uORB topics are white boxes. A list of all uORB topics is in the Doxygen uORB documentation and always up to date.

Manual Input Standard

Radio Control Parameters

The RAW PPM channels are scaled to a range of 0..1 for throttle and -1..1 for other control channels. To achieve this, a total of five parameters has to be set:

  • RC_X_MIN: Minimum value. Set to minimum value when the stick is at the bottom / left
  • RC_X_TRIM: Trim value. Set to the value the stick has in center position and  same as minimum for throttle.
  • RC_X_MAX: Maximum value. Set to maximum value when the stick is at the top / right
  • RC_X_REV: Channel reverse. If the stick value is at the bottom / left not 0 in RAW PWM units but at the maximum of around 1800-2000, set this parameter to -1 to reverse the channel. Keep at 1 else.
  • RC_X_DZ: Deadzone. In this value range (in raw PPM units) the stick input is set to zero. This is to prevent bad recentering on a remote control to give small inputs. Set to 30 for normal channels and 10 for throttle as default.

Radio Control Normalization

  • Left stick: Bottom left corner is -1 for X and 0 for Y, center is 0, 0.5, top right is 1, 1 (assuming that the Y axis is throttle, which ranges from 0 to 1 and not -1 to 1 as the other channels)
  • Right stick: Bottom left corner is -1 for X and -1 for Y, center is 0, 0, top right is 1, 1
  • Switches: All the way away from the pilot / down: -1, all the way towards the pilot: 1
  • Potentiometers: all the way to the left: -1, all the way turned to the right: 1

Manual Control Setpoints

  • x: roll
  • y: pitch
  • r: yaw
  • z: throttle

Waypoint Input Conventions

Controller Setpoint Conventions

  • control 0: roll
  • control 1: pitch
  • control 2: yaw
  • control 3: throttle

Actuator Output Standards

Validation / Debugging

In order to check that the system setup is valid, perform these steps. Make sure to have your radio control ready, QGroundControl connected and in Main Widget → Realtime Plot selected.

If it is a multirotor, unmount all props. If it is a fixed wing, unmount props or keep a safe clearance and make sure to not touch the throttle lever. If unsure, unmount the prop.

Manual Input Check

Place the airframe on a level surface (multirotor of fixed wing) and put it into manual mode (or stabilized, if a multirotor)

  1. Arm the system ( PROPS UNMOUNTED)
  2. Give positive pitch on the RC (pull the right lever on the remote down, assuming the setup is mode 2 (throttle/rudder on left stick, pitch/roll on right stick)
  3. Check that the MANUAL_CONTROL value in the line chart plot in the y dimension becomes positive (pitch up)
  4. Check that the output of “ctrl eff 1” becomes positive as well (it should 'try' to pitch up)
  5. If on an airplane: Check that the elevons also try to pitch up, on a multirotor check that the RPMs of the motors on the back increase

Stabilization Response Check

  1. Arm the system ( PROPS UNMOUNTED)
  2. Keep the remote control inputs at center (throttle at min), and pitch the nose of the plane / multicopter down
  3. Check that the output of “ctrl eff 1” becomes positive (it should 'try' to pitch up)
  4. If on an airplane: Check that the elevons also try to pitch up, on a multirotor check that the RPMs of the motors on the back increase

你可能感兴趣的:(Controller Architecture)