docs: sync control source to AK60 RPi5 BiSS-C

This commit is contained in:
Nick Hermes
2026-07-06 10:21:23 +00:00
parent edb8648f78
commit 5883620f73
18 changed files with 32083 additions and 31969 deletions

View File

@@ -19,7 +19,7 @@ Normand can operate the polisher manually from the touchscreen, with:
- safe force/table/spindle control, including clockwise/counter-clockwise toolhead rotation selection;
- KWR75B-CAN force/torque sensor integration;
- ODrive S1 + M8325s spindle drive integration;
- CubeMars AK60-6 V1.1 KV80 spindle actuator integration;
- Teensy-side fast safety and setpoint/telemetry loop;
- host-side state machine, logs, status, and data export;
- synchronized telemetry at **>=100 Hz**;
@@ -60,7 +60,7 @@ tests/ Host-side contract/state-machine tests
## Current source alignment
Generated: 2026-05-26. This foundation is a repo scaffold and implementation aid,
Generated: 2026-05-26. Source-refresh: 2026-07-06 for Raspberry Pi 5, AK60, and ordered BiSS-C encoders. This foundation is a repo scaffold and implementation aid,
not a replacement for the approved P11 source specifications. If this repo and
the source specs disagree, ask Antoine before changing architecture, safety,
telemetry contracts, or scope.

View File

@@ -22,7 +22,7 @@
- [ ] Host↔Teensy serial link with ACK/NACK and CRC.
- [ ] KWR75B-CAN receive path with measured sample rate and stale-frame watchdog.
- [ ] Encoder acquisition for table and arm.
- [ ] ODrive command/telemetry interface selected and documented, including sign mapping for `cw`/`ccw` physical tool rotation.
- [ ] AK60 command/telemetry interface selected and documented, including direction mapping for `cw`/`ccw` physical tool rotation.
- [ ] Force actuator command path selected and documented.
## Phase 3 — Manual mode MVP

View File

@@ -11,7 +11,7 @@ Build the machine-side control stack for the Fullum swing-arm polisher so Norman
3. Stable host↔Teensy setpoint + telemetry protocol.
4. KWR75B-CAN force/torque acquisition and stale-frame detection.
5. Table/arm encoder acquisition and synchronized timestamps.
6. ODrive spindle command/telemetry path.
6. AK60 spindle command/telemetry path, including CAN topology and safety power-removal assumptions.
7. Run/manual logs and `/data/` file layout.
8. Controller-job intake dry-run for future program execution.

View File

@@ -7,7 +7,7 @@
- Host↔Teensy command/telemetry protocol.
- KWR75B-CAN force/torque sensor integration.
- Table and arm encoder acquisition.
- ODrive S1 + M8325s spindle control/telemetry path.
- CubeMars AK60-6 V1.1 KV80 spindle control/telemetry path.
- Force actuator command path and tool-weight compensation.
- Synchronized telemetry at >=100 Hz.
- Manual-session logs and raw telemetry CSV.

View File

@@ -43,7 +43,7 @@ Requirements:
- `cw` — clockwise
- `ccw` — counter-clockwise
Physical convention: direction is observed from above the toolhead looking down toward the mirror/tool contact. The ODrive sign mapping is a commissioning item and must be configured so UI/protocol values match physical rotation. Direction changes are explicit setpoint changes; do not infer direction from a signed RPM. RPM remains a non-negative magnitude.
Physical convention: direction is observed from above the toolhead looking down toward the mirror/tool contact. The AK60 direction mapping is a commissioning item and must be configured so UI/protocol values match physical rotation. Direction changes are explicit setpoint changes; do not infer direction from a signed RPM. RPM remains a non-negative magnitude.
## v1 production subset

View File

@@ -19,14 +19,18 @@
## Drive bring-up
- [ ] ODrive runtime interface selected and documented.
- [ ] ODrive enable/disable/fault reset path verified.
- [ ] Spindle RPM command and actual feedback verified.
- [ ] AK60 runtime interface selected and documented.
- [ ] AK60 enable/disable/fault reset path verified.
- [ ] Spindle RPM command, actual feedback, direction mapping, and safe ramp/stop behavior verified.
- [ ] Z force actuator command path verified with safe limits.
- [ ] Brake engaged feedback verified if installed.
## Safety
- [ ] STO channels wired as independent safety channels per SV2A and safety relay manuals.
- [ ] Z brake engages on E-stop, STO/drive fault, controller crash, and power loss with no software dependency.
- [ ] AK60 power removal through the safety-controlled post-contactor bus verified; CAN stop is not treated as safety-rated.
- [ ] E-stop hard circuit tested independent of software state.
- [ ] Force over-limit response tested.
- [ ] Encoder-loss response tested.

View File

@@ -3,16 +3,16 @@
## Table interface
- Confirm KBSI-240D opto-isolated interface or replacement.
- Confirm table encoder transport and transceiver.
- Confirm ordered BiSS-C table/arm encoder frame timing, CRC/status bits, RS422 transceiver/pinout, shielding, and startup/error handling.
- Confirm whether the table drive or command path changes electrically.
## Spindle / ODrive
## Spindle / AK60
- Define ODrive runtime command and telemetry path; CAN 2.0B at 1 Mbps is preferred unless replaced.
- Define command scaling for velocity, enable/disable, fault reset, and safe stop.
- Define telemetry subset: actual RPM, drive state/error, DC bus voltage, q-axis current, motor temperature if available.
- Export final ODrive config with release.
- Define spindle enable/fault I/O into HOA + safety chain.
- Define AK60 runtime command and telemetry path; freeze CAN topology, IDs, frame rates, stale-frame timeout, startup behavior, and error isolation.
- Define command scaling for velocity, direction mapping, enable/disable, fault reset, ramp-to-zero / live-reversal policy, and safe stop behavior.
- Define telemetry subset: actual RPM, actuator state/error, bus/supply voltage, torque/current if available, motor/drive temperature if available.
- Export final AK60 commissioning parameters with each machine software release.
- Define spindle enable/fault I/O and the hardwired AK60 power-removal path through HOA + safety chain; prove E-stop/power-loss behavior on bench.
## Z-axis / force actuator

View File

@@ -7,6 +7,7 @@ project: P11-Polisher-Fullum
repo: polisher-control
source_truth: false
created: 2026-06-02
updated: 2026-07-06
privacy: technical-only
---
@@ -32,7 +33,7 @@ If this file conflicts with the source specs or with Antoine's explicit directio
- Force setpoint execution and closed-loop Fz control.
- Table/spindle/arm-drive command interfaces.
- KWR75B-CAN force/torque acquisition.
- ODrive S1 + M8325s spindle integration.
- CubeMars AK60-6 V1.1 KV80 spindle actuator integration.
- State machine, pause/resume/abort, faults, alarms, interlocks.
- Telemetry, event logs, manual-session logs, run artifacts, and `/data/` layout.
- Conservative machine capability descriptor.
@@ -134,7 +135,7 @@ Program execution exists as a contract scaffold and future path, but the v1 prod
3. Stable host ↔ Teensy setpoint and telemetry protocol.
4. KWR75B-CAN force/torque acquisition and stale-frame detection.
5. Table/arm encoder acquisition and synchronized timestamps.
6. ODrive S1 + M8325s spindle command/telemetry path.
6. AK60 spindle command/telemetry path.
7. Run/manual logs and `/data/` file layout.
8. Controller-job intake dry-run for future program execution.
@@ -164,11 +165,11 @@ Program execution exists as a contract scaffold and future path, but the v1 prod
These are current project facts unless Antoine/source specs supersede them:
- Real-time controller: **Teensy 4.1**.
- Host: **Raspberry Pi 4 + touchscreen**.
- Host: **Raspberry Pi 5 + touchscreen**.
- Primary process force sensor: **Kunwei KWR75B-CAN**, dedicated CAN link to Teensy through isolated transceiver.
- Table encoder: **RLS Artos DHR 162 mm**, 20-bit absolute, SSI/RS422 basis.
- Arm encoder: **RLS Orbis BR10**, 14-bit absolute, SSI/RS422 basis.
- Spindle: **ODrive S1 + M8325s 100KV**, v1 velocity control, CAN 2.0B at 1 Mbps preferred.
- Table encoder: **RLS Artos DHR 162 mm**, 20-bit absolute, ordered BiSS-C/RS422 basis.
- Arm encoder: **RLS Orbis BR10**, 14-bit absolute, ordered BiSS-C/RS422 basis.
- Spindle: **CubeMars AK60-6 V1.1 KV80**, v1 velocity control, CAN working basis pending final topology/IDs/rates.
- Z/force actuator: counterweight-biased **AutomationDirect SV2L-210B** servo with **SV2A-2150** drive, torque/current mode to confirm.
- Z brake: NC 24 VDC electromagnetic brake; engages on E-stop or power loss.
- Safety relay: Pilz PNOZ X1 or Banner XS26-2 still needs final selection.
@@ -418,8 +419,8 @@ Use `docs/11-feature-request-intake.md` as the template.
Current control/firmware-facing questions include:
- Confirm KBSI-240D / table drive command path or replacement.
- Confirm table encoder transport and transceiver choice.
- Define ODrive runtime command/telemetry path, scaling, fault reset, safe stop, and config export.
- Confirm ordered BiSS-C table/arm encoder frame timing, CRC/status bits, RS422 transceiver/pinout, shielding, and startup/error handling.
- Define AK60 runtime command/telemetry path, scaling, fault reset, ramp/stop policy, safety power-removal behavior, and commissioning parameter export.
- Confirm SV2A-2150 torque/current command mapping, enable/fault wiring, current/Iq monitor path.
- Confirm Z limit-switch / hard-stop wiring into safety chain.
- Confirm NC brake coil driver and brake-engaged diagnostic feedback.

