Pixhawk Video Tutorial with matlab simulink

8 views (last 30 days)
Abdelkader Fareha
Abdelkader Fareha on 28 Mar 2018
Commented: anil guclu on 7 May 2019
Please can any body provides a video tutorial or more detailed support on how to convert SIMULINK Model into pixhak code apart from the Pixhawk Support Package;
Grisha Khodos
Grisha Khodos on 2 May 2019
Still, is there any gudeline on how to use this? Redy-to fly SImulink model example to start with? Installation guide?

Sign in to comment.

Answers (3)

Steve Kuznicki
Steve Kuznicki on 16 Apr 2018
You will need to become familiar with the PX4 open source flight stack and write your own S-Functions that communicate via the uORB messaging mechanism. You will be able to subscribe or publish to uORB topics yourself just like the commander/navigator modules do. This is essentially what the Pixhawk PSP does for you.

anil guclu
anil guclu on 7 Sep 2018
Hi guys,
I am able to download matlab/simulink model file into px4, drive servo motors and log data in an SD card. Do you still need help?
Kevin Hollands
Kevin Hollands on 18 Mar 2019
I need help as well driving the servo motors and log the data. At this moment I am receiving the message uploading the model is done, but I am not able to run the model. Have you had this problem too?
Kind regards.

Sign in to comment.

anil guclu
anil guclu on 28 Apr 2019
Hi Kevin,
Sorry for late answer, You may check the below things,
  1. be sure that rc.txt file is located in the SD card in etc folder. In addition there must be a folder named as log.
  2. please check inside the rc.txt, there must be a line like "px4_simulink_app".
  3. May be you may run the model, there is a safety button which flahes, it must be solid in order to generate signal from PWM ports.
  4. for logging data, you may connect a step input to enable port of binary logger block. Aware that type of the enable is boolean, and the output of step input is decimal. you must convert it.
please try those and inform me, I will do my best.
anil guclu
anil guclu on 7 May 2019
Hi Kevin,
Have you checked the uORB time. I am having trouble acquiring data. I set sample time as 1/250, and take the uORB time difference , sometimes there are data loss about 180ms.
Could you please check the following link that explains my problem.
If you have time, I will be happy if you run a 5 min vehicle attitude block data with uORB time. I wonder if the problem is related with the hardware or the driver that we use in simulink. I use Matlab 2018B and officially supported PX4 package from Mathworks.

Sign in to comment.


Community Treasure Hunt

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

Start Hunting!