Skip to content

feat(controllers): coupled damping design for impedance control - #50

Merged
gabrielfrasantos merged 5 commits into
mainfrom
ccr-7574d68f-btpm0a-coupled-damping
Nov 21, 2026
Merged

gabrielfrasantos merged 5 commits into
mainfrom
ccr-7574d68f-btpm0a-coupled-damping

Conversation

@gabrielfrasantos

Copy link
Copy Markdown
Contributor

What

New header robotics/controllers/manipulator/CoupledDamping.hpp, providing:

CoupledDamping(M, K, ζ) → D = 2ζ·W·M·W, with W = diag(√ωᵢ) and ωᵢ = √(Kᵢ / Mᵢᵢ).

What the damper gives:

  • Diagonal: Dᵢᵢ = 2ζ·√(Kᵢ·Mᵢᵢ), each joint's single-mass damper.
  • Coupling terms: Dᵢⱼ = 2ζ·√(ωᵢ·ωⱼ)·Mᵢⱼ, so the damper couples the joints exactly where the arm does.
  • Equal frequencies: if every ωᵢ = ω, then D = 2ζω·M, and every mode of the closed loop is damped at ζ.
  • Massless joints: a joint with no inertia gets no damping.

Why

A diagonal damper sized from each joint's own inertia ignores the coupling in the mass matrix. On e-robot-arm's reference arm, that left the coupled shoulder–elbow mode and the light wrist poorly damped at a 10 ms period, and they oscillated. e-robot-arm's joint- and Cartesian-impedance controllers already use this design (arm-controllers.md) through a local helper. This PR moves the design into the toolbox next to the impedance controller.

Tests (TestCoupledDamping)

  • uncoupled joints get the single-mass damper 2ζ·√(K·m)
  • equal natural frequencies give exactly 2ζω·M on a coupled mass matrix
  • a joint with no inertia gets no damping

Docs

  • New doc/controllers/manipulator/CoupledDamping.md, following the template.
  • New row in doc/controllers/manipulator/README.md.
  • New entry in the root README.md Documentation table.

Testing

  • cmake --build --preset host-single-Debug: builds clean
  • ctest --preset host-single-Debug: 7/7 suites pass; the controllers suite passes 67/67
  • CoupledDamping.cpp compiles with -DROBOTICS_TOOLBOX_COVERAGE_BUILD

Note

#48 and #49 also add a cell to the root README.md Documentation table. When one merges, the others get a small table conflict, which I'll resolve.


Generated by Claude Code

CoupledDamping(M, K, zeta) returns D = 2 zeta W M W with
W = diag(sqrt(omega_i)) and omega_i = sqrt(K_i / M_ii): each joint gets
the single-mass damper 2 zeta sqrt(K_i M_ii) on its diagonal, and the
damper couples the joints where the mass matrix does. With equal
frequencies it is 2 zeta omega M, so every mode is damped at zeta. A
joint with no inertia gets no damping.

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

github-actions Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

✅⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Max errors Warnings Elapsed time
✅ ACTION actionlint 7 0 0 0.53s
✅ CPP clang-format 218 0 0 0 2.63s
✅ CPP cppcheck 218 0 0 4.5s
✅ DOCKERFILE hadolint 1 0 0 0.71s
✅ JSON jsonlint 8 0 0 0.09s
✅ JSON prettier 8 2 0 0 0.46s
✅ MARKDOWN markdownlint 86 0 0 0 2.53s
✅ MARKDOWN markdown-table-formatter 86 0 0 0 0.24s
⚠️ SPELL lychee 134 1 0 2.26s
✅ YAML prettier 12 0 0 0 0.55s
✅ YAML yamllint 12 0 0 0.74s

Detailed Issues

⚠️ SPELL / lychee - 1 error
📝 Summary
---------------------
🔍 Total..........389
🔗 Unique.........132
✅ Successful.....378
⏳ Timeouts.........0
🔀 Redirected.......5
👻 Excluded.........9
❓ Unknown..........0
🚫 Errors...........1
⛔ Unsupported......1

Errors in .github/workflows/static-analysis.yml
[403] https://binaries.sonarsource.com/Distribution/sonar-scanner-cli/sonar-scanner-cli-$ (at 37:21) | Rejected status code: 403 Forbidden

Hint: Followed 5 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`

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_CPPCHECK,CPP_CLANG_FORMAT,DOCKERFILE_HADOLINT,JSON_JSONLINT,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,SPELL_LYCHEE,YAML_PRETTIER,YAML_YAMLLINT

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

@sonarqubecloud

Copy link
Copy Markdown

@gabrielfrasantos
gabrielfrasantos merged commit eb60bca into main Nov 21, 2026
12 checks passed
@gabrielfrasantos
gabrielfrasantos deleted the ccr-7574d68f-btpm0a-coupled-damping branch November 21, 2026 14:48
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.

2 participants