Hello everyone,
I am developing a custom flight controller for a fixed-wing UAV using Simulink, QGroundControl, and an mRo Control Zero MH7 flight controller in Hardware in the Loop (HITL).
The controller is deployed to the board and allows switching between manual and autonomous control via an RC transmitter switch. Manual mode works reasonably well using MATLAB’s preconfigured Manual Control example with some gain tuning, and the aircraft flies relatively stable. However, when switching to autonomous mode, the UAV becomes uncontrollable, showing unrealistic pitch, roll, and yaw rates (>100 degress), and quickly diverges from stable flight. The flight dynamics are simulated in Simulink using a model similar to MATLAB’s Fixed-Wing UAV Dynamics example, and the controller relies on sensor data provided via uORB messages for state estimation and control. I suspect the instability is related to these uORB signals, possibly due to mismatches between the real sensor data (or the conversion of this data) from the board and the simulated dynamics.
My main question is:
Is there a way to stream or monitor uORB messages from the flight controller in real time within Simulink, so I can compare the actual onboard data with the simulated dynamics to pinpoint the issue? The Control Board is connected via USB to my Laptop
Any advice or example for accessing and verifying these signals from Simulink would be greatly appreciated.