Inverter Firmware 5.24.R

Post Reply
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Inverter Firmware 5.24.R

Post by johu »

After a very long time it seems that IPM motor support is finally complete with high speed operation now safely possible.

This firmware (well 5.20.R also) in its FOC flavour is the first one to send current to your motor that is NOT related to your throttle input. If you use a poorly tuned syncofs or randomly play with syncadv your car will end up self-accelerating in the upper rev range. Before putting your car to regular use, make sure that is not the case. Be prepared to brake hard!

https://github.com/jsphuebner/stm32-sin ... ag/v5.24.R

No sine release this time as nothing relevant happened there.
  • Removed curkifrqgain, it seems no longer needed and creates confusion
  • Added binstream command (binary streaming of real time data)
  • PWM overflow fix in FOC implementation
  • Limit iq at the same rate that ifw is ramped up
  • Limit id MTPA at the half the rate that ifw is ramped up
  • Replaced field weakening controller with simple IIR filter which is smoother
  • Do not disable PWM when stationary with Prius Gen2 inverter
Some key observations on the parameters
  • high inductance motors, such as Prius or MGR need also have higher winding resistance and this need high curkp, around 500 or so
  • low inductance and thus low resistance motors need low curkp, around 50
  • curki seems not to need the same amount of tweaking, I run the Prius motor with 10000 and the Leaf motor with 20000
  • syncadv is always 10, I don't think there is a reason for changing it (not sure if it should even be a parameter)
  • fwcurmax is the critical current needs some math or trial and error. I run -100A on the Prius and -500A on the Leaf motor
  • vlimflt should be 10 or higher, maybe some extreme use cases need modifying this
  • vlimmargin should be around 2000 (not sure if it should even be a parameter)
  • fluxlinkage is used for MTPA, see example here: viewtopic.php?p=48358#p48358
  • lqminusld needs measuring motor inductances (also somewhere in the IPM thread). Is set to 0 for SPM motors. For IPM motors, if you're too lazy to measure set to 1 or so. Might give away some efficiency and performance but not a huge bit
Please test an report back.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
RetroZero
Posts: 702
Joined: Tue Oct 29, 2019 2:48 pm
Location: France
Has thanked: 311 times
Been thanked: 38 times
Contact:

Re: Inverter Firmware 5.24.R

Post by RetroZero »

👍, might just give it a test @ 200v. Huge thanks again Johu and Pete!!
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Inverter Firmware 5.24.R

Post by Romale »

So, there are probably broken things here. yesterday I installed this firmware and the settings file from tauran in a green buggy for tests from 360 volts.

1) first, starting the charging boost mode via a diode bridge from the 220 network gave 85 amperes of current in the 220 line!! (the setting in the inverter is 20 amps, on the previous setting it worked fine correctly) I lowered the charge current in the setting to 10 amps and there was 50 amps on the 220 line!

With that, I finished checking the charging and moved on to the next stage.

2) if you just turn everything on, then the buggy was driving. with the hubs hung out and the wheels removed, I pressed the gas several times, adjusting the regen using an external variable resistor. once when I pressed the gas hard, I got an uncontrolled acceleration and had to press the brakes hard to stop.

3) having received this uncontrolled acceleration, I thought that it was worth adjusting the angle of the offset of the syncofs , however, there was a failure here. manual run was turned on, but it did not start the contactor. I disconnected the high-voltage battery and connected the 72 volt motorcycle battery directly to the controller, I also changed the operating voltage thresholds in the settings, started the manual run, however, no manipulations with changing the angle and adding manual current caused the motor to rotate.

4) having suffered the third fiasco, I decided to try to drive into the hill with the default angle of the sincofs (after all, the buggy used to go with this setting), but on the first attempt I got a probable overload of the inverter and the failure of the power modules with a desat error. This is the end of the experiments with the new firmware. I must add that it drove perfectly on a straight road!

