Skip to content

Make dyn idle startup increase configurable #12432

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Mar 9, 2023

Conversation

tbolin
Copy link
Contributor

@tbolin tbolin commented Feb 27, 2023

Replace fixed 5 percent max increase from dynamic idle when airmode is inactive with a configurable value.

-Default value is still 5.0 percent (50 in cli)
-Add dyn_idle_start_increase cli setting
-Add dyn_idle_start_increase BB header field

Currently the dynamic idle maximum increase is limited to 5% when arming, until the throttle is pushed past airmode_start_throttle_percent.
For most quads 5% is plenty, and a higher limit could increase the risk of damaging the motors/ESC if the props are obstructed, cause the quad to throttle up unexpectedly on arming, and very powerful quads might even jump slightly.
Some quads however, especially tiny whoops, can have problems getting the motors spinning if the idle is limited to 5%.
This PR implements a setting that allows the max increase at startup to be adjusted so dynamic idle is more usable on those quads.

The default is still the same as the old hard coded limit, so most quads shouldn't be affected.

Demonstration videos

First with dyn_idle_start_increase at 5%. One of the motors fails to start.
https://youtu.be/EjM2xU3o6pA

With dyn_idle_start_increase all motors start (the fly away in the end is just me raising the throttle and not due to the increased limit).
https://youtu.be/wA70vNFtaTM

@github-actions

This comment has been minimized.

@blckmn
Copy link
Member

blckmn commented Feb 27, 2023

AUTOMERGE: (FAIL)

  • github identifies PR as mergeable -> FAIL
  • assigned to a milestone -> PASS
  • cooling off period lapsed -> PASS
  • commit count less or equal to three -> PASS
  • Don't merge label NOT found -> PASS
  • at least one RN: label found -> PASS
  • Tested label found -> FAIL
  • assigned to an approver -> FAIL
  • approver count at least three -> FAIL

@tbolin
Copy link
Contributor Author

tbolin commented Mar 2, 2023

I had forgotten to add some files when pushing an amend.
Now the changes should be more inline with the commit message.

@github-actions

This comment has been minimized.

Replace fixed 5 percent max increase from dynamic idle
when airmode is active with a configurable value.

-Default value is still 5.0 percent (50 in cli)
-Add dyn_idle_start_increase cli setting
-Add dyn_idle_start_increase BB header field
@github-actions

This comment has been minimized.

@haslinghuis
Copy link
Member

@tbolin Almost forgot we need to increase the PG reset function from 5 to 6

https://github.com/betaflight/betaflight/pull/12432/files#diff-afd1226d5a8ae512e5fc53a545d9b7259b4f001bc94eae9c38cacd8762fb7f54R122

@tbolin
Copy link
Contributor Author

tbolin commented Mar 9, 2023

@tbolin Almost forgot we need to increase the PG reset function from 5 to 6

https://github.com/betaflight/betaflight/pull/12432/files#diff-afd1226d5a8ae512e5fc53a545d9b7259b4f001bc94eae9c38cacd8762fb7f54R122

I think that is done now

@github-actions

This comment has been minimized.

@github-actions
Copy link

github-actions bot commented Mar 9, 2023

Do you want to test this code? Here you have an automated build:
Assets
WARNING: It may be unstable. Use only for testing! See: https://www.youtube.com/watch?v=I1uN9CN30gw for instructions for unified targets!

@haslinghuis haslinghuis merged commit 0c70610 into betaflight:master Mar 9, 2023
@haslinghuis
Copy link
Member

@tbolin
Copy link
Contributor Author

tbolin commented Mar 11, 2023

@tbolin see also: https://youtu.be/aUBXt4P8p9w?t=566

Thanks, but both maximum startup power (Boost) and maximum startup power (Protection) is already set to the maximum values (running 48 kHz pwm). IIRC the battery was also full in the videos.
I suspect that the motor is a bit damaged, because it always struggle to start, but for this purpose it made a very reliable demonstrator.
I should try to lower the maximum startup powers and see if the motor still starts spinning with the higher dyn idle limit.

@ctzsnooze
Copy link
Member

I think its good to have two separate values. The original intent of not enabling full dynamic idle when arming without air mode active was to avoid a possible exaggeration of an oscillation on arming, perhaps leading to an arming flyaway. I don't think that this has been a practical problem, however being able to have one value on arming and a higher value in flight can keep the original intent, and allow people who want higher idle without airmode to do so without a problem.

Copy link
Member

@ctzsnooze ctzsnooze left a comment

Choose a reason for hiding this comment

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

Good to see this merged.

davidbitton pushed a commit to davidbitton/betaflight that referenced this pull request Feb 5, 2024
* Make dyn idle startup increase configurable

Replace fixed 5 percent max increase from dynamic idle
when airmode is active with a configurable value.

-Default value is still 5.0 percent (50 in cli)
-Add dyn_idle_start_increase cli setting
-Add dyn_idle_start_increase BB header field

* Increse PG reset to ver 6 for pidProfile

* Indentation

---------

Co-authored-by: Mark Haslinghuis <mark@numloq.nl>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: COMPLETED
Development

Successfully merging this pull request may close these issues.

5 participants