Skip to content

Fix Sim.control_freq in rotor_vel mode - #153

Merged
amacati merged 1 commit into
learnsyslab:mainfrom
malikdurmus:fix-rotor-vel-control-freq
Nov 3, 2026
Merged

amacati merged 1 commit into
learnsyslab:mainfrom
malikdurmus:fix-rotor-vel-control-freq

Conversation

@malikdurmus

Copy link
Copy Markdown
Contributor

Sim.control_freq raises in rotor_vel mode

control_freq has no rotor_vel branch, so the sim.step(sim.freq // sim.control_freq) pattern from the README and docs raises NotImplementedError. Rotor velocity commands are applied every sim step (controllable already returns all True for rotor_vel, and the control docs list it as every dynamics step), so now it returns sim.freq.

@amacati amacati left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good, thanks for contributing!

@amacati

amacati commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

@ratheron Do you know how fast the desired rotor velocities are updated on the firmware? We might need a "proper" frequency for that to have it run at 500Hz or 1kHz. Not a priority though

@amacati amacati added the bug Something isn't working label Nov 3, 2026
@amacati
amacati merged commit f685e3c into learnsyslab:main Nov 3, 2026
5 checks passed
@ratheron

ratheron commented Nov 3, 2026

Copy link
Copy Markdown
Collaborator

@ratheron Do you know how fast the desired rotor velocities are updated on the firmware? We might need a "proper" frequency for that to have it run at 500Hz or 1kHz. Not a priority though

Not completely sure, but I think the uC sends the thrust commands out to the ESCs at 500Hz. The ESCs run at higher frequency of course

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

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants