Motor and Servo Configuration

This page describes the few parameters that should be set in order to support the steering and throttle method being used. This page is closely related to the Motor and Servo Connections page which describes the physical connections between the autopilot, motors, and servos.

Separate Steering and Throttle

For separate steering and throttle vehicles these parameters values should be set (they should already be set by default):

If using the mission planner, the Initial Setup >> Mandatory Hardware >> Servo Output page is a convenient way to do this

../_images/rover-motor-and-servo-config1.png

Skid Steering

For “Skid steering” vehicles (like R2D2) these parameters values will need to be set:

../_images/rover-motor-and-servo-config2.png

Omni Vehicles

For Omni vehicles (that can move left-to-right without changing heading) these parameter values will need to be set:

Motor Driver Types

At least three different Motor Driver (aka ESC) types are supported which allows using ArduPilot with most motor drivers. The MOT_PWM_TYPE parameter should be used to ensure the output from the autopilot board matches the input required by the motor driver.

  • “Normal” is the most common and involves sending PWM values normally between 1000 and 2000 (1ms ~ 2ms)

  • Brushed With Relay” is for brushed motor drivers that use a relay pin to indicate whether it should rotate forward or backward.

  • “Brushed BiPolar” is for brushed motor drivers that, a bit like “Normal” PWM. These devices interpret a low PWM value for reverse, a high PWM value for forward.

ESC Configuration

Some ESCs support three “Running Models”:

  1. Forward with brake

  2. Forward and reverse with brake

  3. Forward and Reverse

For Rover to have full and straightforward control of the throttle it is best to set the “Running Model” to the 3rd option, “Forward and Reverse”. An ESC programming card compatible with the ESC can normally be used to change the ESC’s configuration.

Testing Motor direction

../_images/rover-motor-test.png

The Mission Planner (and perhaps other GCSs) can be used to test the direction of the motors:

  • plug in the vehicle’s battery and place the vehicle on a stand so that its wheels can move freely

  • connect with the Mission Planner using USB or telemetry radio

  • go to the Initial Setup >> Optional Hardware >> Motor Test page

  • increase the “Throttle %” to 20

  • push the “Test motor” buttons to test the steering and motors.

    • for rovers with separate steering and throttle, pushing the “Test motor A” button should cause the wheels to turn forward, “Test motor B” should cause steering to turn right.

    • for rovers with skid steering, “Test motor C” should cause the left wheel to turn forward. “Test motor D” should cause the right wheel to turn forward.

  • If the motors or steering do not move in the correct direction change the appropriate SERVOx_REVERSED value and try again.

  • if a “command rejected” message appears or the motors or steering do not respond to the test, the cause may be written in the Mission Planner’s Flight Data >> Messages tab (see bottom left of the window). Common causes include the radio calibration having not been performed or the SERVOx_FUNCTION parameters having not been set correctly.

Minimum Throttle

Many motors and ESCs have a dead zone. This is the zone between the zero throttle value and the throttle value at which the motor starts to move. This can be compensated by setting minimum throttle in the firmware.

Tip

Remove wheels before proceeding with surface vehicles. Be aware of propellers on boats if they cannot be easily removed!

To fix the dead zone, open the motor test window in Mission Planner, as mentioned below. Find the minimum throttle value at which the motor turns on and set the parameter MOT_THR_MIN to that value. Now the motor should start at 1% throttle.

Steering Speed scaling

The amount of steering that a vehicle can apply without tipping due to lateral acceleration can be adjusted by changing MOT_SPD_SCA_BASE. Speeds below this value will have the full steering angle. Speeds above will have the maximum steering angle reduced by the fraction MOT_SPD_SCA_BASE / GroundSpeed.

This scaling is used at all times in Acro, Hold, Steering, Auto, RTL, Smart RTL, and Follow. In Guided mode, it is used except when direct steering and throttle are provided as input commands. In Manual mode, the use of this scaling is enabled by the first bit of MANUAL_OPTIONS.