View File

@@ -40,7 +40,7 @@ Rationale: the controller is not deciding polishing strategy. It is executing/lo
## 4. Affected layers
- Host controller: normalize/validate direction aliases and include direction in manual setpoints/log events.
- Teensy firmware: accept direction in `MANUAL_START`, `SETPOINT`, and future `SEGMENT_START`; map to ODrive command sign.
- Teensy firmware: accept direction in `MANUAL_START`, `SETPOINT`, and future `SEGMENT_START`; map to AK60 command direction/sign convention.
- Host ↔ Teensy protocol: add `spindle_direction` / `commanded_spindle_direction` enum values `cw` / `ccw`.
- Telemetry channels: add `spindle_direction_setpoint` and `spindle_direction_actual` as recommended channels.
- Run/manual-session logs: record direction separately from RPM; RPM remains a non-negative magnitude.
@@ -51,8 +51,8 @@ Rationale: the controller is not deciding polishing strategy. It is executing/lo
## 5. Safety implications
- Direction must not be inferred from signed RPM; use explicit enum plus non-negative RPM magnitude.
- Direction reversal while spindle is moving should be ramped/handled safely by firmware/ODrive implementation. The scaffold currently defines the contract; Cédric should decide whether live reversal is allowed directly or requires ramp-to-zero before applying the new direction.
- ODrive sign mapping is a commissioning item: firmware must be configured so UI `cw`/`ccw` matches physical observed tool rotation.
- Direction reversal while spindle is moving should be ramped/handled safely by firmware/AK60 implementation. The scaffold currently defines the contract; Cédric should decide whether live reversal is allowed directly or requires ramp-to-zero before applying the new direction.
- AK60 direction mapping is a commissioning item: firmware must be configured so UI `cw`/`ccw` matches physical observed tool rotation.
Safety decision:
@@ -72,14 +72,14 @@ Safety decision:
- [x] Host contract tests for enum values and alias normalization.
- [x] Schema field test for `commanded_spindle_direction`.
- [x] Telemetry channel test for direction channels.
- [ ] Firmware compile/build check once Cédric maps this into Teensy/ODrive code.
- [ ] Firmware compile/build check once Cédric maps this into Teensy/AK60 code.
- [ ] Bench test confirms UI `cw` physically rotates clockwise by the documented convention.
- [ ] Bench test confirms UI `ccw` physically rotates counter-clockwise by the documented convention.
- [ ] Bench test confirms live reversal behavior is safe or blocked until spindle reaches zero.
## 8. Open questions
- Cédric: confirm the ODrive command/sign mapping and whether live direction reversal requires ramp-to-zero.
- Cédric: confirm the AK60 command/direction mapping and whether live direction reversal requires ramp-to-zero.
- Antoine/Normand: confirm the physical viewing convention: current draft uses “viewed from above the toolhead looking down toward the mirror/tool contact.”
## 9. Implementation notes

View File

@@ -0,0 +1,44 @@
---
title: AK60 / Raspberry Pi 5 / BiSS-C Source Sync
status: draft
requested_by: Antoine Letarte
generated_by: Nick / Hermes
project: P11-Polisher-Fullum
repo: polisher-control
source_truth: false
created: 2026-07-06
privacy: technical-only
---
# AK60 / Raspberry Pi 5 / BiSS-C Source Sync
## Purpose
Align the repo foundation with Antoine's accepted hardware corrections before Cédric writes firmware against stale assumptions.
## Source references
- P11 firmware source: `software-suite/control/firmware/Fullum-Polisher-Machine-Control-Firmware-Spec-v1.md`
- Repo mirror: `docs/reference/fullum-control-firmware-spec/Fullum-Polisher-Machine-Control-Firmware-Spec-v1.md`
- Electrical audit TLDR: `2026-07-06-Polisher-Control-Electrical-Audit-TLDR.md`
- Change gate: `CEDRIC-PROP-20260609-001`
## Accepted corrections now reflected here
1. Host computer is **Raspberry Pi 5 + touchscreen**, not Raspberry Pi 4.
2. Toolhead spindle path is **CubeMars AK60-6 V1.1 KV80**, not ODrive S1 + M8325s.
3. Table encoder order is `DHR162DB20BAAS30DA02` + `SAR162C143AF14WAP00`, which means **BiSS-C / RS422**.
4. Arm encoder order is `BR10DCD14B12DH00` + `BM120A190A1ABA00`, which means **BiSS-C / RS422**.
## Cédric implementation cautions
- Do not treat CAN stop/disable as a safety-rated AK60 stop. The safety basis must remove AK60 power through the hardwired safety-controlled post-contactor path and be bench-tested.
- Freeze AK60 CAN topology before firmware lock: IDs, frame rates, stale-frame timeouts, fault handling, startup behavior, and whether AK60 shares a CAN bus with KWR75B.
- Freeze BiSS-C implementation details before encoder firmware lock: frame timing, CRC/status bits, RS422 transceiver/pinout, shielding, and error handling.
- Preserve `cw` / `ccw` as explicit direction enums separate from non-negative RPM; bench-map them to physical rotation.
## Acceptance checks
- Firmware source and repo mirror no longer name ODrive/M8325s as the current spindle basis.
- Repo start docs, LLM context, roadmap, commissioning checklist, open questions, and machine capability profile now use AK60/RPi5/BiSS-C language.
- Host-side tests and JSON validation should still pass after this docs/source refresh.

View File

