Grafito CANStepper

Two firmwares ship for the same board. Pick one per node. Do not mix GCSP and CANopen on the same CAN bus.

SketchVersionProtocolUse
GrafitoCANStepper_C31.12GCSP v1Python (grafito-canstepper), G-code, multi-node machines
GrafitoCANStepper_C3_CANopen2.1CiA 301 / 402PLC import (EDS / DCF)

GCSP v1 — production firmware 1.12

Current production node firmware (S-curve closed loop, encoder LUT, measured precision defaults). Download or preview the full sketch (hosted on this docs site — no private repository access required).

Download GrafitoCANStepper_C3.inoOpen raw file

ESP32-C3 GCSP v1 production firmware (fw 1.12 — S-curve + LUT + precision defaults).

GrafitoCANStepper_C3.inoscroll to preview full source
// Loading firmware preview…

What 1.12 provides

AreaNotes
MotionOpen-loop FastAccelStepper; closed-loop S-curve + Ka (fw ≥1.11)
EncoderMT6701 SSI + optional 200-step LUT (fw ≥1.10)
DriverTMC2209 over UART; OTPW/OT, shorts, StallGuard (fw ≥1.4)
BusTWAI CAN 1 Mbps, USB serial bridge
HOME / IO8INPUT_PULLUP; STATUS byte 7 diagnostics (fw ≥1.5)
SafetyE-stop latch, fault codes, bus-off recovery
Boot (1.9+)Coils off; enable_on_boot=0; hold ≤5; run capped at 40; standstill freewheel
Endstop (1.8+)Hard defaults every boot: enable=1, active-high=1, action=stop
Defaults (1.12)cl_max_accel=1440, Kp=10, Kd=0.35, Ka=0.04 (bench median |err| 0.13°)

Full flash procedure (Arduino IDE + arduino-cli, GCSP and CANopen, node IDs, boot banners, upload failures): Flashing firmware.

Short version: ESP32C3 Dev Module, USB CDC On Boot: Enabled. Libraries: FastAccelStepper, TMC2209 (janelia-arduino). Apply Vin 5–24 V (typically 24 V) before upload — USB-C is data only. See Hardware → Power.

arduino-cli compile --upload -p /dev/ttyACM0 \
  --fqbn esp32:esp32:esp32c3:CDCOnBoot=cdc \
  path/to/GrafitoCANStepper_C3

Healthy serial banner:

# GrafitoCANStepper fw 1.12 proto 1
# HOME pin GPIO8 INPUT_PULLUP raw=HIGH (strapping: keep HIGH at power-on)
# HOME: INPUT_PULLUP + endstop enable=1 active_high=1 action=stop (fw 1.12)
# LUT: valid=1 enabled=1 peak_INL=2.116 deg
# POWER: enable_on_boot=0 hold<=5 run<=40 standstill=freewheel (fw 1.9)
# MT6701 SSI mode=3 encoder-loss-filter=25ms
# CAN started (1 Mbps)

Host API: node.get_driver_status() — see Python library and Protocol DRIVER. Motors stay disabled until node.enable() (1.9 does not auto-enable).

Firmware history (GCSP)

FWBehaviour
≤1.0Pure PI/D chase; default cl_max_speed 30 deg/s
1.1Braking-envelope cap (no planned cruise)
1.2Trapezoid + velocity feedforward + tracking PID
1.4TMC2209 DRIVER telemetry (OTPW/OT, shorts); faults 4/5
1.5STATUS byte 7 — GPIO8 / HOME raw + logical diagnostics
1.7HOME raw boot lines; endstop bring-up diagnostics
1.8Endstop hard defaults every boot (enable, active-high, stop)
1.9Low-power boot: no auto-enable, hold/run caps, freewheel standstill
1.10200-step MT6701 encoder LUT
1.117-segment S-curve + acceleration feedforward (pid_ka)
1.12Precision factory defaults from hardware bench (accel 1440, Kp/Kd/Ka)

CANopen / CiA 402 — firmware 2.1 (PLC)

Optional SKU for TwinCAT, Codesys, or another CANopen master. Firmware 2.1 uses the same closed-loop motion as GCSP 1.12 (7-segment S-curve, Ka feedforward, 200-step encoder LUT, accel 1440 °/s², Kp/Kd/Ka = 10 / 0.35 / 0.04). Full page: CANopen / CiA 402.

Download GrafitoCANStepper_C3_CANopen.inoOpen raw file

CANopen CiA 402 sketch (fw 2.1 — S-curve + LUT + GCSP 1.12 defaults). Also download canopen_stack.h from the CANopen page.

GrafitoCANStepper_C3_CANopen.inoscroll to preview full source
// Loading firmware preview…
FileUse
GrafitoCANStepper_C3_CANopen.inoCANopen sketch (fw 2.1)
canopen_stack.hRequired header — flash the folder, not the .ino alone
GrafitoCANStepper.edsCiA 306 EDS — fw 2.1 template (replace any 2.0 file)
GrafitoCANStepper_Node1.dcfDCF instance, node 1, 1 Mbps, fw 2.1
GrafitoCANStepper_Node2.dcfDCF instance, node 2, 1 Mbps (flash CO_FACTORY_NODE_ID=2)
object_dictionary.jsonObject dictionary (JSON)
object_dictionary.csvObject dictionary (CSV)
Grafito_CANStepper_EDS_Configuration_Guide.pdfPLC / EDS configuration guide (PDF)

Optional: Wi‑Fi SoftAP test portal

For a phone browser bench UI (SoftAP hotspot + enable/move/endstop), see Wi‑Fi test portal. That sketch is separate and overwrites production GCSP until you re-flash GrafitoCANStepper_C3.

On this page