Project Requirement Document Systems - SergeGit/rc-tank-platform GitHub Wiki
RC Tank System-Level Product Requirements Document (PRD)
1. Overview
The RC Tank System is a modular, dual-controller robotic platform consisting of a Raspberry Pi–based Turret Controller and an Arduino Nano–based Hull Controller. The system combines real-time hardware control with high-level autonomy, integrating manual, semi-automatic, and autonomous functionalities for movement, targeting, and firing.
This document defines the system-level engineering requirements, focusing on overall architecture, inter-controller communication, safety, power management, and integrated operating modes.
2. Purpose and Scope
Purpose
To define the integrated product requirements that ensure consistent, safe, and deterministic operation of the RC Tank across all controllers, communication layers, and operation modes.
Scope
- Defines inter-controller interaction via I²C
- Specifies unified control logic and data flow
- Sets overall performance, safety, and reliability standards
- Aligns subsystem requirements (Hull and Turret) under one system framework
3. System Architecture
Hierarchical Overview
User Input (PS3 / Web) → Raspberry Pi (Turret Controller, I²C Master)
→ Arduino Nano (Hull Controller, I²C Slave)
→ Motors / Weapons / Lights / Sensors
Key Components
| Subsystem |
Role |
| Turret Controller (Raspberry Pi) |
High-level logic, computer vision, control modes, I²C master |
| Hull Controller (Arduino Nano) |
Hardware-level control, actuation, I²C slave |
| PS3 Controller |
Local manual control (Bluetooth) |
| Web Interface |
Remote control, telemetry, and video feedback |
| Camera System |
Target detection and tracking |
| Sensors |
Battery, position, firing feedback, GPS (future) |
Communication Layers
| Layer |
Protocol |
Description |
| User → Turret |
Bluetooth / TCP/IP |
PS3 or Web commands |
| Turret → Hull |
I²C (Master–Slave) |
Commands and telemetry |
| Hull → Turret |
I²C Response |
Sensor feedback and system state |
| Turret → Web UI |
HTTP/WebSocket |
Data visualization and control |
4. Operating Modes
| Mode |
Description |
Control Source |
| Local Control |
PS3 controller provides direct manual control |
Bluetooth |
| Remote Control |
Web interface controls all functions |
TCP/IP |
| Semi-Automatic (Auto-Aim) |
CV-assisted turret alignment, manual firing |
Hybrid |
| Semi-Automatic (Auto-Fire) |
Automatic aim and fire, manual movement |
Hybrid |
| Automatic |
Fully autonomous navigation and engagement |
Internal logic |
| Deep Sleep |
Power-saving mode with periodic wake cycles |
Scheduled / Remote |
Mode Transitions
- Mode changes initiated via PS3 or web interface
- Always revert to Manual upon safety event or system reset
5. Data and Control Flow
Command Flow
PS3 / Web Input → Turret Controller → I²C Bus → Hull Controller → Physical Systems
Measurement Flow
Sensors → Hull Controller → I²C Bus → Turret Controller → User Interface (Web/Display)
Data Types
| Data Category |
Source |
Destination |
Frequency |
| Movement commands |
User Input |
Hull Controller |
50 Hz |
| Weapon control |
Turret Logic |
Hull Controller |
Event-driven |
| Lighting control |
User Input |
Hull Controller |
On change |
| Battery telemetry |
Hull Controller |
Turret Controller |
1 Hz |
| Target data |
CV System |
Auto-Aim Processor |
Continuous (as detected) |
6. Functional Requirements
| Subsystem |
Req ID |
Description |
| System Integration |
SYS-01 |
Turret and Hull controllers must communicate via I²C at 100 kHz |
|
SYS-02 |
System must support synchronized command/telemetry cycles |
|
SYS-03 |
Failure of one subsystem must not endanger hardware |
| Motion Control |
MOT-01 |
Tracks operate via PWM differential drive |
|
MOT-02 |
Motor ramping applied for smooth transitions |
| Aiming and Firing |
TGT-01 |
CV system provides real-time turret aim corrections |
|
TGT-02 |
Fire command validated by safety logic before execution |
| Lighting and Indicators |
LGT-01 |
Lights respond to control or state changes |
|
LGT-02 |
Blinking handled autonomously in Hull Controller |
| Battery Management |
PWR-01 |
Continuous battery monitoring and reporting |
|
PWR-02 |
Low-voltage cutout protection enabled below threshold |
| Safety Mechanisms |
SAFE-01 |
Emergency stop must override all active commands |
|
SAFE-02 |
Communication loss for >2s must trigger E-stop |
|
SAFE-03 |
Firing disabled in deep sleep or low power mode |
| Autonomous Control |
AUTO-01 |
Auto mode executes mission via waypoints (future) |
|
AUTO-02 |
Integrate obstacle avoidance based on CV data |
7. Non-Functional Requirements
| Category |
Requirement |
| Performance |
I²C loop <20ms per cycle, system latency <100ms |
| Reliability |
10,000-cycle stress test without communication errors |
| Safety |
All moving parts must stop within 50ms on E-stop |
| Scalability |
Must support future addition of sensors and GPS |
| Maintainability |
Configuration centralized per controller (config.h, config.py) |
| Interoperability |
Compatible across Arduino Nano, Pi 3+, and alternative models |
8. Safety and Fault Handling
- Emergency Stop: Immediate system halt propagated from Turret → Hull
- Watchdogs:
- Hull: 1s timeout for firmware loop
- Turret: 2s timeout for I²C or network loss
- Battery Protection: Automatic cutoff and warning via telemetry
- Manual Override: PS3 input always has highest priority
- Safe Boot: System starts in manual mode with weapons disabled
9. Power Management
| Subsystem |
Mode |
Description |
| Turret Controller |
Deep Sleep |
CPU throttled, sensors idle, periodic wake |
| Hull Controller |
Low Power |
Minimal active subsystems, wakes on I²C trigger |
| Battery Relay |
Controlled by BMS |
Disables output in low-voltage state |
10. Testing and Validation
| Test ID |
Description |
Expected Result |
| TST-01 |
PS3 control of motion and turret |
Real-time response <100ms |
| TST-02 |
I²C command validation |
All command codes acknowledged correctly |
| TST-03 |
Web control latency |
Full round-trip latency <200ms |
| TST-04 |
Emergency stop event |
All motion stops within 50ms |
| TST-05 |
Battery telemetry |
Voltage data accurate ±0.05V |
| TST-06 |
Communication loss |
Failsafe triggers within 2s |
| TST-07 |
Mode switching |
Seamless transitions, no hang or misfire |
| TST-08 |
Power-saving mode |
Power draw reduced by ≥90% |
11. Future Enhancements
- GPS-based waypoint navigation
- Obstacle avoidance (stereo or depth vision)
- Machine learning–based object recognition
- Wireless telemetry logging and replay system
- Integrated Android/iOS mobile app
- Support for additional turrets or payloads via modular bus
- Full power system telemetry (current, temperature, battery state)
12. Acceptance Criteria
- Integrated Hull–Turret control verified across all modes
- Safe handling of all communication and hardware faults
- Power and safety systems meet voltage/current specifications
- Stable operation over 4-hour continuous runtime
- Verified compliance with all subsystem PRDs