Technical documentation - SergeGit/rc-tank-platform GitHub Wiki

Remote Control Tank Documentation

1. Hardware Overview

The remote control tank platform consists of the following primary components:

Tank Hull Assembly

  • Hull structure and chassis
  • Dual tank tracks with DC motors for propulsion
  • Front and rear lighting systems
  • Battery power system

Turret Assembly

  • Rotatable turret base with DC motor
  • Elevation mechanism with DC motor
  • Main cannon with firing mechanism
  • Laser aiming system
  • Turret-mounted light

Sensing and Detection Systems

  • Infrared (IR) transmitter and receiver
  • Camera system for computer vision
  • Object detection capabilities

2. Control System Architecture

The tank employs a dual-controller system with hierarchical responsibilities:

Hull Controller (Arduino)

  • Primary responsibility: Low-level hardware control
  • Manages track motors, lights, and firing mechanisms
  • Receives commands and sends measurements via I2C

Turret Controller (Raspberry Pi)

  • Primary responsibility: High-level functions and user interfaces
  • Runs computer vision and object detection algorithms
  • Manages operating modes and autonomous functions
  • Interfaces with user control devices
  • Master device on the I2C bus

Communication Interfaces

  • Internal Communication: I2C bus between Raspberry Pi and Arduino
  • External Control:
    • Bluetooth connection to PS3 controller
    • Web server for remote commands via keyboard/interface

3. Functional Capabilities

Movement Controls

Function Parameter Range/Unit
Track Movement Speed setpoint (left, right) -100% to +100%
Turret Rotation Rotation speed setpoint -100% to +100%
Turret Elevation Elevation speed setpoint -100% to +100%

Lighting Systems

Function Parameter States
Front Lights State ON/OFF
Back Lights State ON/OFF
Turret Light State ON/OFF

Weapon Systems

Function Parameter States
Laser Sight State ON/OFF
IR Light State ON/OFF
Fire Safety State ON/OFF
Fire Command Trigger Pulse

Telemetry Measurements

Measurement Unit Range
Battery Charge Percent 0-100%
Turret Direction Degrees 0-359°

4. Operating Modes

The tank can operate in four active modes plus a power-saving mode:

Local Control Mode

  • Direct control via PS3 controller connected by Bluetooth
  • Manual control of all movement, turret, and firing functions
  • Real-time response to controller inputs

Remote Control Mode

  • Control via web interface/server
  • Keyboard commands for movement and operations
  • Suitable for longer distance operation

Semi-Automatic Mode

Two sub-modes available:

  • Auto-Aim: Computer vision assists targeting while movement remains manual
  • Auto-Firing: Automatic target identification and firing, with manual movement

Automatic Mode

  • Fully autonomous operation
  • Movement guided by GPS coordinates input by operator
  • Autonomous target identification and engagement
  • Obstacle avoidance using sensor data

Deep Sleep Mode

  • Power-saving state for extended battery life
  • Periodic wake cycles to check for commands
  • Minimal systems active

5. Control Flow Diagrams

Basic Command Flow

User Input (PS3/Web) → Turret Controller → I2C Bus → Hull Controller → Physical Actions

Measurement Flow

Sensors → Hull Controller → I2C Bus → Turret Controller → User Interface

6. Software Architecture

Turret Controller (Raspberry Pi)

  • Operating System: Raspberry Pi OS
  • Main control program handling:
    • Computer vision processing
    • Bluetooth communication with PS3 controller
    • Web server for remote operation
    • I2C master communication
    • Operating mode management
    • Object detection algorithms

Hull Controller (Arduino)

  • Firmware handling:
    • PWM motor control
    • Sensor reading
    • I2C slave communication
    • Direct hardware management

7. Development Guidelines

Extending Functionality

  • New features should be implemented in the appropriate controller based on hardware vs. software distinction
  • Hardware control features belong in Hull Controller
  • High-level logic belongs in Turret Controller

Safety Considerations

  • Implement fail-safe mechanisms for loss of communication
  • Battery level monitoring and low-power behavior
  • Fire safety mechanisms to prevent accidental firing

8. Future Enhancements

  • GPS navigation capabilities
  • Enhanced object recognition
  • Obstacle avoidance algorithms
  • Mobile app control interface
  • Telemetry logging and analysis