Skip to content

Ishan2701/BattleBots

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

Arduino RC Robot Controller (iBUS + Cytron MD)

A robust Arduino-based control system for combat robots or RC vehicles. This project utilizes the iBUS protocol for low-latency digital communication and Cytron Motor Drivers for high-current motor control.

🚀 Features

  • iBUS Digital Input: High-precision control using the FlySky iBUS protocol (up to 6 channels).
  • Differential Steering: Smooth mixed-drive logic for forward, backward, and turning maneuvers.
  • Weapon System: Dedicated control for a weapon motor with speed mapping and direction inversion.
  • Dual Speed Modes: Toggle between 100% (High) and 75% (Precision) speed via RC switch.
  • Safety Kill Switch: Integrated software-level safety that kills all motors and ESCs if the signal is lost or a specific switch is toggled.
  • Quick-Turn Macros: Dedicated 180-degree rotation functions for tactical maneuvering.

🛠 Hardware Components

Component Description
Microcontroller Arduino Mega / Uno (Serial1 capable board recommended)
RC Receiver FlySky iA6B or similar (iBUS compatible)
Motor Drivers 3x Cytron Motor Driver (PWM/DIR mode)
Drive Motors 2x DC Brushed Motors (Left/Right)
Weapon Motor 1x DC Brushed Motor

🔌 Pin Mapping

Motor Connections

Driver Arduino PWM Pin Arduino DIR Pin Function
Motor 1 3 4 Left Drive
Motor 2 5 6 Right Drive
Motor W 11 12 Weapon Motor

Receiver & ESCs

  • iBUS RX: Connected to Serial1 RX
  • ESC 1: Pin 8 (Optional/Auxiliary)
  • ESC 2: Pin 9 (Optional/Auxiliary)

🎮 Transmitter Configuration

The code is mapped to standard 6-channel RC transmitters:

  • Channel 1: Forward/Reverse (Y-Axis)
  • Channel 2: Steering Left/Right (X-Axis)
  • Channel 3: Weapon Speed Control (Throttle)
  • Channel 4: 180° Macro (Left/Right snap turns)
  • Channel 5: Mode/Safety Switch
    • > 1725: Full Speed Mode
    • 1500: 75% Speed Mode
    • < 1250: KILL SYSTEM (All motors stop)
  • Channel 6: Weapon Direction Invert

⚙️ Installation & Setup

  1. Library Installation: Open the Arduino Library Manager and install:
    • IBusBM
    • CytronMotorDriver
    • Servo
  2. Wiring: Ensure the GND of your battery, Arduino, and Motor Drivers are all connected.
  3. Calibration: * Check the motorabias and motorbbias variables in the code if your robot drifts to one side.
    • Ensure your Transmitter is set to output iBUS rather than PPM or PWM.

⚠️ Safety Warning

This code includes a KILL() function. Always test the robot on a stand (wheels off the ground) when first powering on. The weapon system is mapped to Channel 3; ensure your throttle is at the lowest position before turning on the robot.

About

A simple Arduino Sketch to control a 2 Wheel Differential Drive robot using inputs from a Flysky Drone Tx/RX System

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages