You should be able to ride some of the derating parameters, however, I have not played with them enough to understand how well they work.
Re: LDU parameter tuning
Posted: Sun Dec 15, 2019 1:00 am
by dougyip
Good results at the dyno. Bottom Line: Max of 317 ft-lbs/353 HP - with low end torque limited by the dyno and conservative tune due to overcurrent errors.
- Max torque/power directly related to Fslipmax
- Fweak greatly affects peak power, not just point of max power. Looks like you would always want to be less than 300.
- Torque drops sharply after Fweak point. Fconst is very useful in boosting torque and power after fweak (thanks Jon Volk)
- With sufficient power at higher RPM stock LDU max RPM can be raised over stock Tesla. We managed to get to 17,250 RPM (fmax=575) but not 18,000 RPM
Effects of Varying FSlipMax (no use of Fconst):
Fslipmin=0, Fweak=275, Boost=1200, Fslipconstmax=Fslipmax, Fmax=550, Fconst=550, udcnom=0
Other pulls using Fconst
30- Jon Volk: Fweak=258, Fconst=450,fslipmin=0.87,fslipmax=3.06,fslipconst=450, fslipconstmax=9. Boost reduced from 1850 to 1500 to keep within dyno current limits.
31- Fweak=275, Fconst=450,fslipmin=1,fslipmax=3.25,fslipconst=450, fslipconstmax=6, Boost=1500
32 - Same as 32 but Boost = 1200
33 - Same as 32 but Fweak = 258
34 - Same as 31 but fslipconstmax=9
Re: LDU parameter tuning
Posted: Sun Dec 15, 2019 1:22 am
by dougyip
Even with ocurlim, iacmax, and idcmax set to be out of play we were still getting overcurrent errors.
With fweak at 350, boost = 1200, couldn't raise fslipmax above 4.5
with fweak at 300, boost = 1200, couldn't raise fslipmax above 4.0
with fweak at 275, boost=1200, couldn't raise fslipmax above 3.75
Any ideas why? I see that Damien is using fslipmax =5 and the EVShop Porsche = 6
Re: LDU parameter tuning
Posted: Sun Dec 15, 2019 11:07 am
by johu
I'm a bit surprised that torque drops off with speed below your fweak. Are you running version 4.55.R or higher?
Lowering fweak OR raising slip means increasing motor current. Thats why you have to compensate on with the other.
I'm not 100% if desat errors are reported reliably on Tesla hardware. So if you say comparator is taken out of the game you might be seing desat errors declared as over current
Re: LDU parameter tuning
Posted: Sun Dec 15, 2019 5:55 pm
by dougyip
Firmware version 4.57.R.
I am attaching a datalog file for run 23 (Fslipmax=4.0,Fweak=275). Pack volt/amps are measured at the battery by our Orion2 BMS, UDC/PotNom/Freq/IDC are logged via CAN from the open source controller. Pack Volts/UDC agree fairly well. There is a huge discrepancy between PackAmps and IDC. Either there is a reading error or huge inefficiencies.
Dyno Run 23
Fweak=275 Fslipmin=1.0 Fslipmax=4.0 Boost=1200
Really great data! Thanks for doing this and sharing.
Was udcnom in use when running my parameters?
Re: LDU parameter tuning
Posted: Sun Dec 15, 2019 7:57 pm
by dougyip
Udcnom was not in use for any of the runs. Your power and torque should be better as two Volt packs have less sag and more Power capacity.
Re: LDU parameter tuning
Posted: Sat Aug 15, 2020 3:17 pm
by jon volk
Alrighty folks.
If you happen to follow my nonsense on Instagram, you'll know Ive been spending a bunch of time tuning the parameters on my LDU for more performance of the past few months. I have been using a Dragy 10hz gps box to record times for comparing changes. Throughout the process, I tried to make all timed runs at similar SOC and battery temps. Tuning for power was done in the same process that I would use for an ICE combination. Increases in 1/8 and 1/4 mph equate to power gains. If a change did not net any improvement, it was reset to the previous value. Similarly, 60' time and 0-60 were used as measures for not just power, but how effectivly/aggresively it was delivered.
For context, the attached JSON file are the parameters I run in my 3,150lb with driver E30 with a standard base Tesla large drive unit and two Chevy Volt battery packs in parrallel. The car so far has been 3.0 seconds 0-60mph (2.81 if comparing with 1' rollout the magazines use) and 11.02@120mph 1/4 mile. This is on a 26x8.5" bias ply drag slick. There is a bit more power to be had, but I'm out of traction at this point.
Some basic notes/observations on the parameters and tuning them for your own combo.
Boost: This is one I struggled with a bit and now ultimately map over CAN based on pot value. More on that later. The LDU does NOT like higher boost values under any sort of high load, low to mid throttle input. Running a boost value at say 1700 or higher would result in overcurrent shut downs when attempting to start up a steep hill or a quick throttle transition shortly after inverter startup. I had also chased a low-ish parking lot speed oscillating surge that was downright annoying at times. Both of these issues have since gone away for good when setting boost to a lowly 1400.
Fweak:The LDU makes a bunch of torque. More than most reasonable cars can use. Fweak is really the key to regulating where in the rpm range the power is delivered. For me 238hz will stick my slicks and net the above posted acceleration times almost every hit. Bringing this to 233hz will just burn the slicks. 258hz worked well for me on street radials.
Fcost/Fslipconstmax:I've found these values net the highest 1/4 mile mph. There is not much point in changing these as you will not likely find any gains and reduction will only hurt higher speed freeway/highway/motorway performance.
Fslipmax: I run a parameter value of 3.18 to 3.3. Dont be fooled if you compare this to the parameter files on Damiens Github. With UDCnom factored in, this value is really 4.0-4.5 under voltage sag. Higher value=more power. Going too high will slam an overcurrent trip. Value needs to be a bit lower if battery temps are over 95-100F on a full SOC for me. I'm presently working on mapping this.
IDCmax: This is the DC current limit and a good parameter to use as a power ceiling and preventing overcurrent trips. I can get away with a slightly higher fslip value if this is used effectively. I do not have a standalone current sensor, but based on the hp calculated by mph and weight, I believe the DC current values shown in the software are roughly 50-60% of actual. Particularly what Tom has said they've seen their skyline pull for amps. All I know is the trap speed and weight of the car calculate to more power than the software says is being used. As such, an IDCmax of 760 seems to work well for me.
Throtramp:This is really a subjective setting but can be used to fine tune launching the car at WOT. If you go WOT while holding the brake and then release the brake pedal. Throtramp will control how fast throttle is applied. Think of it as another tool to control the onset of low end torque. I run anywhere from 65-75 and adjust based on tire temp. For regular driving, Id start off around 5 and move up from there if you want.
Idle:My parameters have a brake-off idle that will roughly simulate an ICE motor and cruise around a parking lot around 10-15mph without throttle input. Ive found this to be the most natural and comfortable setup. Be warned, boost, ampmin, slipstart, and idle throttle limit all play into how the car behaves in idle. If you start chaning these, it may take some playing with to get a satisfactory performance.
Regen: I use a 0-5v pressure transducer to control regen. The harder I press the brake, the more the motor regens. I do not have it set up to do any "one foot" driving off throttle regen. When driving the car hard, this feels most natural to me. It also feels more efficent being able to just coast throttle off. I have no emperical data on that. I just "feels" better. I believe Porsche didnt do any, or very little at most, throttle off regen on the Taycan for whatever thats worth. If you want throttle off regen, you are on your own with those settings.
Overcurrent faults: I've beat the shit out of my inverter and hit overcurrent shut down more times that I care to count in exploring how far I can take this thing. So much so that I had written a function meant to auto retart the car if it hit a fault. Doing so brought to light that these overcurrent events are more than likely desat faults from a gate driver on one or more inverter phases. I discovered this when the openinverter board would transition back into a run mode, but no PWM generation in the inverter woudl take place without a power cycle. This pointed to the issue being a Tesla hardware sourced fault rather than openinverter software triggered. From my original LDU with a bad IGBT that never turned an rpm in anger, I know that a desat fault will show as "overcurrent" in the software.
UDCnom: Ive posted this spreadsheet before, but here it is again so if you decide you want to deviate from my 390 value, you can see how it will affect other parameters. You can also input throtramp value and itll tell you how long in seconds from 0 to 100% throttle to compare scenarios.
CAN mapped boost: Running a measly 1400 for boost means there is some degree of decreased perfromance up higher. Its still more than enough power to kill yourself if you're not used to decently quick cars, but not gonna cut it for me. To deal with this, I map boost to pot value over CAN. The following code is on a Teensy3.6 with flexcan and works very well. My pot min and max are 830 and 4095, respectively. I map boost from 1400 to 1840 between pot values 3700 and 4095. This allows me to get full axle abusing startup torque when holidng WOT and brake on, yet smooth reliable take off on inclines or otherwise with lower throttle input. I had to mess with the range and scaling a bit to get the transition I wanted, but the below works well for me.
Im only including the mapping function as there is enough elsewhere on the site in regards to mapping CAN values.
Jon, this is amazing information! This much context is truly appreciated.
This will easily save myself (and others) months of headaches. We all owe you a drink or 5.
Re: LDU parameter tuning
Posted: Sun Aug 16, 2020 7:42 am
by Boxster EV
Very useful post and summary, Jon.
Further to our separate discussions, I have two pieces of feedback from my testing over the past few days:
My OC issues which have been a nuisance from the beginning, but since dropping the BOOST parameter to 1375, they seem to have a gone. I can pull away at any speed and on any steep gradient without tripping. There has been just one exception: During some testing yesterday with 50% charge, I changed direction quickly (R to F), went to pull away hit OC.
I still need to drill into IDLEMODE. As you’ve previously reported, having it set to ON, seems to help and makes the car feel like an OEM auto. However when I enable that parameter and set IDLESPEED into a positive number it works as expected. However when I power-cycle, the logic board won’t close the positive contactor.
Re: LDU parameter tuning
Posted: Sun Aug 16, 2020 7:59 am
by Jack Bauer
Thanks for your hard work Jon. I never try to promote the Openinverter Tesla board as being better than other solutions despite them seemingly being quite happy to do the reverse. However, your efforts have proven beyond any doubt that there is no loss of any "Tesla Magic". It really is the EV version of a standalone ecu.
Re: LDU parameter tuning
Posted: Sun Aug 16, 2020 8:13 am
by johu
Boxster EV wrote: ↑Sun Aug 16, 2020 7:42 am
There has been just one exception: During some testing yesterday with 50% charge, I changed direction quickly (R to F), went to pull away hit OC.
Yes, quick direction changes were never a development goal since mister lead developer uses the mechanical transmission to change direction
Boxster EV wrote: ↑Sun Aug 16, 2020 7:42 am
I still need to drill into IDLEMODE. As you’ve previously reported, having it set to ON, seems to help and makes the car feel like an OEM auto. However when I enable that parameter and set IDLESPEED into a positive number it works as expected. However when I power-cycle, the logic board won’t close the positive contactor.
That is intended and also happens in OEM vehicles. As soon as idle mode is enabled you need to press the brake pedal to start.
Boxster EV wrote: ↑Sun Aug 16, 2020 7:42 am
There has been just one exception: During some testing yesterday with 50% charge, I changed direction quickly (R to F), went to pull away hit OC.
Yes, quick direction changes were never a development goal since mister lead developer uses the mechanical transmission to change direction
Boxster EV wrote: ↑Sun Aug 16, 2020 7:42 am
I still need to drill into IDLEMODE. As you’ve previously reported, having it set to ON, seems to help and makes the car feel like an OEM auto. However when I enable that parameter and set IDLESPEED into a positive number it works as expected. However when I power-cycle, the logic board won’t close the positive contactor.
That is intended and also happens in OEM vehicles. As soon as idle mode is enabled you need to press the brake pedal to start.
Thanks for the steer. I’ll give it a whirl.
To continue enhancements in firmware development happy to support through Patreon.
Re: LDU parameter tuning
Posted: Sun Aug 16, 2020 1:56 pm
by jon volk
Jack Bauer wrote: ↑Sun Aug 16, 2020 7:59 am
Thanks for your hard work Jon. I never try to promote the Openinverter Tesla board as being better than other solutions despite them seemingly being quite happy to do the reverse. However, your efforts have proven beyond any doubt that there is no loss of any "Tesla Magic". It really is the EV version of a standalone ecu.
Thanks Damien. Like a traditional standalone, its more work up front and theres plenty of opportunity to mess things up, but the control-ability over multiple platforms is way more appealing to me.
Re: LDU parameter tuning
Posted: Sat Sep 12, 2020 11:49 pm
by Roadstercycle
Hi, I am trying to change a couple parameters on my LDU but it seems they will not save. It has worked fine in the past and I'm getting a good wifi signal. I change one setting at a time then hit enter, refresh page and it is OK. Then cycle power and then it's back to the original setting. Any one else had this issue. I've tried 2 computers to eliminate that possible issue of the enter button not working. Any ideas?
Re: LDU parameter tuning
Posted: Sat Sep 12, 2020 11:52 pm
by jon volk
Did you click save to flash at the top of the page?
Re: LDU parameter tuning
Posted: Sun Sep 13, 2020 12:24 am
by Roadstercycle
Jon, Thank you, I'm sure that's it. Just forgot, it's been awhile since I played with the parameters but your latest parameter post and explanation got me motivated to see if I can do a little better... Again thank you.
Re: LDU parameter tuning
Posted: Sat Feb 12, 2022 8:39 pm
by P.S.Mangelsdorf
I've begun to dig into optimizing the tune for my car. I started out with Jon's updated parameters and tuning guide, and the first major change was to adjust the udcgain because it was way off and causing issues with regen, phantom spinning etc.
Since this change, I now slam into an over current fault whenever I stand on the throttle. I think I need to adjust the current limit, but I first started examining how far off the current reading was from reality. Based on comparisons to my ISA shunt, output via the CHAdeMO web interface, the LDU is reporting a calculated idc of roughly 16% of what the ISA shunt is seeing. Being that it is this far off, I'd like to get the current reading correct before playing with settings.
I assume the adjustment needs to be in the two current sensor gains, but because those are on the AC side, I don't have a good way to figure out how far off they are.
Has anyone figured out what the current gains need to be for a base LDU?
Re: LDU parameter tuning
Posted: Sat Feb 12, 2022 8:41 pm
by jon volk
I should probably update the parameters now that there’s been some fundamental change to the newest firmware with fweak stuff.
Re: LDU parameter tuning
Posted: Sat Feb 12, 2022 8:43 pm
by P.S.Mangelsdorf
jon volk wrote: ↑Sat Feb 12, 2022 8:41 pm
I should probably update the parameters now that there’s been some fundamental change to the newest firmware with fweak stuff.
I'm still running the 4.97 firmware at the moment, but I (and I'm sure others) would appreciate it. Your parameters were a great starting point since I'm running a similar setup.
Re: LDU parameter tuning
Posted: Sat Feb 12, 2022 8:47 pm
by johu
There will be an update to idc calculation in the next release, I think the current calculation is like 30% off. But yours seems 600% off? Default ilXgain is 1 for LDU boards, that would mean 2048A maximum swing. Sounds plausible actually, no?
Re: LDU parameter tuning
Posted: Sat Feb 12, 2022 8:51 pm
by P.S.Mangelsdorf
johu wrote: ↑Sat Feb 12, 2022 8:47 pm
There will be an update to idc calculation in the next release, I think the current calculation is like 30% off. But yours seems 600% off? Default ilXgain is 1 for LDU boards, that would mean 2048A maximum swing. Sounds plausible actually, no?
Seeing as my ilgain setting is currently 4.68, that's way different than 1.
Edit to add: fixing this seems to have me at least close to the ballpark in terms of DC current reading.
Re: LDU parameter tuning
Posted: Sat Feb 12, 2022 9:57 pm
by P.S.Mangelsdorf
So I took the car out to make a few pulls, and tried several different settings. I continue to slam an overcurrent fault when launching hard. It feels like it is occurring right as the throttle ramp ends, i.e. when it should be delivering full power.
Oddly (to me at least), it also shows an encoder fault when it trips the overcurrent fault (see below screenshots below, yes this is from this event, I cleared the errors before the test).
The screen shots are from an attempt with idcmax of 740, but I tried as low as 700 with the same results.
Anyone see something glaringly wrong or do I just need to keep pulling back?
Re: LDU parameter tuning
Posted: Sun Feb 13, 2022 12:16 am
by Isaac96
idcmax is a pretty slow limiter, probably won't prevent an OC event. It's more often used for reducing power long-term to protect batteries, and even then only works well with FOC (and thus PM motors).
Raising fweak might do the trick, as it will move power delivery further to the right on a torque curve.
Mr. Volk's modified software with the new parameters made significant driveability improvements to my SDU-powered vehicle (before the third inverter blew), it ought to improve your experience a lot.