Configure Simulink Model for Monitor & Tune Simulation with Hardware-in-the-loop (HITL)
Configure PX4 Controller Model in Simulink for Monitor & Tune Simulation
In the Modeling tab, click Model Settings.
In the Configuration Parameters dialog box, choose any Pixhawk® Series board.
Click External mode and select
/dev/ttyS1as the Hardware board serial port. The serial port
/dev/ttyS1corresponds to TELEM1 on Pixhawk 4 over which External Mode communication would be established.
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.
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.
Clear the Use the same host serial port for External mode as used for firmware upload option.
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.
Click MAVLink and ensure that Enable MAVLink on /dev/ttyACM0 option is selected.
Click /dev/ttyS1 and set the Baud rate to
921600. Do not change any other parameters.
Click Apply and then click OK.