# geovani5410/multi-arm-pca9685 architecture

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

- Interactive diagram: https://gitdiagram.com/geovani5410/multi-arm-pca9685
- Repository: https://github.com/geovani5410/multi-arm-pca9685

## Overview

Celda Robótica is an ESP32-controlled manufacturing-cell project. Its arm workflow is configured as posture arrays, selected by a section routine, executed by the shared runner, and translated by each arm into PCA9685 servo commands. The README also describes timed conveyor stages, limit-switch reversal, and planned relay/electromagnet capability; the conveyor and top-level implementation are not present in the supplied tree, so those links are documented rather than verified in source. The graph preserves the three distinct arm stages and their shared execution layer.

Main entry points: [`CeldaRobotica/CeldaRobotica.ino`](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/CeldaRobotica.ino) (ESP32 controller), [`CeldaRobotica/RutinaRunner.cpp`](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/RutinaRunner.cpp) (Routine runner), [`CeldaRobotica/Seccion1.cpp`](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion1.cpp) (Welding station), [`CeldaRobotica/Seccion2.cpp`](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion2.cpp) (Independent station)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_control["Cell Control"]
  node_controller["ESP32 controller<br/>[CeldaRobotica.ino]"]
end

subgraph group_stations["Arm Stations"]
  node_stage1["Welding station<br/>[Seccion1.cpp]"]
  node_config1["Welding postures<br/>[ConfigSeccion1.cpp]"]
  node_stage2["Independent station<br/>[Seccion2.cpp]"]
  node_config2["Station 2 postures<br/>[ConfigSeccion2.cpp]"]
  node_stage3["Door assembly<br/>[Seccion3.cpp]"]
  node_config3["Station 3 postures<br/>[ConfigSeccion3.cpp]"]
end

subgraph group_runtime["Arm Runtime"]
  node_posture["Posture model<br/>[Postura.h]"]
  node_runner["Routine runner<br/>[RutinaRunner.cpp]"]
  node_arm["Robot arm driver<br/>[BrazoRobotico.cpp]"]
end

subgraph group_hardware["Cell Hardware"]
  node_servos["PCA9685 servos"]
  node_conveyor["Timed conveyor"]
  node_motor["L298N motor"]
  node_limits["Limit switches"]
  node_relays["Relay electromagnets"]
end

node_operator(("Cell operation"))
node_workpiece(("Assembly workpiece"))

node_operator -.->|"operates"| node_controller
node_controller -.->|"runs stage"| node_stage1
node_controller -.->|"runs stage"| node_stage2
node_controller -.->|"runs stage"| node_stage3
node_stage1 -->|"selects postures"| node_config1
node_stage2 -->|"selects postures"| node_config2
node_stage3 -->|"selects postures"| node_config3
node_config1 -->|"defines arrays"| node_posture
node_config2 -->|"defines arrays"| node_posture
node_config3 -->|"defines arrays"| node_posture
node_stage1 -->|"executes routine"| node_runner
node_stage2 -->|"executes routine"| node_runner
node_stage3 -->|"executes routine"| node_runner
node_runner -->|"moves group"| node_arm
node_arm -->|"writes PWM"| node_servos
node_controller -.->|"advances stages"| node_conveyor
node_conveyor -.->|"drives"| node_motor
node_conveyor -.->|"reads switches"| node_limits
node_conveyor -.->|"transports"| node_workpiece
node_controller -.->|"controls"| node_relays

click node_controller "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/CeldaRobotica.ino"
click node_stage1 "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion1.cpp"
click node_config1 "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/ConfigSeccion1.cpp"
click node_stage2 "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion2.cpp"
click node_config2 "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/ConfigSeccion2.cpp"
click node_stage3 "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion3.cpp"
click node_config3 "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/ConfigSeccion3.cpp"
click node_posture "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Postura.h"
click node_runner "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/RutinaRunner.cpp"
click node_arm "https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/BrazoRobotico.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_controller toneBlue
class node_stage1,node_config1,node_stage2,node_config2,node_stage3,node_config3 toneAmber
class node_posture,node_runner,node_arm toneMint
class node_servos,node_conveyor,node_motor,node_limits,node_relays toneRose
class node_operator,node_workpiece toneIndigo
```

## Components

### Cell Control

- [ESP32 controller](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/CeldaRobotica.ino): `CeldaRobotica/CeldaRobotica.ino`

### Arm Stations

- [Welding station](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion1.cpp): `CeldaRobotica/Seccion1.cpp`
- [Welding postures](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/ConfigSeccion1.cpp): `CeldaRobotica/ConfigSeccion1.cpp`
- [Independent station](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion2.cpp): `CeldaRobotica/Seccion2.cpp`
- [Station 2 postures](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/ConfigSeccion2.cpp): `CeldaRobotica/ConfigSeccion2.cpp`
- [Door assembly](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Seccion3.cpp): `CeldaRobotica/Seccion3.cpp`
- [Station 3 postures](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/ConfigSeccion3.cpp): `CeldaRobotica/ConfigSeccion3.cpp`

### Arm Runtime

- [Posture model](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/Postura.h): `CeldaRobotica/Postura.h`
- [Routine runner](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/RutinaRunner.cpp): `CeldaRobotica/RutinaRunner.cpp`
- [Robot arm driver](https://github.com/geovani5410/multi-arm-pca9685/blob/main/CeldaRobotica/BrazoRobotico.cpp): `CeldaRobotica/BrazoRobotico.cpp`

### Cell Hardware

- **PCA9685 servos**
- **Timed conveyor**
- **L298N motor**
- **Limit switches**
- **Relay electromagnets**

### Other components

- **Cell operation**
- **Assembly workpiece**

## Connections

- Cell operation → ESP32 controller: operates (evidence: `README.md`)
- ESP32 controller → Welding station: runs stage (evidence: `README.md`)
- ESP32 controller → Independent station: runs stage (evidence: `README.md`)
- ESP32 controller → Door assembly: runs stage (evidence: `README.md`)
- Welding station → Welding postures: selects postures (evidence: `CeldaRobotica/Seccion1.cpp`)
- Independent station → Station 2 postures: selects postures (evidence: `CeldaRobotica/Seccion2.cpp`)
- Door assembly → Station 3 postures: selects postures (evidence: `CeldaRobotica/Seccion3.cpp`)
- Welding postures → Posture model: defines arrays
- Station 2 postures → Posture model: defines arrays
- Station 3 postures → Posture model: defines arrays
- Welding station → Routine runner: executes routine (evidence: `CeldaRobotica/Seccion1.cpp`)
- Independent station → Routine runner: executes routine (evidence: `CeldaRobotica/Seccion2.cpp`)
- Door assembly → Routine runner: executes routine (evidence: `CeldaRobotica/Seccion3.cpp`)
- Routine runner → Robot arm driver: moves group
- Robot arm driver → PCA9685 servos: writes PWM (evidence: `CeldaRobotica/BrazoRobotico.cpp`)
- ESP32 controller → Timed conveyor: advances stages (evidence: `README.md`)
- Timed conveyor → L298N motor: drives (evidence: `README.md`)
- Timed conveyor → Limit switches: reads switches (evidence: `README.md`)
- Timed conveyor → Assembly workpiece: transports (evidence: `README.md`)
- ESP32 controller → Relay electromagnets: controls (evidence: `README.md`)
