Skip to content

stix26/humanoid-robot-control-system

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI StreetWalker Humanoid Robot Control System V2.0

This project implements a professional-grade AI-powered street-walking humanoid robot control system with advanced navigation capabilities. The system is designed to provide smooth and adaptive walking motion, sensor fusion for environmental awareness, and intelligent decision-making modules for safe autonomous navigation in urban environments.

🌐 Online Simulation

Try it online: Wokwi Simulation - AI StreetWalker Robot

Experience the robot's capabilities in a virtual environment before building the physical hardware. The simulation includes all the advanced AI features including traffic light detection, pedestrian awareness, and autonomous navigation.

Features

  • Inverse Kinematics: Precise joint control for natural humanoid movement
  • PID Controllers: Adaptive gains for different joint types (arms vs legs)
  • Multi-Sensor Fusion: IMU, force, proximity, and vision sensors
  • Adaptive Gait Generation: Smooth walking with terrain adaptation
  • Traffic Light Detection: Automatic compliance with traffic signals
  • Pedestrian Awareness: Density-based speed adjustment
  • Predictive Collision Avoidance: 8-directional obstacle detection
  • ZMP Balance Control: Zero Moment Point stability analysis
  • Terrain Adaptation: Automatic gait adjustment for rough surfaces

Components

Hardware Requirements

  • Arduino Mega 2560 (48 servo support)
  • 24 Servo Motors (6 per arm, 6 per leg)
  • IMU Sensors (2 analog pins)
  • Force Sensors (4 analog pins for foot contact)
  • Proximity Sensors (8 analog pins for obstacle detection)
  • Vision System (2 analog + 2 digital pins)

Pin Assignments

Servo Motors (24 total):
- Left Arm:  Pins 2-7
- Right Arm: Pins 8-13
- Left Leg:  Pins 22-27
- Right Leg: Pins 28-33

Sensors:
- IMU: A0, A1
- Force: A2-A5
- Proximity: A6-A13
- Vision Analog: A14, A15
- Vision Digital: 34, 35

Installation

1. Hardware Setup

  1. Assemble the robot according to the mechanical design
  2. Connect all sensors to the appropriate pins on the Arduino Mega 2560
  3. Connect the servos to their respective pins as defined in the servo_pins array
  4. Ensure proper power supply for all components

2. Software Setup

  1. Open the Arduino IDE
  2. Go to File > Open
  3. Select the EnhancedHumanoidRobot.ino file from the src directory
  4. Connect your Arduino Mega 2560 to your computer via USB
  5. Select the correct board and port in the Tools menu
  6. Click on the Upload button to upload the sketch to the Arduino

3. Configuration

  1. Modify the robot.config.json file to adjust system parameters
  2. Calibrate sensors according to your specific hardware setup
  3. Test individual components before full system integration

Usage

Serial Commands

Connect to the robot's serial monitor at 115200 baud rate to send commands:

Motion Commands

  • walk - Start walking gait
  • stop - Stop walking and stand
  • emergency - Emergency stop (halts all motion)
  • reset - Reset system after emergency

Status Commands

  • status - Show detailed system status
  • balance - Check balance and COM position
  • joints - Display all joint states
  • env - Show environmental sensor data
  • speed - Display speed and gait parameters
  • help - Show command reference

Example Usage

1. Upload the code to Arduino Mega 2560
2. Open Serial Monitor at 115200 baud
3. Send 'walk' command to start walking
4. Monitor status with 'status' command
5. Use 'stop' to halt movement

System Architecture

Control Loop (100Hz)

  1. Sensor Fusion: Update all sensor data
  2. Balance Control: Compute ZMP and stability
  3. Decision Making: Evaluate environment and safety
  4. Gait Generation: Generate foot trajectories
  5. Inverse Kinematics: Solve joint angles
  6. PID Control: Execute joint movements
  7. Status Reporting: Update system status

Key Classes

  • EnhancedPID: Advanced PID controller with feedforward
  • InverseKinematics: 6-DOF leg inverse kinematics solver
  • TrajectoryGenerator: Smooth foot trajectory generation
  • ZMPBalanceController: Zero Moment Point balance control
  • SensorFusion: Multi-sensor data integration
  • DecisionMaker: AI-based decision making
  • GaitController: Adaptive gait generation

Safety Features

  • Emergency Stop: Immediate halt of all motion
  • Obstacle Detection: 8-directional proximity sensing
  • Traffic Light Compliance: Automatic stop at red lights
  • Pedestrian Awareness: Speed adjustment based on density
  • Balance Monitoring: Continuous stability assessment
  • Joint Limits: Hardware and software joint limits
  • Fault Detection: Automatic fault detection and reporting

Troubleshooting

Common Issues

  1. Servo Jitter: Check power supply and PID tuning
  2. Balance Problems: Verify IMU calibration and COM estimation
  3. Sensor Errors: Check wiring and pin assignments
  4. Communication Issues: Verify baud rate and USB connection

Debug Commands

  • Use joints to check individual joint status
  • Use balance to verify stability calculations
  • Use env to check sensor readings
  • Monitor serial output for error messages

Calibration

  1. IMU Calibration: Ensure robot is level during startup
  2. Force Sensors: Adjust thresholds in configuration
  3. Proximity Sensors: Test range and sensitivity
  4. Vision System: Calibrate traffic light detection thresholds

Performance Specifications

  • Control Frequency: 100 Hz
  • Walking Speed: 0.58 m/s (adjustable)
  • Step Length: 0.35 m
  • Step Height: 0.06 m
  • Joint Resolution: 1 degree
  • Balance Accuracy: ±3 cm ZMP margin
  • Sensor Update Rate: 100 Hz

Advanced Features

AI Decision Making

  • Traffic light detection and compliance
  • Pedestrian density analysis
  • Terrain roughness assessment
  • Predictive collision avoidance
  • Adaptive speed control

Sensor Fusion

  • Complementary filtering for IMU data
  • Force sensor integration for foot contact
  • Multi-directional obstacle detection
  • Vision-based environment analysis

Gait Control

  • Smooth trajectory generation
  • Phase-based gait control
  • Arm swing coordination
  • Terrain adaptation
  • Speed modulation

License

This project is licensed under the MIT License.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Test thoroughly
  5. Submit a pull request

Support

For technical support and questions:

  • Check the troubleshooting section
  • Review the API documentation
  • Test with debug commands
  • Verify hardware connections

Version History

V2.0 (Current)

  • Enhanced sensor fusion
  • Improved balance control
  • Advanced AI decision making
  • Better error handling
  • Optimized performance

V1.0

  • Basic walking gait
  • Simple PID control
  • Basic sensor integration

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages