Page 1 of 1

Inverter Firmware v4.17.R

Posted: Mon Apr 08, 2019 8:36 pm
by johu
Decided to draft a release with the recent changes contributed by Nail and myself:
  • Added possibility for a constant power region, set fslipconstmax=fslipmax if you don't want it!
  • Using DMA for serial communication if possible (all boards but Rev1)
  • Calculation of ilrms is now being done by averaging with previous RMS values
  • Do not swallow the new line in echo
  • FP multiplication fixed under LimitCurrent() method. Also, max current is calculated by SVM approach.
  • Fix infinite speed when fmax<20
  • Fmax minimum set to 21
  • brkmax now negative (to be consistent with brknompedal)
The constant power region is a braking change. To disable it set fslipconstmax=fslipmax
Otherwise, here is how it works:
Say you set fweak=100 and fslipmax=3. Then as you reach 100Hz torque will start declining with the square of frequency and thus power will decline linear with frequency. With this version you can counter that decline by allowing slip to become higher than fslipmax.
The parameter fconst now sets the frequency to which a constant power region stretches. The parameter fslipconstmax sets the maximum allowed slip at the frequency.
So now, when fweak is hit (at full throttle) the controller will start to increase slip linearly with every Hz above fweak until it reaches fconst and fslipconstmax.
In my conversion I set fweak=100, fslipmax=3.5, fconst=160 and fslipconstmax=5 and enjoy less drop in power at higher speeds :)

Re: Inverter Firmware v4.17.R

Posted: Tue Apr 09, 2019 5:01 am
by arber333
johu wrote: Mon Apr 08, 2019 8:36 pm Decided to draft a release with the recent changes contributed by Nail and myself:
  • Added possibility for a constant power region, set fslipconstmax=fslipmax if you don't want it!
  • Using DMA for serial communication if possible (all boards but Rev1)
  • Calculation of ilrms is now being done by averaging with previous RMS values
  • Do not swallow the new line in echo
  • FP multiplication fixed under LimitCurrent() method. Also, max current is calculated by SVM approach.
  • Fix infinite speed when fmax<20
  • Fmax minimum set to 21
  • brkmax now negative (to be consistent with brknompedal)
The constant power region is a braking change. To disable it set fslipconstmax=fslipmax
Otherwise, here is how it works:
Say you set fweak=100 and fslipmax=3. Then as you reach 100Hz torque will start declining with the square of frequency and thus power will decline linear with frequency. With this version you can counter that decline by allowing slip to become higher than fslipmax.
The parameter fconst now sets the frequency to which a constant power region stretches. The parameter fslipconstmax sets the maximum allowed slip at the frequency.
So now, when fweak is hit (at full throttle) the controller will start to increase slip linearly with every Hz above fweak until it reaches fconst and fslipconstmax.
In my conversion I set fweak=100, fslipmax=3.5, fconst=160 and fslipconstmax=5 and enjoy less drop in power at higher speeds :)
Hi

What happens with phase voltage at that speed? So motor torque is continued throughout the rpm curve? Does that mean more Amps to the windings? I should try this though i was having problems with overtaxing batteries in the higher RPM region. :)

tnx

Re: Inverter Firmware v4.17.R

Posted: Tue Apr 09, 2019 7:59 am
by johu
Phase voltage is not affected by the change. No, not the full torque is continued but the torque is now supposed to decline linear with speed instead of quadratic. As it is a "constant power" region the battery current will not increase, provided to configure fconst (not too close to fweak) and fslipconstmax (not too much) correctly

Re: Inverter Firmware v4.17.R

Posted: Wed Apr 10, 2019 3:37 pm
by nailgg
Great addition, sounds very nice :) . So now we can keep the motor in the constant power region between fweak<fstat<fconst, and the slip will increase from fslipmax to fslipconstmax in this region, full throttle assumed. But one needs to set fmax to at least fconst+20 to avoid power drop between fconst-20<fstat<fconst, if I'm not mistaken.

Re: Inverter Firmware v4.17.R

Posted: Wed Apr 10, 2019 5:52 pm
by johu
Yes, very true (as opposed to just true ;) )

Re: Inverter Firmware v4.17.R

Posted: Sun May 05, 2019 5:32 pm
by johu
Just traced a bug that only shows under very unique conditions:
idlemode = 0 or 1 (always/nobrake) (0 is default)
idlespeed = -100 (default)
speedkp = 0 (default is 0.25)

You will experience that there is no regen because the idlespeed controller always overrules potnom < 0
Even with speedkp at its default value you might experience attenuated regen at lower speeds.

Solutions: Set idlemode=2 so it's disabled while cruise_in is off.

I will add idlemode=off in next revision

Re: Inverter Firmware v4.17.R

Posted: Wed Jun 05, 2019 8:35 pm
by jon volk
On the next update, would it be possible to add a decimal to the value of the throttle and brake ramp settings? That would offer a greater level of tuning resolution, particularly if using the throtramp as a launch control by going WOT before letting off the brake. My initial thought would have been to increase the time period of the ramp from 10ms to 100ms, but it seems some other motors already utilize much higher values as evidenced by the wiki configuration files. Unless of course the time period was changed along with the ability to use a value of 1-1000 for the slew rate.