# gyrocopterllc/flatmcu architecture

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

- Interactive diagram: https://gitdiagram.com/gyrocopterllc/flatmcu
- Repository: https://github.com/gyrocopterllc/flatmcu

## Overview

flatmcu is a KiCad hardware-design repository for an STM32G4-based BLDC/FOC motor controller. Its principal workflow is to design the controller schematic and board, then retain fabrication outputs such as Gerbers and drill data. The documented design spans a main schematic, microcontroller schematic, and three-phase bridge schematic; the README also identifies the MCU, bridge driver, current sensing, buck regulator, and MOSFETs. Relationships below rely on README statements; file contents were not provided for inspection.

Main entry points: [`design/ThreePhaseBridge.kicad_sch`](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch) (Three-phase bridge), [`design/flatmcu.kicad_sch`](https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu.kicad_sch) (Main schematic), [`design/MCU.kicad_sch`](https://github.com/gyrocopterllc/flatmcu/blob/master/design/MCU.kicad_sch) (MCU schematic), [`design/flatmcu.kicad_pcb`](https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu.kicad_pcb) (PCB layout)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_design["Hardware design"]
  node_main_schematic["Main schematic<br/>[flatmcu.kicad_sch]"]
  node_mcu_schematic["MCU schematic<br/>[MCU.kicad_sch]"]
  node_bridge_schematic["Bridge schematic"]
  node_pcb["PCB layout<br/>[flatmcu.kicad_pcb]"]
  node_symbols["Custom symbols<br/>[Custom.lib]"]
  node_footprints["Custom footprints<br/>[Custom.pretty]"]
  node_models["3D component models<br/>[Custom.3dshapes]"]
end

subgraph group_electronics["Controller electronics"]
  node_mcu["STM32G473CB MCU<br/>[MCU.kicad_sch]"]
  node_bridge["Three-phase bridge"]
  node_driver["DRV8353RS driver"]
  node_sensing["Shunt sensing"]
  node_buck["Buck regulator"]
  node_mosfets["Power MOSFETs"]
end

subgraph group_outputs["Design outputs"]
  node_bom["Bill of materials<br/>[flatmcu_bom.csv]"]
  node_gerbers["Gerber files<br/>[flatmcu-F_Cu.gbr]"]
  node_drill["Drill data<br/>[flatmcu.drl]"]
end

node_kicad(("KiCad EDA"))

node_kicad -->|"creates"| node_main_schematic
node_kicad -->|"creates"| node_pcb
node_main_schematic -->|"includes section"| node_mcu_schematic
node_main_schematic -->|"includes section"| node_bridge_schematic
node_mcu_schematic -->|"depicts"| node_mcu
node_bridge_schematic -->|"depicts"| node_bridge
node_bridge -->|"contains"| node_driver
node_bridge -->|"contains"| node_sensing
node_bridge -->|"contains"| node_buck
node_bridge -->|"uses"| node_mosfets

click node_main_schematic "https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu.kicad_sch"
click node_mcu_schematic "https://github.com/gyrocopterllc/flatmcu/blob/master/design/MCU.kicad_sch"
click node_bridge_schematic "https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch"
click node_pcb "https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu.kicad_pcb"
click node_symbols "https://github.com/gyrocopterllc/flatmcu/blob/master/design/Custom.lib"
click node_footprints "https://github.com/gyrocopterllc/flatmcu/tree/master/design/Custom.pretty"
click node_models "https://github.com/gyrocopterllc/flatmcu/tree/master/design/Custom.3dshapes"
click node_mcu "https://github.com/gyrocopterllc/flatmcu/blob/master/design/MCU.kicad_sch"
click node_bridge "https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch"
click node_driver "https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch"
click node_sensing "https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch"
click node_buck "https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch"
click node_mosfets "https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch"
click node_bom "https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu_bom.csv"
click node_gerbers "https://github.com/gyrocopterllc/flatmcu/blob/master/gerbers/flatmcu-F_Cu.gbr"
click node_drill "https://github.com/gyrocopterllc/flatmcu/blob/master/gerbers/flatmcu.drl"

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_schematic,node_mcu_schematic,node_bridge_schematic,node_pcb,node_symbols,node_footprints,node_models toneBlue
class node_mcu,node_bridge,node_driver,node_sensing,node_buck,node_mosfets toneAmber
class node_bom,node_gerbers,node_drill toneMint
class node_kicad toneIndigo
```

## Components

### Hardware design

- [Main schematic](https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu.kicad_sch): `design/flatmcu.kicad_sch`
- [MCU schematic](https://github.com/gyrocopterllc/flatmcu/blob/master/design/MCU.kicad_sch): `design/MCU.kicad_sch`
- [Bridge schematic](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch): `design/ThreePhaseBridge.kicad_sch`
- [PCB layout](https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu.kicad_pcb): `design/flatmcu.kicad_pcb`
- [Custom symbols](https://github.com/gyrocopterllc/flatmcu/blob/master/design/Custom.lib): `design/Custom.lib`
- [Custom footprints](https://github.com/gyrocopterllc/flatmcu/tree/master/design/Custom.pretty): `design/Custom.pretty`
- [3D component models](https://github.com/gyrocopterllc/flatmcu/tree/master/design/Custom.3dshapes): `design/Custom.3dshapes`

### Controller electronics

- [STM32G473CB MCU](https://github.com/gyrocopterllc/flatmcu/blob/master/design/MCU.kicad_sch): `design/MCU.kicad_sch`
- [Three-phase bridge](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch): `design/ThreePhaseBridge.kicad_sch`
- [DRV8353RS driver](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch): `design/ThreePhaseBridge.kicad_sch`
- [Shunt sensing](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch): `design/ThreePhaseBridge.kicad_sch`
- [Buck regulator](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch): `design/ThreePhaseBridge.kicad_sch`
- [Power MOSFETs](https://github.com/gyrocopterllc/flatmcu/blob/master/design/ThreePhaseBridge.kicad_sch): `design/ThreePhaseBridge.kicad_sch`

### Design outputs

- [Bill of materials](https://github.com/gyrocopterllc/flatmcu/blob/master/design/flatmcu_bom.csv): `design/flatmcu_bom.csv`
- [Gerber files](https://github.com/gyrocopterllc/flatmcu/blob/master/gerbers/flatmcu-F_Cu.gbr): `gerbers/flatmcu-F_Cu.gbr`
- [Drill data](https://github.com/gyrocopterllc/flatmcu/blob/master/gerbers/flatmcu.drl): `gerbers/flatmcu.drl`

### Other components

- **KiCad EDA**

## Connections

- KiCad EDA → Main schematic: creates (evidence: `README.md`)
- KiCad EDA → PCB layout: creates (evidence: `README.md`)
- Main schematic → MCU schematic: includes section (evidence: `README.md`)
- Main schematic → Bridge schematic: includes section (evidence: `README.md`)
- MCU schematic → STM32G473CB MCU: depicts (evidence: `README.md`)
- Bridge schematic → Three-phase bridge: depicts (evidence: `README.md`)
- Three-phase bridge → DRV8353RS driver: contains (evidence: `README.md`)
- Three-phase bridge → Shunt sensing: contains (evidence: `README.md`)
- Three-phase bridge → Buck regulator: contains (evidence: `README.md`)
- Three-phase bridge → Power MOSFETs: uses (evidence: `README.md`)
