Skip to content

feat(position): jerk-limited S-curve motion profile - #715

Merged
gabrielfrasantos merged 23 commits into
mainfrom
claude/motion-profile-scurve
Nov 12, 2026
Merged

gabrielfrasantos merged 23 commits into
mainfrom
claude/motion-profile-scurve

Conversation

@gabrielfrasantos

@gabrielfrasantos gabrielfrasantos commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor

Follow-up to #714 (#498). The stored profileJerk (0x68) is now used.

Summary

  • Profile choice: with profileVelocity and profileAcceleration above zero, a profileJerk above zero makes foc::PositionProfile plan a jerk-limited S-curve, using the toolbox's SCurveProfileFromState (feat(motion_profiles): plan a jerk-limited S-curve from a moving state numerical-toolbox-cpp#380). With profileJerk at 0 the trapezoid is unchanged.
  • Replan: a new setpoint replans from the current reference position, speed and acceleration, so all three stay continuous. This keeps the J·a/Kt feed-forward current continuous too.
  • Restart: the profile restarts from the measured state on Enable, after a jog and after a held current, with acceleration 0. The acceleration is clamped to the S-curve's precondition.
  • Planning cost: the plan runs in the 1 kHz outer loop when the setpoint changes, with a fixed 32-step bisection. Its loop_bounds entry is in cycle-analysis-outer.json. The cycle gate charges the plan 3 182 cycles, so the outer loop's worst case goes from 8 133 to 11 315: 20 000 is the budget on EK-TM4C1294XL and 28 333 on NUCLEO-G474RE. The inner loop is unchanged.
  • Docs: the motion-profile theory, foc-position.md and the performance README. The protocol docs are updated in docs(contract): profileJerk selects the S-curve profile e-foc-protocol#7, which is documentation only.
  • Requirement: new REQ-CTL-011 limits the jerk of the commanded motion.
  • Toolbox: infra/numerical-toolbox moves to toolbox main, which includes Release workflow: cancel-in-progress can cancel asset build after tag creation #380.

Verification

Check Result
Host build Pass
Host unit tests (ctest) 46/46 pass; e_foc.foc.cascade_test 226/226
Model-in-the-loop (1.5 rad at 20 rad/s, 400 rad/s², 20000 rad/s³; 5 laws × 2 motors) 6/6 pass. Duration 142 ms for every case (limit ±2). Cruise error ≤ 0.0057 rad (limit 0.04). Peak jerk ≤ 20 863 rad/s³ in the reversal (limit 22 000, finite-difference estimate).
SIL, new S-curve scenario Following error 0.0058 rad (limit 0.03); arrival at 131 ms (window 125–165 ms)
SIL, all shards Pass locally and in CI
Cycle budget and memory (CI) Within budget on both MCUs. TM4C flash at 27.0 %, G474 flash at 59.7 %.
Requirements traceability, clang-format, SonarCloud Pass

🤖 Generated with Claude Code

https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE

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
… 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
# Conflicts:
#	documentation/design/service-can.md
#	infra/e-foc-protocol
Advances infra/numerical-toolbox to upstream main, which adds
motion_profiles::SCurveProfileFromState<T> and
JerkLimitedMotionLimits<T> (bisection-based, 32 iterations,
plans from q0, v0, a0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
- Extend position-motion-profile.md with S-curve plan from (q,v,a),
  7-phase description, preconditions, 142 ms example, cycle estimate
  (~13 300 cycles worst case, inside 20 000)
- Update foc-position.md: remove "reserved/no effect" language for
  profileJerk, describe trapezoid vs S-curve selection
- Update service-nvm.md: remove "reserved, not used yet" note
- Add REQ-CTL-011: jerk limit keeps acceleration rate within limit
  (verified, [sil, mil, unit])
- Add loop_bounds entry for SCurveProfileFromState::Bisect (32) in
  cycle-analysis-outer.json

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
- Unit tests: jerk=0 bit-identical to trapezoid, jerk>0 smooth
  acceleration ramp, mid-move replan acceleration step <= jerk*period,
  142 ms arrival, reseed with a0 clamp
- MIL tests: 142 ms ± 2 ms arrival on nominal and anaheim with all
  5 position laws; reversal peak jerk estimate <= 110% of limit
- SIL scenario (REQ-CTL-010/REQ-CTL-011): S-curve following error
  < 0.03 rad, arrival between 125–165 ms after setpoint
- Add SCurveProfileFromState include and new THEN step for S-curve
  following error validation in ResponseSteps.cpp

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
PositionProfile now selects between TrapezoidalProfileFromState
(jerk=0, default, bit-identical) and SCurveProfileFromState (jerk>0)
at replan time. The plan is held in a std::variant<Trapezoidal,SCurve>
member; Sample() and Duration() use std::visit.

On replan the S-curve receives a0 = last reference acceleration clamped
to [-max(aMax,dMax), +max(aMax,dMax)], satisfying the precondition even
when the operator lowers the limits mid-move. On reseed, a0=0.

PositionProfile::Limit gains a jerk parameter (default 0 = trapezoid).
PositionCascade::ProfileMotion forwards it to Limit instead of ignoring
it. All reseed, wrap/travel-limit and feed-forward paths are unchanged.

Closes: profileJerk stored-but-unused (settings 0x68 contract 3.1).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
Copilot AI balanced review requested due to automatic review settings November 11, 2026 20:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@gabrielfrasantos

gabrielfrasantos commented Nov 11, 2026 •

Copy link
Copy Markdown
Contributor Author

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 9 0 0 0.39s
✅ CPP clang-format 944 0 0 0 18.82s
✅ DOCKERFILE hadolint 1 0 0 0.03s
✅ JSON jsonlint 18 0 0 0.11s
✅ JSON prettier 18 7 0 0 0.59s
⚠️ MARKDOWN markdownlint 95 2 93 0 4.84s
✅ MARKDOWN markdown-table-formatter 95 5 0 0 0.69s
✅ REPOSITORY betterleaks yes no no 1.19s
✅ REPOSITORY checkov yes no no 31.06s
✅ REPOSITORY git_diff yes no no 0.15s
✅ REPOSITORY grype yes no no 83.0s
✅ REPOSITORY ls-lint yes no no 0.02s
⚠️ REPOSITORY osv-scanner yes no 1 0.59s
✅ REPOSITORY secretlint yes no no 1.44s
✅ REPOSITORY syft yes no no 1.68s
✅ REPOSITORY trivy yes no no 10.51s
✅ REPOSITORY trivy-sbom yes no no 0.25s
✅ REPOSITORY trufflehog yes no no 3.19s
⚠️ SPELL lychee 290 2 0 94.95s
✅ XML xmllint 2 0 0 0 0.18s
✅ YAML prettier 23 3 0 0 0.8s
✅ YAML v8r 23 0 0 6.7s
✅ YAML yamllint 23 0 0 0.67s

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, 30.499848ms elapsed, 30.500028ms 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

⚠️ Your configuration references items that have been removed from MegaLinter and are ignored: 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

MegaLinter is provided by OX Security
Show us your support by starring ⭐ the repository

@github-actions

Copy link
Copy Markdown
Contributor

🏎️ Cycle Estimation — EK-TM4C1294XL

RelWithDebInfo · Cortex-M4 · 120 MHz · percentages are of the loop period

Path Rate Max cycles Budget Status
Inner loop 20 kHz 3131 (52.2%) 4500 (75.0%) ✅ within budget
Outer loop 1 kHz 11315 (9.4%) 20000 (16.7%) ✅ within budget
Identification path 20 kHz 4519 (75.3%) 6000 (100.0%) ✅ within budget
Path breakdowns

Inner loop

ADC ISR -> FOC inner loop (Clarke/Park/current loop/SVM) -> PWM output

Stage Cycles (min–max) Share
ISR Entry (exception overhead) 12–29 1%
Interrupt Vector 26–35 1%
ADC ISR + Callback Dispatch 259–564 18%
Control Mode Dispatch 63–87 3%
Encoder Read 7–89 3%
FOC Inner Loop (Calculate) 553–1275 41%
PWM Output 56–403 13%
PWM Register Update 135–620 20%
ISR Exit (exception return) 12–29 1%
Total 1123–3131

1662 instructions · 6252 bytes · 9 stages

Outer loop

Low-priority interrupt -> position loop -> speed loop -> online estimators

Stage Cycles (min–max) Share
LPI Entry (exception overhead) 12–29 0%
Interrupt Vector 34–49 0%
FOC Outer Loop (LowPriorityHandler) 84–7595 67%
Online Mechanical Estimator (RLS) 403–3172 28%
Online Electrical Estimator (RLS) 31–441 4%
LPI Exit (exception return) 12–29 0%
Total 576–11315

4669 instructions · 11016 bytes · 6 stages

Identification path

ADC ISR -> FOC inner loop -> PWM output -> calibration observer

Stage Cycles (min–max) Share
ISR Entry (exception overhead) 12–29 1%
Interrupt Vector 26–35 1%
ADC ISR + Callback Dispatch 259–564 12%
Control Mode Dispatch 63–87 2%
Encoder Read 7–89 2%
FOC Inner Loop (Calculate) 553–1275 28%
PWM Output 56–403 9%
PWM Register Update 135–620 14%
Observer Hand-over 14–17 0%
Calibration Observer (costliest) 7–1371 30%
ISR Exit (exception return) 12–29 1%
Total 1144–4519

2159 instructions · 8064 bytes · 11 stages

📦 Full reports, annotated disassembly and JSON metrics: the cycle-analysis-EK-TM4C1294XL-* workflow artifacts.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Memory budget (multi-mode)

Unified binary

📦 Memory budget

EK-TM4C1294XL (M4, RelWithDebInfo) — flash 276.49 KiB · static RAM 29.74 KiB · stack 0 B · heap 0 B

Region Used Free Total %
FLASH 276.49 KiB 747.51 KiB 1.00 MiB 27.0%
RAM 29.74 KiB 226.26 KiB 256.00 KiB 11.6%

Top symbols

Show top symbols
# Symbol Section Size Source
1 main::logic .bss 18.19 KiB —
2 main::hardware .bss 6.29 KiB —
3 foc::CascadeWithSpeedLoop::CalculateInnerLoop(foc::PhaseCurrents const&, infra::Quantity<infra::BaseUnit<10u>, float> const&) .text 3.05 KiB /__w/e-foc/e-foc/build/EK-TM4C1294XL/../../core/foc/cascade/CascadeWithSpeedLoop.cpp
4 foc::TorqueCascade::Calculate(foc::PhaseCurrents const&, infra::Quantity<infra::BaseUnit<10u>, float>&) .text 2.32 KiB /__w/e-foc/e-foc/build/EK-TM4C1294XL/../../core/foc/cascade/TorqueCascade.cpp
5 can::focParameters .data 2.09 KiB —
6 math::detail::fastSineTable .data 2.00 KiB —
7 _acUpBuffer .bss 2.00 KiB —
8 services::RealTimeFrictionAndInertiaEstimator::Update(foc::MechanicalWindow const&) .text 1.83 KiB /__w/e-foc/e-foc/build/EK-TM4C1294XL/../../core/services/mechanical_system_ident/RealTimeFrictionAndInertiaEstimator.cpp
9 services::Validated<application::FocLifecycleTable>()::rows .data 1.56 KiB —
10 state_machine::ControlModeStateMachine::Activate(state_machine::ControlMode) .text 1.52 KiB /__w/e-foc/e-foc/build/EK-TM4C1294XL/../../core/state_machine/ControlModeStateMachine.cpp

@github-actions

Copy link
Copy Markdown
Contributor

🏎️ Cycle Estimation — NUCLEO-G474RE

RelWithDebInfo · Cortex-M4 · 170 MHz · percentages are of the loop period

Path Rate Max cycles Budget Status
Inner loop 20 kHz 2955 (34.8%) 6375 (75.0%) ✅ within budget
Outer loop 1 kHz 11315 (6.7%) 28333 (16.7%) ✅ within budget
Identification path 20 kHz 4343 (51.1%) 8500 (100.0%) ✅ within budget
Path breakdowns

Inner loop

ADC ISR -> FOC inner loop (Clarke/Park/current loop/SVM) -> PWM output

Stage Cycles (min–max) Share
ISR Entry (exception overhead) 12–29 1%
Interrupt Vector 26–35 1%
ADC ISR + Callback Dispatch 374–717 24%
Control Mode Dispatch 63–87 3%
Encoder Read 7–86 3%
FOC Inner Loop (Calculate) 553–1275 43%
PWM Output 60–406 14%
PWM Register Update 74–291 10%
ISR Exit (exception return) 12–29 1%
Total 1181–2955

1538 instructions · 6594 bytes · 9 stages

Outer loop

Low-priority interrupt -> position loop -> speed loop -> online estimators

Stage Cycles (min–max) Share
LPI Entry (exception overhead) 12–29 0%
Interrupt Vector 34–49 0%
FOC Outer Loop (LowPriorityHandler) 84–7595 67%
Online Mechanical Estimator (RLS) 403–3172 28%
Online Electrical Estimator (RLS) 31–441 4%
LPI Exit (exception return) 12–29 0%
Total 576–11315

4669 instructions · 11016 bytes · 6 stages

Identification path

ADC ISR -> FOC inner loop -> PWM output -> calibration observer

Stage Cycles (min–max) Share
ISR Entry (exception overhead) 12–29 1%
Interrupt Vector 26–35 1%
ADC ISR + Callback Dispatch 374–717 17%
Control Mode Dispatch 63–87 2%
Encoder Read 7–86 2%
FOC Inner Loop (Calculate) 553–1275 29%
PWM Output 60–406 9%
PWM Register Update 74–291 7%
Observer Hand-over 14–17 0%
Calibration Observer (costliest) 7–1371 32%
ISR Exit (exception return) 12–29 1%
Total 1202–4343

2035 instructions · 8406 bytes · 11 stages

📦 Full reports, annotated disassembly and JSON metrics: the cycle-analysis-NUCLEO-G474RE-* workflow artifacts.

@github-actions

Copy link
Copy Markdown
Contributor

📦 Memory budget (multi-mode)

Unified binary

📦 Memory budget

NUCLEO-G474RE (M4, RelWithDebInfo) — flash 305.57 KiB · static RAM 30.12 KiB · stack 0 B · heap 0 B

Region Used Free Total %
RAM 30.08 KiB 97.92 KiB 128.00 KiB 23.5%
RAM_SHARED 0 B 0 B 0 B 0.0%
FLASH 305.61 KiB 206.39 KiB 512.00 KiB 59.7%

Top symbols

Show top symbols
# Symbol Section Size Source
1 main::logic .bss 18.19 KiB —
2 main::hardware .bss 7.96 KiB —
3 foc::CascadeWithSpeedLoop::CalculateInnerLoop(foc::PhaseCurrents const&, infra::Quantity<infra::BaseUnit<10u>, float> const&) .text 3.05 KiB /__w/e-foc/e-foc/build/NUCLEO-G474RE/../../core/foc/cascade/CascadeWithSpeedLoop.cpp
4 HAL_TIM_ConfigClockSource .text 2.86 KiB /__w/e-foc/e-foc/build/NUCLEO-G474RE/../../infra/hal/st/st/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_tim.c
5 HAL_ADC_ConfigChannel .text 2.69 KiB /__w/e-foc/e-foc/build/NUCLEO-G474RE/../../infra/hal/st/st/STM32G4xx_HAL_Driver/Src/stm32g4xx_hal_adc.c
6 foc::TorqueCascade::Calculate(foc::PhaseCurrents const&, infra::Quantity<infra::BaseUnit<10u>, float>&) .text 2.32 KiB /__w/e-foc/e-foc/build/NUCLEO-G474RE/../../core/foc/cascade/TorqueCascade.cpp
7 can::focParameters .data 2.09 KiB /__w/e-foc/e-foc/build/NUCLEO-G474RE/../../infra/e-foc-protocol/e-foc-protocol/contract/FocMotorWireContract.hpp
8 math::detail::fastSineTable .data 2.00 KiB —
9 _acUpBuffer .bss 2.00 KiB —
10 services::RealTimeFrictionAndInertiaEstimator::Update(foc::MechanicalWindow const&) .text 1.83 KiB /__w/e-foc/e-foc/build/NUCLEO-G474RE/../../core/services/mechanical_system_ident/RealTimeFrictionAndInertiaEstimator.cpp

The cycle gate charges the plan 3 182 cycles (outer loop 11 315 of 20 000
on EK-TM4C1294XL), not the hand estimate of 5 180. Shorten the
ProfileMotion row so its table stays within the line-length limit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014WUWh7J6XTBVeyaibAtKuE
@sonarqubecloud

Copy link
Copy Markdown

@gabrielfrasantos
gabrielfrasantos merged commit 64e5c16 into main Nov 12, 2026
26 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the claude/motion-profile-scurve branch November 12, 2026 06:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants