Main Content

Configure and Assign Actuators in QGC

For Firmware version 1.14, the PWM & AUX pins need to be configured in QGroundControl (QGC) before the PX4 Actuator Write block can be used in Simulink. The configurations for QGroundControl described here are based on version 4.3.0.

Depending on your vehicle's airframe, you might need to configure and allocate actuators for motors and servos. The following sections provide a detailed explanation of the necessary steps.

Step1: Open QgroundControl and establish connection with PX4 autopilot

  1. Enable MAVLink over USB (/dev/ttyACM0) for QGC connectivity. For more information, see Enabling MAVLink in PX4 Over USB.

  2. Launch QGroundControl (QGC) and allow it to connect to your Autopilot.

Step2: Choose Airframe

Select an Airframe for your vehicle from Vehicle Setup -> Airframe tab, if you have not chosen one yet. Reboot the hardware to apply this change.

Generic Quadcopter

Step3: Actuator Configuration and Actuator outputs assignment

  1. Once QGC is connected, go to Vehicle Setup -> Actuators tab.

  2. Based on the Airframe selection, you will see the corresponding number of motors and servos displayed. The interface also shows tabs for actuator output assignment (PWM AUX, PWM MAIN, UAVCAN, and so on.). For more information on actuator configuration, see PX4 documentation.

    UAVCAN

    Depending on whether you want to write to motors or servos and choose to use the PWM or UAVCAN/DroneCAN interface for actuator communication, select the appropriate output assignment in the corresponding tabs. Refer to the following sections for more information.

Configure Motors over PWM MAIN

If you select the Generic Quadcopter airframe, an option to configure four motors appears. In this scenario, you can configure the four motors using PWM Main channels 1-4.

Configure PWM MAIN

The number of Main channels used should match the required number of motors.

It recommended to use only PWM Main channels for Motors connected over PWM interface.

Configure Servos over AUX PWM

If you select the Generic Standard Plane airframe, an option to configure one motor and four servos appears by default. If you need only three servos, you can change the configuration to three.

Configure servos

Motor can be assigned to PWM Main channels 1 as described in step3.1. Servos can be assigned to Aux channel 1-3.

Main and Aux channels

Depending on the number of servos needed, use the corresponding number of Aux channels. It is recommended to use only PWM Aux channels for servos connected over the PWM interface.

Configure Motors and servos over UAVCAN

Note

UAVCAN interface is supported only with PX4 Actuator Write block and not with PX4 PWM output block.

For example, if you choose Generic Standard Plane airframe you will see an option to configure one motor and four servos by default.

Motor and Servo configuration

The motor can be assigned to UAVCAN ESC channel 1, while servos can be assigned to Servo channels 1-4.

UAVCAN Motor and Servo configuration

Depending on the number of motors and servos needed, use the corresponding number of ESC channels and Servo channels respectively. It is recommended to use only ESC channels for motors and servos channels for Servos connected over the UAVCAN interface.

Configure Motors and Servos for HITL

Note

HITL actuator configuration is necessary only for the PX4 Actuator Write block and is not required for the PX4 PWM Output block.

For example, selecting the Generic Standard Plane airframe and enabling HITL will show a new tab labeled HIL in the Actuator Outputs section.

HIL tab

By default, the option to configure one motor and four servos is shown. If you require only three servos, you can adjust this to three.

Motors and Servos can be assigned to the HIL channels based on the specific needs of your UAV vehicle physics simulation and how Simulation reads the actuator data. For example, if your physics simulation uses control channel 4 of the HIL_ACTUATOR_CONTROLS MAVLink message to simulate motor thrust, then the motor should be assigned to the fourth channel accordingly.

Actuator setup

Configure Motors and Servos for PX4 Host Target

Note

The PX4 Host Target actuator configuration is necessary only for the PX4 Actuator Write block and not for the PX4 PWM Output block.

By default, in the PX4 host target, an option to configure four motors is shown. These four motors will also be automatically assigned to the first 4 channels in the SIM tab, by default.

SIM tab

If you select a different airframe, then you must assign the motors and servos accordingly in the SIM tab.

See Also