Pixhawk Video Tutorial with matlab simulink

7 views (last 30 days)
Abdelkader Fareha
Abdelkader Fareha on 28 Mar 2018
Commented: UASLAB on 16 May 2023
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;
  2 Comments
Walter Roberson
Walter Roberson on 4 Sep 2018
Vasanthakumar Sekar comments,
I bought a Pixhawk -4 new and install the simulation package from matlab 2018a. now, what i have to see is on-board sensors reading in matlab. try to find out a way to see possibly. need some video lecture indeed.
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?
Sincerely.
  3 Comments
Kevin Hollands
Kevin Hollands on 18 Mar 2019
Hi,
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.
Kevin
UASLAB
UASLAB on 16 May 2023
can you please provide me with your models and how you push your simulink model into pixhawk? Thank you.

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.
Sincerely.
  2 Comments
Kevin Hollands
Kevin Hollands on 7 May 2019
Hi,
Thank you for your answer. It is working right now! I changed the rc file, updated the bootloader using qgroundcontrol and set all sample frequencies to 400.
Kind regards.
Kevin
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.
Thanks.

Sign in to comment.

Tags

Community Treasure Hunt

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

Start Hunting!