All Projects → lobodol → Drone Flight Controller

lobodol / Drone Flight Controller

Licence: mit
A quadcopter flight controller based on Arduino Uno

Projects that are alternatives of or similar to Drone Flight Controller

Jankdrone
The jankest autonomous drone ever built and programmed from scratch
Stars: ✭ 127 (+24.51%)
Mutual labels:  arduino, quadcopter
Plus
Otto DIY+ ("Otto DIY with steroids" + Bluetooth + APP + switch + sensors + strength +...
Stars: ✭ 100 (-1.96%)
Mutual labels:  arduino
Exploring Arduino 1st Edition
Companion Code for the 1st Edition of "Exploring Arduino," the book by Jeremy Blum
Stars: ✭ 95 (-6.86%)
Mutual labels:  arduino
Car Controller
An arduino firmware that outputs a PWM signal for steering motor control via serial.
Stars: ✭ 98 (-3.92%)
Mutual labels:  arduino
Blockly At Rduino
[email protected] : Blockly remix for Arduino. Totally new version, enhanced one !
Stars: ✭ 96 (-5.88%)
Mutual labels:  arduino
Polaron
A DIY drum machine for the teensy microcontroller (hardware / software)
Stars: ✭ 99 (-2.94%)
Mutual labels:  arduino
Esp8266button
An IoT Button using an Adafruit Huzzah or SparkFun Thing, push button and IFTTT
Stars: ✭ 95 (-6.86%)
Mutual labels:  arduino
Jtagduino
The JTAGduino project has the goal of using Arduino as a JTAG interface.
Stars: ✭ 101 (-0.98%)
Mutual labels:  arduino
Rgb
Offline smart home - esp8266 and WS2811/WS2812/NeoPixel LEDs Smart home / Gudra māja / Умны дом
Stars: ✭ 99 (-2.94%)
Mutual labels:  arduino
Stm32generic
Generic implementation of Arduino for STM32 boards
Stars: ✭ 98 (-3.92%)
Mutual labels:  arduino
Erika3
ERIKA Enterprise v3 RTOS
Stars: ✭ 98 (-3.92%)
Mutual labels:  arduino
Esp32 soundrecorder
ESP32 Sound recorder with simple code in arduino-esp32. (I2S interface)
Stars: ✭ 96 (-5.88%)
Mutual labels:  arduino
Noodle Synth
A User-friendly Arduino/Teensy/ESP8266 Library to play MIDI files with infinite polyphonic notes with full control over volume, pitch, and . . . music. No shields needed(Just a speaker).
Stars: ✭ 99 (-2.94%)
Mutual labels:  arduino
Easyddns
Easy to Use ESP8266 DDNS Update Client Library.
Stars: ✭ 96 (-5.88%)
Mutual labels:  arduino
Arduinomididrums
A velocity sensitive MIDI drum program with realistic feedback
Stars: ✭ 100 (-1.96%)
Mutual labels:  arduino
Teensyterpreter
A Teensy script to open up a reverse TCP shell on Windows machines in as little time as possible.
Stars: ✭ 95 (-6.86%)
Mutual labels:  arduino
Growerbot
growerbot sources
Stars: ✭ 97 (-4.9%)
Mutual labels:  arduino
Websocketserialmonitor
ESP8266 based serial-to-websockets proxy for OTA debugging
Stars: ✭ 98 (-3.92%)
Mutual labels:  arduino
Avr8js
Arduino (8-bit AVR) simulator, written in JavaScript and runs in the browser / Node.js
Stars: ✭ 102 (+0%)
Mutual labels:  arduino
Cirnos
Bringing the workflow of Arduino to the Raspberry Pi
Stars: ✭ 101 (-0.98%)
Mutual labels:  arduino

Quadcopter PID implementation

Build Status License: MIT

flight

1. Introduction

This Arduino sketch provides a flight controller for an X quadcopter based on an Arduino Uno board and the MPU6050 sensor.

Basically, this automation routine is an implementation of a digital PID with a refresh rate of 250Hz. The method used to calculate PID coefficients is Ziegler Nichols method. The frame of the quadcopter is based on the F450.

You can use this to calibrate your ESCs.

A detailed article is available here (in french)

(i) Currently under active development.

2. Requirements

Arduino libraries:

3. Pin connection:

       +-------------------------+
       |        MPU-6050         |
       |                         |
       | 3V3  SDA  SCL  GND  INT |
       +--+----+----+----+----+--+
          |    |    |    |
          |    |    |    |
+---------+----+----+----+----------------+
|        3.3V  A4   A5  GND               |
|                                         |
|                                         |
|                 Arduino Uno             |
|                                         |
| #4   #5   #6   #7   #8   #9  #10   #11  |
+--+----+----+----+----+----+----+----+---+
   |    |    |    |    |    |    |    |
  (M1) (M2) (M3) (M4)  |    |    |    |
                       |    |    |    |  
                       |    |    |    |
                    +--+----+----+----+---+
                    | C1   C2   C3   C4   |
                    |                     |
                    |     RF Receiver     |
                    +---------------------+
  
Legend:
Mx : Motor X
Cx : Receiver channel x

4. Configuration

4.1 Remote configuration

By default, this sketch uses the mode 2 for RF remote, according to the following picture:

remote modes

The channel mapping is then :

Channel Command
1 ROLL
2 PITCH
3 THROTTLE
4 YAW

To change the channel mapping, update the function configureChannelMapping according to your needs:

void configureChannelMapping() {
    mode_mapping[YAW]      = CHANNEL4;
    mode_mapping[PITCH]    = CHANNEL2;
    mode_mapping[ROLL]     = CHANNEL1;
    mode_mapping[THROTTLE] = CHANNEL3;
}

4.2 PID tuning

The default PID coeffcient values might work for an F450-like quadcopter. However, you can tune them in the global variable declaration section:

// PID coefficients
float Kp[3] = {4.0, 1.3, 1.3};    // P coefficients in that order : Yaw, Pitch, Roll
float Ki[3] = {0.02, 0.04, 0.04}; // I coefficients in that order : Yaw, Pitch, Roll
float Kd[3] = {0, 18, 18};        // D coefficients in that order : Yaw, Pitch, Roll

5. Quadcopter orientation

 Front
(1) (2)     x
  \ /     z ↑
   X       \|
  / \       +----→ y
(3) (4)
  • Motor 1 : front left - clockwise
  • Motor 2 : front right - counter-clockwise
  • Motor 3 : rear left - clockwise
  • Motor 4 : rear left - counter-clockwise

Paper plane

  • Left wing up implies a positive roll
  • Nose up implies a positive pitch
  • Nose right implies a positive yaw

The MPU6050 must be oriented as following:

  • X axis : roll
  • Y axis : pitch
  • Z axis : yaw

6. Start/stop

This sketch comes with a safety process : to start the quadcopter, move the left stick of the remote in the bottom left corner. Then move it back in center position.

To stop the quadcopter, move the left stick in the bottom right corner.

State machine

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].