Skip to content

Refresh config values at 1 Hz, only the axis state at 10 Hz - #18

Merged
falkoschindler merged 1 commit into
mainfrom
poll-config-values-at-1-hz-instead-of-10
Oct 28, 2026
Merged

falkoschindler merged 1 commit into
mainfrom
poll-config-values-at-1-hz-instead-of-10

Conversation

@falkoschindler

Copy link
Copy Markdown
Contributor

Closes #17.

Since #16, every axis panel refreshed all its mirrors on the USB worker every 0.1 s: the axis state, but also every bound config value (gains, limits, bandwidths, input-mode parameters, trap_traj limits). Every write and command (Idle, Stop, current_lim) queues behind those reads, and each open tab adds its own. Measured with the mock (two calibrated axes, one tab, plots off), that was 483 worker reads per second.

Now only the axis state mirror refreshes at 10 Hz. The four config mirrors have their own 1 Hz timer. With the same setup that gives 105 reads per second. An edit made in this panel still shows and is written at once. An edit from another client or odrivetool now shows up within about a second instead of 0.1 s.

Tests:

  • test_config_values_are_not_polled_at_10_hz (new) caps the worker at 150 reads per second with two axes. Before this change it would have counted ~480.
  • test_gain_edits_reach_the_device_and_device_changes_reach_the_ui now waits 2 s instead of 1.2 s for a device-side change to reach the UI.

※

Every axis panel refreshed all its mirrors on the USB worker every 0.1 s:
the axis state, but also every bound config value (gains, limits,
bandwidths, input-mode parameters, trap_traj limits), about 22 reads per
axis and tick. Every write and command queues behind those reads, and
each open tab adds its own. With two axes that was ~480 reads per second.

Only the axis state must feel live. Config values change only when
someone edits them, and an edit made here shows at once, so their mirrors
now refresh at 1 Hz: ~105 reads per second. An edit from another client
or odrivetool shows up within a second instead of 0.1 s.

Closes #17

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01FUjP7mHeiHytZSgfnFC3W2
@falkoschindler falkoschindler added the enhancement New feature or request label Oct 26, 2026
@falkoschindler falkoschindler added this to the 0.3 milestone Oct 26, 2026

@evnchn evnchn 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.

Looks good. The new test fails on main (483 reads per second) and passes here, and the full suite passes (21). An edit in the panel still shows at once, and a change from odrivetool taking up to a second is fine for config values.

@falkoschindler
falkoschindler merged commit d8737b8 into main Oct 28, 2026
6 checks passed
@falkoschindler
falkoschindler deleted the poll-config-values-at-1-hz-instead-of-10 branch October 28, 2026 06:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Poll config values at 1 Hz instead of 10 Hz

2 participants