-
Couldn't load subscription status.
- Fork 353
Flight Controller Design and Hardware Deployment (Project 217) #48
-
Contribute to the discussion by asking and/or answering questions, commenting, or sharing your ideas for solutions to project #217
Beta Was this translation helpful? Give feedback.
All reactions
Replies: 12 comments 22 replies
-
Hi, I am a student at National Taitung University and interested in working and collaborating on this project
Beta Was this translation helpful? Give feedback.
All reactions
-
Hey Ben,
I am an undergraduate @ Thapar University and I am looking forward to collaborating on this. Can you drop your email so I can contact you further?
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi Ben and Paul,
Glad to see that you are interested in this project. You can find the instructions for setting up PX4 with Simulink here. Additionally these examples can help you get started.
Please feel free to post any questions or thoughts you may have below.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi, I am a graduate from Dayananda Sagar Academy Of Technology And Management (DSATM), Bangalore and interested in working on this project.
Beta Was this translation helpful? Give feedback.
All reactions
-
Glad to see your interest, Anchit. If you have not done already, please sign up for the project here.
We have shipped a Simulink quad-copter plant along with a reference controller in R2022a for performing Hardware In Loop simulations. Feel free to check this example and other examples to get started.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi, my name is Jasmine an undergraduate senior from CSULA, I am currently working on the flight controller design for our project. We are currently in the process of uploading our control system to our autopilot. We are facing a problem within our project where our motors are not continuously spinning. Instead, they are stuttering when we send a thrust command through our RC. However, the appropriate motors are spinning when we give pitch, roll, and thrust commands which indicates to us that our control system is working appropriately. We are running the hardware simulation via I/O connection while having this issue, so we tried to run the control system via external mode, and we got a sample time error which stated that we need to set the sample time of all the PX4 blocks to 1ms. When we changed the sampling time in the PX4 blocks, we still got the same error message. This tells me that it may be a PWM signal rate or Code generation problem, and we have debugged the system and did not find issues with the control system or RC. We also tried the MathWorks model shown here, and the drone's motors would still stutter. I have a video of the issue attached and a picture of the error message we are receiving while running the simulation via external mode. I also have our hardware settings attached.
Hardware setting
CSULA.simulink.motor.run.mov
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi Jasmine,
Can you confirm whether the drone motor stuttered when you deployed (build deploy start or monitor and tune) the example model? I want to understand whether the stutter occurred during monitor and tune mode or during connected io mode. Connected IO mode is quite slow and suitable for checking sensors or actuators. For real time control, use monitor and tune or build, deploy, start option.
About the sample time configuration, we usually set sample time to 10ms for most blocks in controller model. 1ms may be too low.
Can you share the model (along with MATLAB version) that throws "The base rate of the Simulink model 0 is...." error. It is likely due to an incorrect model configuration.
About the stutter, some debugging steps are below,
- Use a logic analyzer (or an oscilloscope) to see if PWM's on time (pulsewidth) is as expected and does not drop to <=1000us. This will confirm if the PWM is being sent correctly from Pixhawk board to ESC. For this experiment you can deploy the the example model.
- Implement a direct pass through from RC receiver to PWM output in this example model. Start from low throttle and see if motor spins correctly.
- Check if motors run as expected if you directly connect the RC receiver to ESC without Pixhawk.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello @vmanoj1996,
The motors worked fine when running the "PX4 PWM" example model through connected IO.
When we input constant to the thrust roll pitch and yaw in our controller system model, all motors worked fine, when we connected our RC block the motors only stuttered/ twitched, but still responded to roll pitch and yaw commands. (also through connected IO)
Currently using MATLAB R2022a
Thank you for the advice!
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi my name is Sean Atkins and I am on the same team as Jasmine. Here is the zipped Simulink file of the model we are using. We are using the monitor and tuned option via external mode when we are getting the "the base rate of the Simulink model 0 is...." error. Flight_Test_Model_4_19_22.zip
Beta Was this translation helpful? Give feedback.
All reactions
-
Hey Sean,
3 things to look for,
- There are 1/s continuous time integrators in your model (Flight_Test_Model_4_19_22/Sensors). Replace them with discrete time integrators.
- Sample time in PX4 uORB Read block is 1 ms. I am not sure if 1 ms rate is achievable on Pixhawk board.
- manual_control_setpoint is an intermediate uorb topic published by another px4 module. Can you try using "Radio Control Transmitter" block instead.
Flight_Test_Model_4_19_22.zip
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello all,
I am Atharva from COEP Technological University majoring in Mechanical Engineering. I am really interested in working and collaborating on this project.
Beta Was this translation helpful? Give feedback.
All reactions
-
@patweatharva, Glad to see that you are interested. Fill out the form available at this link in case you have not done it already.
Feel free to post any questions below!
Beta Was this translation helpful? Give feedback.
All reactions
-
Screenshot (94)
hello, I am facing the above error, whenever I try to build the firmware in UAV toolbox support package for px4 autopilot. As Pixhawk 4 mini is not listed in the select controller, so I have chosen my board is not listed here. and choose the v5 c-make default file and facing the above error. please help in resolving the error.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi,
In your MATLAB command window, there will be build logs getting displayed. Can you please share that as a text file? That would be helpful in understanding what is going wrong. I would also recommend giving a try with px4_fmu-v5_default CMake and seeing if that is also causing a build failure.
Beta Was this translation helpful? Give feedback.
All reactions
-
👀 1
-
Beta Was this translation helpful? Give feedback.
All reactions
-
Are you working on windows or Linux? look like a toolchain issue.
Beta Was this translation helpful? Give feedback.
All reactions
-
we are working on windows. what can be the possible steps to resolve this issue.
Beta Was this translation helpful? Give feedback.
All reactions
-
This looks like an issue with Cygwin toolchain. You can try uninstalling and reinstalling Cygwin and then clone a fresh PX4 Firmware ( you can refer this page). Make sure the clone and update completed without errors. After this before building from the MATLAB Hardware setup screens, build the PX4 Firmware manually in Cygwin window using 'make px4_fmu-v5_default' command. See if you are facing any errors. Note that now you are building without MATLAB and Simulink in picture and if the build fails here, then it is due to some machine/environment specific issue and I am not really sure how to help you out here. You can report this to PX4 issues. and you might get some help from PX4 community.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello, thanks for your response and help. As per your suggestion, we tried uninstalling and reinstalling, cygwin and also cloned a fresh px4 firmware, it cloned and completed without any errors. Later we tried building the px4 firmware manually in cygwin window using 'make px4_fmu-v5_default' command, and we are facing a error there, can you please help out in resolving the error. Complete error is pasted below.
$ make px4_fmu-v5_default
[0/1] Re-running CMake...
-- PX4 version: v1.12.3
-- PX4 config file: /cygdrive/c/PX4/home/Firmware/boards/px4/fmu-v5/default.cmake
-- PX4 config: px4_fmu-v5_default
-- PX4 platform: nuttx
-- cmake build type: MinSizeRel
-- Enabling double FP precision hardware instructions
-- Found PythonInterp: /usr/bin/python3 (found suitable version "3.6.9", minimum required is "3")
-- build type is MinSizeRel
-- PX4 ECL: Very lightweight Estimation & Control Library v1.9.0-rc1-591-gb3fed06
-- Building and including px4_io-v2_default
-- Found PythonInterp: /usr/bin/python3 (found version "3.6.9")
-- Using C++11
-- Release build type: MinSizeRel
-- ROMFS: ROMFS/px4fmu_common
-- ROMFS: Adding build/px4_fmu-v5_default/romfs_extras/px4_io-v2_default.bin -> /etc/extras/px4_io-v2_default.bin
-- ROMFS: Adding boards/px4/fmu-v5/bootloader/px4_fmu-v5_bootloader.bin -> /etc/extras/bootloader.bin
-- ROMFS: Adding platforms/nuttx/init/stm32f7/rc.board_arch_defaults -> /etc/init.d/rc.board_arch_defaults
-- ROMFS: Adding boards/px4/fmu-v5/init/rc.board_defaults -> /etc/init.d/rc.board_defaults
-- ROMFS: Adding boards/px4/fmu-v5/init/rc.board_sensors -> /etc/init.d/rc.board_sensors
-- ROMFS: Adding boards/px4/fmu-v5/init/rc.board_extras -> /etc/init.d/rc.board_extras
-- ROMFS: Adding boards/px4/fmu-v5/init/rc.board_mavlink -> /etc/init.d/rc.board_mavlink
-- Configuring done
-- Generating done
-- Build files have been written to: /cygdrive/c/PX4/home/Firmware/build/px4_fmu-v5_default
[0/1372] git submodule src/drivers/gps/devices
[2/1372] Performing configure step for 'px4io_firmware'
FAILED: external/Stamp/px4io_firmware/px4io_firmware-configure
cd /cygdrive/c/PX4/home/Firmware/build/px4_fmu-v5_default/external/Build/px4io_firmware && /usr/bin/cmake.exe -DCONFIG=px4_io-v2_default -GNinja /cygdrive/c/PX4/home/Firmware && /usr/bin/cmake.exe -E touch /cygdrive/c/PX4/home/Firmware/build/px4_fmu-v5_default/external/Stamp/px4io_firmware/px4io_firmware-configure
-- PX4 version: v1.12.3
CMake Error at cmake/px4_config.cmake:81 (message):
PX4 config file not set, try one of
airmind/mindpx-v2/default.cmake;ark/can-flow/canbootloader.cmake;ark/can-flow/debug.cmake;ark/can-flow/default.cmake;ark/can-gps/canbootloader.cmake;ark/can-gps/debug.cmake;ark/can-gps/default.cmake;atlflight/cmake_hexagon/bundle.cmake;atlflight/cmake_hexagon/fastrpc.cmake;atlflight/cmake_hexagon/hexagon_sdk.cmake;atlflight/cmake_hexagon/linux_app.cmake;atlflight/cmake_hexagon/qurt_flags.cmake;atlflight/cmake_hexagon/qurt_lib.cmake;atlflight/cmake_hexagon/toolchain/Toolchain-arm-linux-gnueabihf.cmake;atlflight/cmake_hexagon/toolchain/Toolchain-arm-oemllib32-linux-gnueabi.cmake;atlflight/cmake_hexagon/toolchain/Toolchain-qurt.cmake;atlflight/eagle/cmake/upload.cmake;atlflight/eagle/default.cmake;atlflight/eagle/qurt.cmake;atlflight/excelsior/default.cmake;atlflight/excelsior/qurt.cmake;av/x-v1/default.cmake;beaglebone/blue/cmake/init.cmake;beaglebone/blue/cmake/upload.cmake;beaglebone/blue/default.cmake;bitcraze/crazyflie/default.cmake;bitcraze/crazyflie21/default.cmake;cuav/can-gps-v1/canbootloader.cmake;cuav/can-gps-v1/debug.cmake;cuav/can-gps-v1/default.cmake;cuav/nora/bootloader.cmake;cuav/nora/default.cmake;cuav/nora/test.cmake;cuav/x7pro/bootloader.cmake;cuav/x7pro/default.cmake;cuav/x7pro/test.cmake;cubepilot/cubeorange/bootloader.cmake;cubepilot/cubeorange/default.cmake;cubepilot/cubeorange/test.cmake;cubepilot/cubeyellow/default.cmake;cubepilot/cubeyellow/test.cmake;cubepilot/io-v2/default.cmake;emlid/navio2/cmake/upload.cmake;emlid/navio2/default.cmake;freefly/can-rtk-gps/canbootloader.cmake;freefly/can-rtk-gps/default.cmake;holybro/can-gps-v1/canbootloader.cmake;holybro/can-gps-v1/debug.cmake;holybro/can-gps-v1/default.cmake;holybro/durandal-v1/bootloader.cmake;holybro/durandal-v1/default.cmake;holybro/durandal-v1/test.cmake;holybro/kakutef7/default.cmake;holybro/pix32v5/default.cmake;holybro/pix32v5/test.cmake;modalai/fc-v1/default.cmake;modalai/fc-v1/rtps.cmake;modalai/fc-v1/test.cmake;modalai/fc-v2/bootloader.cmake;modalai/fc-v2/default.cmake;modalai/fc-v2/test.cmake;mro/ctrl-zero-f7-oem/default.cmake;mro/ctrl-zero-f7/default.cmake;mro/ctrl-zero-h7-oem/bootloader.cmake;mro/ctrl-zero-h7-oem/default.cmake;mro/ctrl-zero-h7/bootloader.cmake;mro/ctrl-zero-h7/default.cmake;mro/pixracerpro/bootloader.cmake;mro/pixracerpro/default.cmake;mro/x21-777/default.cmake;mro/x21/default.cmake;nxp/fmuk66-e/default.cmake;nxp/fmuk66-e/rtps.cmake;nxp/fmuk66-e/socketcan.cmake;nxp/fmuk66-v3/default.cmake;nxp/fmuk66-v3/rtps.cmake;nxp/fmuk66-v3/socketcan.cmake;nxp/fmuk66-v3/test.cmake;nxp/fmurt1062-v1/default.cmake;nxp/ucans32k146/canbootloader.cmake;nxp/ucans32k146/default.cmake;omnibus/f4sd/default.cmake;px4/fmu-v2/default.cmake;px4/fmu-v2/fixedwing.cmake;px4/fmu-v2/multicopter.cmake;px4/fmu-v2/rover.cmake;px4/fmu-v2/test.cmake;px4/fmu-v3/default.cmake;px4/fmu-v3/test.cmake;px4/fmu-v4/cannode.cmake;px4/fmu-v4/default.cmake;px4/fmu-v4/test.cmake;px4/fmu-v4pro/default.cmake;px4/fmu-v4pro/io-v2/default.cmake;px4/fmu-v4pro/test.cmake;px4/fmu-v5/ctrlalloc.cmake;px4/fmu-v5/debug.cmake;px4/fmu-v5/default.cmake;px4/fmu-v5/fixedwing.cmake;px4/fmu-v5/multicopter.cmake;px4/fmu-v5/optimized.cmake;px4/fmu-v5/rover.cmake;px4/fmu-v5/rtps.cmake;px4/fmu-v5/stackcheck.cmake;px4/fmu-v5/test.cmake;px4/fmu-v5/uavcanv0periph.cmake;px4/fmu-v5/uavcanv1.cmake;px4/fmu-v5x/base_phy_DP83848C.cmake;px4/fmu-v5x/default.cmake;px4/fmu-v5x/test.cmake;px4/fmu-v6x/bootloader.cmake;px4/fmu-v6x/default.cmake;px4/fmu-v6x/fixedwing.cmake;px4/fmu-v6x/multicopter.cmake;px4/fmu-v6x/test.cmake;px4/raspberrypi/cmake/upload.cmake;px4/raspberrypi/default.cmake;px4/sitl/ctrlalloc.cmake;px4/sitl/default.cmake;px4/sitl/nolockstep.cmake;px4/sitl/replay.cmake;px4/sitl/rtps.cmake;px4/sitl/test.cmake;scumaker/pilotpi/arm64.cmake;scumaker/pilotpi/cmake/upload.cmake;scumaker/pilotpi/default.cmake;spracing/h7extreme/default.cmake;uvify/core/default.cmake
Call Stack (most recent call first):
CMakeLists.txt:142 (include)
-- Configuring incomplete, errors occurred!
[6/1372] Generating git version header
ninja: build stopped: subcommand failed.
make: *** [Makefile:226: px4_fmu-v5_default] Error 1
Beta Was this translation helpful? Give feedback.
All reactions
-
Since the build is failing without MATLAB and Simulink in picture, it is due to some machine/environment specific issue and I am not really sure how to help you out here. You can report this to PX4 issues. and you might get some help from PX4 community.
Beta Was this translation helpful? Give feedback.
All reactions
-
Screenshot (96)
Hello, I had a query, as the challenge states that "Pixhawk 4 mini flight controller" must be used to complete it, but its not listed in the dropdown list of px4 autopilot board in "UAV toolbox support package for px4 autopilot." Also can we use any of the controller mentioned like pixhawk cube orange inorder to complete the challenge. If yes, what all errors or difficulties we can face further. And if we have to go with only "Pixhawk 4 mini flight controller" then do we have to select "my board is not mentioned here" in the dropdown.
Beta Was this translation helpful? Give feedback.
All reactions
-
If you are using Pixhawk 4 mini you can choose 'My board not listed here' or ' PX4 Pixhawk 4' (Since both Pixhawk 4 and mini are fmu-v5). I recommend using 'PX4 Pixhawk 4' because you get some extra features like Connected I/O. You can also use Cube Orange also but make sure that you chose the physical airframe accordingly since their form factors are slightly different. Here is the link to some known build failure issues and their fixes for Cube Orange.
Beta Was this translation helpful? Give feedback.
All reactions
-
Also is it necessary to use pixhawk 4 mini only, or we can use any flight controller, like pixhawk cube orange.
Beta Was this translation helpful? Give feedback.
All reactions
-
You can use any supported flight controller such as cube orange. Make sure that you chose the physical airframe accordingly.
Beta Was this translation helpful? Give feedback.
All reactions
-
Contribute to the discussion by asking and/or answering questions, commenting, or sharing your ideas for solutions to project #217
Hi, I am a final year student at Vellore Institute of Technology Bhopal and interested in working and collaborating on this project.
Beta Was this translation helpful? Give feedback.
All reactions
-
👍 1
-
hello,
Good to see you are interested in the above challenge to complete, Please let me know how we can contribute more
Beta Was this translation helpful? Give feedback.
All reactions
-
I would be grateful if I could get some guidance on where to start as this is the first time I am doing an industry level project with MATLAB Simulink.
Beta Was this translation helpful? Give feedback.
All reactions
-
Glad to see that you are interested in this project. You can find the instructions for setting up PX4 with Simulink here. Additionally these examples can help you get started.
Please feel free to post any questions or thoughts you may have below.
Beta Was this translation helpful? Give feedback.
All reactions
-
Hi, I am Shiva Rajesh. I signed up for this challenge and set up the UAV toolbox support package for PX4 autopilots and tried to run the SITL simulation for a simple Simulink example model I found on MathWorks resource page. But whenever I run the model the jMAVsim simulation window does not pop up, instead i get the following error. I request your guidance to solve this.
Screenshot (328)
Beta Was this translation helpful? Give feedback.
All reactions
-
https://radiolink.com.cn/doce/pro
צילום מסך 2024年12月20日 105001
Hi all,
I want to start this project soon ,someone knows if this pixhawk controller is supported by simulink?
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello , I am an MSc student( Aerospace Engineering) at the University Of Salford. I had my bachelor degree in electrical and Electronics Engineering ..
Please I am interested in this project. How can I join and contribute to the project. I am new to Matlab design of flight controller and simulink.
Beta Was this translation helpful? Give feedback.
All reactions
-
Beta Was this translation helpful? Give feedback.