one clarifying question, why is the current sensor setup now 2.31 instead of 1.68? is this correct for nissan leaf gen2, could this be the reason for the huge charging current?
evil neodymium :twisted:
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware 5.24.R

Post by johu »

Strange with the charging, the behaviour is unchanged with the Prius inverter. Please attach your parameters. Also put in your signature (or every post) the hardware you're using, I can't remember everyones setup here.
2) Unwanted acceleration with unloaded motor is now unfortunately more probably than before, as we are injecting throttle independent current. The slightest misalignment will cause a small amount of torque, enough to spin up the unloaded motor. Needs a solution I guess, like faulting out at fmax+x Hz.
3) Manual Run never turns on the contactor. So going from Off to ManualRun your current commands were ignored? Will test this later
4) Could be caused by change in curkp. Did you change it?

The sensor gains are hardware dependent, you shouldn't overwrite your own setting. I have changed it in the reference parameters to match the ratio of the mini-mainboard based Leaf kit.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Romale
Posts: 441
Joined: Fri May 20, 2022 4:16 pm
Location: Romania
Has thanked: 204 times
Been thanked: 45 times

Re: Inverter Firmware 5.24.R

Post by Romale »

I used the Nissan leaf gen 2 kit (motor + inverter + v3 board) and slightly modified settings from your tauran (changes in gas pedal control and pinswap 4), yes, the manual ran did not respond to commands.
parExTract.json
(1.47 KiB) Downloaded 201 times
evil neodymium :twisted:
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware 5.24.R

Post by johu »

Ok, running the same parameters as me. Please change ilXgain back to 1.7 when running on the V3 mainboard. Because now your throtcur is essentially 7.5A (factor 2.3/1.7) or 755A RMS. That will trip the inverter.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Dusty4
Posts: 83
Joined: Tue Dec 25, 2018 12:41 pm
Location: Western Australia
Has thanked: 11 times
Been thanked: 7 times

Re: Inverter Firmware 5.24.R

Post by Dusty4 »

Hey Guys,
Just went for a short run with the new firmware in my beetle running the leaf motor/inverter. First impressions are brilliant! Power delivery was smooth through out the rev range and same for regen. Looking forward to go for a longer drive tomorrow 😁 Big thanks to Johannes, Pete and anyone whose contributed you guys are legends!
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Inverter Firmware 5.24.R

Post by Bigpie »

Not tested this yet on my car, not sure what the formula for calculating fwcurmax is?
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
User avatar
johu
Site Admin
Posts: 5683
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware 5.24.R

Post by johu »

@Dusty: thanks, good to hear!

@BigPie: that's how I found it: viewtopic.php?p=47564#p47564 (only there is no manualifw anymore, would need to use manual mode and find which manualid eliminates changes of uq with frequency)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

hi all,
i have a triumph spitfire with a mitsubishi generator as a motor and i was running it on the stock inverter. this was working super smooth but I felt like there was more in the motor so i gave the openinverter a try, i got the mini mainboard and put it in a opel ampera inverter. i got it running on the bench before on firmware 5.14, now the inverter is in the car i updated to the 5.24R version. it was a bit of a fight but i finally got it running, and how is it running!? the motor has a LOT more power so i'm supper happy. but i have a couple of questions, first i don't get the regen working. i do run the throttle via the CANbus so maybe that has something to do with it? i mapped it correctly i think, the first part of the throttle is doing nothing because that is the regen part i assume? and after the first part i got the potnom from 0 to 100%. is there something i'm overlooking here?
secondly, if I give it a lot of throttle and the motor speed starts to increase. the Id current starts to oscillate and eventually trips the overcurrent. if i lower the throtcur then it won't trip but i can still see the Id oscillating. i can simply rase the ocurlim but eventually something will break. it looks like the oscillating starts with RPM and not especially with current, is this normal or can i do something with tuning to prevent this? so the Id line starts nice but af the speed of the motor goes up during the graph the oscillating starts.
Id current graph
Id current graph
settings dump:
Schermafbeelding 2023-03-08 om 17.14.21.png
Schermafbeelding 2023-03-08 om 17.14.04.png
to be clear, I'm already very satisfied with the performance now, but I mainly wonder if that oscillation is normal

thanks in advance for the help
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Inverter Firmware 5.24.R

Post by Pete9008 »

I'm assuming that this is a permanent magnet motor from you captures and that you have syncofs corretly tuned? If so then it looks like you need to get the lqminusld, flux linkage, fw current and kp/ki values tuned to your motor.

Do you have any more details on the motor or a way of measuring the motor inductances? Alteratively if you can run and log the motor use you can use the calculator to work them out https://openinverter.org/forum/viewt ... p?t=3047

Once you have those set up right ki and kp need tuning, you can either do this by trial end error, start from values people have used on motors with similar values or use the simulator to see what type of value might work well https://openinverter.org/forum/view ... ?t=2611
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Inverter Firmware 5.24.R

Post by Bigpie »

It's the same motor that I have (do you have build thread/videos btw? interested in how you've used the ampera inverter too)

My params
params (8).json
params (8).json
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Inverter Firmware 5.24.R

Post by Pete9008 »

Bigpie wrote: Wed Mar 08, 2023 6:16 pm It's the same motor that I have (do you have build thread/videos btw?)

My params params (8).jsonparams (8).json
Oops, brains not working today, of course it is! I was thinking Mitsubishi industrial motor for some strange reason :oops:

In that case your Ki is probably way too high for such a low inductance motor.
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

thanks for the fast replays!
my syncofs is correct I think, I followed Damians video for tuning this and also read the wiki about this. motor is not turning in manual mode if I put some Id current, up to 100A or so. what strikes me is that the margin appears to be quite large at 14000 the motor was slowly turning one way and at 22000 it was slowly turning the other way, all the values in between is the motor not spinning so I put 18000 in there because that is the middle. that was my thought. maybe if I tune the other values you suggested I can redo the syncofs tuning.

@Bigpie, so all the values Pete9008 suggest are already in your params? I'm looking forward to test this in the next days if I found some time.
I'm planning to make a post with my build but until now I haven't had the time for this. but the ampera inverter looks very nice and is compact, the mitsubishi inverter looks like a beast compared. also it is extremely simple to control, 2 identical stages inside. only 5 volt and the 6 Pwm signals needed, only thing is that the signals are inverted. I used a simple inverter ic for this(I know you can do this in software but I like it more in hardware, because of the startup state of the open inverter mini). also the current sensor is plug and play, 850 amp if a remember and 2,5 volt is 0 amps. IGBT's are 600v and 650 amps if a remember it correct. ooh and it is also very cheap!
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

oh and any idea about the regen not working?
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Inverter Firmware 5.24.R

Post by Pete9008 »

Not sure Bigpie's link above is working but they are also listed here https://openinverter.org/forum/view ... #p53764

He's spent a lot of time tuning these so they should be an excellent base to work from. Obviously keep your own installation specific values as they are and just copy across the motor specific ones from Bigpies parameters.
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

Perfect, I give the parameters a try and let it know if I have succes.
I'm going to dive into the links you send for tuning the parameters and what they do.
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

hi,
i have tested the parameter settings from bigpie, the. motor runs smoother and better especially from a standstill so i'm happy. it had so much power that it broke the coupling so i need to redo it, so that caused some delay. but the Iq current oscillation is still happening, it is less but it is still there and trips the overcurrent eventually. do you have any idea what is causing this? I would guess it's in the current control loop, but then i only have the curkp and kurki to work with?


the regen is working btw, idle mode setting was not set.
Schermafbeelding 2023-03-14 om 14.24.15.png
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Inverter Firmware 5.24.R

Post by Pete9008 »

