- Make sure your autopilot not in HITL mode. Ensure that you uncheck the 'Enable HITL Mode' in the Model Configuration paramters so that the Autopilot not in HITL mode. Verify the same in QGC as well.
- When you say you arm the drone, did you just arm it in the Simulink model or did you use the safety switch to arm the drone. For PX4 Autopilots the software arming as well as hardware arming using safety switch is required for successful arming.
- Enable the PWM error staus output from the PWM block and observe for any error status.
UAV Toolbox Support Package for PX4 Autopilots - Pixhawk 4 Flight preparation
15 次查看（过去 30 天）
The project I am working on is to design a controller in Simulink using UAV Toolbox Support Package for PX4 Autopilots and distribute it to Pixhawk4 to enable actual flight.
I designed Position&Altitude Controller and Attitude Controller as my model and uploaded it to Pixhawk4 using Build&Deploy.
It was confirmed that the auto code generated by Simulink was generated in the px4_simulink_app folder as follows. I confirmed that auto code generation replaces firmware with newly generated code from existing px4 firmware.
In order to verify the actual hardware flight performance of the controller I designed myself, I tried to conduct a flight test of a quadrotor equipped with a Pixhawk4 through QGrondControl. However, even when Arming at QGroundControl, the motor did not arm and eventually failed the flight test.
What additional work is required to apply the Auto generated Simulink code to the actual flight?
Should I change the input and output variables of the Auto-generated controller to the same as the variables of the code connected by px4 firmware? I'm looking for related data, but I'm having a hard time because I can't find a case where the actual flight took place.
Arun Mathamkode 2022-12-28
编辑：Arun Mathamkode 2022-12-28
As per my understanding there are no specific steps other than what you did to deploy code for an actual flight. I can provide some direction for you investigate and understand what might be going wrong here.