@@ -2,13 +2,13 @@
#show: atomaste-report.with(
title: "Fullum Polisher Machine Control and Firmware Specification",
subtitle: "Cédric implementation reference - Draft v1.2",
subtitle: "Cédric implementation reference - Draft v1.3",
project: "Polisher Software Suite",
client: "Optiques Fullum",
doc-number: "ATM-2026-POL-CTRL-001",
date: "2026-05-19",
date: "2026-07-06",
author: "Antoine Letarte, Eng., M.A.Sc.",
revision: "Draft v1.2 - telemetry retention contract",
revision: "Draft v1.3 - AK60/RPi5/BiSS-C source sync",
show-toc: true,
show-list-of-figures: true,
show-list-of-tables: true
@@ -58,8 +58,8 @@
columns: 2,
[Field], [Value],
[Document number], [ATM-2026-POL-CTRL-001],
[Revision], [Draft v1.2 - telemetry retention contract],
[Date], [2026-05-19],
[Revision], [Draft v1.3 - AK60/RPi5/BiSS-C source sync],
[Date], [2026-07-06],
[Author], [Antoine Letarte (Atomaste)],
[Recipient], [Cédric Leclerc],
[Status], [For Cédric's review comments requested before lock],
@@ -70,10 +70,11 @@
*Changes since previous internal draft:*
- _2026-07-06 source sync:_ promotes Antoine-confirmed Raspberry Pi 5 host, AK60 spindle path, and ordered Renishaw/RLS BiSS-C encoders into the firmware source/report package.
- _Hardware sync with Cédric's current BOM:_ primary F/T sensor updated from the retired SRI M3703C + M8228S1 path to the selected *Kunwei KWR75B-CAN* integrated 6-axis load cell. The transport section is now CAN-based and the telemetry status channel is generalized to `ft_status`.
- _Toolhead spindle drive update:_ Zone 2 now treats the selected full *ODrive S1 + M8325s 100KV* toolhead spindle system as finalized mechanical input, and documents only firmware-facing items: ODrive control mode, CAN/interface options, onboard MA702 encoder use, motor electrical constants, current/thermal limits, fault mapping, and telemetry fields.
- _Toolhead spindle drive source sync:_ Zone 2 now treats the selected *CubeMars AK60-6 V1.1 KV80* integrated actuator as the current spindle path, replacing ODrive S1 + M8325s. Firmware-facing work is now AK60 command/telemetry mapping, CAN topology, limits, fault mapping, and safety power-removal validation.
- _Z-axis drive selection update:_ Zone 4 now reflects Cédric's selected *AutomationDirect SV2L-210B / SV2A-2150* servo package, with remaining work focused on torque/current command scaling, enable/fault wiring, and current/Iq monitor mapping.
- _Open questions refreshed:_ removed SRI UDP and generic spindle-vector-drive questions; replaced them with KWR75B-CAN frame-map confirmation, ODrive command/telemetry interface confirmation, and SV2A-2150 control mapping.
- _Open questions refreshed:_ replaced stale ODrive and SSI encoder questions with AK60 CAN/telemetry/safety-stop items and ordered Renishaw/RLS BiSS-C encoder frame/pinout items.
- _Formatting:_ ToC / figure lists enabled; exec summary expanded; Excalidraw architecture diagram retired, Mermaid is now the sole source of truth for all three diagrams (delivery-scope, control-stack, runtime-split).
- _Structure:_ §5.1 Three-Truths duplicate removed (canonical definition in §2.3); schema references cleaned up to logical names; §18.1 v1 scope and §19 acceptance criteria cross-referenced; §21 open-questions list audited.
@@ -82,13 +83,25 @@
- _Telemetry retention contract added:_ raw \>=100 Hz capture remains the machine-side audit source, while a host-side post-run routine derives compressed/downsampled telemetry, segment statistics, dwell/work maps, anomaly windows, hashes, and retention status after each run or manual session.
- _Figure readability update:_ The tall in-body safety and segment-lifecycle figures are reduced to clear the footer. Figures 4, 5, and 6 now point to Appendix A, where landscape large-format copies are provided for review.
- _Open questions closed:_ arm encoder (Orbis), Z force actuator architecture (counterweight+servo), force-actuator feedback method (Iq), table motor retention (Baldor DC kept).
- _Normand operator request added:_ toolhead spindle rotation direction is now an explicit operator/job setpoint (`cw` / `ccw`) logged separately from non-negative spindle RPM; ODrive sign mapping is a commissioning item.
- _Normand operator request preserved:_ toolhead spindle rotation direction remains an explicit operator/job setpoint (`cw` / `ccw`) logged separately from non-negative spindle RPM; AK60 physical direction mapping is a commissioning item.
#line(length: 100%)
// --- Embedded from: Fullum-Polisher-Machine-Control-Firmware-Spec-v1 ---
= Fullum Polisher - Machine Control & Firmware Specification v1
== Revision history
#figure(
table(
columns: 3,
[Date], [Revision], [Update],
[2026-07-06], [Draft v1.3 - AK60/RPi5/BiSS-C source sync], [Promotes Antoine's accepted hardware corrections into the firmware source: Raspberry Pi 5 host, CubeMars AK60-6 V1.1 KV80 spindle path replacing ODrive/M8325s, ordered Renishaw/RLS BiSS-C encoder part numbers, and AK60 safety/CAN commissioning items.],
),
kind: table,
caption: [Source document revision history.]
)
== Purpose and Context
This document is the *implementation target* for the machine-side stack of the Fullum swing-arm polisher. It tells you exactly:
@@ -388,26 +401,26 @@ Use the status terms below consistently:
==== Table encoder
- *Current basis:* Absolute rotary encoder, *RLS Artos DHR 162 mm*, 20-bit, P/N `DHR162SC20BAAS30DF00` with SAR162 ring for the 143 mm table shaft.
- *Status:* Fixed (BOM 2026-04-24).
- *Required capability / notes:* High angular fidelity, deterministic absolute readout for modulation phase reference. Large-bore OEM ring-kit mount on the existing table shaft.
- *Interface expectation:* SSI (SC) over RS422 into Teensy via an appropriate transceiver (MAX3490-class working basis).
- *Current basis:* Absolute rotary encoder, *RLS Artos DHR 162 mm*, 20-bit, P/N `DHR162DB20BAAS30DA02`, with SAR162 ring P/N `SAR162C143AF14WAP00` for the 143 mm table shaft.
- *Status:* Fixed (actual Renishaw/RLS order validated 2026-06-18; source sync 2026-07-06).
- *Required capability / notes:* High angular fidelity, deterministic absolute readout for modulation phase reference. Large-bore OEM ring-kit mount on the existing table shaft. The ordered `DB` output code is *BiSS-C bidirectional*, replacing the stale `SC` / SSI assumption.
- *Interface expectation:* *BiSS-C over RS422* into Teensy via an appropriate RS422 transceiver/interface. Cédric must confirm frame timing, CRC/status-bit handling, and exact wiring from the ordered RLS documentation before firmware lock.
- *Purpose:* Table angle, derived table RPM, phase reference for force modulation.
==== Arm encoder
- *Current basis:* Absolute rotary encoder on the swing-arm pivot, *RLS Orbis BR10*, 14-bit on-axis (stub-shaft magnet), P/N `BR10SCB14B12DD00` + magnet `BM120A190A1ABA00`.
- *Status:* Fixed (BOM 2026-04-24).
- *Required capability / notes:* ~230 µm radial uncertainty at the encoder bore, sufficient for logging, kinematic linearization, and post-hoc characterization of oscillation amplitude/center (see §3.3, §9.1). SSI protocol for harmonization with the table axis. The earlier Artos DHR option-B path is closed.
- *Interface expectation:* SSI (SC) over RS422 into Teensy.
- *Current basis:* Absolute rotary encoder on the swing-arm pivot, *RLS Orbis BR10*, 14-bit on-axis (stub-shaft magnet), P/N `BR10DCD14B12DH00` + magnet `BM120A190A1ABA00`.
- *Status:* Fixed (actual Renishaw/RLS order validated 2026-06-18; source sync 2026-07-06).
- *Required capability / notes:* ~230 µm radial uncertainty at the encoder bore, sufficient for logging, kinematic linearization, and post-hoc characterization of oscillation amplitude/center (see §3.3, §9.1). The ordered `DC` output code is *BiSS-C over RS422 at 5 V*, replacing the stale `SC` / SSI assumption. The earlier Artos DHR option-B path is closed.
- *Interface expectation:* *BiSS-C over RS422* into Teensy; confirm frame format, CRC/status handling, and transceiver/pinout before firmware lock.
- *Purpose:* Swing-arm oscillation position and amplitude, kinematic linearization reference (§9.5), derived amplitude/center statistics (§9.1).
==== Spindle speed feedback
- *Current basis:* *ODrive S1 + M8325s 100KV kit*, using the motor encoder magnet and the ODrive S1 onboard MA702 magnetic encoder.
- *Status:* Fixed (Antoine selection, 2026-05-18).
- *Required capability / notes:* Must provide stable actual spindle RPM for logging and fault checks. The ODrive closes the motor current/velocity loop locally; the machine controller receives actual RPM and fault state. Firmware must treat the ODrive as the selected spindle servo, not as a candidate or prototype option.
- *Interface expectation:* ODrive local encoder for commutation; controller interface via CAN preferred, or another confirmed ODrive interface.
- *Current basis:* *CubeMars AK60-6 V1.1 KV80 integrated actuator*, using the actuator's internal sensing/drive telemetry for commutation and actual speed feedback.
- *Status:* Fixed hardware direction (Antoine confirmation 2026-07-05; CEDRIC-PROP-20260609-001 accepted).
- *Required capability / notes:* Must provide stable actual spindle RPM for logging and fault checks. The AK60 closes the motor loop locally; the machine controller receives actual RPM, direction state when available, current/torque/thermal telemetry when available, and fault state. Firmware must treat ODrive S1 + M8325s as obsolete for this machine.
- *Interface expectation:* AK60 runtime command/telemetry via CAN is the current working basis. Final CAN topology, IDs, frame rates, timeouts, and fault handling must be frozen before firmware lock; keep the primary KWR75B-CAN force path isolated unless Cédric explicitly proves a shared-bus design is safe and deterministic.
- *Purpose:* Spindle commutation, speed monitoring, and tool rotation telemetry.
==== Force actuator feedback
@@ -438,10 +451,11 @@ Use the status terms below consistently:
==== Spindle motor
- *Current basis:* *ODrive S1 + M8325s 100KV pancake/outrunner motor kit* as the selected full toolhead spindle system. This replaces the earlier Mosrac U7636 + separate drive/encoder basis.
- *Status:* Fixed (Antoine selection, 2026-05-18).
- *Required capability / notes:* From the controller's perspective: an ODrive-controlled BLDC spindle that accepts speed/enable commands, accepts explicit clockwise/counter-clockwise direction selection, closes the motor loop locally, and exposes actual RPM plus fault state. ODrive S1 supports torque, velocity, position, and trajectory modes; v1 uses velocity control for commanded spindle RPM. Direction is represented separately from RPM; RPM remains a non-negative magnitude.
- *Drive expectation:* ODrive S1 local FOC velocity loop; controller command/telemetry path via CAN or confirmed ODrive interface.
- *Current basis:* *CubeMars AK60-6 V1.1 KV80 integrated actuator* as the selected toolhead spindle system. This replaces the ODrive S1 + M8325s path and earlier Mosrac U7636 / separate-drive assumptions.
- *Status:* Fixed hardware direction (Antoine confirmation 2026-07-05; CEDRIC-PROP-20260609-001 accepted).
- *Required capability / notes:* From the controller's perspective: an AK60 spindle actuator that accepts speed/enable commands, accepts explicit clockwise/counter-clockwise direction selection, closes the motor loop locally, and exposes actual RPM plus fault state. Direction is represented separately from RPM; RPM remains a non-negative magnitude. Preserve sizing caveats: the AK60-6 KV80 path is acceptable for the documented normal polishing torque basis and transient aggressive cases, but sustained high-torque duty, gearbox ripple/backlash, wet/slurry protection, output interface, and thermal/current telemetry must be validated before commissioning sign-off.
- *Drive expectation:* AK60 integrated drive/controller. Runtime command/telemetry via CAN is the current working basis; if Cédric selects a different supported AK60 interface, update this spec and the machine capability profile before firmware lock.
- *Safety expectation:* AK60 has no safety-rated STO in the current plan. Firmware CAN stop/disable commands are normal-control actions only; the safety model must remove AK60 power through the safety-controlled post-contactor power path and bench-test coast-down/fault behavior.
- *Purpose:* Tool rotation.
==== Arm oscillation motor
@@ -460,40 +474,27 @@ Use the status terms below consistently:
- *Drive expectation:* 010 V isolated analog speed reference from the Teensy; run/stop and fault I/O into the HOA and safety chain.
- *Purpose:* Swing-arm motor drive.
==== ODrive S1 + M8325s Firmware-Facing Facts
==== CubeMars AK60-6 V1.1 Firmware-Facing Facts
The toolhead/spindle mechanical design is finalized outside this firmware document. The firmware/control scope is only the electrical interface, configuration, command path, telemetry path, and fault handling for the selected ODrive kit.
The toolhead/spindle mechanical design is finalized outside this firmware document. The firmware/control scope is the electrical interface, configuration, command path, telemetry path, safety-stop assumptions, and fault handling for the selected AK60 integrated actuator path.
Firmware-facing ODrive S1 facts from the vendor page:
Firmware-facing AK60 assumptions to verify before commissioning:
- Single-axis BLDC / PMAC servo drive.
- Control modes available: torque, velocity, position, trajectory; v1 spindle operation uses velocity mode.
- Supply range: 12-48 V operation, 50.5 V maximum.
- Continuous current: 40 A with heat spreader recommended.
- Control interfaces: USB, isolated UART, isolated STEP/DIR, analog voltage, PWM, and CAN.
- CAN: CAN 2.0B at 1 Mbps; CAN-FD 5 Mbps is experimental and is not the v1 baseline.
- On-board magnetic encoder: MA702, used with the M8325s encoder magnet for the selected package.
- ODrive S1 control-loop rate: 8 kHz; PWM frequency: 24 kHz.
- On-board brake chopper supports brake-energy management with a brake resistor.
- Built-in motor thermistor divider circuit.
Firmware-facing M8325s facts from the vendor page/documentation:
- Motor: M8325s 100KV, 20 pole pairs.
- Torque constant: approximately 0.083 Nm/A.
- Phase resistance: 24 mOhm phase-neutral.
- Phase inductance: 9.9 uH phase-neutral.
- Continuous current: 40 A free air, 60 A forced air.
- Peak current: 80 A for 3 s.
- Thermistor: NTC 10k 3435.
- Selected actuator path: *CubeMars AK60-6 V1.1 KV80* integrated actuator.
- Low-speed polishing preference: KV80 remains preferred over KV140 for the torque-dominated 10-120 RPM use case.
- Approximate torque envelope to preserve in design notes: about *3 N·m rated / 9 N·m peak*. This is suitable for the documented normal polishing basis and acceptable for short aggressive transients, but not enough margin to treat the aggressive case as sustained duty without thermal/current validation.
- Current generated electrical basis: AK60 powered from a *24 VDC supply downstream of the safety-controlled post-contactor bus*. Confirm final supply rail, fuse/breaker sizing, cable/connector ratings, and voltage/current telemetry before commissioning.
- Runtime interface: CAN is the working basis. Freeze AK60 command IDs, telemetry IDs, frame rates, stale-frame timeout, startup/fault behavior, and whether AK60 shares a bus with KWR75B or uses a separate Teensy CAN channel.
- Direction: `cw` / `ccw` remains an explicit protocol enum separate from non-negative RPM. Cédric must bench-map the enum to the actual physical rotation convention.
- Environmental/mechanical checks: gearbox backlash/ripple, non-hollow packaging, wet/slurry protection, output interface, thermal path, and cable strain relief must be verified outside firmware before final commissioning.
Firmware obligations:
- Store the ODrive configuration used for commissioning with the machine software release or machine-capability profile.
- Configure and log the motor electrical parameters, encoder source, velocity-loop limits, current limits, thermal limits, spindle direction/sign convention, and brake-resistor/chopper settings used on the machine.
- Expose ODrive fault state to the host and map faults into the normal `DRIVE_FAULT` / spindle fault handling path.
- Prefer CAN for runtime command and telemetry if Cédric does not select another ODrive-supported interface.
- Log at least actual spindle RPM; strongly recommended ODrive telemetry channels are listed in §9.1.
- Store the AK60 commissioning parameters used with the machine software release or machine-capability profile.
- Configure and log velocity limits, current/torque limits, thermal limits, acceleration/deceleration/ramp policy, spindle direction mapping, and fault thresholds.
- Expose AK60 fault state to the host and map faults into the normal `DRIVE_FAULT` / spindle fault handling path.
- Log at least actual spindle RPM; strongly recommended AK60 telemetry channels are listed in §9.1.
- Treat CAN stop/disable commands as normal-control actions, not safety-rated stop functions. E-stop safety must rely on the hardwired safety chain and power-removal path, then be bench-tested.
=== Cam Mechanism
@@ -515,7 +516,7 @@ Firmware obligations:
==== Host computer
- *Current basis:* *Raspberry Pi 4 + touchscreen*.
- *Current basis:* *Raspberry Pi 5 + touchscreen*.
- *Status:* Fixed for this revision.
- *Role:* State machine, job management, UI, telemetry logging, operator workflow.
@@ -824,7 +825,7 @@ Each segment is a self-contained, machine-executable command block:
- `commanded_force_n`: float, N. Base force setpoint.
- `commanded_table_rpm`: float, RPM. Table rotation speed.
- `commanded_spindle_rpm`: float, RPM. Spindle rotation speed as a non-negative magnitude.
- `commanded_spindle_direction`: enum, `"cw"` or `"ccw"`. Toolhead spindle rotation direction, viewed from above the toolhead looking down toward the mirror/tool contact. The ODrive sign mapping is a commissioning item and must be configured so these enum values match physical observed rotation.
- `commanded_spindle_direction`: enum, `"cw"` or `"ccw"`. Toolhead spindle rotation direction, viewed from above the toolhead looking down toward the mirror/tool contact. The AK60 direction mapping is a commissioning item and must be configured so these enum values match physical observed rotation.
- `commanded_cam_amplitude_deg`: float, degrees. Machine-package representation of the mechanical oscillation amplitude. In v1 this is not actuator-commanded; it is confirmed by the operator through the geometric gate and logged as `configured_arm_amplitude_deg` in machine-side/manual records.
- `commanded_cam_offset_deg`: float, degrees. Machine-package representation of the mechanical oscillation center/offset. In v1 this is not actuator-commanded; it is confirmed by the operator through the geometric gate and logged as `configured_arm_center_deg` in machine-side/manual records.
- `force_modulation`: object/null. Angle-synchronized modulation parameters.
@@ -1071,17 +1072,17 @@ These channels are characterization, not control: the firmware does not act on t
- `ft_status`: uint32 bitfield, F/T sensor. Raw KWR75B-CAN status word or mapped validity bitfield (validity, saturation, fault bits).
- `z_servo_iq_v`: float, V, Z servo drive analog out. Quadrature current (Iq) from the Z-axis AC servo drive, linear proxy for belt tension / applied differential force (§3.1, §3.2).
- `z_brake_engaged`: bool, safety chain. True when the Z-axis NC electromagnetic brake is engaged (de-energized coil). Expected false during normal RUNNING / MANUAL, true in IDLE / FAULTED / E-stop.
- `spindle_drive_state`: enum/string, ODrive S1. ODrive axis state or mapped controller state for the spindle drive.
- `spindle_drive_error`: uint32/string, bitfield/code, ODrive S1. Raw or mapped ODrive error / fault code.
- `spindle_bus_voltage_v`: float, V, ODrive S1. DC bus voltage reported by the ODrive.
- `spindle_iq_a`: float, A, ODrive S1. Measured q-axis current / torque-producing current, if exposed over the selected interface.
- `spindle_motor_temp_c`: float, degC, ODrive S1 thermistor input. Motor thermistor temperature derived from the M8325s NTC 10k 3435, if enabled.
- `spindle_drive_state`: enum/string, AK60 integrated actuator. AK60 state or mapped controller state for the spindle drive.
- `spindle_drive_error`: uint32/string, bitfield/code, AK60 integrated actuator. Raw or mapped AK60 error / fault code.
- `spindle_bus_voltage_v`: float, V, AK60 integrated actuator. DC bus / supply voltage reported by the actuator if exposed.
- `spindle_iq_a`: float, A, AK60 integrated actuator. Measured torque/current channel, if exposed over the selected interface.
- `spindle_motor_temp_c`: float, degC, AK60 integrated actuator. Motor/drive temperature telemetry, if exposed over the selected interface.
- `arm_angle_linearized_deg`: float, deg, Teensy from encoder + geometry. Crank-rocker linearized arm angle (§9.5); NaN if geometry not validated.
- `force_setpoint_n`: float, N, setpoint generator. Current target force after modulation; this is the input to the Fz PID, not the PID actuator output.
- `table_rpm_setpoint`: float, RPM, host command. Commanded table speed.
- `spindle_rpm_setpoint`: float, RPM, host command. Commanded spindle speed magnitude.
- `spindle_direction_setpoint`: enum, `cw` / `ccw`, host command. Requested toolhead spindle direction.
- `spindle_direction_actual`: enum, `cw` / `ccw`, ODrive/firmware-derived. Actual observed or drive-reported spindle direction after sign mapping.
- `spindle_direction_actual`: enum, `cw` / `ccw`, AK60/firmware-derived. Actual observed or actuator-reported spindle direction after direction mapping.
- `force_actuator_cmd`: float, V or mA, DAC output. Raw actuator command signal.
- `estop_active`: bool, hardware. E-stop circuit state.
- `interlock_state`: uint16 bitfield, multiple. Packed interlock status bits.
@@ -1856,37 +1857,26 @@ Your controller must expose a static capability profile so upstream software kno
"notes": "Counterweight cancels head static weight; controller modulates residual differential only. Force PID closes on Fz from the Kunwei KWR75B-CAN 6-axis sensor."
},
"spindle_drive": {
"system": "ODrive S1 + M8325s 100KV kit",
"system": "CubeMars AK60-6 V1.1 KV80 integrated actuator",
"status": "selected_final",
"drive": "ODrive S1",
"motor": "M8325s 100KV",
"encoder": "ODrive S1 onboard MA702 magnetic encoder with M8325s encoder magnet",
"actuator": "CubeMars AK60-6 V1.1 KV80",
"controller": "integrated AK-series drive/controller",
"encoder": "integrated actuator sensing / vendor telemetry",
"control_mode_v1": "velocity",
"preferred_runtime_interface": "CAN 2.0B 1Mbps",
"supported_drive_modes": ["torque", "velocity", "position", "trajectory"],
"odrive_supply_range_v": [12, 48],
"odrive_abs_max_v": 50.5,
"odrive_continuous_current_a": 40,
"odrive_control_loop_hz": 8000,
"odrive_pwm_hz": 24000,
"motor_kv_rpm_per_v": 100,
"motor_torque_constant_nm_per_a": 0.083,
"motor_pole_pairs": 20,
"motor_phase_resistance_ohm": 0.024,
"motor_phase_inductance_h": 0.0000099,
"motor_continuous_current_a_free_air": 40,
"motor_continuous_current_a_forced_air": 60,
"motor_peak_current_a_3s": 80,
"motor_thermistor": "NTC 10k 3435",
"preferred_runtime_interface": "CAN, topology/IDs/rates/timeouts to freeze before firmware lock",
"supply_voltage_v_working_basis": 24,
"safety_stop_basis": "remove actuator power through safety-controlled post-contactor bus; CAN stop is not safety-rated",
"rated_torque_nm_approx": 3,
"peak_torque_nm_approx": 9,
"required_firmware_items": [
"saved_odrive_configuration",
"saved_ak60_commissioning_parameters",
"velocity_command_scaling",
"spindle_direction_sign_mapping",
"spindle_direction_mapping",
"actual_rpm_telemetry",
"drive_fault_mapping",
"current_limit_configuration",
"current_torque_limit_configuration",
"thermal_limit_configuration",
"brake_chopper_resistor_configuration_if_used"
"safety_power_removal_bench_test"
]
},
"safety_limits": {
@@ -1911,7 +1901,7 @@ Your controller must expose a static capability profile so upstream software kno
"unknowns": [
"Z-axis drive control mapping pending confirmation on the SV2A-2150",
"Measured force loop bandwidth pending commissioning",
"ODrive S1 + M8325s spindle package is selected; firmware command/telemetry mapping still to be documented"
"AK60 command/telemetry mapping, CAN topology, safety power-removal behavior, and thermal/current limits still to be documented and bench-tested"
]
}
```
@@ -2324,16 +2314,16 @@ Every item flagged *"Preferred, confirm in detailed design"* or *"Open, Cédric
=== Zone 1 — Table (Control Interface)
- Confirm the KBSI-240D opto-isolated interface as the DC-variator command path, or name the replacement.
- Confirm the table encoder transport (SSI (SC) / RS422) and the transceiver choice (MAX3490-class working basis).
- Confirm BiSS-C frame details for the ordered table and arm encoders: timing, CRC/status bits, RS422 transceiver/pinout, shielding, and startup/error handling.
- Confirm whether the table drive or its command path changes electrically as part of the overhaul.
=== Zone 2 — Spindle / Toolhead Drive (Control Interface)
- Define the ODrive runtime command and telemetry path to the controller. CAN 2.0B at 1 Mbps is the preferred baseline unless Cédric selects another ODrive-supported interface.
- Define command scaling for spindle velocity setpoint, clockwise/counter-clockwise sign mapping, enable/disable, fault reset, and safe stop.
- Define the ODrive telemetry subset mapped into the host logs: actual RPM, drive state, drive error, DC bus voltage, q-axis current if available, and motor temperature if the thermistor is enabled.
- Store/export the final ODrive configuration file or parameter dump with the machine software release.
- Define the spindle enable/fault I/O wired into the HOA + safety chain.
- Define the AK60 runtime command and telemetry path to the controller. CAN is the working basis, but Cédric must freeze CAN topology, IDs, frame rates, stale-frame timeout, startup behavior, and error isolation before firmware lock.
- Define command scaling for spindle velocity setpoint, clockwise/counter-clockwise direction mapping, enable/disable, fault reset, ramp-to-zero / live-reversal policy, and safe stop behavior.
- Define the AK60 telemetry subset mapped into the host logs: actual RPM, actuator state, actuator error, bus/supply voltage, torque/current if available, and motor/drive temperature if available.
- Store/export the final AK60 commissioning parameter set with the machine software release.
- Define the spindle enable/fault I/O and the hardwired AK60 power-removal path through the HOA + safety chain; prove with a bench E-stop/power-loss test.
=== Zone 4 — Z-Axis / Force Actuator (Control Interface)

View File

@@ -8,10 +8,12 @@ tags:
- Interface
- Cedric
- Engineering/Specification
date: 2026-05-18
date: 2026-07-06
status:
- draft
title: "Fullum Polisher - Machine Control & Firmware Specification v1"
revision: "Draft v1.3 - AK60/RPi5/BiSS-C source sync"
last_source_sync: 2026-07-06
author: Antoine Letarte
abstract: >
Machine-side technical specification for the Fullum swing-arm polisher.
@@ -24,6 +26,12 @@ abstract: >
# Fullum Polisher - Machine Control & Firmware Specification v1
## Revision history
| Date | Revision | Update |
|---|---|---|
| 2026-07-06 | Draft v1.3 - AK60/RPi5/BiSS-C source sync | Promotes Antoine's accepted hardware corrections into the firmware source: Raspberry Pi 5 host, CubeMars AK60-6 V1.1 KV80 spindle path replacing ODrive/M8325s, ordered Renishaw/RLS BiSS-C encoder part numbers, and AK60 safety/CAN commissioning items. |
## 1. Purpose and Context
This document is the **implementation target** for the machine-side stack of the Fullum swing-arm polisher. It tells you exactly:
@@ -316,26 +324,26 @@ Use the status terms below consistently:
#### Table encoder
- **Current basis:** Absolute rotary encoder, **RLS Artos DHR 162 mm**, 20-bit, P/N `DHR162SC20BAAS30DF00` with SAR162 ring for the 143 mm table shaft.
- **Status:** Fixed (BOM 2026-04-24).
- **Required capability / notes:** High angular fidelity, deterministic absolute readout for modulation phase reference. Large-bore OEM ring-kit mount on the existing table shaft.
- **Interface expectation:** SSI (SC) over RS422 into Teensy via an appropriate transceiver (MAX3490-class working basis).
- **Current basis:** Absolute rotary encoder, **RLS Artos DHR 162 mm**, 20-bit, P/N `DHR162DB20BAAS30DA02`, with SAR162 ring P/N `SAR162C143AF14WAP00` for the 143 mm table shaft.
- **Status:** Fixed (actual Renishaw/RLS order validated 2026-06-18; source sync 2026-07-06).
- **Required capability / notes:** High angular fidelity, deterministic absolute readout for modulation phase reference. Large-bore OEM ring-kit mount on the existing table shaft. The ordered `DB` output code is **BiSS-C bidirectional**, replacing the stale `SC` / SSI assumption.
- **Interface expectation:** **BiSS-C over RS422** into Teensy via an appropriate RS422 transceiver/interface. Cédric must confirm frame timing, CRC/status-bit handling, and exact wiring from the ordered RLS documentation before firmware lock.
- **Purpose:** Table angle, derived table RPM, phase reference for force modulation.
#### Arm encoder
- **Current basis:** Absolute rotary encoder on the swing-arm pivot, **RLS Orbis BR10**, 14-bit on-axis (stub-shaft magnet), P/N `BR10SCB14B12DD00` + magnet `BM120A190A1ABA00`.
- **Status:** Fixed (BOM 2026-04-24).
- **Required capability / notes:** ~230 µm radial uncertainty at the encoder bore, sufficient for logging, kinematic linearization, and post-hoc characterization of oscillation amplitude/center (see §3.3, §9.1). SSI protocol for harmonization with the table axis. The earlier Artos DHR option-B path is closed.
- **Interface expectation:** SSI (SC) over RS422 into Teensy.
- **Current basis:** Absolute rotary encoder on the swing-arm pivot, **RLS Orbis BR10**, 14-bit on-axis (stub-shaft magnet), P/N `BR10DCD14B12DH00` + magnet `BM120A190A1ABA00`.
- **Status:** Fixed (actual Renishaw/RLS order validated 2026-06-18; source sync 2026-07-06).
- **Required capability / notes:** ~230 µm radial uncertainty at the encoder bore, sufficient for logging, kinematic linearization, and post-hoc characterization of oscillation amplitude/center (see §3.3, §9.1). The ordered `DC` output code is **BiSS-C over RS422 at 5 V**, replacing the stale `SC` / SSI assumption. The earlier Artos DHR option-B path is closed.
- **Interface expectation:** **BiSS-C over RS422** into Teensy; confirm frame format, CRC/status handling, and transceiver/pinout before firmware lock.
- **Purpose:** Swing-arm oscillation position and amplitude, kinematic linearization reference (§9.5), derived amplitude/center statistics (§9.1).
#### Spindle speed feedback
- **Current basis:** **ODrive S1 + M8325s 100KV kit**, using the motor encoder magnet and the ODrive S1 onboard MA702 magnetic encoder.
- **Status:** Fixed (Antoine selection, 2026-05-18).
- **Required capability / notes:** Must provide stable actual spindle RPM for logging and fault checks. The ODrive closes the motor current/velocity loop locally; the machine controller receives actual RPM and fault state. Firmware must treat the ODrive as the selected spindle servo, not as a candidate or prototype option.
- **Interface expectation:** ODrive local encoder for commutation; controller interface via CAN preferred, or another confirmed ODrive interface.
- **Current basis:** **CubeMars AK60-6 V1.1 KV80 integrated actuator**, using the actuator's internal sensing/drive telemetry for commutation and actual speed feedback.
- **Status:** Fixed hardware direction (Antoine confirmation 2026-07-05; CEDRIC-PROP-20260609-001 accepted).
- **Required capability / notes:** Must provide stable actual spindle RPM for logging and fault checks. The AK60 closes the motor loop locally; the machine controller receives actual RPM, direction state when available, current/torque/thermal telemetry when available, and fault state. Firmware must treat ODrive S1 + M8325s as obsolete for this machine.
- **Interface expectation:** AK60 runtime command/telemetry via CAN is the current working basis. Final CAN topology, IDs, frame rates, timeouts, and fault handling must be frozen before firmware lock; keep the primary KWR75B-CAN force path isolated unless Cédric explicitly proves a shared-bus design is safe and deterministic.
- **Purpose:** Spindle commutation, speed monitoring, and tool rotation telemetry.
#### Force actuator feedback
@@ -366,10 +374,11 @@ Use the status terms below consistently:
#### Spindle motor
- **Current basis:** **ODrive S1 + M8325s 100KV pancake/outrunner motor kit** as the selected full toolhead spindle system. This replaces the earlier Mosrac U7636 + separate drive/encoder basis.
- **Status:** Fixed (Antoine selection, 2026-05-18).
- **Required capability / notes:** From the controller's perspective: an ODrive-controlled BLDC spindle that accepts speed/enable commands, accepts explicit clockwise/counter-clockwise direction selection, closes the motor loop locally, and exposes actual RPM plus fault state. ODrive S1 supports torque, velocity, position, and trajectory modes; v1 uses velocity control for commanded spindle RPM. Direction is represented separately from RPM; RPM remains a non-negative magnitude.
- **Drive expectation:** ODrive S1 local FOC velocity loop; controller command/telemetry path via CAN or confirmed ODrive interface.
- **Current basis:** **CubeMars AK60-6 V1.1 KV80 integrated actuator** as the selected toolhead spindle system. This replaces the ODrive S1 + M8325s path and earlier Mosrac U7636 / separate-drive assumptions.
- **Status:** Fixed hardware direction (Antoine confirmation 2026-07-05; CEDRIC-PROP-20260609-001 accepted).
- **Required capability / notes:** From the controller's perspective: an AK60 spindle actuator that accepts speed/enable commands, accepts explicit clockwise/counter-clockwise direction selection, closes the motor loop locally, and exposes actual RPM plus fault state. Direction is represented separately from RPM; RPM remains a non-negative magnitude. Preserve sizing caveats: the AK60-6 KV80 path is acceptable for the documented normal polishing torque basis and transient aggressive cases, but sustained high-torque duty, gearbox ripple/backlash, wet/slurry protection, output interface, and thermal/current telemetry must be validated before commissioning sign-off.
- **Drive expectation:** AK60 integrated drive/controller. Runtime command/telemetry via CAN is the current working basis; if Cédric selects a different supported AK60 interface, update this spec and the machine capability profile before firmware lock.
- **Safety expectation:** AK60 has no safety-rated STO in the current plan. Firmware CAN stop/disable commands are normal-control actions only; the safety model must remove AK60 power through the safety-controlled post-contactor power path and bench-test coast-down/fault behavior.
- **Purpose:** Tool rotation.
#### Arm oscillation motor
@@ -388,40 +397,27 @@ Use the status terms below consistently:
- **Drive expectation:** 010 V isolated analog speed reference from the Teensy; run/stop and fault I/O into the HOA and safety chain.
- **Purpose:** Swing-arm motor drive.
#### 3.2.1 ODrive S1 + M8325s Firmware-Facing Facts
#### 3.2.1 CubeMars AK60-6 V1.1 Firmware-Facing Facts
The toolhead/spindle mechanical design is finalized outside this firmware document. The firmware/control scope is only the electrical interface, configuration, command path, telemetry path, and fault handling for the selected ODrive kit.
The toolhead/spindle mechanical design is finalized outside this firmware document. The firmware/control scope is the electrical interface, configuration, command path, telemetry path, safety-stop assumptions, and fault handling for the selected AK60 integrated actuator path.
Firmware-facing ODrive S1 facts from the vendor page:
Firmware-facing AK60 assumptions to verify before commissioning:
- Single-axis BLDC / PMAC servo drive.
- Control modes available: torque, velocity, position, trajectory; v1 spindle operation uses velocity mode.
- Supply range: 12-48 V operation, 50.5 V maximum.
- Continuous current: 40 A with heat spreader recommended.
- Control interfaces: USB, isolated UART, isolated STEP/DIR, analog voltage, PWM, and CAN.
- CAN: CAN 2.0B at 1 Mbps; CAN-FD 5 Mbps is experimental and is not the v1 baseline.
- On-board magnetic encoder: MA702, used with the M8325s encoder magnet for the selected package.
- ODrive S1 control-loop rate: 8 kHz; PWM frequency: 24 kHz.
- On-board brake chopper supports brake-energy management with a brake resistor.
- Built-in motor thermistor divider circuit.
Firmware-facing M8325s facts from the vendor page/documentation:
- Motor: M8325s 100KV, 20 pole pairs.
- Torque constant: approximately 0.083 Nm/A.
- Phase resistance: 24 mOhm phase-neutral.
- Phase inductance: 9.9 uH phase-neutral.
- Continuous current: 40 A free air, 60 A forced air.
- Peak current: 80 A for 3 s.
- Thermistor: NTC 10k 3435.
- Selected actuator path: **CubeMars AK60-6 V1.1 KV80** integrated actuator.
- Low-speed polishing preference: KV80 remains preferred over KV140 for the torque-dominated 10-120 RPM use case.
- Approximate torque envelope to preserve in design notes: about **3 N·m rated / 9 N·m peak**. This is suitable for the documented normal polishing basis and acceptable for short aggressive transients, but not enough margin to treat the aggressive case as sustained duty without thermal/current validation.
- Current generated electrical basis: AK60 powered from a **24 VDC supply downstream of the safety-controlled post-contactor bus**. Confirm final supply rail, fuse/breaker sizing, cable/connector ratings, and voltage/current telemetry before commissioning.
- Runtime interface: CAN is the working basis. Freeze AK60 command IDs, telemetry IDs, frame rates, stale-frame timeout, startup/fault behavior, and whether AK60 shares a bus with KWR75B or uses a separate Teensy CAN channel.
- Direction: `cw` / `ccw` remains an explicit protocol enum separate from non-negative RPM. Cédric must bench-map the enum to the actual physical rotation convention.
- Environmental/mechanical checks: gearbox backlash/ripple, non-hollow packaging, wet/slurry protection, output interface, thermal path, and cable strain relief must be verified outside firmware before final commissioning.
Firmware obligations:
- Store the ODrive configuration used for commissioning with the machine software release or machine-capability profile.
- Configure and log the motor electrical parameters, encoder source, velocity-loop limits, current limits, thermal limits, spindle direction/sign convention, and brake-resistor/chopper settings used on the machine.
- Expose ODrive fault state to the host and map faults into the normal `DRIVE_FAULT` / spindle fault handling path.
- Prefer CAN for runtime command and telemetry if Cédric does not select another ODrive-supported interface.
- Log at least actual spindle RPM; strongly recommended ODrive telemetry channels are listed in §9.1.
- Store the AK60 commissioning parameters used with the machine software release or machine-capability profile.
- Configure and log velocity limits, current/torque limits, thermal limits, acceleration/deceleration/ramp policy, spindle direction mapping, and fault thresholds.
- Expose AK60 fault state to the host and map faults into the normal `DRIVE_FAULT` / spindle fault handling path.
- Log at least actual spindle RPM; strongly recommended AK60 telemetry channels are listed in §9.1.
- Treat CAN stop/disable commands as normal-control actions, not safety-rated stop functions. E-stop safety must rely on the hardwired safety chain and power-removal path, then be bench-tested.
### 3.3 Cam Mechanism
@@ -443,7 +439,7 @@ Firmware obligations:
#### Host computer
- **Current basis:** **Raspberry Pi 4 + touchscreen**.
- **Current basis:** **Raspberry Pi 5 + touchscreen**.
- **Status:** Fixed for this revision.
- **Role:** State machine, job management, UI, telemetry logging, operator workflow.
@@ -726,7 +722,7 @@ Each segment is a self-contained, machine-executable command block:
- `commanded_force_n`: float, N. Base force setpoint.
- `commanded_table_rpm`: float, RPM. Table rotation speed.
- `commanded_spindle_rpm`: float, RPM. Spindle rotation speed as a non-negative magnitude.
- `commanded_spindle_direction`: enum, `"cw"` or `"ccw"`. Toolhead spindle rotation direction, viewed from above the toolhead looking down toward the mirror/tool contact. The ODrive sign mapping is a commissioning item and must be configured so these enum values match physical observed rotation.
- `commanded_spindle_direction`: enum, `"cw"` or `"ccw"`. Toolhead spindle rotation direction, viewed from above the toolhead looking down toward the mirror/tool contact. The AK60 direction mapping is a commissioning item and must be configured so these enum values match physical observed rotation.
- `commanded_cam_amplitude_deg`: float, degrees. Machine-package representation of the mechanical oscillation amplitude. In v1 this is not actuator-commanded; it is confirmed by the operator through the geometric gate and logged as `configured_arm_amplitude_deg` in machine-side/manual records.
- `commanded_cam_offset_deg`: float, degrees. Machine-package representation of the mechanical oscillation center/offset. In v1 this is not actuator-commanded; it is confirmed by the operator through the geometric gate and logged as `configured_arm_center_deg` in machine-side/manual records.
- `force_modulation`: object/null. Angle-synchronized modulation parameters.
@@ -963,17 +959,17 @@ These channels are characterization, not control: the firmware does not act on t
- `ft_status`: uint32 bitfield, F/T sensor. Raw KWR75B-CAN status word or mapped validity bitfield (validity, saturation, fault bits).
- `z_servo_iq_v`: float, V, Z servo drive analog out. Quadrature current (Iq) from the Z-axis AC servo drive, linear proxy for belt tension / applied differential force (§3.1, §3.2).
- `z_brake_engaged`: bool, safety chain. True when the Z-axis NC electromagnetic brake is engaged (de-energized coil). Expected false during normal RUNNING / MANUAL, true in IDLE / FAULTED / E-stop.
- `spindle_drive_state`: enum/string, ODrive S1. ODrive axis state or mapped controller state for the spindle drive.
- `spindle_drive_error`: uint32/string, bitfield/code, ODrive S1. Raw or mapped ODrive error / fault code.
- `spindle_bus_voltage_v`: float, V, ODrive S1. DC bus voltage reported by the ODrive.
- `spindle_iq_a`: float, A, ODrive S1. Measured q-axis current / torque-producing current, if exposed over the selected interface.
- `spindle_motor_temp_c`: float, degC, ODrive S1 thermistor input. Motor thermistor temperature derived from the M8325s NTC 10k 3435, if enabled.
- `spindle_drive_state`: enum/string, AK60 integrated actuator. AK60 state or mapped controller state for the spindle drive.
- `spindle_drive_error`: uint32/string, bitfield/code, AK60 integrated actuator. Raw or mapped AK60 error / fault code.
- `spindle_bus_voltage_v`: float, V, AK60 integrated actuator. DC bus / supply voltage reported by the actuator if exposed.
- `spindle_iq_a`: float, A, AK60 integrated actuator. Measured torque/current channel, if exposed over the selected interface.
- `spindle_motor_temp_c`: float, degC, AK60 integrated actuator. Motor/drive temperature telemetry, if exposed over the selected interface.
- `arm_angle_linearized_deg`: float, deg, Teensy from encoder + geometry. Crank-rocker linearized arm angle (§9.5); NaN if geometry not validated.
- `force_setpoint_n`: float, N, setpoint generator. Current target force after modulation; this is the input to the Fz PID, not the PID actuator output.
- `table_rpm_setpoint`: float, RPM, host command. Commanded table speed.
- `spindle_rpm_setpoint`: float, RPM, host command. Commanded spindle speed magnitude.
- `spindle_direction_setpoint`: enum, `cw` / `ccw`, host command. Requested toolhead spindle direction.
- `spindle_direction_actual`: enum, `cw` / `ccw`, ODrive/firmware-derived. Actual observed or drive-reported spindle direction after sign mapping.
- `spindle_direction_actual`: enum, `cw` / `ccw`, AK60/firmware-derived. Actual observed or actuator-reported spindle direction after direction mapping.
- `force_actuator_cmd`: float, V or mA, DAC output. Raw actuator command signal.
- `estop_active`: bool, hardware. E-stop circuit state.
- `interlock_state`: uint16 bitfield, multiple. Packed interlock status bits.
@@ -1710,37 +1706,26 @@ Your controller must expose a static capability profile so upstream software kno
"notes": "Counterweight cancels head static weight; controller modulates residual differential only. Force PID closes on Fz from the Kunwei KWR75B-CAN 6-axis sensor."
},
"spindle_drive": {
"system": "ODrive S1 + M8325s 100KV kit",
"system": "CubeMars AK60-6 V1.1 KV80 integrated actuator",
"status": "selected_final",
"drive": "ODrive S1",
"motor": "M8325s 100KV",
"encoder": "ODrive S1 onboard MA702 magnetic encoder with M8325s encoder magnet",
"actuator": "CubeMars AK60-6 V1.1 KV80",
"controller": "integrated AK-series drive/controller",
"encoder": "integrated actuator sensing / vendor telemetry",
"control_mode_v1": "velocity",
"preferred_runtime_interface": "CAN 2.0B 1Mbps",
"supported_drive_modes": ["torque", "velocity", "position", "trajectory"],
"odrive_supply_range_v": [12, 48],
"odrive_abs_max_v": 50.5,
"odrive_continuous_current_a": 40,
"odrive_control_loop_hz": 8000,
"odrive_pwm_hz": 24000,
"motor_kv_rpm_per_v": 100,
"motor_torque_constant_nm_per_a": 0.083,
"motor_pole_pairs": 20,
"motor_phase_resistance_ohm": 0.024,
"motor_phase_inductance_h": 0.0000099,
"motor_continuous_current_a_free_air": 40,
"motor_continuous_current_a_forced_air": 60,
"motor_peak_current_a_3s": 80,
"motor_thermistor": "NTC 10k 3435",
"preferred_runtime_interface": "CAN, topology/IDs/rates/timeouts to freeze before firmware lock",
"supply_voltage_v_working_basis": 24,
"safety_stop_basis": "remove actuator power through safety-controlled post-contactor bus; CAN stop is not safety-rated",
"rated_torque_nm_approx": 3,
"peak_torque_nm_approx": 9,
"required_firmware_items": [
"saved_odrive_configuration",
"saved_ak60_commissioning_parameters",
"velocity_command_scaling",
"spindle_direction_sign_mapping",
"spindle_direction_mapping",
"actual_rpm_telemetry",
"drive_fault_mapping",
"current_limit_configuration",
"current_torque_limit_configuration",
"thermal_limit_configuration",
"brake_chopper_resistor_configuration_if_used"
"safety_power_removal_bench_test"
]
},
"safety_limits": {
@@ -1765,7 +1750,7 @@ Your controller must expose a static capability profile so upstream software kno
"unknowns": [
"Z-axis drive control mapping pending confirmation on the SV2A-2150",
"Measured force loop bandwidth pending commissioning",
"ODrive S1 + M8325s spindle package is selected; firmware command/telemetry mapping still to be documented"
"AK60 command/telemetry mapping, CAN topology, safety power-removal behavior, and thermal/current limits still to be documented and bench-tested"
]
}
```
@@ -2142,16 +2127,16 @@ Every item flagged **"Preferred, confirm in detailed design"** or **"Open, Cédr
### 21.1 Zone 1 — Table (Control Interface)
- Confirm the KBSI-240D opto-isolated interface as the DC-variator command path, or name the replacement.
- Confirm the table encoder transport (SSI (SC) / RS422) and the transceiver choice (MAX3490-class working basis).
- Confirm BiSS-C frame details for the ordered table and arm encoders: timing, CRC/status bits, RS422 transceiver/pinout, shielding, and startup/error handling.
- Confirm whether the table drive or its command path changes electrically as part of the overhaul.
### 21.2 Zone 2 — Spindle / Toolhead Drive (Control Interface)
- Define the ODrive runtime command and telemetry path to the controller. CAN 2.0B at 1 Mbps is the preferred baseline unless Cédric selects another ODrive-supported interface.
- Define command scaling for spindle velocity setpoint, clockwise/counter-clockwise sign mapping, enable/disable, fault reset, and safe stop.
- Define the ODrive telemetry subset mapped into the host logs: actual RPM, drive state, drive error, DC bus voltage, q-axis current if available, and motor temperature if the thermistor is enabled.
- Store/export the final ODrive configuration file or parameter dump with the machine software release.
- Define the spindle enable/fault I/O wired into the HOA + safety chain.
- Define the AK60 runtime command and telemetry path to the controller. CAN is the working basis, but Cédric must freeze CAN topology, IDs, frame rates, stale-frame timeout, startup behavior, and error isolation before firmware lock.
- Define command scaling for spindle velocity setpoint, clockwise/counter-clockwise direction mapping, enable/disable, fault reset, ramp-to-zero / live-reversal policy, and safe stop behavior.
- Define the AK60 telemetry subset mapped into the host logs: actual RPM, actuator state, actuator error, bus/supply voltage, torque/current if available, and motor/drive temperature if available.
- Store/export the final AK60 commissioning parameter set with the machine software release.
- Define the spindle enable/fault I/O and the hardwired AK60 power-removal path through the HOA + safety chain; prove with a bench E-stop/power-loss test.
### 21.3 Zone 4 — Z-Axis / Force Actuator (Control Interface)

