98 lines
2.3 KiB
Markdown
98 lines
2.3 KiB
Markdown
# ESP32-S3 Drone Stabilization Project
|
|
|
|
This project implements a robust flight stabilization system for a quadcopter drone using the **ESP32-S3 Super Mini** microcontroller and an **MPU6050 IMU**. The firmware leverages the dual-core architecture of the ESP32-S3 to separate real-time stabilization from command processing, ensuring smooth and responsive flight control.
|
|
|
|
---
|
|
|
|
## Features
|
|
|
|
- **Dual-Core Architecture:**
|
|
- **Core 0:** Dedicated to high-priority, real-time sensor reading and PID-based stabilization.
|
|
- **Core 1:** Handles lower-priority tasks such as receiving and processing flight commands.
|
|
- **Autonomous Hover:**
|
|
- Maintains stable hover when no control commands are received.
|
|
- **IMU Integration:**
|
|
- Uses the MPU6050 for accurate attitude estimation and stabilization.
|
|
- **Motor Mixing:**
|
|
- Dynamically adjusts motor outputs for balanced flight.
|
|
- **Command Input:**
|
|
- Supports input via serial, WiFi, or Bluetooth (customizable).
|
|
|
|
---
|
|
|
|
## Hardware Requirements
|
|
|
|
- **ESP32-S3 Super Mini**
|
|
- **MPU6050 IMU**
|
|
- **4x ESCs and motors**
|
|
- **3.7V LiPo battery (2S-4S)**
|
|
- **Optional:** WiFi/BLE module for wireless control
|
|
|
|
---
|
|
|
|
## Wiring Guide
|
|
|
|
- **MPU6050:**
|
|
- SCL → `GPIO39`
|
|
- SDA → `GPIO40`
|
|
- **ESCs:**
|
|
- ESC1 → `GPIO4`
|
|
- ESC2 → `GPIO5`
|
|
- ESC3 → `GPIO6`
|
|
- ESC4 → `GPIO7`
|
|
|
|
---
|
|
|
|
## Software Requirements
|
|
|
|
- **Arduino IDE** (with ESP32 board support)
|
|
- **Libraries:**
|
|
- `Adafruit_MPU6050`
|
|
- `ESP32Servo`
|
|
- `Wire`
|
|
|
|
---
|
|
|
|
## Getting Started
|
|
|
|
1. **Clone the Repository:**
|
|
2. **Open the project in Arduino IDE.**
|
|
3. **Install the required libraries.**
|
|
4. **Connect your hardware as described above.**
|
|
5. **Upload the firmware to your ESP32-S3.**
|
|
6. **Calibrate the IMU and test with props removed for safety.**
|
|
|
|
---
|
|
|
|
## Usage
|
|
|
|
- **Serial Commands:**
|
|
- Send flight commands via the serial monitor.
|
|
- No commands = autonomous hover.
|
|
- **Customization:**
|
|
- Adjust PID constants in the code for optimal flight performance.
|
|
- Integrate WiFi or Bluetooth for wireless control.
|
|
|
|
---
|
|
|
|
## Safety Warning
|
|
|
|
**Always test with props removed and use a safety switch!**
|
|
PID tuning and calibration are essential for stable flight.
|
|
|
|
---
|
|
|
|
## Contributing
|
|
|
|
Pull requests and feedback are welcome! Please open an issue or submit a PR for any improvements or bug fixes.
|
|
|
|
---
|
|
|
|
## License
|
|
|
|
MIT License
|
|
|
|
---
|
|
|
|
Happy flying! 🚁
|