MATLAB Answers

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

13 views (last 30 days)
MASAHIRO HORIKAWA
MASAHIRO HORIKAWA on 17 Apr 2019
Answered: mechali omar on 17 Dec 2019
Hello
I'm sorry in poor English.
I am planning to fly drone by connecting MATLAB / Simulink and PIXHAWK.
MATLAB version is R2017b
PIXHAWK uses PIXHAWK2.
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
-------------------------------------------------------------------------------------------------
thanks.

Communities

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!