Repository navigation
feat(position): trapezoidal motion profile with velocity and acceleration feed-forward - #714
Conversation
The FOC motor CAN category's message catalogue, wire contract, server
and client categories and FocMotorCanClient move to the e-foc-protocol
library, together with the unit types, the command limits and the
parameter range checks they use, so a client (a motion controller, a
tool) can depend on the contract without the firmware.
- add infra/e-foc-protocol as a submodule
- remove the moved headers, sources and tests; include them as
e-foc-protocol/{foc,contract,server,client}/...
- e_foc.can and e_foc.foc.interfaces link the e_foc_protocol targets
- service-can.md keeps the firmware side (Parts D, F-K) and points to
the library's wire-contract.md for Parts A, B, C and E
The board kind is still reported by the firmware; the contract now
carries it as a byte instead of reading the board registry.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh4ve7wn8JxNywWbX5h
Align the two tables this change touched and restore the spacing of the pointer-to-member parameter in CurrentStreamSteps.cpp, which a newer clang-format had rewritten. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh4ve7wn8JxNywWbX5h
Four limits, profileVelocity, profileAcceleration, profileDeceleration and profileJerk (parameters 0x65-0x68), join the configuration record (layout 15) and the CAN Commander's Motion Profile group. The jerk is reserved for a later S-curve and is only stored and read back. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
Position mode plans a trapezoid from the reference state to each setpoint within the profile velocity and acceleration, replans mid-move without a jump, and feeds the reference velocity to every position law and J*a/Kt to the q-axis current. The monitors measure the following error against the profiled reference and the target-reached check against the final target. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
The 0.75 reference weight shapes a step the loop is given whole. A profiled reference is already shaped and its velocity is fed forward, so the weight is 1 while a profile is active; with 0.75 the integral had to supply a quarter of the move and the rotor ended the profile 8 % short. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
Model-in-the-loop sweeps every position law on the nominal and Anaheim plants: a 1.5 rad move at 20 rad/s and 400 rad/s2 takes 125 ms and follows the cruise within 20 mrad, a mid-move setpoint stays inside the limits, and a profile without an acceleration leaves the errors equal. The SIL scenario checks the rotor against the trapezoid and the target-reached flag, and the stored-limits scenario reads the four profile settings back after a restart. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
e-foc-protocol's extraction is merged (embedded-pro/e-foc-protocol#3); move the submodule from the PR head to the merge commit on main. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh4ve7wn8JxNywWbX5h
…noether-b931rk # Conflicts: # core/services/mechanical_system_ident/MechanicalParametersIdentificationImpl.cpp
…omState Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
…switch e-foc-protocol now fetches embedded-infra-lib, can-lite and numerical-toolbox only when their targets do not exist yet (embedded-pro/e-foc-protocol#5), so a recursive checkout of e-foc no longer clones a second copy of each under infra/e-foc-protocol/infra. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh4ve7wn8JxNywWbX5h
…/motion-profile Move the wire contract, server, client, Units, CommandLimits and ParameterValidation to infra/e-foc-protocol; delete the five files that were added by the motion-profile CAN commit but now live only in the library. Point the submodule at claude/motion-profile-parameters (contract 3.1 with the four profile parameters). service-can.md Part A now defers to wire-contract.md in the library; infra/numerical-toolbox stays at 63218e3. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
|
Generated by Claude Code |
✅
|
| Descriptor | Linter | Files | Fixed | Errors | Max errors | Warnings | Elapsed time |
|---|---|---|---|---|---|---|---|
| ✅ ACTION | actionlint | 9 | 0 | 0 | 0.52s | ||
| ✅ CPP | clang-format | 944 | 0 | 0 | 0 | 25.38s | |
| ✅ DOCKERFILE | hadolint | 1 | 0 | 0 | 0.04s | ||
| ✅ JSON | jsonlint | 18 | 0 | 0 | 0.13s | ||
| ✅ JSON | prettier | 18 | 7 | 0 | 0 | 0.7s | |
| markdownlint | 95 | 2 | 93 | 0 | 5.76s | ||
| ✅ MARKDOWN | markdown-table-formatter | 95 | 5 | 0 | 0 | 0.82s | |
| ✅ REPOSITORY | betterleaks | yes | no | no | 1.03s | ||
| ✅ REPOSITORY | checkov | yes | no | no | 40.34s | ||
| ✅ REPOSITORY | git_diff | yes | no | no | 0.12s | ||
| ✅ REPOSITORY | grype | yes | no | no | 104.96s | ||
| ✅ REPOSITORY | ls-lint | yes | no | no | 0.03s | ||
| osv-scanner | yes | no | 1 | 0.84s | |||
| ✅ REPOSITORY | secretlint | yes | no | no | 2.04s | ||
| ✅ REPOSITORY | syft | yes | no | no | 2.38s | ||
| ✅ REPOSITORY | trivy | yes | no | no | 13.78s | ||
| ✅ REPOSITORY | trivy-sbom | yes | no | no | 0.33s | ||
| ✅ REPOSITORY | trufflehog | yes | no | no | 3.79s | ||
| lychee | 290 | 2 | 0 | 95.76s | |||
| ✅ XML | xmllint | 2 | 0 | 0 | 0 | 0.2s | |
| ✅ YAML | prettier | 23 | 3 | 0 | 0 | 0.87s | |
| ✅ YAML | v8r | 23 | 0 | 0 | 8.22s | ||
| ✅ YAML | yamllint | 23 | 0 | 0 | 0.94s |
Detailed Issues
⚠️ SPELL / lychee - 2 errors
📝 Summary
---------------------
🔍 Total..........802
🔗 Unique.........546
✅ Successful.....774
⏳ Timeouts.........0
🔀 Redirected.....196
👻 Excluded........26
❓ Unknown..........0
🚫 Errors...........2
⛔ Unsupported......2
Errors in CHANGELOG.md
[404] https://github.com/embedded-pro/e-foc/compare/v0.0.1...v1.0.0 (at 235:4) | Rejected status code: 404 Not Found
[404] https://github.com/sil-known-defect (at 304:50) | Rejected status code: 404 Not Found
Hint: Followed 196 redirects. You might want to consider replacing redirecting URLs with the resolved URLs. Use verbose mode (`-v`/`-vv`) to see redirection details.
Hint: You can configure accepted/rejected response codes with `-a` or `--accept`
⚠️ MARKDOWN / markdownlint - 93 errors
.claude/agents/reviewer.md:23 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
.github/agents/reviewer.agent.md:25 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
CHANGELOG.md:62 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:113 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Continuous Integration"]
CHANGELOG.md:120 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:127 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:132 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Performance Improvements"]
CHANGELOG.md:137 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Continuous Integration"]
CHANGELOG.md:144 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:153 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:165 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Performance Improvements"]
CHANGELOG.md:172 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Documentation"]
CHANGELOG.md:180 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:187 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:195 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:200 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Continuous Integration"]
CHANGELOG.md:207 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:213 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Continuous Integration"]
CHANGELOG.md:220 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:226 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:231 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Continuous Integration"]
CHANGELOG.md:238 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "⚠ BREAKING CHANGES"]
CHANGELOG.md:245 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Features"]
CHANGELOG.md:284 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Bug Fixes"]
CHANGELOG.md:323:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
CHANGELOG.md:341 error MD024/no-duplicate-heading Multiple headings with the same content [Context: "Performance Improvements"]
documentation/architecture/system.md:507:401 error MD013/line-length Line length [Expected: 400; Actual: 467]
documentation/architecture/system.md:509:401 error MD013/line-length Line length [Expected: 400; Actual: 467]
documentation/architecture/system.md:510:401 error MD013/line-length Line length [Expected: 400; Actual: 467]
documentation/architecture/system.md:511:401 error MD013/line-length Line length [Expected: 400; Actual: 467]
documentation/booklet/README.md:107 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/async-callback-lifetime.md:82:401 error MD013/line-length Line length [Expected: 400; Actual: 535]
documentation/design/async-callback-lifetime.md:211:32 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/async-callback-lifetime.md:211:151 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/async-callback-lifetime.md:211:301 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/async-callback-lifetime.md:212:121 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/async-callback-lifetime.md:212:265 error MD060/table-column-style Table column style [Table pipe does not align with header for style "aligned"]
documentation/design/bootloader.md:468:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:470:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:471:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:472:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:473:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:474:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:475:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:476:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:477:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:478:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:479:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/bootloader.md:480:401 error MD013/line-length Line length [Expected: 400; Actual: 442]
documentation/design/error-handling.md:170:401 error MD013/line-length Line length [Expected: 400; Actual: 412]
documentation/design/error-handling.md:172:401 error MD013/line-length Line length [Expected: 400; Actual: 446]
documentation/design/foc-speed.md:199:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:201:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:202:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:203:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:204:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:205:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:206:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:207:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:208:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:209:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:210:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:211:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:212:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:213:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:214:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-speed.md:215:401 error MD013/line-length Line length [Expected: 400; Actual: 508]
documentation/design/foc-transforms.md:102:401 error MD013/line-length Line length [Expected: 400; Actual: 1047]
documentation/design/foc-transforms.md:115:401 error MD013/line-length Line length [Expected: 400; Actual: 503]
documentation/design/integration-testing.md:236 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
documentation/design/service-can.md:83:401 error MD013/line-length Line length [Expected: 400; Actual: 1037]
documentation/design/service-firmware-upgrade.md:302:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-firmware-upgrade.md:304:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-firmware-upgrade.md:305:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-firmware-upgrade.md:306:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-firmware-upgrade.md:307:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-firmware-upgrade.md:308:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-firmware-upgrade.md:309:401 error MD013/line-length Line length [Expected: 400; Actual: 422]
documentation/design/service-mechanical-ident.md:450:401 error MD013/line-length Line length [Expected: 400; Actual: 567]
documentation/design/state-machine.md:35:401 error MD013/line-length Line length [Expected: 400; Actual: 470]
documentation/design/state-machine.md:53:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
documentation/design/state-machine.md:55:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
documentation/design/state-machine.md:56:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
documentation/design/state-machine.md:57:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
documentation/design/state-machine.md:58:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
documentation/design/state-machine.md:59:401 error MD013/line-length Line length [Expected: 400; Actual: 566]
documentation/design/state-machine.md:201:401 error MD013/line-length Line length [Expected: 400; Actual: 755]
documentation/design/state-machine.md:320:401 error MD013/line-length Line length [Expected: 400; Actual: 612]
documentation/design/state-machine.md:487:401 error MD013/line-length Line length [Expected: 400; Actual: 728]
documentation/design/state-machine.md:491:401 error MD013/line-length Line length [Expected: 400; Actual: 582]
documentation/design/state-machine.md:495:401 error MD013/line-length Line length [Expected: 400; Actual: 736]
documentation/design/state-machine.md:830:401 error MD013/line-length Line length [Expected: 400; Actual: 606]
documentation/performance-optimization/README.md:373:401 error MD013/line-length Line length [Expected: 400; Actual: 583]
⚠️ REPOSITORY / osv-scanner - 1 warning
Scanning dir .
Starting filesystem walk for root: /
End status: 218 dirs visited, 1599 inodes visited, 0 Extract calls, 33.156038ms elapsed, 33.156318ms wall time
No package sources found, --help for usage information.
[REPOSITORY_OSV_SCANNER_ERROR_NO_PACKAGE_SOURCES] osv-scanner found no lockfiles, manifests, or SBOMs to scan in the repository.
This is a configuration/scope issue, not a vulnerability finding.
Resolutions:
- Verify the repository actually contains a supported lockfile (package-lock.json, go.sum, Gemfile.lock, Pipfile.lock, etc.) at the scanned path.
- If this is expected for some sub-projects, disable osv-scanner for the affected paths or mark it non-blocking via `DISABLE_ERRORS_LINTERS`.
Notices
REPOSITORY_GITLEAKS, REPOSITORY_KICS. See Removed linters to find their replacements.
See detailed reports in MegaLinter artifacts
Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)
- Documentation: Custom Flavors
- Command:
npx mega-linter-runner@10.2.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_BETTERLEAKS,REPOSITORY_GRYPE,REPOSITORY_LS_LINT,REPOSITORY_OSV_SCANNER,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_LYCHEE,XML_XMLLINT,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

Show us your support by starring ⭐ the repository
🏎️ Cycle Estimation — NUCLEO-G474RE
Path breakdownsInner loopADC ISR -> FOC inner loop (Clarke/Park/current loop/SVM) -> PWM output
1538 instructions · 6594 bytes · 9 stages Outer loopLow-priority interrupt -> position loop -> speed loop -> online estimators
2994 instructions · 9124 bytes · 6 stages Identification pathADC ISR -> FOC inner loop -> PWM output -> calibration observer
2035 instructions · 8406 bytes · 11 stages
|
📦 Memory budget (multi-mode)Unified binary📦 Memory budgetNUCLEO-G474RE (M4, RelWithDebInfo) — flash 303.36 KiB · static RAM 29.96 KiB · stack 0 B · heap 0 B
Top symbolsShow top symbols
|
🏎️ Cycle Estimation — EK-TM4C1294XL
Path breakdownsInner loopADC ISR -> FOC inner loop (Clarke/Park/current loop/SVM) -> PWM output
1662 instructions · 6252 bytes · 9 stages Outer loopLow-priority interrupt -> position loop -> speed loop -> online estimators
2994 instructions · 9124 bytes · 6 stages Identification pathADC ISR -> FOC inner loop -> PWM output -> calibration observer
2159 instructions · 8064 bytes · 11 stages
|
📦 Memory budget (multi-mode)Unified binary📦 Memory budgetEK-TM4C1294XL (M4, RelWithDebInfo) — flash 274.27 KiB · static RAM 29.59 KiB · stack 0 B · heap 0 B
Top symbolsShow top symbols
|
… runners The pre-move phase (boot, alignment, the settle wait polled over CAN) lasts longer in plant time on a slower host, so 600 samples could fill before the setpoint and leave nothing to measure. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
# Conflicts: # documentation/design/service-can.md # infra/e-foc-protocol
There was a problem hiding this comment.
Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.
An organization owner can choose the repository organization as the billing source for reviews requested by members with a paid Copilot license. Learn about Copilot code review billing. Review the Copilot code review billing settings.
|



Closes #498.
Summary
In position mode, an optional motion profile replaces the step setpoint with a trapezoid. The trapezoid has limited speed, acceleration and deceleration, plus velocity and acceleration feed-forward. With the profile parameters at their default of 0, position mode behaves exactly as before.
foc::PositionProfile(core/foc/cascade/) runs in the 1 kHz outer loop on the toolbox'sTrapezoidalProfileFromState.frictionCurrentis renamed tofeedForwardCurrent.MotionObservation.positionErroris now measured against the profiled reference, for the following-error and encoder-plausibility monitors. A newtargetErroris measured against the final target, for target reached.foc-position.md,position-loop-*.md,service-nvm.md,tool-can-commander.md,fault-supervision.mdand the performance README.Verification
ctest47/47, including model-in-the-loop.@REQ-CTL-010scenario measures a cruise error of 0.002–0.003 rad and reaches the target in 118 ms.Dependencies
All are merged:
infra/e-foc-protocolis on itsmain.infra/numerical-toolboxis on itsmain.🤖 Generated with Claude Code
https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE