Skip to content

Auto Tune module#3121

Draft
mustafab0 wants to merge 8 commits into
mainfrom
mustafa/task/control-autotune
Draft

Auto Tune module#3121
mustafab0 wants to merge 8 commits into
mainfrom
mustafa/task/control-autotune

Conversation

@mustafab0

Copy link
Copy Markdown
Contributor

Problem

Tuning a mobile base's velocity controller is manual and expert-only. There's no single path from a robot to its gains.

Issue: #2755
Closes DIM-1116

Solution

Adds dimos/control/autotune/. You declare a RobotProfile (command interface, odometry domain, channels, limits, fitter); it probes stream timing, drives a step/ramp battery through the ControlCoordinator recording one episode per run, fits a first-order-plus-deadtime model per axis, derives bandwidth plus Bode and pole-zero plots, then lambda-tunes PI gains with a robustness sweep.

Emits a tuned artifact in the shape the control task already loads, plus a separate characterization report. Fitters and tuner were ported from the characterization branches and made robot-agnostic. Live drive wiring is not included.


Breaking Changes

None. Additive module.


How to Test

  1. pytest dimos/control/autotune (~2s).
  2. Confirm it recovers the synthetic plant's K/tau/L and emits a schema-v1 artifact.
  3. Confirm valid_for_tuning is false for non-hardware data.

Checklist

  • [ x] I have read and approved the CLA.

Drives one autotune run against a known synthetic plant: profile -> probe ->
excitation battery -> fit -> tune -> artifact. Exercises the external APIs the
module binds to (Twist/Vector3, EpisodeStatus) as part of the flow so drift in
those surfaces fails here rather than on the robot.

In-process and synthetic; the process-level run against a booted blueprint
belongs in dimos/e2e_tests/ once the live drive wiring exists.
@mustafab0 mustafab0 linked an issue Jul 21, 2026 that may be closed by this pull request
@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
dimensional 🟢 Ready View Preview Jul 21, 2026, 8:49 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

@mustafab0 mustafab0 added the backport:skip Skip creating a backport to any release branches label Jul 21, 2026
@codecov

codecov Bot commented Jul 21, 2026

Copy link
Copy Markdown

❌ 1 Tests Failed:

Tests completed Failed Passed Skipped
2647 1 2646 165
View the top 1 failed test(s) by shortest run time
dimos.codebase_checks.test_no_all::test_no_all
Stack Traces | 5.89s run time
def test_no_all():
        """Fail if any file defines `__all__`."""
        dimos_dir = DIMOS_PROJECT_ROOT / "dimos"
        hits = find_all_definitions()
        if hits:
            listing = "\n".join(f"  - {p.relative_to(dimos_dir)}:{lineno}" for p, lineno in hits)
>           raise AssertionError(
                f"Found __all__ definition(s) in dimos/:\n{listing}\n\n"
                "__all__ is not allowed. We don't use `from x import *`, so __all__ "
                "lists serve no purpose and are tedious to maintain. Remove them. For "
                "an import that exists purely to be re-exported, use `# noqa: F401`."
            )
E           AssertionError: Found __all__ definition(s) in dimos/:
E             - .../autotune/fit/pose_fopdt.py:305
E             - .../autotune/fit/velocity_fopdt.py:234
E             - control/autotune/tune.py:584
E           
E           __all__ is not allowed. We don't use `from x import *`, so __all__ lists serve no purpose and are tedious to maintain. Remove them. For an import that exists purely to be re-exported, use `# noqa: F401`.

dimos_dir  = PosixPath('.../dimos/dimos/dimos')
hits       = [(PosixPath('.../dimos/dimos/dimos/.../autotune/fit/pose_fopdt.py'), 305), (PosixPath('.../home/runner/...totune/fit/velocity_fopdt.py'), 234), (PosixPath('.../dimos/dimos/dimos/control/autotune/tune.py'), 584)]
listing    = '  - .../autotune/fit/pose_fopdt.py:305\n  - .../autotune/fit/velocity_fopdt.py:234\n  - control/autotune/tune.py:584'

dimos/codebase_checks/test_no_all.py:51: AssertionError

To view more test analytics, go to the Test Analytics Dashboard
📋 Got 3 mins? Take this short survey to help us improve Test Analytics.

@mintlify

mintlify Bot commented Jul 21, 2026

Copy link
Copy Markdown
Contributor

Preview deployment for your docs. Learn more about Mintlify Previews.

Project Status Preview Updated (UTC)
dimensional 🟡 Building Jul 21, 2026, 8:48 PM

💡 Tip: Enable Workflows to automatically generate PRs for you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backport:skip Skip creating a backport to any release branches

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Autotune Module

1 participant