Blade Runner

Distributed Carriage Control System (CCP)

Core LogicJava CCP
OrchestrationMCP Master
ProtocolUDP / JSON
HardwareESP32 S3

// System Abstract

Autonomous Carriage Control
Network & Telemetry

The BladeRunner Project is a high-fidelity simulation of an industrial transportation system. It orchestrates real-time communication between a centralMCP (Master Control Processor) and distributedCCP (Carriage Control Processor) nodes.

By leveraging UDP multicasting and ESP32 hardware integration, the system achieves precise, low-latency synchronization of physical carriage movements, door actuation, and hazard detection.

ArchitectureDistributed IoT
Latency< 50ms UDP
SafetyFail-Safe Logic
ProtocolCustom JSON

Core Technologies

JavaC++Next.jsUDPESP32Tailwind

Live Simulation

Interactive interface for the CCP Java Client. Initialize the UDP Uplink below to observe real-time state transitions and packet handling.

CCP // TERMINAL_ACCESS
UDP LINK
ESP32
STARTED

Motor Output0%

Door Actuators
LOCKED

Diagnostic LEDs (ESP32)

L0
L1
L2
L3
build 2026.01.24_rc
Waiting for initialization signal...

Technical Schematics

01. Distributed Nodes

The system implements a distributed control pattern, delegating specific responsibilities to three primary nodes for optimal latency and fail-safety.

    MCP (Master)Central orchestrator. Handles routing, collision avoidance, and global emergency stops.
    CCP (Client)Java-based carriage brain. Manages local state (doors/motors) and sensors.
    ESP32 (Hardware)Embedded layer. Translates digital commands into raw motor voltage & IR signals.

02. JSON Protocol

Stateless UDP communication payload structure.

payload.json
{
  "client_type": "ccp",
  "message": "STRQ",      // Status Request
  "client_id": "BR12",    // Unit Identifier
  "timestamp": "2026-01-24T14:30:00"
}

03. Core Logic Patterns

Finite State Machine

Strict transitions in CCP.java prevent hardware hazards (e.g., locking motors while doors are open).

CCP.java
if (stateManager.getCurrentState() != CCPState.STOPPED) {
    // Force transition before door actuation
    stateManager.updateState(CCPState.STOPPED);
    updateLEDState();
}

Async Concurrency

Utilizes ScheduledExecutorService for non-blocking heartbeats, ensuring the main thread remains responsive to UDP packets.

CCP.java
heartbeatExecutor.scheduleAtFixedRate(() -> {
    try {
        sendHeartbeat(); // UDP Packet Dispatch
    } catch (Exception e) {
        logError(e);
    }
}, 0, 2, TimeUnit.SECONDS);

System Directory

ROOT: ~/BladeRunner
▶CCP/// Java Core Logic
[JAVA]CCP.java
[JAVA]MCP.java
[JAVA]CommunicationHandler.java
[JAVA]UDPCommunicationHandler.java
[JAVA]StateManager.java
▶Carriage/// Embedded C++ (Arduino)
▶ESP/// Hardware Layer (ESP32)
▶website/// Next.js Dashboard
▶DOCs/// System Archives
▶.vscode/// Config
Total Modules: 6● SYNCED

System Prerequisites

Hardware Specifications

MicrocontrollerESP32 S3

Primary carriage control unit & networking node.

SensorsIR Photodiodes

Required for track alignment & checkpoint detection.

ActuatorsDC Motors / Servos

Door actuation and main drive train.

Software Environment

Java Development KitJDK 11+
IDE PlatformVS Code + Java Ext
Dependencyorg.json Library
Network2.4GHz Wi-Fi
Embedded ToolchainArduino IDE / PlatformIO

Deployment Protocols

01

Clone Repository

Retrieve the latest source code from the central VCS.

$git clone https://github.com/Wasif-ZA/BladeRunner.git
02

Initialize CCP Directory

Navigate to the Carriage Control Program sector.

$cd BladeRunner/CCP
03

Environment Setup

Configure the Java Runtime Environment and dependencies.

Install Java Extension Pack (VS Code)
Add JSON-20240303.jar to Classpath
Verify UDP Port 3000 Access