# tobethieren/parol6_leader-arm architecture

> Architecture diagram of the GitHub repository tobethieren/parol6_leader-arm, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-13). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/tobethieren/parol6_leader-arm
- Repository: https://github.com/tobethieren/parol6_leader-arm

## Overview

PAROL6 Leader Arm is Arduino Mega firmware that maps a manually moved, potentiometer-equipped leader arm to a six-joint follower robot. The principal workflow samples and calibrates joint positions, filters and queues poses, generates synchronized motion segments, and emits timed step pulses. Calibration is a separate utility whose output is copied into the runtime firmware; hardware documentation covers the mechanical and wiring build. Runtime is intentionally concentrated in one source file, so its internal stages share that path. Edges reflect the README’s documented workflow; unsampled implementation details are not inferred.

Main entry points: [`src/main.cpp`](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp) (Synchronized stepping), [`calibration/calibration.cpp`](https://github.com/tobethieren/parol6_leader-arm/blob/main/calibration/calibration.cpp) (Interactive calibration), [`hardware`](https://github.com/tobethieren/parol6_leader-arm/tree/main/hardware) (Build and wiring resources)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_runtime["Leader-follow firmware"]
  node_capture["ADC sampling<br/>[main.cpp]"]
  node_mapping["Angle mapping<br/>[main.cpp]"]
  node_filter["One Euro filter<br/>[main.cpp]"]
  node_queue["Pose queue<br/>[main.cpp]"]
  node_segments["Motion segments<br/>[main.cpp]"]
  node_execution["Synchronized stepping<br/>[main.cpp]"]
  node_fastio["Fast pin writes<br/>[main.cpp]"]
  node_adcconfig["Fast ADC configuration<br/>[main.cpp]"]
  node_deadbands["Axis deadbands<br/>[main.cpp]"]
  node_calibrationdata["Calibration values<br/>[main.cpp]"]
end

subgraph group_calibration["Calibration utility"]
  node_calibrator["Interactive calibration<br/>[calibration.cpp]"]
end

subgraph group_hardware["Robot hardware"]
  node_hardwaredocs["Build and wiring resources"]
end

node_leader(("Leader arm"))
node_follower["Follower robot"]
node_serial(("Serial monitor"))

node_leader -->|"provides pose"| node_capture
node_capture -->|"samples raw values"| node_mapping
node_mapping -->|"maps angles"| node_filter
node_filter -->|"queues poses"| node_queue
node_queue -->|"supplies poses"| node_segments
node_segments -->|"schedules axes"| node_execution
node_execution -->|"drives joints"| node_follower
node_serial -->|"guides calibration"| node_calibrator
node_calibrator -->|"prints values"| node_calibrationdata
node_calibrationdata -->|"configures mapping"| node_mapping
node_adcconfig -->|"speeds sampling"| node_capture
node_fastio -->|"writes pulses"| node_execution
node_deadbands -->|"limits chatter"| node_execution
node_hardwaredocs -->|"documents build"| node_leader

click node_capture "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_mapping "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_filter "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_queue "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_segments "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_execution "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_calibrator "https://github.com/tobethieren/parol6_leader-arm/blob/main/calibration/calibration.cpp"
click node_hardwaredocs "https://github.com/tobethieren/parol6_leader-arm/tree/main/hardware"
click node_fastio "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_adcconfig "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_deadbands "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"
click node_calibrationdata "https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_capture,node_mapping,node_filter,node_queue,node_segments,node_execution,node_fastio,node_adcconfig,node_deadbands,node_calibrationdata toneBlue
class node_calibrator toneAmber
class node_hardwaredocs toneMint
class node_leader,node_follower,node_serial toneIndigo
```

## Components

### Leader-follow firmware

- [ADC sampling](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Angle mapping](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [One Euro filter](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Pose queue](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Motion segments](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Synchronized stepping](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Fast pin writes](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Fast ADC configuration](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Axis deadbands](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`
- [Calibration values](https://github.com/tobethieren/parol6_leader-arm/blob/main/src/main.cpp): `src/main.cpp`

### Calibration utility

- [Interactive calibration](https://github.com/tobethieren/parol6_leader-arm/blob/main/calibration/calibration.cpp): `calibration/calibration.cpp`

### Robot hardware

- [Build and wiring resources](https://github.com/tobethieren/parol6_leader-arm/tree/main/hardware): `hardware`

### Other components

- **Leader arm**
- **Follower robot**
- **Serial monitor**

## Connections

- Leader arm → ADC sampling: provides pose (evidence: `README.md`)
- ADC sampling → Angle mapping: samples raw values (evidence: `README.md`)
- Angle mapping → One Euro filter: maps angles (evidence: `README.md`)
- One Euro filter → Pose queue: queues poses (evidence: `README.md`)
- Pose queue → Motion segments: supplies poses (evidence: `README.md`)
- Motion segments → Synchronized stepping: schedules axes (evidence: `README.md`)
- Synchronized stepping → Follower robot: drives joints (evidence: `README.md`)
- Serial monitor → Interactive calibration: guides calibration (evidence: `calibration/calibration.cpp`)
- Interactive calibration → Calibration values: prints values (evidence: `README.md`)
- Calibration values → Angle mapping: configures mapping (evidence: `README.md`)
- Fast ADC configuration → ADC sampling: speeds sampling (evidence: `README.md`)
- Fast pin writes → Synchronized stepping: writes pulses (evidence: `README.md`)
- Axis deadbands → Synchronized stepping: limits chatter (evidence: `README.md`)
- Build and wiring resources → Leader arm: documents build (evidence: `README.md`)
