Skip to content

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Scarab: Combat Robot (Metal Monsters 4th Edition)

Scarab is a remote-controlled combat robot that our team, Pegasi, built for the Metal Monsters competition at the Alamein Robotics Championship in El Alamein, Egypt. In Metal Monsters, two robots fight inside a closed arena until one of them can no longer move or fight. We finished in 4th place among all competing teams.

Scarab front view

Achievements

  • 4th place at Metal Monsters, 4th Edition (El Alamein)
  • Full robot designed, built, wired and programmed by the team
  • Welded 2 mm sheet-metal chassis that took hits through the whole competition

Robot at a glance

Item Detail
Robot name Scarab
Team Pegasi
Chassis 2 mm sheet metal
Drivetrain 4 wheels, 2 DC motors, chain and sprocket, bearings
Weapon Spinner steel bar driven by a 350 W DC motor through a chain
Controller ESP32 with a PS4 controller over Bluetooth
Control mode Manual, arcade-style driving
Power 3 x 12V batteries

Motor specifications (MY1016Z)

Parameter Value
Voltage 24 V DC
Output power 350 W
Rated speed (base motor) 3200 RPM
Rated speed (after reduction) 300 RPM
Rated current 19.2 A
Sprocket 9 tooth, 1/8" bicycle chain

The reduction from 3200 RPM to 300 RPM gives a ratio of about 10.7:1. Three motors at rated current draw about 57.6 A in total, and stall current is higher, so the weapon is ramped up gradually in firmware.

Bill of materials

System Parts
Chassis 2 mm metal sheet
Drivetrain 4 wheels, 2 x 350 W DC motors, gear coupling assembly, chains, bearings
Weapon 1 x 350 W DC motor, spinner steel bar, gear coupling assembly, bearings, chain
Control ESP32, 30 A motor driver, 5 V step-down, relay, PS4 controller
Power 3 x 12V batteries

System diagram

System diagram

flowchart LR
    PS4[PS4 controller] -- Bluetooth --> ESP[ESP32]
    BAT[3 x 12V batteries] --> ESTOP[Emergency stop]
    ESTOP --> BUCK[5V step-down]
    BUCK -- 5V --> ESP
    ESTOP --> DRV1[Motor driver 30A: drive]
    ESTOP --> RLY[Relay]
    RLY --> DRV2[Motor driver 30A: weapon]
    ESP -- 4 PWM --> DRV1
    ESP -- 2 PWM --> DRV2
    ESP -- GPIO --> RLY
    DRV1 --> ML[Left motor]
    DRV1 --> MR[Right motor]
    DRV2 --> MW[Weapon motor]
Loading

Controls

Input Action
Left stick (up / down) Throttle
Right stick (left / right) Steering
OPTIONS Arm weapon (relay closes, lightbar turns red)
SHARE Disarm weapon (lightbar turns blue)
R2 Weapon speed, only while armed
CIRCLE Emergency stop for all motors

Safety behavior in firmware:

  • The weapon relay is open at boot and every time the controller connects.
  • If the controller disconnects, all motors stop and the relay opens.
  • Weapon speed ramps up in about 1.7 s and ramps down in about 0.3 s.
  • Wheel output uses a slew limit to protect the chains and the drivers.

Software

The firmware is an Arduino-framework project for the ESP32, built with PlatformIO. It uses the PS4-esp32 library.

include/config.h   Pins, PWM settings, drive tuning
include/motor.h    Motor class for two-input PWM drivers
src/main.cpp       Control loop, mixing, arming, failsafe

Build and flash

  1. Install PlatformIO.
  2. Clone the repo and open it in VS Code with the PlatformIO extension.
  3. Edit include/config.h to match your wiring.
  4. Run pio run -t upload, then pio device monitor to read the ESP32 Bluetooth MAC.

Pair the PS4 controller

  1. Open the serial monitor and note the line ESP32 Bluetooth MAC.
  2. Write that address into the controller with SixaxisPairTool.
  3. Put the same address in PS4_MAC_ADDRESS in include/config.h and flash again.
  4. Power the robot and press the PS button. The lightbar turns blue when the link is up.

Default pin map

Function GPIO
Left motor RPWM / LPWM 25 / 26
Right motor RPWM / LPWM 27 / 18
Weapon motor RPWM / LPWM 32 / 33
Weapon relay 23

Photos

Internals Top view

Inside the chassis: three MY1016Z motors, chain drive, motor drivers, the step-down module and the battery tray.

Team Pegasi

Repository structure

scarab-combat-robot/
├── README.md
├── LICENSE
├── .gitignore
├── platformio.ini
├── include/
│   ├── config.h
│   └── motor.h
├── src/
│   └── main.cpp
└── docs/
    ├── system_diagram.svg
    └── images/
        ├── 01-internals.png
        ├── 02-scarab-top.png
        ├── 03-scarab-front.png
        └── 04-team-pegasi.png

Safety

Combat robots can injure people. Test on a stand with the wheels off the ground, keep the weapon disarmed while you work on the robot, and always use a physical emergency stop on the main power line.

License

MIT. See LICENSE.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages