|
|
ESP32-S3-WROOM-1UEspressif Systems
|
x 1 | |
|
|
MPU-6050 |
x 1 | |
|
|
SPX3819M5-L-3-3/TR |
x 1 | |
|
|
10k Ohm Resistor |
x 9 | |
|
|
AO3400A Mosfet |
x 4 | |
|
|
5mm Red DIP LED |
x 3 | |
|
|
SS34 Schottky Diode |
x 4 | |
|
|
1uF Capacitor |
x 5 | |
|
|
10uF Capacitor |
x 1 | |
|
|
470uF Capacitor |
x 1 | |
|
|
100nF Capacitor |
x 1 |
|
KiCad 9.0 |
|
|
arduino IDEArduino
|
|
|
betaflight configurator |
Real Time Control Interface Board
I designed and built a Real-Time Control Interface Board (RTCIB) as a compact and reliable embedded control platform for dynamic motion and actuation systems used in aerial and robotic applications. To improve integration and efficiency, I implemented a custom motor driver directly on the PCB, eliminating the need for external drive modules. This approach reduced wiring complexity, saved board space, and enhanced overall system reliability.
At the core of the board is a high-performance microcontroller responsible for real-time data processing and precise actuation control. The design includes dedicated expansion headers for external sensors and peripherals, allowing flexible system configuration, testing, and future scalability.
Significant focus was placed on power management and electrical noise mitigation. The board features onboard voltage regulation, filtering networks, and carefully placed decoupling capacitors to maintain stable operation during rapid load and speed variations. Multiple test points were incorporated to simplify debugging, calibration, and validation during development.
Visual status indicators provide immediate feedback on system states and fault conditions. The PCB layout was optimized for signal integrity, thermal performance, and vibration resistance, ensuring reliable operation in demanding environments.
This project highlights my practical experience in embedded systems design, motor control, power electronics, and PCB layout, and demonstrates my ability to deliver a complete, production-ready hardware solution—from initial concept to functional prototype..
#include <Wire.h>
#include <WiFi.h>
#include <MPU6050.h>
// ================= WIFI =================
const char* ssid = "ESP32_DRONE";
const char* password = "12345678";
WiFiServer server(80);
// ================= MPU =================
MPU6050 mpu;
// ================= MOTOR PINS =================
#define M1 25
#define M2 26
#define M3 27
#define M4 14
// ================= PWM =================
#define PWM_FREQ 400
#define PWM_RES 12
#define MIN_THROTTLE 1000
#define MAX_THROTTLE 2000
// ================= PID =================
float kp = 1.3, ki = 0.02, kd = 0.9;
float rollSet = 0, pitchSet = 0;
float rollInput, pitchInput;
float rollOutput, pitchOutput;
float rollError, pitchError;
float rollLastError, pitchLastError;
float rollI, pitchI;
// ================= CONTROL =================
int throttle = 1000;
void setup() {
Serial.begin(115200);
// Motor PWM setup
ledcSetup(0, PWM_FREQ, PWM_RES);
ledcSetup(1, PWM_FREQ, PWM_RES);
ledcSetup(2, PWM_FREQ, PWM_RES);
ledcSetup(3, PWM_FREQ, PWM_RES);
ledcAttachPin(M1, 0);
ledcAttachPin(M2, 1);
ledcAttachPin(M3, 2);
ledcAttachPin(M4, 3);
Wire.begin(21, 22);
mpu.initialize();
if (!mpu.testConnection()) {
Serial.println("MPU6050 connection failed!");
while (1);
}
// WiFi AP
WiFi.softAP(ssid, password);
server.begin();
Serial.println("ESP32 Flight Controller Ready");
}
void loop() {
handleWiFiControl();
readMPU();
computePID();
mixMotors();
}
// ================= MPU READ =================
void readMPU() {
int16_t ax, ay, az;
mpu.getAcceleration(&ax, &ay, &az);
rollInput = atan2(ay, az) * 57.2958;
pitchInput = atan2(-ax, az) * 57.2958;
}
// ================= PID =================
void computePID() {
rollError = rollSet - rollInput;
pitchError = pitchSet - pitchInput;
rollI += rollError;
pitchI += pitchError;
rollOutput = kp * rollError + ki * rollI + kd * (rollError - rollLastError);
pitchOutput = kp * pitchError + ki * pitchI + kd * (pitchError - pitchLastError);
rollLastError = rollError;
pitchLastError = pitchError;
}
// ================= MOTOR MIXING =================
void mixMotors() {
int m1 = throttle + pitchOutput + rollOutput;
int m2 = throttle + pitchOutput - rollOutput;
int m3 = throttle - pitchOutput - rollOutput;
int m4 = throttle - pitchOutput + rollOutput;
m1 = constrain(m1, MIN_THROTTLE, MAX_THROTTLE);
m2 = constrain(m2, MIN_THROTTLE, MAX_THROTTLE);
m3 = constrain(m3, MIN_THROTTLE, MAX_THROTTLE);
m4 = constrain(m4, MIN_THROTTLE, MAX_THROTTLE);
ledcWrite(0, map(m1, 1000, 2000, 0, 4095));
ledcWrite(1, map(m2, 1000, 2000, 0, 4095));
ledcWrite(2, map(m3, 1000, 2000, 0, 4095));
ledcWrite(3, map(m4, 1000, 2000, 0, 4095));
}
// ================= PHONE CONTROL =================
// URL example:
// http://192.168.4.1/?t=1300&r=5&p=-3
void handleWiFiControl() {
WiFiClient client = server.available();
if (!client) return;
String req = client.readStringUntil('\r');
client.flush();
if (req.indexOf("t=") != -1) {
throttle = req.substring(req.indexOf("t=") + 2).toInt();
}
if (req.indexOf("r=") != -1) {
rollSet = req.substring(req.indexOf("r=") + 2).toFloat();
}
if (req.indexOf("p=") != -1) {
pitchSet = req.substring(req.indexOf("p=") + 2).toFloat();
}
client.println("OK");
}
Real Time Control Interface Board
*PCBWay community is a sharing platform. We are not responsible for any design issues and parameter issues (board thickness, surface finish, etc.) you choose.
Raspberry Pi 5 7 Inch Touch Screen IPS 1024x600 HD LCD HDMI-compatible Display for RPI 4B 3B+ OPI 5 AIDA64 PC Secondary Screen(Without Speaker)
BUY NOW- Comments(0)
- Likes(0)
- 0 USER VOTES
- YOUR VOTE 0.00 0.00
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
- 1
- 2
- 3
- 4
- 5
- 6
- 7
- 8
- 9
- 10
More by Tamil Engineer
-
A Compact Charging Breakout Board For Waveshare ESP32-C3
455 3 4 -
AI-driven LoRa & LLM-enabled Kiosk & Food Delivery System
471 2 0 -
-
-
-
ESP32-C3 BLE Keyboard - Battery Powered with USB-C Charging
671 0 1 -
-
mammoth-3D SLM Voron Toolhead – Manual Drill & Tap Edition
659 0 1 -
-
AEL-2011 Power Supply Module
1329 0 2 -
AEL-2011 50W Power Amplifier
1208 0 2