That does look like a current loop stability issue. It also looks suspiciously like an instability I've been chasing when using the simulator recently (see https://openinverter.org/forum/v ... 69#p53769 ) but to date hadn't seen any evidence of it happening in real life. What speed does it start to happen? Is it anywhere around 550Hz ( 8000rpm)? Is it present in both Iq and Id?

This is going a bit off topic now so it would probably be best to start a new thread specific to this issue.

Edit - or even better a build thread - would be great to have a few more details and some pictures of your car :)
User avatar
Bigpie
Posts: 1585
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 74 times
Been thanked: 299 times

Re: Inverter Firmware 5.24.R

Post by Bigpie »

What throtcur are you using? Interesting that you find it very powerful,. Not plotted my currents with 5.24, I should get round to it.
VW Beetle 2003
Outlander front generator
Prius Gen 3 inverter (EVBMW logic board)
Outlander charger
3x Golf GTE batteries
Chademo Charging
Outlander water heater
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

@pete9008, we need to set it on hold for now. I exchanged the Opel inverter with the Mitsubishi, because I had already built it neatly into the car. but unfortunately this causes some extra problems. I had it driving but still had some problems but now the wifi is almost non-existent. I can just connect to the wifi but the page usually doesn't come and when it comes there is no data. wifi bricked? that would be a pity because it is a lot of work to develop it. I can reach 192.168.4.1/wifi and /page and /update so there is some activity. so i have to fix that first before i can continue, is there any way to re-flash the wifi over wifi or isn't that my problem here?

@Bigpie, I mean compared to how it was, with the original inverter I had a 0 to 100 time of 22 seconds. after some tuning I have now been able to get that to 11. and then I may have to turn the throttle in when the rudders rise because of the oscillation. so there is even more potential. and I'm talking about a car of 850 kilos or something.
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

wifi issues solved, so back to driving again. as said earlier, I had done the previous tests with the opel inverter but now i put the mini openinverter board in the Mitsubishi outlander front inverter. so i got it running again, i tested the output stages with low voltage and measured it with a scope and all 3 outputs pull and push so that's good. next i calibrated the current sensors and got a nice responsive trace in the graph. the i calibrated the resolver and i got a spinning motor with working regen again. but the strange thing is that it is really overcurrent happy, and the strange thing is that in forward the overcurrent triggers a lot faster then in reverse. for example i set the overcurrent to 500 amp and i gave a little throttle the car starts to roll but if i want a bit more power then it cuts out in overcurrent fault. but if a trace the il1 and il2 then the phase current is far from the 500 amp, also if i push the throttle very gentle. and in reverse this is not happening or at least a whole lot later. as fas as i understand is the current limit a hardware limit on the inverter board and if the current got higher then the reference voltage the opamp triggers and shuts the PWM stage of the microcontroller off. do i need the set the max current higher or is there something wrong in my setup? could this problem be resolver related? in manual mode i can push the id current to 100 amp without a turning motor so i think this is good.

or is my mini inverter board just overcurrent happy?:P

looking forward to your opinion on this, and thanks in advance for your thoughts!
Pete9008
Posts: 1801
Joined: Sun Apr 03, 2022 1:57 pm
Has thanked: 102 times
Been thanked: 347 times

Re: Inverter Firmware 5.24.R

Post by Pete9008 »

You're not providing much data to go on but my first guess would be that your 0A reference on the current inputs might not be correctly centred on 1.65V. Are you getting a ERR_HICUROFS1 error logged?

This is really getting a bit off topic now. It would be a lot easier to help if you started another thread containing more detail on your instal and issues (in particular how you have hooked into the Mitsubishi inverter as it would help diagnose the problem and could be useful information for others).
nathaniel
Posts: 92
Joined: Thu Jun 09, 2022 10:17 am
Been thanked: 42 times

Re: Inverter Firmware 5.24.R

Post by nathaniel »

I have created a new topic for this issue because it is no longer directly related to this topic, for those who want to follow it:
viewtopic.php?p=54468#p54468
Post Reply