Skip to content
pradeepsuryadPublic

About

C++17 firmware for a 7-DoF robotic arm: CAN, SPI and I2C drivers, AS5047P encoders, PID joint control and a host-simulated build, plus ngspice overcurrent-protection analysis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

22 Commits

Folders and files

Repository files navigation

arm-core

Electrical architecture for a 7-DoF robotic arm: high-power DC system, motor driver, power distribution & protection, sensor interfaces, MCU firmware components in C++17 (drivers and a joint controller; the main control loop is still a placeholder) with a native simulated build, and HIL test scripts. The KiCad schematics are generated placeholders (no PCB layouts), and no HIL runs have been captured yet.

Northeastern University.

Stack & requirements

Area Tooling Install
Firmware C++17, CMake ≥ 3.22, Ninja, GoogleTest (via FetchContent) cmake -S firmware -B build/sim -DBUILD_TARGET=SIM
Schematics KiCad 8+ (.kicad_pro / .kicad_sch, generated by hardware/gen_schematics.py; no PCB layouts) —
SPICE ngspice (decks in sim/spice/*.cir) apt install ngspice
Analysis Python 3.11, numpy>=1.24, matplotlib>=3.7 pip install -r sim/analysis/requirements.txt
HIL Python 3.11, python-can>=4.3 + a USB-CAN adapter (CANable/slcan, PEAK PCAN, Kvaser) pip install -r hil/scripts/requirements.txt
Lint ruff (check + format --check) pip install ruff

The firmware builds two ways: -DBUILD_TARGET=SIM compiles natively (x86-64) so the unit tests run anywhere, and -DBUILD_TARGET=MCU cross-compiles for the target. CI only exercises SIM — the MCU ELF needs vendor linker scripts and startup files that live with the BSP, not in this repo.

Build & test

# firmware unit tests (native, with ASAN + UBSAN)
cmake -S firmware -B build/sim -G Ninja -DCMAKE_BUILD_TYPE=Debug -DBUILD_TARGET=SIM
cmake --build build/sim --parallel
ctest --test-dir build/sim --output-on-failure

# overcurrent-protection analytical model → sim/analysis/figures/*.png
cd sim/analysis && python overcurrent_analysis.py

CI

.github/workflows/ci.yml runs three jobs on push and PR: firmware unit tests in SIM mode (covering CAN frame packing, PID direction, fault latch/clear, and soft position limits), the SPICE analytical model as a smoke test, and a ruff lint/format gate over the Python.

Layout

hardware/              KiCad projects (generated placeholder schematics, no PCB layouts)
  motor-driver/          DC servo motor driver
  power-distribution/    Bus power, short-circuit / overcurrent protection
  sensor-interface/      Sensor interfaces (encoder, IMU, thermistor)
  common/                Connector, wiring and grounding notes

firmware/              C++17 MCU firmware (native SIM build + unit tests)
  src/                   Application sources
  include/               Public headers
  drivers/               Peripheral & comms drivers (CAN / SPI / I2C)
  tests/                 Unit tests (GoogleTest, SIM build)

sim/                   Pre-silicon validation
  spice/                 LTspice / ngspice decks
  analysis/              Python scripts (figures are generated, not committed)

hil/                   Hardware-in-the-loop
  scripts/               Test runners

docs/                  Specs
  architecture/          Block diagrams, power tree, comms map

Communication buses

CAN — high-bandwidth motor command / telemetry bus SPI — AS5047P absolute encoder I2C — driver present, not yet used

About

C++17 firmware for a 7-DoF robotic arm: CAN, SPI and I2C drivers, AS5047P encoders, PID joint control and a host-simulated build, plus ngspice overcurrent-protection analysis

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages