Skip to main content
Stretch Lab

Architecture Overview

Stretch 4 robot platform — NUC to firmware communication stack. Click any block to expand details.

Architecture Risks & Critical Issues

1 CRITICAL3 HIGH

I2C Bus Contention — Pimu

All four devices share a single bus on . The interrupt handler performs blocking reads inside context — adding more devices without refactoring will cause bus corruption or deadlocks.

Pimu I2C bus — current BNO085 + 3 planned devices on single bus

Lead Integration (You)

System integration, EMC compliance, and cross-team coordination

Mechanical

Physical structure, cable routing, enclosures, and thermal management

Electrical

PCB design, power topology, e-fuse, INA228, battery management

Firmware

firmware — PIMU, Stepper, Wacc MCU code and RPC interface

Software / AI

Python body API, stretch_ai perception and planning stack

Communication Architecture

Full data path: User scripts → ZMQ → Robot Server → USB CDC (2 Mbaud, COBS + CRC-16) → SAMD21 boards. Pimu generates sync pulses (GPIO) to coordinate all stepper motion.

NUC → ZMQ → Robot Server → USB CDC → SAMD21 firmware boards
USB Serial transport protocol parameters
ParameterValue
Baud rate2,000,000 (2 Mbaud)
Physical layer ACM (native USB on )
Framing with 0x00 packet marker
Integrity Modbus (2 bytes)
Max frame63 bytes (V1) / 64 bytes (V0)
Max RPC payload1024 bytes + 1 byte RPC ID
Frame timeout100 ms

Hardware Block Diagram

Click any block to expand details. timing, devices, and control loop rates included.

Communication Protocols

Communication protocols between system components
FromToInterfaceProtocol
nucserverIn-processPython
serverpimu-framed RPC
serverstepper-framed RPC
serverwacc-framed RPC
servereoaUSB TTLFeetech SM Protocol

Transport Layer Detail

Hello Serial Transport: COBS (Consistent Overhead Byte Stuffing) framing over USB CDC serial. V1 protocol: push/pull model with single-frame fast path (PUSH_FRAME_FIRST_ONLY). Supports sync and async RPC via TransportPySerial or TransportCSerial (C extension, non-blocking).
Feetech SM Protocol: Half-duplex TTL serial bus. Uses SCS/STS packet protocol with GroupSyncRead and GroupSyncWrite for efficient multi-servo communication. Daisy-chain topology.

System Data Flow

Data flow from NUC through Python server to firmware boards

Power State Machine

PIMU power state transitions