Page 1 of 1

Inverter Firmware 5.27.R

Posted: Thu Jun 01, 2023 6:16 pm
by johu
Yay, new release. This is the first one with catphish code, very thankful that he now maintains sine code.

When upgrading to this version your canspeed will be off by one, as the new speed 125k has been added. You need to manually set it to the desired speed again.
As always there is the possibility of overspeeding the motor especially when it's unloaded. Set fwcurmax=0 for unloaded tests.

  • Removed ManualMode in FOC, now always adding manualid and manualiq to controller calculated values
  • Added manualstart parameter, has the same effect as pulling start pin high
  • Don't apply backwards regen if motor is already turning backwards
  • Make sine output filter "filterConst" a configurable value "sinefilter"
  • Improve ilMax calculation
  • Add an option to scale voltage and slip simultaneously with throttle
  • New CAN module:
    • gain factor is now in floating point format, no more awkward multiplication by 32 for RX items
    • More than 8 items can be mapped to one message
    • An optional offset can be added between -128 to 127
    • Various commands (save, load, stop) can be issued via CAN (see here: viewtopic.php?t=2907)
    • Full json parameter dump available via CAN
  • Make maximum modulation index variable to allow over modulation
  • Bugfix: tmpm and tmphs were unfiltered
  • Added separate proportional gain parameter for id-controller
  • Scale creep torque with inverse brake pressure (if brake pedal configured)
  • Corrected ids of id/iq to make it mappable to CAN
https://github.com/jsphuebner/stm32-sin ... ag/v5.27.R

As always I haven't published sine binaries on github until somebody tests them

Re: Inverter Firmware 5.27.R

Posted: Sun Jun 04, 2023 11:17 am
by arber333
johu wrote: Thu Jun 01, 2023 6:16 pm Yay, new release. This is the first one with catphish code, very thankful that he now maintains sine code.
As always I haven't published sine binaries on github until somebody tests them
Hi i have just tested this code version in Mazda. I never had a chance to test the previous version though.
I am rather pleased with behaviour at low RPM. It actually takes effort to reduce vibration because of transmission backlash.

My hardware:
ACIM motor 28kW at 260Vdc
AB encoder
400A IGBTs
maxC=400A
overcurrent -600A
single throttle
no CAN

My observations:
- smooth takeoff just after braking to full stop!
- generally smooth takeoff
- after RPM rise there is grumbling from the motor. Sounds like sine is skewed a bit. Previous version 5.20R had no grumbling.
- that grumbling sound is present when hard accelerating from more than 2000rpm, DC amps from 120A - 200A
- what is sinecurve? I have tried it at "voltage" as well as "simultaneous" and the latter gives less grumbling apparently

Let me know which parameters you would like me to record.
params.json
(1.54 KiB) Downloaded 194 times

Re: Inverter Firmware 5.27.R

Posted: Sun Jun 04, 2023 5:24 pm
by catphish
arber333 wrote: Sun Jun 04, 2023 11:17 am - what is sinecurve? I have tried it at "voltage" as well as "simultaneous" and the latter gives less grumbling apparently
Sinecurve is a feature I added. It changes the way voltage and slip increase with throttle:

* VoltageSlip - this is the default and the original behaviour from older versions. The first half of the throttle increases voltage but keeps slip at fslipin. Then the second half of the throttle increases slip up to fslipmax.
* Simultaneous - this new behaviour increases slip and voltage at the same time across the whole range of the throttle. I added this because I suspected that current and slip should increase proportionally, and for me it seemed to provide smoother throttle response.

I will add this new parameter to the wiki.

Re: Inverter Firmware 5.27.R

Posted: Sun Jun 04, 2023 7:08 pm
by arber333
catphish wrote: Sun Jun 04, 2023 5:24 pm Sinecurve is a feature I added. It changes the way voltage and slip increase with throttle:
...
I will add this new parameter to the wiki.
Well thanks.

It seems i get smoother start when my regen setting is at 30%. If more car starts to lurch again just before stop.
That growling or shaking at acceleration seems to be aclimit in effect. Seems my motor maxslip wants to pull more than 400A and inverter tries to cut that off. I am not sure how to smooth that off as it is quite disturbing when accelerating.

Re: Inverter Firmware 5.27.R

Posted: Sun Jun 11, 2023 5:26 pm
by johu
Thanks for testing, I published the sine binaries now.

Re: Inverter Firmware 5.27.R

Posted: Sat Jul 01, 2023 6:13 pm
by Bratitude
switch direction when coasting still deliver torque in the wrong direction. ie if coasting forwarded and switch to rev it'll pull forward when throttle is pressed

Re: Inverter Firmware 5.27.R

Posted: Sat Jul 01, 2023 10:06 pm
by johu
It will only accept a direction change below dirchangerpm.

Re: Inverter Firmware 5.27.R

Posted: Sat Jul 01, 2023 11:35 pm
by catphish
johu wrote: Sat Jul 01, 2023 10:06 pm It will only accept a direction change below dirchangerpm.
I always assumed it would go into neutral and stay there. Maybe that would be a safer behaviour in that case.

Re: Inverter Firmware 5.27.R

