I want to run a flight controller implemented by Simulink with PIXHAWK (I want to turn the motor)

10 views (last 30 days)
I'm sorry in poor English.
I am planning to fly drone by connecting MATLAB / Simulink and PIXHAWK.
MATLAB version is R2017b
Using the manual (Pixhawk Pilot Support Package (PSP) User Guide), it is possible to build the environment of Windows 10 and Ubuntu, “build” and “UPLOAD” of the sample model (px4demo_attitude_system_multi_task.slx).
In order to operate the Simulink model, I placed the file (rc.txt) in the etc folder of the SD card according to the manual. The file is pasted rc.tct which exists in C \ px4_firmware _ *** of PC.
And I turned on the power, but the motor did not rotate.
We built a sample model (px4demo_rgbled.slx) that lights the LED to investigate the cause, and when it was uploaded, we could see that the LED turned on at the intended timing and the color changed.
According to my guess, I think that an instruction to turn the motor is necessary in rc.txt.
Please tell me how to change rc.txt.
If my guess is wrong, please tell me how the motor turns. I write the rc.txt that I use below.
#sercon - in the latest release sercon already gets called
#usleep 1000
uorb start
usleep 1000
mtd start
usleep 1000
param load /fs/mtd_params
#param set COM_RC_IN_MODE=2
usleep 1000
rgbled start
usleep 1000
sh /etc/init.d/rc.sensors
usleep 1000
gps start
usleep 1000
px4io start
usleep 1000
attitude_estimator_q start
position_estimator_inav start
usleep 5000
rgbled rgb 10 255 10
usleep 5000
px4_simulink_app start
usleep 1000
mavlink start -d /dev/ttyACM0 -b 57600
#usleep 1000
#nshterm /dev/ttyACM0 -b 115200 &
usleep 1000
#usleep 1000
#tone_alarm MFT200MNO3C8C8C8O2B-8G8G8B-8B8O3C8C8C8O2B-8G8O3C8E

Answers (2)

Dr.Thirunavukkarasu Indiran
Edited: Dr.Thirunavukkarasu Indiran on 29 Sep 2021
Dear All,
We use HexSoon Edu 450 Quadrotor with Pixhawk autopilot. We collected flight data for parameter estimation and modeling. Controller is also designed for the model parameters and ready in m-file as well as simulink. We are facing problem in dumping the controller with reference to the Pixhawk autopilot.
Need any advice for solving this issue. We also installed px4_fmu-v3_default firmware from MATLAB and validated the firmware too.
Need suggestions to embed the control algorithms into the Pixhawk autopilot.
THanks in advance


More Answers in the  Power Electronics Control

Community Treasure Hunt

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

Start Hunting!