Aviumtechnologies

Pixhawk HIL Connector for Simulink

Simulink C++ S-function for hardware-in-the-loop simulation with Pixhawk.

common GitHub repository

Requirements

  • Windows 10/11
  • MATLAB & Simulink (MATLAB R2022a or later)
  • QGroundControl
  • Flight controller

Note: Tested extensively with a BeagleBone® Blue based flight controller running PX4.

Files

pixhawk_hil_connector_example.slx
pixhawk_hil_connector.mexw64

Use instructions

  • Download and install QGroundControl
    http://qgroundcontrol.com/.
  • In the "Application Settings", "General" page deselect the auto connect option for all devices except UDP.
  • Open the "pixhawk_hil_connector_example.slx" model. Make sure that you set the correct serial port in the Pixhawk HIL Connector block parameters. Do not change the destination address and port.
  • Run the "pixhawk_hil_connector_example.slx" model. The UAV will be shown in QGroundControl. To perform HIL simulations set the "SYS_HITL" parameter to 1.

Building and running PX4 Autopilot on BeagleBone Blue

https://blog.aviumtechnologies.com/topics/px4-autopilot/building-and-running-px4-autopilot-on-beaglebone-blue#building-px4-autopilot-v1.14.0

Example use of the Pixhawk HIL connector with a BeagleBone® Blue board running the PX4 Autopilot.

Pixhawk HIL setup

Pixhawk HIL setup.

Pixhawk HIL connector example Pixhawk HIL connector example sensors

Pixhawk HIL connector example.