Index Numbers for Analog Channels on Pixhawk Series Controller Boards
The PX4 Analog Input block in UAV Toolbox Support Package for PX4® Autopilots supports reading of analog voltage values from the sensors connected to the Pixhawk Series controller board. This block outputs a 1-by-12 array that contains single values of analog voltage at the corresponding channel numbers. Because the analog pins on each Pixhawk Series controller board varies according to the FMU version that they support, it is necessary to understand the correct channel numbers represented in the output signal from the PX4 Analog Input block.
The supported FMU version defines all the available channels, even though the analog channels that are exposed on a PX4 flight controller depends on the manufacturer.
Available analog input channels based on FMU versions
FMU Version | Available Analog Input Channels |
---|---|
FMUv2 | 2, 3, 4, 10, 11, 12, 13, 14, 15 |
FMUv3 | 2, 3, 4, 10, 11, 12, 13, 14, 15 |
FMUv4 | 2, 3, 4, 10, 11, 12, 13, 14 |
FMUv5 | 0, 1, 2, 3, 4, 8, 10, 11, 12, 13, 14 |
The following table contains the index numbers that you can use to extract signal values, based on the channel to which the analog input device is connected. The table lists all the target hardware that is tested for this release of UAV Toolbox Support Package for PX4 Autopilots.
Index numbers for supported Pixhawk series boards
Target Hardware supported for R2018b | Analog Input Channels available on the corresponding FMU version | Analog Input Channels exposed on the board | Index of exposed channels in the 1-by-12 array (output signal from PX4 Analog Input block) |
---|---|---|---|
Pixhawk 1 | FMUv2: 2, 3, 4, 10, 11, 12, 13, 14, 15 | 13, 14, 15 | 7, 8, 9 |
Cube (Pixhawk 2) | FMUv3: 2, 3, 4, 10, 11, 12, 13, 14, 15 | 15 | 9 |
Pixracer | FMUv4: 2, 3, 4, 10, 11, 12, 13, 14 | No ADC channels are exposed on the board | -- |
Pixhawk 4 | FMUv5: 0, 1, 2, 3, 4, 8, 10, 11, 12, 13, 14 | 4,14 | 5, 11 |
In the Simulink model, the 1-by-12 array output from the PX4 Analog Input block can be connected to a Selector block, which extracts the signals from the array, based on index numbers that you specify.