Main Content

PX4 Analog Input

Measure analog voltage applied to an ADC channel

Add-On Required: This feature requires the UAV Toolbox Support Package for PX4 Autopilots add-on.

  • PX4 Analog Input block

Libraries:
UAV Toolbox Support Package for PX4 Autopilots / PX4 Utility Blocks

Description

The PX4 Analog Input block measure the analog voltage at the ADC channels on the PX4® flight controller hardware, and outputs the voltages as a 1-by-12 array. Each value in the array corresponds to the analog voltage at a particular channel number.

For more information about mapping the channel numbers and the voltage array, see Index Numbers for Analog Channels on Pixhawk Series Controller Boards.

During Normal mode simulation, the block outputs zeroes.

During Connected I/O simulation, this block reads data from the peripherals of the hardware.

Ports

Output

expand all

The voltage values captured at the different ADC channels on the flight controller board.

Connect this output to a Selector block with its Input port size parameter value set to 12. You can use the Selector block to specify the index values of the required channel numbers from which you want to read the voltage values.

Data Types: vector

Parameters

expand all

Enter the time interval at which the block reads voltage values from the ADC channels on the flight controller board.

When you set this parameter to -1, Simulink® determines the best sample time for the block based on the block context within the model.

Version History

Introduced in R2018b