View File

@@ -18,4 +18,5 @@ Source-truth rule:
- These repo docs are implementation aids.
- Approved P11 source specs and schemas outrank generated summaries.
- 2026-07-06 source refresh: repo reference copy now reflects Raspberry Pi 5, AK60-6 V1.1 KV80, and ordered Renishaw/RLS BiSS-C encoders.
- If anything here conflicts with a source spec, ask Antoine before changing technical direction.

View File

@@ -10,7 +10,7 @@ Core modules to implement:
- KWR75B-CAN decoder via isolated CAN transceiver;
- table and arm encoder readers;
- force PID and actuator output;
- ODrive command/telemetry path;
- AK60 command/telemetry path;
- telemetry packet builder;
- fast interlocks and watchdogs.

View File

@@ -13,7 +13,7 @@ class SpindleDirection(StrEnum):
"""Toolhead spindle rotation direction using stable protocol/schema values.
Physical convention: clockwise/counter-clockwise are as viewed from above the
toolhead looking down toward the mirror/tool contact. ODrive sign mapping is
toolhead looking down toward the mirror/tool contact. AK60 direction mapping is
a commissioning item and must be configured so these UI/protocol values match
the observed tool rotation.
"""

View File

@@ -133,12 +133,21 @@
],
"unknowns": [
"Exact KWR75B-CAN frame map, scaling, status bits, and update rate.",
"Final ODrive runtime interface and command scaling.",
"Final AK60 runtime interface, CAN topology/IDs/rates, command scaling, safety power-removal behavior, and commissioning parameters.",
"Final SV2A-2150 torque/current command scaling and Iq monitor mapping.",
"Final safety relay model and wiring details."
],
"supported_spindle_directions": [
"cw",
"ccw"
]
],
"hardware_basis": {
"host": "Raspberry Pi 5 + touchscreen",
"real_time_controller": "Teensy 4.1",
"force_sensor": "Kunwei KWR75B-CAN",
"spindle": "CubeMars AK60-6 V1.1 KV80 integrated actuator",
"table_encoder": "RLS Artos DHR162, ordered P/N DHR162DB20BAAS30DA02 + SAR162C143AF14WAP00, BiSS-C/RS422",
"arm_encoder": "RLS Orbis BR10, ordered P/N BR10DCD14B12DH00 + BM120A190A1ABA00, BiSS-C/RS422",
"source_sync": "2026-07-06"
}
}

View File

@@ -159,7 +159,7 @@
"cw",
"ccw"
],
"description": "Toolhead spindle rotation direction, as viewed from above the toolhead looking down toward the mirror/tool contact. ODrive sign mapping is commissioned to match this physical convention."
"description": "Toolhead spindle rotation direction, as viewed from above the toolhead looking down toward the mirror/tool contact. AK60 direction mapping is commissioned to match this physical convention."
}
}
}