Skip to content

SIH on Flight Controller Hardware

SIH can run directly on flight controller hardware with SYS_HITL=2. This replaces real sensors with simulated data while running on the actual autopilot, useful for testing without propellers.

For a comparison of SIH and HITL on hardware, see Hardware Simulation.

Firmware Builds with SIH

The SIH module is included in many, but not all, default firmware builds. This list can change between PX4 releases. Always verify using the method in Check if SIH is in Firmware.

The table below lists build targets that include SIH at the time of writing:

Build TargetBoard
px4_fmu-v3_defaultPixhawk 2 (Cube Black)
px4_fmu-v4_defaultPixhawk 3 Pro
px4_fmu-v4pro_defaultPixracer
px4_fmu-v5_defaultPixhawk 4
px4_fmu-v5x_defaultPixhawk 5X
px4_fmu-v6c_defaultPixhawk 6C
px4_fmu-v6c_raptorPixhawk 6C (Raptor)
px4_fmu-v6x_multicopterPixhawk 6X (multicopter)
auterion_fmu-v6s_defaultAuterion FMU-v6S
auterion_fmu-v6x_defaultAuterion FMU-v6X
holybro_durandal-v1_defaultHolybro Durandal
holybro_kakuteh7_defaultHolybro Kakute H7
holybro_kakuteh7v2_defaultHolybro Kakute H7 V2
holybro_pix32v5_defaultHolybro Pix32 V5
cuav_nora_defaultCUAV Nora
cuav_x7pro_defaultCUAV X7 Pro
cuav_x25-evo_defaultCUAV X25 EVO
cuav_x25-super_defaultCUAV X25 Super
cubepilot_cubeyellow_defaultCubePilot Cube Yellow
mro_pixracerpro_defaultMRO PixRacer Pro
mro_x21_defaultMRO X2.1
mro_ctrl-zero-h7_defaultMRO Ctrl Zero H7
mro_ctrl-zero-h7-oem_defaultMRO Ctrl Zero H7 OEM
mro_ctrl-zero-f7_defaultMRO Ctrl Zero F7
mro_ctrl-zero-f7-oem_defaultMRO Ctrl Zero F7 OEM
mro_ctrl-zero-classic_defaultMRO Ctrl Zero Classic
3dr_ctrl-zero-h7-oem-revg_default3DR Ctrl Zero H7 OEM RevG
modalai_fc-v1_defaultModalAI FC V1
nxp_fmuk66-v3_defaultNXP FMUK66-V3
nxp_fmuk66-e_defaultNXP FMUK66-E
radiolink_PIX6_defaultRadiolink PIX6
siyi_n7_defaultSIYI N7
sky-drones_smartap-airlink_defaultSky-Drones SmartAP Airlink
uvify_core_defaultUVify Core
atl_mantis-edu_defaultATL Mantis EDU
av_x-v1_defaultAV X-V1
narinfc_h7_defaultNarinFC H7
thepeach_k1_defaultThePeach K1
thepeach_r1_defaultThePeach R1
airmind_mindpx-v2_defaultAirMind MindPX V2
beaglebone_blue_defaultBeagleBone Blue
bluerobotics_navigator_defaultBlueRobotics Navigator
emlid_navio2_defaultEmlid Navio2
px4_raspberrypi_defaultRaspberry Pi
scumaker_pilotpi_defaultScumaker PilotPi

INFO

Some boards (e.g., px4_fmu-v6x_default, cubepilot_cubeorange_default) do not include SIH in their default build due to flash memory constraints. You can add SIH to any board -- see Check if SIH is in Firmware.

Requirements

  • A flight controller with SIH module included in firmware (see Firmware Builds with SIH).
  • USB connection for QGroundControl.
  • Optional: jMAVSim for 3D visualization via serial link (see Visualization).

Check if SIH is in Firmware

SIH is included in most default firmware builds. To verify, search for sih in the parameter list in QGroundControl. If SIH_* parameters are available, the module is included.

To add SIH to a custom build, enable it in the board configuration:

txt
CONFIG_MODULES_SIMULATION_SIMULATOR_SIH=y

Starting SIH

  1. Connect the flight controller to QGroundControl via USB.
  2. Set SYS_HITL parameter to 2.
  3. Reboot the flight controller.
  4. The SIH module starts automatically and provides simulated sensor data.

Once running, the vehicle can be controlled from QGroundControl or an RC controller.

WARNING

To save flash memory on boards with limited storage, SIH can be built with only quadrotor support. Set SIH_VEHICLE_TYPE before building to limit included vehicle models.

Visualization (Optional)

If you need a visual aid to see what the simulated vehicle is doing on hardware:

QGroundControl

Connect the flight controller via USB. QGC shows the vehicle on the map view with attitude, position, and telemetry, the same as a real flight.

jMAVSim (3D Display-Only)

jMAVSim can render a 3D view of the vehicle over a serial connection. No physics are simulated in jMAVSim -- it is display-only.

sh
./Tools/simulation/jmavsim/jmavsim_run.sh -q -d /dev/ttyACM0 -b 2000000 -o

Where /dev/ttyACM0 is the serial device for the flight controller. On macOS, this is typically /dev/tty.usbmodem*.

Controlling Actuators

WARNING

If you want to control throttling actuators in SIH, make sure to remove propellers for safety.

In some scenarios, it may be useful to control an actuator while running SIH on hardware. For example, you might want to verify that winches or grippers are functioning correctly by checking the servo responses.

To enable actuator control in SIH:

  1. Configure PWM parameters in the airframe file:

    Ensure your airframe file includes the necessary parameters to map PWM outputs to the correct channels.

    For example, if a servo is connected to MAIN 3 and you want to map it to AUX1 on your RC, use the following command:

    param set-default PWM_MAIN_FUNC3 407

    You can find a full list of available values for PWM_MAIN_FUNCn here. In this case, 407 maps the MAIN 3 output to AUX1 on the RC.

    Alternatively, you can use the PWM_AUX_FUNCn parameters.

    You may also configure the output as desired:

  2. Manually start the PWM output driver

    For safety, the PWM driver is not started automatically in SIH. To enable it, run the following command in the MAVLink shell:

    sh
    pwm_out start

    And to disable it again:

    sh
    pwm_out stop

Adding New Airframes (FC)

Airframe configuration for SIH on a flight controller differs from SITL in a few ways:

  • Airframe file goes in ROMFS/px4fmu_common/init.d/airframes and follows the naming template ${ID}_${model_name}.hil, where ID is the SYS_AUTOSTART_ID used to select the airframe, and model_name is the airframe model name.
  • Add the model name in ROMFS/px4fmu_common/init.d/airframes/CMakeLists.txt to generate a corresponding make target.
  • Actuators are configured with HIL_ACT_FUNC* parameters (not the usual PWM_MAIN_FUNC* parameters). This is to avoid using the real actuator outputs in SIH. Similarly, the bitfield for inverting individual actuator output ranges is HIL_ACT_REV, rather than PWM_MAIN_REV.

For general airframe setup (SIH parameters, EKF2 tuning), see Adding New Airframes on the main SIH page.

For examples, see the .hil airframes in ROMFS/px4fmu_common/init.d/airframes.