Flix v1: Guide to Minimalistic ESP32 Quadcopter

Flix v1 is a fully open source, Arduino based quadcopter built on an ESP32 D1 Mini and low cost IMUs (GY-91 or ICM-20948). Designed for education, research, and experimentation, Flix emphasizes simplicity and clarity:

  • Clean, easy to follow Arduino code
  • 3D‑printed frame optimized for minimal build time
  • Precise Gazebo simulation, running the same flight code
  • WiFi & MAVLink support, enabling remote control & telemetry
  • WCLI (Wireless Command Line Interface) for real time monitoring
  • Flight control textbook in development, plus plans for position control/autonomy

You can pilot Flix with a smartphone, RC transmitter (SBUS), or computer via MAVLink/WiFi. The project includes everything from 3D-print files and wiring schematics to simulation setup, deployment instructions, and flight logs. It’s perfect for diving into drone design, sensor fusion, PID controllers, and autonomous flight research all while spending under $100.

Bill of Materials & Tools

ComponentDescription
ESP32 D1 MiniCore flight controller: Wi‑Fi, GPIO, Arduino IDE
IMUGY‑91 (MPU‑9250 + BMP280) or ICM‑20948 for orientation sensing
MotorsFour 8520 brushed 3.7 V motors
Props55 mm Hubsan or compatible
MOSFETs + resistors100N03A + 10 kΩ pull down resistors to drive motors
Battery1S Li-Po, ~3.7 V compatible
Battery connector + chargerMX2.0 2P connectors, any Li-Po charger
3D-printed frameSTL files: flix frame 1.1, esp32 holder, washer m3
Fasteners & wiringM‑series screws, 28 AWG wire, tape/ties

Tools needed:

  • 3D printer (e.g., Ender 3)
  • Soldering iron, solder with flux
  • Multimeter, screwdrivers

Flix costs under $70 if you source components wisely ESP32 and IMU modules are ~$7, motors/props ~$20, plus batteries.

Assembly & Wiring

A. 3D Printing Frame Parts

Print with 0.2 mm layers, 100 % infill. Total print time: ~6–8 hours depending on your machine. The design features built in mounting holes for IMU and ESP32, ensuring structural rigidity without extra hardware.

B. Wiring Overview

Detailed steps in README.md:

  • Mount ESP32 & IMU to the frame (orientation “LFD” default; customize in imu.ino)
  • IMU → ESP32 (VSPI interface):
    • GND→GND, 3.3 V→3.3 V, SCK→GPIO18, MOSI→GPIO23, MISO→GPIO19, CS→GPIO5
  • MOSFET wiring: Each motor is routed through a MOSFET controlled by GPIO12/13/14/15, pulling motor ground to switch speed via PWM output
  • Optional: SBUS RC receiver on UART2 (GPIO4)

Wiring Code Snippet

// motor_control.ino snippet
#define MOTOR0_PIN 12
#define MOTOR1_PIN 13
#define MOTOR2_PIN 14
#define MOTOR3_PIN 15

void setupMotors() {
  pinMode(MOTOR0_PIN, OUTPUT);
  pinMode(MOTOR1_PIN, OUTPUT);
  pinMode(MOTOR2_PIN, OUTPUT);
  pinMode(MOTOR3_PIN, OUTPUT);
}

// Inside loop: set motor PWM
analogWrite(MOTOR0_PIN, motor0Throttle);

Using 8-bit PWM on ESP32 gives decent motor control. IMU orientation adjustment can be done in imu.ino.

Software Architecture

Flix’s codebase (on GitHub as okalachev/flix) is structured modularly:

  • Loop: IMU → attitude estimation → PID → motor output
  • Interfaces: Wi-Fi CLI (Serial1), MAVLink for QGroundControl compatibility, SBUS RC control
  • Logging & telemetry over Wi-Fi using a simple CLI, no ground station required
  • Simulation interface: Gazebo plugin calls same firmware functions, making simulation results representative

Key Modules

  1. imu.ino: Interfaces with GY‑91 or ICM‑20948. Swap filter code by flipping rotateIMU(…).
  2. controller.ino: Implements cascaded PID: roll/pitch stabilize attitude; yaw and throttle handled separately
  3. motors.ino: Sends motor speed commands via analogWrite
  4. telemetry.ino: CLI and MAVLink communication
  5. Build scripts via Arduino CLI, and Gazebo integration with .world, .sdf, and plugin configuration

Gazebo Simulation Setup

Gazebo offers faithful virtual testing:

  • Load Flix .sdf model + plugin
  • Build with catkin or Gazebo makefile
  • Firmware flash performed inside the simulation
  • Run: $ gazebo flix.world, then $ roslaunch flix_controller.launch

While Gazebo displays model and sensors, the Arduino firmware (identical to real hardware) computes control commands. This allows:

  • Validate frame geometry and stability before printing
  • Tune PID gains in a safe, repeatable environment
  • Accelerated iteration loop without risking components or injury

Flying Flix

  1. Upload firmware via Arduino IDE or CLI
  2. Power the drone; Wi‑Fi network “FlixDrone” appears
  3. Connect terminal (e.g., screen or Putty) → Observe IMU readings
  4. Switch flight mode:
    • Manual via CLI
    • SBUS RC input
    • MAVLink with QGroundControl on PC/phone
  5. PID values can be tuned live via CLI & logged for later analysis

Flight performance:

Code Example: PID Tuning

struct PID { float kp, ki, kd, prevErr, integral; };

PID pidRoll{4.5, 0.02, 0.12}, pidPitch{4.5,0.02,0.12};

float updatePID(PID &pid, float target, float measured, float dt) {

  float err = target - measured;

  pid.integral += err * dt;

  float derivative = (err - pid.prevErr) / dt;

  pid.prevErr = err;

  return pid.kp*err + pid.ki*pid.integral + pid.kd*derivative;

}

Tune kp, ki, kd via CLI during hover testing, then log.

// further details omitted for conciseness

Future Plans

  • Position hold & autonomous waypoint flight (open-source camera system)
  • PCB integration for neat layout & efficient wiring
  • Flight controller textbook, covering IMU filtering, control theory, MAVLink internals
  • Community-driven enhancements on GitHub and Telegram chat hubs

Troubleshooting & Tips

  • IMU calibration: Run 30-sec stationary average before flight
  • Motor direction mismatch: Use CLI test to reverse any
  • Wi‑Fi range: Keep flights indoors; MAVLink helps with telemetry if signal drops
  • Prop balancing: Critical for reducing vibe noise in IMU data
  • Gazebo mismatches: Virtually tune PID, then scale for real-world inertia

Conclusion

Flix v1 is a compact, elegant educational tool ideal for:

  • Learning flight dynamics & PID control
  • Integrating Wi‑Fi, MAVLink, and sensor fusion
  • Rapid prototyping using Gazebo simulation
  • Low-cost experimental or research quadcopter

All code, models, and docs are on GitHub under open-source licensing. Contributions and extensions are encouraged—build your own Flix and join the live Telegram community!

Resources

  • Demo videos & Gazebo simulation details (youtube.com)

Demo Videolink

Previous Article

Design Of Reinforced Concrete Structures 2nd Edition Volume 1

Next Article

Handbook Of Farm, Dairy, And Food Machinery

Write a Comment

Leave a Comment

Your email address will not be published. Required fields are marked *

Subscribe to our Newsletter

Subscribe to our email newsletter to get the latest posts delivered right to your email.
Pure inspiration, zero spam ✨