Miscellaneous
Manless Aerial Device
This is an Arduino library to build ESP32 / ESP32-S3 / RP2350 / RP2040 / STM32 flight controllers. A functional DIY flight controller can be build for under $10 from readily available development boards and sensor breakout boards. Ideal if you want to try out new flight control concepts, without first having to setup a build environment and without having to read through thousands lines of code to find the spot where you want to change something.
Quadcopter.ino
is a 1000 line demo program for a quadcopter. It has been flight tested on ESP32, ESP32-S3, RP2350, RP2040, and STM32F405 microcontrollers with the Arduino IDE. The program can be easily adapted to control your plane or VTOL craft. The source code has extensive documentation explaning what the settings and functions do.
I enjoy hacking with electronics and I'm attempting to write some decent code for this project. If you enjoy it as well, please leave some feedback in the form of Stars, Issues, Pull Requests, or Discussions. Thanks!
help
to see the available CLI commands.pimu
, pgyro
, proll
to Check that IMU sensor and AHRS are working correctly.calimu
and calmag
to calibate the sensors.ppwm
and pradio
to show pwm and scaled radio values.pmot
to show motor output.By default madflight has these safety features enabled:
src/madflight
directory.setup()
and loop()
.imu
Inertial Measurement Unit, retrieves accelerometer, gyroscope, and magnetometer sensor dataahrs
Attitude Heading Reference System, estimates roll, yaw, pitchrcin
RC INput, retrieves RC receiver datacontrol
PID controller and output mixerout
Output to motors and servosmag
Magnetometer (external)baro
Barometergps
GPS receiverbb
Black Box data loggercli
Command Line Interface for debugging, configuration and calibrationcfg
Read and save configuration to flashhw
Hardware specific code for STM32, RP2040 and ESP32imu
object has property imu.gx
which is the current gyro x-axis rate in degrees per second for the selected IMU chip.src/madflight/interfaces.h
which defines the module interfaces.src/madflight
directory. Here you find the module header file, e.g. src/madflight/imu/imu.h
. In the extras
directory your find test programs for the modules, e.g. extras/TestMadflight/imu.ino
.This code is a shared, open source flight controller for small micro aerial vehicles and is intended to be modified to suit your needs. It is NOT intended to be used on manned vehicles. I do not claim any responsibility for any damage or injury that may be inflicted as a result of the use of this code. Use and modify at your own risk. More specifically put:
THIS SOFTWARE IS PROVIDED BY THE CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Logo image copyright (c) 1975 Deutsches MAD Magazine. This project is not associated with MAD Magazine.