Pixhawk HIL Connector for Simulink

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

common GitHub repository


  • Windows 10/11
  • MATLAB & Simulink (MATLAB R2022a or earlier)
  • QGroundControl
  • Board running the PX4 Autopilot (BeagleBone Blue)



Use instructions

  • Download and install QGroundControl
  • 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


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