Skip to content
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

Add power limits #6929

Merged
merged 4 commits into from
May 8, 2021
Merged

Conversation

shellixyz
Copy link
Collaborator

@shellixyz shellixyz commented May 6, 2021

Adds the possibility to limit the throttle depending on set current/power continuous/burst values

Matching configurator part: iNavFlight/inav-configurator#1259

Closes #3888

@shellixyz shellixyz added this to the 3.0 milestone May 6, 2021
@shellixyz shellixyz force-pushed the feature/power_limits branch from 4665134 to 2f61d79 Compare May 6, 2021 17:27
@shellixyz shellixyz force-pushed the feature/power_limits branch from 2f61d79 to 8fbf14e Compare May 6, 2021 18:11
@avsaase
Copy link
Member

avsaase commented May 6, 2021

This would be great for flying with li-ion packs. I vaguely remember there was a feature request for this but I cannot find it anymore.

Quick question though, are the time limits set in deciseconds? I don't think that time unit is used anywhere else in INAV so maybe it's better to change it so either seconds or milliseconds. Also, a max burst time of 60 seconds could be useful depending on how you set the constant and burst currents/powers.

@shellixyz
Copy link
Collaborator Author

This would be great for flying with li-ion packs. I vaguely remember there was a feature request for this but I cannot find it anymore.

I vaguely remember a similar request but I can't find it either

Quick question though, are the time limits set in deciseconds? I don't think that time unit is used anywhere else in INAV so maybe it's better to change it so either seconds or milliseconds. Also, a max burst time of 60 seconds could be useful depending on how you set the constant and burst currents/powers.

Yes deciseconds. TBH I would much prefer having the settings be seconds but I also like the tenth of a second granularity. The best would be to switch to float but that would double the storage size for the timing settings from 8 bytes to 16 bytes, I am not sure it is worth it.

@shellixyz shellixyz added the Release Notes Add this when a PR needs to be mentioned in the release notes label May 6, 2021
@avsaase
Copy link
Member

avsaase commented May 7, 2021

Hmm yeah, perhaps this should be made more intuitive on the configurator side at some point (but not only for this feature, iNavFlight/inav-configurator#1201).

Can you increase the max value for limit_burst_current_time and limit_burst_power_time to 600? I have a 18650 pack that specifies a burst current for up to 60 seconds.

@shellixyz
Copy link
Collaborator Author

Hmm yeah, perhaps this should be made more intuitive on the configurator side at some point (but not only for this feature, iNavFlight/inav-configurator#1201).

I wanted to add these settings to the GUI but I wanted to use the generic settings interface and there is an issue with that in the configuration tab. I'm not sure what is going on.

Can you increase the max value for limit_burst_current_time and limit_burst_power_time to 600? I have a 18650 pack that specifies a burst current for up to 60 seconds.

Let's make it even 300s

@ArnoTlse
Copy link

ArnoTlse commented Jun 3, 2021

Hi @shellixyz ,

I aim at using a li ion battery on my 5"quad to do some longer time flight (smooth flight not freestyle), but I would like to keep quad motor configuration as it is to be able to switch from long flight to freestyle (shorter flight) mode. If I understand this PR, it is the solution to limit power. I would like to test it on my lipo first to see if it will be still flyable with limits for li ion. Do you know which kind of parameters I have to set in the Cli to tune this?

Arnotlse

@shellixyz
Copy link
Collaborator Author

@ArnoTlse

I will add documentation for this soon. There are 4 parameters you can set to change the behavior:

limit_cont_current which is the continuous allowed current (eg 45 = 4.5A)
limit_burst_current which is the burst allowed current (eg 100 = 10.0A)
The burst current is allowed for limit_burst_current_time (eg 100 = 10s)
limit_burst_current_falldown_time specifies the time for the current to ramp down to the continuous limit when the burst reserve is soon to be depleted

You can find all the settings and their description in the documentation. Settings for power limitation begins with limit_

@ArnoTlse
Copy link

Hi @shellixyz,

Ok, thanks a lot.
I will test it.

Arno

@ArnoTlse
Copy link

Hi @shellixyz,

Another question, does it works also with battery profile? I mean, can I limit the current using the parameter you mention depending on the battery profile used?

For example, if I want to limit current with specific values to use li ion battery safely (30A max) when selecting battery profile n°2 and go back to default value for battery profile n°1, is it manageable? Or are the variables for current limitation unique and apply to all battery profile?

Arno

@shellixyz
Copy link
Collaborator Author

Not in 3.0 but that will be possible in 3.1

@ArnoTlse
Copy link

ArnoTlse commented Jul 1, 2021

OK, great. Thanks for the information.

Arno

@ArnoTlse
Copy link

Hi @shellixyz,

I have made a flight yesterday with such limit configured :

  • Limit_cont_current = 200
  • Limit_burst_current = 250
  • limit_burst_current_time = 100
  • limit_burst_current_falldown_time = 100

I have made some vertical acceleration test (gently accelerating) to see if the limitations will be floored by those settings. I have experimented at moment, a very short déstabilisation of the quad following quickly by a complete shutoff of the quad in flight when pushing throttle. When I get it back, I have to disconnect and reconnect the lipos to make it work again. Disam/arm not working. Unfortunately, the log is corrupted. It has stopped recording before this event. So it is just what I have observed.

Do you know if it is a normal or expected behavior? Do I have also to configure limit_power stuff related to limit_current?

Arno

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
New Feature Release Notes Add this when a PR needs to be mentioned in the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Is it possible to limit throttle according to the programmed max current?
3 participants