Main Content

Configure Simulink Model for Monitor & Tune Simulation with Hardware-in-the-loop (HITL)

Configure PX4 Controller Model in Simulink for Monitor & Tune Simulation

  1. In the Modeling tab, click Model Settings.

  2. In the Configuration Parameters dialog box, choose any Pixhawk® Series board.

  3. Click External mode and select /dev/ttyS1 as the Hardware board serial port. The serial port /dev/ttyS1 corresponds to TELEM1 on Pixhawk 4 over which External Mode communication would be established.

    Note

    If you select PX4 Pixhawk 4 hardware board, then configure /dev/ttyS1 tab. If you select any other Pixhawk Series board, configure the appropriate /dev/tty tab. For example, for PX4 Pixhawk 1 as hardware board, configure /dev/ttyS6 tab.

    For more information, see Using External Mode over FTDI with Pixhawk 1.

  4. Ensure that MAVLink is not enabled in the TELEM1 port of Pixhawk 4 (or any other Pixhawk 4 serial port that you want to use for External Mode communication) as part of MAV_0_CONFIG or MAV_1_CONFIG or MAV_2_CONFIG.

  5. Clear the Use the same host serial port for External mode as used for firmware upload option.

  6. In the Host Serial port parameter, enter the host serial port number on the host computer for External mode communication. This is usually the COM port of the FTDI that is connected with the /dev/ttyS1 (TELEM1) serial port on Pixhawk 4.

  7. Click MAVLink and ensure that Enable MAVLink on /dev/ttyACM0 option is selected.

  8. Click /dev/ttyS1 and set the Baud rate to 921600. Do not change any other parameters.

  9. Click Apply and then click OK.

See Also

|