How muhyildiz/robohexa works
Project type and purpose
• This is an embedded real-time control system for a hexapod robot (RoboHexa) designed to traverse rough terrain. It comprises both hardware (mechanics, PCB, sensors, actuators) and firmware (sensor drivers, PID motion control, RF communication, mapping integration).
Key components
• Mechanical subsystem (six‐leg chassis)
• Electrical/PCB subsystem (power management, PWM drivers, SPI/I²C bus)
• Sensors
• IMU6050 (orientation & acceleration)
• Mini limit switches (leg contact)
• LIDAR module (optional mapping)
• Actuators
• 6× MG996R servo motors
• Control & processing
• STM32 microcontroller running firmware (sensor acquisition, control loops, state machine)
• Communication
• NRF24L01 transceiver (robot ↔ wireless handheld controller)
• External operator interface (RF remote controller)
Relationships and data flows
• Sensors → MCU: IMU6050 via I²C, switches via GPIO, LIDAR via serial or I²C
• MCU → Actuators: PWM outputs (18 channels) drive servos
• MCU ↔ PCB: power regulation and signal routing (internal to board)
• MCU ↔ Remote controller: bidirectional packets over NRF24L01
• Firmware modules interact:
• Sensor drivers feed data to balance & gait algorithms
• PID controller issues real-time PWM commands
• RF module transmits telemetry & receives user commands
• Mapping subroutine (LIDAR data) may run on MCU or an off-board processor
Architectural patterns and design principles
• Modular firmware architecture:
• Hardware abstraction layer (HAL) for sensors, timers, comms
• Control layer implementing gait scheduler and PID loops
• Communication layer handling RF packets and mapping data
• Real-time control loop: fixed-rate main loop or RTOS threads
• Separation of concerns: sensing, planning, actuation, communication
Details
• Every bus and signal (I²C, SPI, PWM, GPIO, RF)
• Real-time feedback loops (sensor → control → actuator)
• Power domains and voltage rails
• Firmware tasks and their timing constraints (e.g., PID loop at 100 Hz, RF update at 10 Hz)