Posted: Sat Jul 01, 2023 11:50 pm
by Romale
I forget to ask if the description of the parameters has been updated? after all, a lot has been added, some have been renamed, and some have disappeared. or maybe it is in some new place?

Re: Inverter Firmware 5.27.R

Posted: Sun Jul 02, 2023 3:53 am
by Bratitude
johu wrote: Sat Jul 01, 2023 10:06 pm It will only accept a direction change below dirchangerpm.
🤦🏼‍♂️ thanks. I’ll update wiki

Re: Inverter Firmware 5.27.R

Posted: Sun Jul 02, 2023 6:08 am
by johu
Some code says more than 1000 words:

Code: Select all

   if (!(Param::GetBool(Param::din_forward) ^ Param::GetBool(Param::din_reverse)))
      selectedDir = 0;

   if ((int)Encoder::GetSpeed() < Param::GetInt(Param::dirchrpm) && !potPressed)
      selectedDir = userDirSelection;
Neutral selection is immediately applied while forward/reverse go via userDirSelection. And userDirSelection is only applied below dirchrpm.
So catpish is right, the intended behaviour, if you drop it to neutral is to stay in neutral until motor drop below dirchrpm and throttle is not pressed.
@Bratitude, what value is that parameter on yours?

Re: Inverter Firmware 5.27.R

Posted: Sat Aug 26, 2023 1:19 am
by Bratitude
johu wrote: Sun Jul 02, 2023 6:08 am Some code says more than 1000 words:

Code: Select all

   if (!(Param::GetBool(Param::din_forward) ^ Param::GetBool(Param::din_reverse)))
      selectedDir = 0;

   if ((int)Encoder::GetSpeed() < Param::GetInt(Param::dirchrpm) && !potPressed)
      selectedDir = userDirSelection;
Neutral selection is immediately applied while forward/reverse go via userDirSelection. And userDirSelection is only applied below dirchrpm.
So catpish is right, the intended behaviour, if you drop it to neutral is to stay in neutral until motor drop below dirchrpm and throttle is not pressed.
@Bratitude, what value is that parameter on yours?
100.

have to come to a full stop or it'll keep going in the same direction

Re: Inverter Firmware 5.27.R

Posted: Mon Sep 04, 2023 5:26 pm
by Audia2electric
Help!
5.27 uploaded to v.6 tesla sdu board. Before upload (5.20) I also activated hillhold and changed idlethrottlim from 50 to 60. After cycle off/on my parameter set is different…I dont have parameterset started with -Motor->
0 boost
1 tweak

As soon as I activate drive inverter clicks and overcurrent is present. Have I uploaded wrong file? see attached..
Returning from hillhold and idlethtrottle don’t help!
Just got car running again with proper coolant flow and pump…shouldnt mess with working system😕

Re: Inverter Firmware 5.27.R

Posted: Mon Sep 04, 2023 5:48 pm
by Romale
Audia2electric wrote: Mon Sep 04, 2023 5:26 pm Help!
5.27 uploaded to v.6 tesla sdu board.

shouldnt mess with working system😕
you made a gross mistake and flashed the firmware from the synchronous motor into the asynchronous)) download and update to the firmware marked sine!

Re: Inverter Firmware 5.27.R

Posted: Mon Sep 04, 2023 8:21 pm
by Audia2electric
Thanks! Prblm solved! Changed to sin file. Testrun showed very smooth in low acceleration but cutoff probably overcurrent not letting me go hard on throttle. Changed back to 5.20
Any parameter changes needed to be able to run 5.27?

Re: Inverter Firmware 5.27.R

Posted: Tue Sep 12, 2023 10:48 am
by johu
catphish wrote: Sat Jul 01, 2023 11:35 pm I always assumed it would go into neutral and stay there. Maybe that would be a safer behaviour in that case.
Just quoting you so you get a bell :) Any idea on the above?

Re: Inverter Firmware 5.27.R

Posted: Tue Sep 12, 2023 12:08 pm
by Romale
johu wrote: Tue Sep 12, 2023 10:48 am Any idea on the above?
switching to neutral when switching off the sw forward should clearly work immediately, regardless of what the motor speed is (isn't that the case now?) but the reverse gear, when turned on, turns on at speeds below those specified in the value (it seems to work like that, I personally used the value of 1000 rpm)

Re: Inverter Firmware 5.27.R

Posted: Wed Sep 13, 2023 12:23 am
by catphish
Audia2electric wrote: Mon Sep 04, 2023 8:21 pm Thanks! Prblm solved! Changed to sin file. Testrun showed very smooth in low acceleration but cutoff probably overcurrent not letting me go hard on throttle. Changed back to 5.20
Any parameter changes needed to be able to run 5.27?
The immediate problem here is that your fweak value is much too low. Lower fweak = more current. For reference, here is my SDU tune:

Code: Select all

boost = 3200
fweak = 230
fslipmin=1.5
fslipmax = 3.0
fslipconstmax = 3.0
Increase fweak to 250 and go from there.

Re: Inverter Firmware 5.27.R

Posted: Fri Jan 12, 2024 6:29 am
by Audia2electric
Thanks!
I’ll go back to 5.27 and adjust params when its time to start using car when spring and warmer weather is back.
I drive an 2010 Volvo V50 D2 when I cant use the Electric Audi so I really start to miss the little beast now😁
/Mattias