PX4 HIL with Pixhawk 6x : HIL with simulink plant dynamics using Sik Telemetry Radio. Could not connect to target application: XCP serial port error

2 views (last 30 days)
I want to perform HIL with pixhawk 6x using Telemetry radio(Holybro 100mW 433Mhz) instead of the FTDI converter. So I connect the pixhawk via USB type C to PC.One of the telemetry radio is connected to TELEM1 and the other one is connected to USB to PC.
The Pixhawk linked via USB type C is COM9 and the Telemetry radio is COM10 in my PC.
I want to perform HIL using the UAV dynamics on simulink via "Monitor and tune" (https://uk.mathworks.com/help/supportpkg/px4/ref/hitl-simulink-plant-example.html#responsive_offcanvas ) in Matlab 2023b on windows 11. In the setting QGC as the Mathworks documentation says:
  • Set HITL mode
  • Airframe HIL Quadcopter X
  • Set Flight mode
  • In the General tab of the settings menu, clear all AutoConnect options except Sik (should I select UDP instead of Sik?i've tried both)
  • Set MAV_0_CONFIG to disabled
I've set the following parameters too:
  • COM_RC_IN_MODE to Joystick only (virtual joystick option was selected too)
  • COM_DISARM_LAND set to -1
  • NAV_ACC_RAD set to 10
  • NAV_RCL_ACT to disabled
In the Hardware setting in Simulink in the external mode I've selected:
  • Hardware board serial port /dev/ttyS6 (TELEM1) (I've also set a band rate of 921600)
  • Host serial port : COM10
I've enabled the HIL mode and in the build option I've selected Automatically determine serial port for firmware upload.
When I run through "MONITOR AND TUNE", it displays this:
How can I solve this problem? Are some setting wrong?
  1 Comment
Ankur Bose
Ankur Bose on 16 Oct 2023
Please note that from MATLAB & Simulink, the Wireless Monitor & Tune workflow has not been tested. This workflow sometimes works, but at other times due to data drop in wireless mode, the connection errors out. For running Monitor & Tune, we recommend wired connection.

Sign in to comment.

Accepted Answer

Ankur Bose
Ankur Bose on 16 Nov 2023
Note that from MATLAB & Simulink, the Wireless Monitor & Tune workflow has not been tested. This workflow sometimes works, but at other times due to data drop in wireless mode, the connection errors out. For running Monitor & Tune, we recommend wired connection.

More Answers (0)

Tags

Products


Release

R2023b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!