You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+13-49Lines changed: 13 additions & 49 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,25 +7,27 @@
7
7
8
8
_madflight_ is a toolbox to build high performance flight controllers with Aduino IDE or PlatformIO for ESP32-S3 / ESP32 / RP2350 / RP2040 / STM32. A functional DIY flight controller can be build for under $10 from readily available [development boards](https://madflight.com/Controller-Boards/) and [sensor breakout boards](https://madflight.com/Sensor-Boards/).
9
9
10
+
Get started with the [Arduino IDE](https://madflight.com/Getting-Started) or [PlatformIO](https://madflight.com/Getting-Started)
11
+
10
12
Flight tested example programs for quadcopter and airplane are included. The example programs are only a couple hundred lines long, but contain the full flight controller logic. The nitty-gritty low-level sensor and input/output management is done by the _madflight_ library.
11
13
12
14
The source code and [website](https://madflight.com/) have extensive documentation explaning what the settings and functions do.
If you clone/download this repository you get version 2.0.0-DEV, which is BLEEDING EDGE - not flight tested at all, might not even compile, and will completely change in the next hour...
20
+
If you clone/download this repository you get the DEVELOPMENT version, which is BLEEDING EDGE - not flight tested at all, might not even compile, and will completely change in the next hour...
19
21
20
-
Use [release version 1.3.3](https://github.com/qqqlab/madflight/releases) if you want something that actually has logged flight hours.
22
+
Use a [release version](https://github.com/qqqlab/madflight/releases) if you want something that actually has logged flight hours.
-[STM32](https://madflight.com/Board-STM32/) (e.g. Black Pill or a commercial flight controller)
28
-
-[SPI IMU sensor](https://madflight.com/Sensor-Boards/) (BMI270, MPU9250, MPU6500, or MPU6000), if not available then use an I2C IMU sensor (MPU6050 or MPU9150)
30
+
-[SPI/I2C IMU sensor](https://madflight.com/Sensor-Boards/) (BMI270, MPU9250, MPU6500, MPU6000, MPU6050 or MPU9150)
29
31
- RC Receiver: MAVLink, ELRS, CRSF, SBUS, DMSX, or PPM
30
32
- BEC or DC-DC converter to power your board from a battery
31
33
- ESC (OneShot125 or 50-490Hz PWM) and/or servos (50-490Hz PWM)
@@ -40,62 +42,24 @@ Use [release version 1.3.3](https://github.com/qqqlab/madflight/releases) if you
40
42
41
43
## Getting Started
42
44
43
-
1. Connect the required hardware to your controller board:
45
+
1. Connect the required hardware (see below) to your controller board:
44
46
- See [RP2350/RP2040 pinout and instructions](https://madflight.com/Board-RP2040/)
45
47
- -or- [ESP32-S3/ESP32 pinout and instructions](https://madflight.com/Board-ESP32/)
46
48
- -or- [STM32 pinout and instructions](https://madflight.com/Board-STM32/)
47
-
- Connect your IMU (gyro/acceleration) sensor as shown [here](https://madflight.com/).
49
+
- Connect your IMU (gyro/acceleration) sensor as shown [here](https://madflight.com/Getting-Started/).
48
50
- Connect your radio receiver according to the configured pins.
49
-
2. Install the madflight library in Arduino IDE. (Menu *Tools->Manage Libraries*, then search for **madflight**)
51
+
2. Install the madflight library in Arduino IDE. (Menu *Tools->Manage Libraries*, then search for _madflight_)
50
52
3. Open *Examples for custom libraries->madflight->Quadcopter.ino* in the Arduino IDE.
51
-
4. Edit the HARDWARE section in madflight_config.h to enable the connected peripherals.
52
-
5. If you're not using the default pinout then setup your board pinout in the CUSTOM PINS section.
53
-
6. Compile Quadcopter.ino and upload it to your board. Connect the Serial Monitor at 115200 baud and check the startup messages. Type `help` to see the available CLI commands.
53
+
4. Edit the HARDWARE CONFIG section in madflight_config.h to enable the connected peripherals.
54
+
5. If you're not using the default pinout then setup your board pinout in the CUSTOM PINS CONFIG section.
55
+
6. Compile Quadcopter.ino and upload it to your board. Connect the Serial Monitor at 115200 baud and check the messages. Type `help` to see the available CLI commands.
54
56
7. Type `calradio` and follow the prompts to setup your RC radio receiver.
55
57
8. IMPORTANT: Use CLI `calimu` and `calmag` to calibate the sensors.
56
58
9. Use CLI commands `pimu`, `pahr`, `prcl`, `pmot`, etc. and check that IMU sensor, AHRS and RC Receiver are working correctly.
57
59
10. Connect motors (no props) and battery and check that motors are spinning correctly.
58
60
11. Mount props, go to an wide open space, and FLY!
59
61
60
-
## Safety First!!!
61
-
62
-
By default **madflight** has these safety features enabled:
63
-
64
-
- Motors only rotate when armed.
65
-
- Arming Procedure: set throttle low then flip the arm switch from disarmed to armed.
66
-
- Kill Switch: when the arm switch is in the disarm position, disarm and stop motors until re-armed.
67
-
- Failsafe: when radio connection is lost, disarm and stop motors until re-armed.
68
-
- Armed Low Throttle: motors run at low speed, to give visible armed indication.
69
-
- LED armed/disarmed indicator.
70
-
71
-
## Software Design
72
-
73
-
- Keep it simple!!!
74
-
- Based on [dRehmFlight](https://github.com/nickrehm/dRehmFlight)
75
-
- Coded primarily for readability, then for speed and code size.
76
-
- No external dependencies, all modules are included in the `src/madflight` directory.
77
-
- The madflight flight controller runs standard `setup()` and `loop()`.
78
-
- It mainly uses plain Arduino functionality: Serial, Wire, and SPI. One custom hardware dependent library is used for PWM. Therefor, it can fairly easily ported to other 32 bit microcontrollers that support the Arduino framework. Also porting to other build environments like PlatformIO or CMake should not be a huge effort.
-`cli` Command Line Interface for debugging, configuration and calibration
87
-
-`gps` GPS receiver
88
-
-`hw` Hardware specific code for STM32, RP2040 and ESP32
89
-
-`imu` Inertial Measurement Unit, retrieves accelerometer, gyroscope, and magnetometer sensor data
90
-
-`led` LED driver
91
-
-`mag` Magnetometer sensor (external)
92
-
-`out` Output to motors and servos
93
-
-`pid` PID controller
94
-
-`rcin` RC INput, retrieves RC receiver data
95
-
-`veh` Vehicle information
96
-
- Most modules are interfaced through a global object, for example the `imu` object has property `imu.gx` which is the current gyro x-axis rate in degrees per second for the selected IMU chip.
97
-
- The module implementations are in subdirectories of the `src/madflight` directory. Here you find the module header file, e.g. `src/madflight/imu/imu.h`, and the interface declaration `src/madflight/imu/imu.h`
98
-
- The module files are usually header only, that is, the header also includes the implemention.
62
+
For additional help see [Discussions](https://github.com/qqqlab/madflight/discussions)
0 commit comments