Page 1 of 2
Can't get any regen with LDU, help!
Posted: Thu Jul 13, 2023 8:26 pm
by mane2
Could someone pelase help me how to get regen working? I've been reading the parameters wiki page and forum posts. Comparing parameters but whatever I change, I get zero regen. Accelerator is configured correctly and potnom2 is 4095 min and max.
I guess relevant settings are here:
Code: Select all
"brakeregen": -55,
"regenramp": 100,
"regentravel": 20,
"offthrotregen": -70,
"cruiseregen": -30,
"regenrampstr": 40,
"brklightout": -10,
But changing any of those, does nothing. It must be something else that I'm missing.
I have 12 Tesla 5.3kWh modules, so voltage range is about 216V to 300V. Motor is Sport LDU.
I'm on version v5.27.R.
Attached my params.json
Thanks!
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 14, 2023 12:06 am
by P.S.Mangelsdorf
Does this happen regardless of the pack SOC? If your pack is fully charged, it won't regen because there is nowhere to go.
You probably also want udcmax to be a bit higher than actual pack max voltage.
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 14, 2023 5:33 am
by mane2
Yeah, no matter what SOC. Zero regen.
I’ll try increasing udcmax. Wondering how is this parameter used.. why inverter needs this param in first place.
I read one post here, who has the same problem with SDU and it was solved by changing idlespeed and some kps value. Could that be issue with my params too?
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 14, 2023 10:45 am
by johu
Unfortunately I can't get my bloody phone to open the json. udcmax is meant to limit regen into a full battery. Yes if idlemode is set to something and speedkp=0 that will also inhibit regen
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 14, 2023 12:45 pm
by mane2
I think idlemode 4 is hill hold (which did not work either for some reason)
maybe speedkp get rounded to 0 ?
What values should I use if I want to have hill hold and regen working?
Here's a mobile readable link to params.json
https://gist.github.com/amattila/092fc8 ... 4aba5800aa
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 14, 2023 12:57 pm
by mane2
Code: Select all
enum _idlemodes
{
IDLE_MODE_ALWAYS = 0,
IDLE_MODE_NOBRAKE,
IDLE_MODE_CRUISE,
IDLE_MODE_OFF,
IDLE_MODE_HILLHOLD
};
Do you mean idlemode "not set to something", means it's 3/off ?
Why is regen related to idle automation?
Re: Can't get any regen with LDU, help!
Posted: Sat Jul 15, 2023 6:51 am
by johu
Yes, "off" eliminates that culprit. What "udc" are you seeing?
Re: Can't get any regen with LDU, help!
Posted: Sat Jul 15, 2023 7:28 am
by mane2
johu wrote: ↑Sat Jul 15, 2023 6:51 am
Yes, "off" eliminates that culprit. What "udc" are you seeing?
Thanks I'll try that. So I can't have hill-hold and regen at the same time? Or was it just because the speedkp gets rounded to zero? So increasing speedpk, I could have both working at the same time?
Battery voltage (udc) is 216-301V. I haven't been able to plot while driving, as the wifi signal is so weak from inside the inverter that I can only connect to when laptop is at trunk. Well I guess I could leave it there while driving

Re: Can't get any regen with LDU, help!
Posted: Sun Jul 16, 2023 5:26 pm
by mane2
I tested with idlemode=3 (off). Still no regen.
I wonder if my wiring creates this issue. There is constant 12v to start pin. Looking at the code, I can see that this gets executed on every cycle of ms10task.
Code: Select all
if (newMode != MOD_OFF)
{
opmode = newMode;
DigIo::dcsw_out.Set();
DigIo::err_out.Clear();
Param::SetInt(Param::opmode, newMode);
ErrorMessage::UnpostAll();
}
Though it only seems to set some pins high and unpost all error messages. So does not seem to be related..
I'm at loss. How should I debug this? Plot some values?
Re: Can't get any regen with LDU, help!
Posted: Sun Jul 16, 2023 5:30 pm
by catphish
The settings look right to me. It might be worth trying the previous firmware just in case there's a bug. I added a safety feature to the latest firmware that can disable regen, so I wonder if it's possible that this is being trigered for some reason.
Re: Can't get any regen with LDU, help!
Posted: Sun Jul 16, 2023 8:07 pm
by mane2
I actually had the same problem with earlier firmware too. I don’t recall the version it was.
I was able to plot now, keeping the laptop on the back seat. What hit me, was that udc showed 305V! That’s above my 302 udcmax. Quickly pulled multimeter and checked the motor + and - poles, and it showed 287V. Is this normal?
I then tested to up the udcmax to 310V and I was able to see some negative potnom values, but didn’t feel any Regen happening still.
Something is off here

Re: Can't get any regen with LDU, help!
Posted: Sun Jul 16, 2023 8:24 pm
by johu
Ok, seems you need to tune udcgain . It may be hidden. If you don't see it, type "flag udcgain ~hidden" into the custom command field and send it.
Apart from that, -40% should cause considerable regen force. Did you try at very low speed? You set regenrampstr=40 so only at 40 Hz do you get full regen and half at 20 Hz. This doesn't display in potnom to make standstill tuning easier.
Re: Can't get any regen with LDU, help!
Posted: Thu Jul 20, 2023 7:51 pm
by mane2
Thanks! I got the voltage now adjusted. It was weird that udcgain felt reversed, less gain means more voltage. Ended up with udcgain = 8.15.
After that, I upped some regen values and I was able to feel regen happening! Though it's way milder than I'm used to. These are my current settings, but even with these, it's rather mild. I wonder if some of these settings are reversed too?
Code: Select all
"brakeregen": -100,
"regenramp": 50.03,
"regentravel": 30,
"offthrotregen": -94.9,
"cruiseregen": -30,
"regenrampstr": 60,
"brklightout": -10,
What should I adjust to get more regen? I mean when I lift my foot off the accelerator, I'd like to regen to bite more. I think the ramp-speed is ok, just that it could be stronger.
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 21, 2023 6:16 am
by johu
Your regen parameters are so strong now they should throw you out the window. Something still holds it back.
Decrease regenrampstr to 20
Before driving make sure potnom actually reaches the desired negative value
Re: Can't get any regen with LDU, help!
Posted: Fri Jul 21, 2023 1:24 pm
by mane2
I tested with regenrampstr 30, and it wasn't that smooth. Liked 60 better.
I've seen videos with LDU where rear wheels lock because of regen. I'm not even close to that. Going this quite steep downhill in front of my house, speed slightly increases. Would like to get it stronger.. I feel there is still something limiting this..
Potnom goes to all the way -95% that I've configured. So that seems to be working. I'll set that to -100 and brakeregen too. But that's not a big difference.
Re: Can't get any regen with LDU, help!
Posted: Mon Jul 24, 2023 11:40 am
by P.S.Mangelsdorf
mane2 wrote: ↑Fri Jul 21, 2023 1:24 pm
I tested with regenrampstr 30, and it wasn't that smooth. Liked 60 better.
I've seen videos with LDU where rear wheels lock because of regen. I'm not even close to that. Going this quite steep downhill in front of my house, speed slightly increases. Would like to get it stronger.. I feel there is still something limiting this..
Potnom goes to all the way -95% that I've configured. So that seems to be working. I'll set that to -100 and brakeregen too. But that's not a big difference.
Can you provide another full param dump? I'll compare with mine; I remember that a few other parameters were affecting regen strength.
Re: Can't get any regen with LDU, help!
Posted: Tue Jul 25, 2023 5:47 am
by johu
P.S.Mangelsdorf wrote: ↑Mon Jul 24, 2023 11:40 am
Can you provide another full param dump? I'll compare with mine; I remember that a few other parameters were affecting regen strength.
It's in his first post. The odd thing is that potnom reaches -100 during standstill, so that's after all deraters (but before regenrampstr)
The only thing I can see is voltage rising too close to udcmax during regen. A plot of udc and potnom while driving would show this
Re: Can't get any regen with LDU, help!
Posted: Tue Jul 25, 2023 12:12 pm
by P.S.Mangelsdorf
johu wrote: ↑Tue Jul 25, 2023 5:47 am
It's in his first post.
I thought he had made some changes, hence asking for a new param dump. Makes it easier to compare.
Based on the regen settings alone, I agree it should be putting your face through the windshield.
The only major difference I see compared to my parameters, beyond the voltage difference, is that fconst is not in use (ie below fweak), and idcmax is low.
Re: Can't get any regen with LDU, help!
Posted: Wed Aug 02, 2023 1:44 pm
by mane2
I dont' have the most recent params in hand right now, but it's pretty much the same as in first post, but I increased brakeregen to -100 and offthrotregen to -100 too. Trying to max everything.
So, setting udcgain made the voltage right, which made regen to work initially. But I'm not getting more than -25kW of regen at max. potnom goes to -100.
I'll do a plot of udc and potnom when I get to the car. Thanks for suggestions.
Re: Can't get any regen with LDU, help!
Posted: Sat Aug 05, 2023 8:06 am
by mane2
Hey can it be the potmode setting? I have only one pot connected (accelerator) but inverter sees some low value for pot2 too. Looking at the Parameters wiki, it says:
potmode=0 : Pot 1 is throttle and pot 2 is regen strength preset
As inverter sees low number for pot2 in spot values, it thinks that is used for regen strength? I have set pot2min and pot2max to 4095 (default values). Should I set these to something else?
Another problem I was experiencing was the dead zone in the pedal (started another topic on it). That was related to regentravel parameter being 50% for me, so lots of pedal pressing had to happen before car moved. But now, when I turned regentravel off completely, I can't get any off throttle regen - and actually I seem to have slight positive throttle as the car keeps coasting and using about 5kW power even without throttle. Very weird, something fishy is going on here.
Re: Can't get any regen with LDU, help!
Posted: Sat Aug 05, 2023 9:56 pm
by johu
You would see that in potnom never reaching - 100%
Regentravel 0 could be a weird corner case, need to check
Re: Can't get any regen with LDU, help!
Posted: Sun Aug 06, 2023 5:16 am
by Ev8
I think you’ll need to hook up a pot for the the regen, without it the input is floating and will be pulled low,
Possibly should have mentioned earlier you didn’t connect one!
Re: Can't get any regen with LDU, help!
Posted: Tue Aug 08, 2023 10:03 am
by mane2
Ev8 wrote: ↑Sun Aug 06, 2023 5:16 am
I think you’ll need to hook up a pot for the the regen, without it the input is floating and will be pulled low,
Possibly should have mentioned earlier you didn’t connect one!
Do people really connect a pot for regen? I would really love to have working pedal regen, and not adding any pots of paddles to adjust it. When it works well, there is no need for that.
As my pot2 shows value of 27, I changed pot2min to 0 and pot2max to 27 to overcome that, but there was no change in regen. Still always only 26kW regen power and pretty mild. I did not see any change to earlier setting, where I had 4095 for both (min and max).
Re: Can't get any regen with LDU, help!
Posted: Tue Aug 08, 2023 10:07 am
by mane2
johu wrote: ↑Sat Aug 05, 2023 9:56 pm
You would see that in potnom never reaching - 100%
Regentravel 0 could be a weird corner case, need to check
I changed regentravel to 10%, and I was able to get offthrottle regen now too. Definitely something wrong there.
Re: Can't get any regen with LDU, help!
Posted: Wed Aug 09, 2023 12:29 am
by P.S.Mangelsdorf
mane2 wrote: ↑Wed Aug 02, 2023 1:44 pm
I increased brakeregen to -100 and offthrotregen to -100 too.
In my experience, this should be basically undrivable, the regen is that strong. I've got no clue what's going on here.