regen tuning process!  [SOLVED]

Nissan Leaf/e-NV200 drive stack topics
Post Reply
janosch
Posts: 98
Joined: Tue Jun 30, 2020 9:23 am
Location: London, UK

regen tuning process!

Post by janosch »

Hello,

this should be easy to answer for someone who has done it. We have a Leaf drivetrain on a RWD vehicle with 5.06.R-foc software. I just went to a car park to try various settings.
  • My idea: Set it super aggressive -> then work backwards from there till it is pleasant
  • Primary goal: range
  • Secondary goal: smoothness
1) How can I create visibility of what is actually happening in a plot?
I tried plotting il1, il2, idc and expected negative values for idc at least but couldn't really spot it when braking from low speeds, is there a variable that will help? scaledBrkMax from throttle.cpp would be interesting I think, but it isn't a param. I could expose it as a param and plot I suppose.

2) Do I need to save to flash & fully turn inverter off between every param change for them to take effect? (I saw it can't be done in run-mode, makes sense).

3) BrkRampStr in Hz <-- What is 1 Hz here? Is it one motor revolution, or one magnetic field revolution (so 4x per physical rotation). I didn't go faster than 20mph/32kmh, gearbox reduction is pretty close to 8:1, wheel diameter 66cm so in 1s @ 20mph I drive 8.9m, 8.9 / 2.07 are 4.3 wheel revolutions. 4.3 * 8 = 34.4 Hz if it is the motor revolution or 137Hz for the field. brkrampstr felt the same at 10Hz and 30Hz.

Below the two sets of params that I tried, but I struggled to feel a difference really.

Thanks for any hints!

calm settings
calm_settings.png
more aggressive settings
more_aggr_settings.png
P.S: I had a look at the tuning guide here before I went out: https://openinverter.org/wiki/Parameters#Tuning_Guide
But it appears the parameters there are more throttle related and for SIN rather than FOC.
janosch
Posts: 98
Joined: Tue Jun 30, 2020 9:23 am
Location: London, UK

Re: regen tuning process?

Post by janosch »

I am controlling via CAN, just saw this post:
viewtopic.php?p=33532#p33532
Are you sending anything to pot2? If so, pot2 will scale your regen as well. Check pot2min and pot2max
Is this relevant for CAN control? pot2min, pot2max sit at 4095
User avatar
johu
Site Admin
Posts: 3058
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Contact:

Re: regen tuning process?

Post by johu »

1. Plotting potnom will show the regen command, in percent of 100*throtcur. Idc should indeed be negative, at least at higher speed.
2. Changes take effect instantly. You only need to stop the inverter to save to flash (which stalls the processor and is therefore not allowed in run mode)
3. Refers to electrical turns

CAN only differs in data sourcing, not processing
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
janosch
Posts: 98
Joined: Tue Jun 30, 2020 9:23 am
Location: London, UK

Re: regen tuning process?

Post by janosch »

It only brakes at ~1kW.
I would have expected it to be more like 10kW with aggressive settings, right?

pot2 sits at 0. I set pot2min = pot2max = 0 for the trials just then, I could try -1 I suppose, haven't looked at the code yet if that would force it to 100%.

Noteworthy: I averaged the brake signal over 100ms in code to make sure there is no oscillation between 1 and 0, thats why din_brake comes up a bit later. Still I would have expected idc to dip a lot further afterwards. It just coasts till the friction brakes catch.

acceleration & brake test
regen_when_braking.png
most aggressive settings I tested
most_aggressive_settings.png
List of all options below. Sorry it is in a screenshot.
Attachments
Screenshot 2021-12-21 at 13-07-13 Huebner Inverter Management Console.png
User avatar
johu
Site Admin
Posts: 3058
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Contact:

Re: regen tuning process?  [SOLVED]

Post by johu »

In some version there was indeed an issue with pot2. Try setting both to 0. Indeed potnom never seems to go below 0, so no regen
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
janosch
Posts: 98
Joined: Tue Jun 30, 2020 9:23 am
Location: London, UK

Re: regen tuning process?

Post by janosch »

johu wrote: Tue Dec 21, 2021 4:17 pm In some version there was indeed an issue with pot2. Try setting both to 0. Indeed potnom never seems to go below 0, so no regen
I had both at 0 earlier. Let me update firmware and see if that alleviates the issue.


Edit:
Software update to 5.14-FOC makes potnom go negative!

Going to a car park now to try it.
Screenshot from 2021-12-21 16-55-14.png
Edit Edit:
There she is! 5.06r-FOC had the pot issue.
Screenshot from 2021-12-21 17-10-42.png
To summarise regen braking setup:

prerequisites for regen when coasting & brake pedal:
  • check din_brake shows up correctly when pedal depressed
  • observe params here: https://openinverter.org/wiki/Parameters and in the param database
  • potnom and idc go negative when regen is active
  • pot2min, pot2max need to be set correctly
  • 5.06R-FOC seems to not let potnom go negative, update if on that version
  • a plot of potnom, idc and din_brake will help you debugging (erroneous and correct plots in my posts above)
Further reading: https://openinverter.org/forum/viewtopic.php?f=7&t=2172

Thanks Johannes!
Renegate2020
Posts: 19
Joined: Tue Dec 01, 2020 6:20 am

Re: regen tuning process!

Post by Renegate2020 »

If you do not mind, I will try to find out here - is it possible to regulate the regeneration on the fly? For example, by installing a push-button or rotary knob.
User avatar
johu
Site Admin
Posts: 3058
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Contact:

Re: regen tuning process!

Post by johu »

Yes, by connecting it to the pot2 input.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Renegate2020
Posts: 19
Joined: Tue Dec 01, 2020 6:20 am

Re: regen tuning process!

Post by Renegate2020 »

Super!!!
Post Reply