This might be what is supposed to happen but im not sure that is what actually does happen.
Im not an expert, jsut posting my understanding but Im 90% sure the problems people are seeing are coming from code in this commit :https://github.com/vedderb/bldc/commit/57c5d04214ea0665e385d0e79818f50924cf3572
It says :
if (duty_now_abs < conf->l_duty_start) {
lo_max_duty = l_current_max_tmp;
} else {
lo_max_duty = utils_map(duty_now_abs, conf->l_duty_start, conf->l_max_duty, l_current_max_tmp, 0.0);
}
Its hard to read but as i understand it the code is saying :
if current duty cycle is less than the new "duty cycle current limit start" {
then current limit is the max current;
} otherwise (if current duty is more than the limit) {
then current limit is scaled from the max current to 0, depending on where the current duty cycle value is between the "duty cycle current limit start" and the "maximum duty cycle".
}
So here is my thinking,
Previously it seems like this code pays no attention to duty cycle, it always delivers full current irrelevant of duty cycle. It Seems like somewhere else the Software, the power is reduced to observe the 95% duty cycle limit.
As you hit the 95 % limit you just get limited power due to physics, but limited power != 0 amps. Its suddenly less amps but still some amps.
With the new code it actually fades you out to 0 amps.
HOWEVER the closer the “duty cycle current limit start” is to the “maximum duty cycle” the quicker this will happen.
so what happens if you have this new current limit set to 95%? This fade suddenly becomes a binary switch. at 94% you have full power. and as soon as you pass the limit all current is instantly cut to 0 Amps, probably causing you to slow down. As soon as you slow under 95% duty you get full power back again. This could easily show the behavior users are seeing.
Furthermore this calculation happens independent for both motors possibly causing the power cuts to be out of sync for both sides.
Additionally the default setting is 100% so in the rare case you reach 100% duty you will drop into the else condition and cause some sort of weird values to be put into the mapping function where the max value is smaller than the min value. no idea how well that map function would handle that situation.
Again this is my understanding and it may be incorrect, If anyone has better understanding of whats going in here it would be good to try and fully work it out. i don’t think these issues are a fault of the feature, just something unexpected happening due to its implementation.
Maybe there is a simple fix to ensure the default setting of 100% keeps the old behavior, eg.
if (l_duty_start = 1) { # if set to 100%
lo_max_duty = l_current_max_tmp; # use old behavior
} else {
#do new behaviour
}
Anyways . . . i realize that is is getting a bit of topic so if your not happy with this here we could always get it moved to somewhere more relevant for this discussion to continue.