# 20dcyy06/icar_lower_board_26 architecture

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

- Interactive diagram: https://gitdiagram.com/20dcyy06/icar_lower_board_26
- Repository: https://github.com/20dcyy06/icar_lower_board_26

## Overview

This is embedded lower-board firmware for a remotely controlled maze-following vehicle. Its documented operating path accepts speed and steering commands, measures encoder speed, applies motor control, and reports telemetry; the sampled main-loop code also handles communication loss and motor-stall shutdown. The README confirms neutral-centered bidirectional PWM and duty ramping. Excerpts do not establish every module call, so uncertain links are omitted; the vendor library tree is supporting platform code rather than a separate product workflow.

Main entry points: [`user/cpu0_main.c`](https://github.com/20dcyy06/icar_lower_board_26/blob/main/user/cpu0_main.c) (Firmware Loop), [`code/motor.c`](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/motor.c) (Motor Output), [`code/ano.c`](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/ano.c) (Command Protocol), [`code/control.c`](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/control.c) (Vehicle Control)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_app["Vehicle Firmware"]
  node_main["Firmware Loop<br/>[cpu0_main.c]"]
  node_protocol["Command Protocol<br/>[ano.c]"]
  node_telemetry["Telemetry<br/>[ano.c]"]
  node_safety["Fault Handling<br/>[cpu0_main.c]"]
end

subgraph group_control["Motion Control"]
  node_control["Vehicle Control<br/>[control.c]"]
  node_pid["PID Algorithms<br/>[pid.c]"]
  node_motor["Motor Output<br/>[motor.c]"]
  node_imu["Motion Sensing<br/>[imu.c]"]
end

subgraph group_platform["Board Interfaces"]
  node_board["TC26B Drivers"]
end

node_host(("Upper Controller"))
node_vehicle(("Motors and Sensors"))

node_host -->|"sends commands"| node_main
node_main -->|"receives frames"| node_protocol
node_protocol -->|"decoded commands"| node_main
node_main -->|"updates motion"| node_control
node_control -->|"computes control"| node_pid
node_main -->|"sets output"| node_motor
node_main -->|"reads motion"| node_imu
node_main -->|"checks faults"| node_safety
node_safety -->|"stops motor"| node_motor
node_main -->|"sends status"| node_telemetry
node_telemetry -->|"reports status"| node_host
node_motor -->|"uses drivers"| node_board
node_board -->|"drives hardware"| node_vehicle
node_vehicle -.->|"provides measurements"| node_imu

click node_main "https://github.com/20dcyy06/icar_lower_board_26/blob/main/user/cpu0_main.c"
click node_protocol "https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/ano.c"
click node_telemetry "https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/ano.c"
click node_safety "https://github.com/20dcyy06/icar_lower_board_26/blob/main/user/cpu0_main.c"
click node_control "https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/control.c"
click node_pid "https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/pid.c"
click node_motor "https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/motor.c"
click node_imu "https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/imu.c"
click node_board "https://github.com/20dcyy06/icar_lower_board_26/tree/main/libraries/infineon_libraries/iLLD/TC26B/Tricore"

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_main,node_protocol,node_telemetry,node_safety toneBlue
class node_control,node_pid,node_motor,node_imu toneAmber
class node_board toneMint
class node_host,node_vehicle toneIndigo
```

## Components

### Vehicle Firmware

- [Firmware Loop](https://github.com/20dcyy06/icar_lower_board_26/blob/main/user/cpu0_main.c): `user/cpu0_main.c`
- [Command Protocol](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/ano.c): `code/ano.c`
- [Telemetry](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/ano.c): `code/ano.c`
- [Fault Handling](https://github.com/20dcyy06/icar_lower_board_26/blob/main/user/cpu0_main.c): `user/cpu0_main.c`

### Motion Control

- [Vehicle Control](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/control.c): `code/control.c`
- [PID Algorithms](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/pid.c): `code/pid.c`
- [Motor Output](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/motor.c): `code/motor.c`
- [Motion Sensing](https://github.com/20dcyy06/icar_lower_board_26/blob/main/code/imu.c): `code/imu.c`

### Board Interfaces

- [TC26B Drivers](https://github.com/20dcyy06/icar_lower_board_26/tree/main/libraries/infineon_libraries/iLLD/TC26B/Tricore): `libraries/infineon_libraries/iLLD/TC26B/Tricore`

### Other components

- **Upper Controller**
- **Motors and Sensors**

## Connections

- Upper Controller → Firmware Loop: sends commands
- Firmware Loop → Command Protocol: receives frames
- Command Protocol → Firmware Loop: decoded commands
- Firmware Loop → Vehicle Control: updates motion
- Vehicle Control → PID Algorithms: computes control
- Firmware Loop → Motor Output: sets output
- Firmware Loop → Motion Sensing: reads motion
- Firmware Loop → Fault Handling: checks faults
- Fault Handling → Motor Output: stops motor
- Firmware Loop → Telemetry: sends status
- Telemetry → Upper Controller: reports status
- Motor Output → TC26B Drivers: uses drivers
- TC26B Drivers → Motors and Sensors: drives hardware
- Motors and Sensors → Motion Sensing: provides measurements
