Upload custom flight controller on Pixhawk 4, and flight tests
23 views (last 30 days)
Show older comments
Edorado Baldacci
on 12 Sep 2023
Commented: Luca Montecchio
on 28 Apr 2024
Hello.
I developed my flight controller in simulink, and i tested it In SIL, HITL following the matlab examples https://it.mathworks.com/help/supportpkg/px4/setup-and-configuration_mw_3095a711-0234-45ed-9b75-77488e8e577d.html https://it.mathworks.com/help/supportpkg/px4/setup-and-configuration_mw_06fa168c-661f-4e54-b3b0-197c970f0ac9.htm . Now i want try to perform the flight test with my fligth controller. Now, there isn't any examples about perform real fligth tests. So, I uploaded the firmware following the HIL procedure:
Build the firmware and upload
- Default startup script
- Design flight controller in simulink
- Boardo Pixhawk 4, whit px4_fmu-v5_default
Then after these passages i Build Start and deploy my fligth controller into Pixhawk 4.
Now if i try to connect my drone with Qground cotnrol station, all the sensors, frame, GPS, ecc... are ok. So I armed the drone and command the take off, but the motors didn't start to spinn. I also tried with the example in matlab "px4demo_HardwareInLoopWithSimulinkPlantStart", but even this dind't work. A strange thing is that when i armed and command the take off, i saw (in Qg mavlink inspector) that the actuator_commands change his values to 2000 us, but the engines doesn't move ( i use the PWM channel block). I alredy cheked that all the wires are connected, and also i tesed the engines via Qg and they works. So I guess that i miss something in the configuration for perform real fligth.
I also tried to uplod custom startup script, but i didn't undestand very well the procedure. But in any case the default script should work, because it already disable the mc_postion_controller, and mc_attitude_controller.
I anyone have some guides to follow, or some adevices. Thanks in advance.
0 Comments
Accepted Answer
Ankur Bose
on 14 Sep 2023
Check if the board is in HITL mode. In HITL mode, the actuator pins are disabled. If you want to run the engines, then you have to bring the board out of HITL mode.
More Answers (1)
Edorado Baldacci
on 16 Sep 2023
1 Comment
Luca Montecchio
on 28 Apr 2024
Hello Edoardo,
I am currently trying to do the same so to deploy a custom controller in a real flight test. Could you tell the passages you followed after the HITL to deploy it on the physical drone?
Did you eventually succeeded?
Thanks.
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!