System Specification
VER_0.4.2_STABLE

Technical Documentation

Full architectural breakdown of the ATLAS firmware, electronics, and mechanical subsystems. Designed for transparency in PID control logic and hardware compliance.

Overview

PID Control Core

Dual-axis stabilizer running at 100Hz. The MPU6050 IMU provides orientation data via a complementary filter (α=0.96) to mitigate high-frequency noise and low-frequency drift.

Kp2.0
Ki0.1
Kd0.5
Range±30°
main_control_loop.ino
// Main control loop — ~100Hz
void loop() {
    // 1. Read IMU sensor data
    imu.update();
    pitchAngle = imu.getPitch();
    rollAngle  = imu.getRoll();

    // 2. Safety check
    if (abs(pitchAngle) > MAX_PITCH_ANGLE ||
        abs(rollAngle) > MAX_ROLL_ANGLE) {
        emergencyStop();
        return;
    }

    // 3. PID computation (target = 0° horizontal)
    pitchCommand = pidPitch.compute(0.0 - pitchAngle, dt);
    rollCommand  = pidRoll.compute(0.0 - rollAngle, dt);

    // 4. Drive servos
    servoPitch.setAngle(pitchCommand);
    servoRoll.setAngle(rollCommand);
}
graduated_warning_logic
// 4-level graduated warning system
// Hardware: Green LED (D3), Red LED (D5), Piezo Buzzer (D6)
void updateWarningSystem() {
    float totalTilt = sqrt(pitch*pitch + roll*roll);

    if (totalTilt < 5.0) {      // SAFE — green, silent
        setLED(GREEN); buzzerOff();
    } else if (totalTilt < 15.0) { // CAUTION — green+red (amber), slow beep
        setLED(AMBER); buzzerBeep(500);
    } else if (totalTilt < 25.0) { // DANGER — red, fast beep
        setLED(RED);   buzzerBeep(200);
    } else {                    // CRITICAL — red flash, continuous tone
        setLED(RED_FLASH); buzzerContinuous();
    }
}

Module Registry

main.ino
Main control loop, setup, serial commands
394 LOC
config.h
Pin definitions, PID gains, thresholds, feature flags
183 LOC
imu.h / imu.cpp
MPU6050 driver, complementary filter, calibration
~200 LOC
pid.h / pid.cpp
PID controller with anti-windup and output limits
~120 LOC
servo_control.h / .cpp
Servo abstraction with angle limits and rate limiting
~100 LOC
safety.h / safety.cpp
Emergency stop, soft start, watchdog
~80 LOC
warning.h / warning.cpp
4-level graduated LED + buzzer + haptic alerts
~150 LOC

Repository Snapshot

Branch: master // Last Commit: Feb 15, 2026