How to Write your own Flight Controller Software — Part 1

Why would You?

The Hardware

Figure 1. Prototype Drone Hardware.
Figure 2. Drone Block Diagram.

Flight Controller Theory

Figure 3. Drone Free Body Diagram.
Equation 1. PID Loop Response
Figure 4. Drone PID Control Loop

ESC PWM Motor Control

Figure 5. Arduino Nano 33 IoT Header Pins (credit).
PWM frequency = (frequency GCLK) / (N * PER + 1)
Timer resolution = log(PER + 1) / log(2)
log = log to the base 10

The Nano 33 BLE and Portenta H7

Figure 6. Nano 33 BLE Pinout (credit).

Thrust Calculations

F = ma = 0.360 x 9.8 (acceleration due to gravity) = 3.528 N
Figure 7. Racerstar BR2205 Motor Specifications.

Correlating PWM Speed and Thrust

Reefwing Software · iOS & Android Development · Robotics · #followback #iOS #Android #developer #indiedev #robotics #startup #arduino #raspberrypi

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store