Page 1 of 1

Inverter Firmware v4.85.R

Posted: Tue May 19, 2020 7:10 pm
by johu
Here comes a big release, check it out:
  • Added support for driving "useless" current into the motor in order to heat up cabin in standstill
  • Added various temperature sensors
  • Hopefully fixed Tesla muxed temp sensor issues for good
  • Trying to mitigate false positive on LORESAMP
  • Fixed pin mapping issues, prevented start on Tesla boards
  • Simpler and apparently more effective speed/frequency calculation in resolver mode (same routine as AB encoder)
  • Seperate max regen setting for cruise control
  • Keep PWM enabled when there is id OR iq current request (smoother coast down)
  • CAN fixe for more than 3 received message IDs
  • Fixed possible over current trip on FOC startup
  • Added motor temperature derating
  • Added derating parameters for heatsink and motor
  • Do not read BMS input on Tesla hardware
  • Deleting timer capture buffer on standstill (single channel mode, caused startup trips)
  • Moved charge code to pwmgeneration module and using PI controller
  • The latter did achieve power factor up to 0.93 in boost charging mode
  • Recalibrate current sensor offset on every standstill
  • Added initial support for Prius board
So definitely upgrade if you are on Tesla hardware, use FOC or use charge mode.

Binaries here: https://github.com/jsphuebner/stm32-sin ... ag/v4.85.R

Re: Inverter Firmware v4.85.R

Posted: Tue May 19, 2020 7:18 pm
by RetroZero
Thanks Johu, don't know how you do it. 🙏

Re: Inverter Firmware v4.85.R

Posted: Wed May 20, 2020 5:37 pm
by yaroslav
Thank you very much for your work

Re: Inverter Firmware v4.85.R

Posted: Fri May 22, 2020 7:05 pm
by Martin1775
Thank you very much Johannes,

the programming is beyond my means.

I had some problems with the new version. With the wifi interface it stops at the update that was very slow, so I had to use the programmer. Then it worked and showed the new parameters.

I've tried the Prius pinswap but it doesn't work for me with the straight connection. In manual mode it jumps as before with the interchanged current measurement inputs for l2 and l3. In normal mode the motor moves a few degrees and take current and that's it.

For the temp sensors it would be nice if I could use all sensors for inverter and motor, the MGR uses a 47k NTC in the motor.

Martin

Re: Inverter Firmware v4.85.R

Posted: Sat May 23, 2020 10:49 am
by johu
Thanks zippy500 for his "release donation" :)
Martin1775 wrote: Fri May 22, 2020 7:05 pm I had some problems with the new version. With the wifi interface it stops at the update that was very slow, so I had to use the programmer. Then it worked and showed the new parameters.
The firmware cannot affect the update process, so this must be down to something else.
Martin1775 wrote: Fri May 22, 2020 7:05 pm I've tried the Prius pinswap but it doesn't work for me with the straight connection. In manual mode it jumps as before with the interchanged current measurement inputs for l2 and l3. In normal mode the motor moves a few degrees and take current and that's it.
Yes always hard to figure out. Try to make a detailed drawing that shows the 3 PWM channels and the current sensor connected to each channel. Then make sure pwm1 is the channel sensed by il1, pwm2 sensed by il2 (possibly after pinswap).

Also the resolver has a number of permutations. The one supported by pinswap (sin/cos) but also the polarity (sin-, sin+ and cos-, cos+). Luckily I reused the original Leaf harness which has all that sorted, so I'm not very experienced in trying.

Re: Inverter Firmware v4.85.R

Posted: Sat May 23, 2020 4:28 pm
by SciroccoEV
johu wrote: Sat May 23, 2020 10:49 am Try to make a detailed drawing that shows the 3 PWM channels and the current sensor connected to each channel. Then make sure pwm1 is the channel sensed by il1, pwm2 sensed by il2 (possibly after pinswap).
Just kind of musing to myself. Could you add a test sequence that would pair up the sensors with their phases.
If I remember rightly, some of this is to to with swapping phases to change motor rotation, perhaps a "motor rotation for forward" parameter option would be simpler.
Also the resolver has a number of permutations. The one supported by pinswap (sin/cos) but also the polarity (sin-, sin+ and cos-, cos+). Luckily I reused the original Leaf harness which has all that sorted, so I'm not very experienced in trying.
Resolver secondary coil phasing could also be swapped in software too couldn't it?

Re: Inverter Firmware v4.85.R

Posted: Sat May 23, 2020 4:59 pm
by Martin1775
Thanks Johannes,

today update was fine with wifi, I dont know what was wrong.

For the Prius/Yaris inverter with the Prius Gen 3 Inverter Logic Board from Damien, I used Damien's modified Firmware version from yesterday viewtopic.php?f=14&t=488&start=60#p11328 and it works with the board how he designed it.

The Prius Inverter measures the current on L1 and L3 so there L2 has to change with L3.

I thought I use the Lexus MGR connected as the MG2/MGR in the original Toyota/Lexus circuit diagram to the inverter, but afterwards I've seen that the Prius inverter have a different sequence than the Lexus inverter for the pins. I've set syncofs to 22100 so there is a phase shift, because it's around 120 degrees. What needs to be considered, the MG1 have a different wiring than the MG2/MGR.

Re: Inverter Firmware v4.85.R

Posted: Sat Jun 13, 2020 1:37 pm
by joromy
johu wrote: Sat May 23, 2020 10:49 am
Yes always hard to figure out. Try to make a detailed drawing that shows the 3 PWM channels and the current sensor connected to each channel. Then make sure pwm1 is the channel sensed by il1, pwm2 sensed by il2 (possibly after pinswap).
Does it really matter what phase you put the current sensors on? (for ACIM motor)

I am making a new board, and it would be easier to put it on phase 1 and 3, but I will change it if there should be some problems with that.

Re: Inverter Firmware v4.85.R

Posted: Sat Jun 13, 2020 7:16 pm
by johu
For sine software it does not matter at all.

Re: Inverter Firmware v4.85.R

Posted: Wed Jun 17, 2020 5:52 pm
by damian.lo
Hi,

I have in my conversion 2 independent CAN buses:
CAN#1: BMS - charger - DCDC
CAN#2: BMW - inverter board

For now I don't want to mix them to be sure, that I will be more sure to not block any traffic to safety equipment (maybe I'm wrong - what all You think?)
Because of this I have to put some arduino canbus shield to speak for example with instrument cluster and etc.
Johannes, is it possible to implement in next firmware some more CANbus data, like:
- fixed rpm at idle when DCSW is closed
- some data like You did in Your project stm32-car
https://github.com/jsphuebner/stm32-car
I tried to fight with this project, but since it's my first contact with Code::Blocks, result is evident :)
Or maybe You can little expand this project - comments for dummies?

Regards,
d.lo

Re: Inverter Firmware v4.85.R

Posted: Sat Jun 20, 2020 9:57 pm
by Fierobsessed
Second on the comments for dummies thing. I've been writing a lot of code for my can interface device on the Arduino IDE, but I look at the code for the inverter and it just flies right over my head. Personally, I comment nearly every line (except for the obvious) on what I'm working on so I know why I did what I did, but looking at someone else's without heavy commenting is tough. But I'm still relatively fresh on this and haven't done C++ yet

Re: Inverter Firmware v4.85.R

Posted: Sun Jun 21, 2020 6:19 am
by johu
I am very very sparse with comments as a comment is already a redundancy. It expresses something that the line of code expresses as well. So I would much rather change the code to be more descriptive than adding comments.

Re: Inverter Firmware v4.85.R

Posted: Mon Jun 29, 2020 4:06 pm
by konstantin8818
Interesting yet scary thing I've encountered today: if parameter "throtramp" contain a fractional number, there is an issue when vehicle accelerates on its own, but at the time throttle input is at 0% and pot value is lower then potmin parameter. If throtramp is integer, everything is OK.

Re: Inverter Firmware v4.85.R

Posted: Mon Jun 29, 2020 8:08 pm
by johu
Oh that sounds scary indeed. Will check it out

Re: Inverter Firmware v4.85.R

Posted: Tue Jun 30, 2020 11:54 am
by konstantin8818
johu wrote: Mon Jun 29, 2020 8:08 pm Oh that sounds scary indeed. Will check it out
So I've tried to recreate this bug today, but it didn't showed up. May be this was a combination of parameters, and maybe it's because all my signal and HV wires are not screened and crossing. It might be just radio interference.

Update.
It showed up. It is not depending on fractional digits. This is what parameters look like when it appeared:
Screenshot_20200630-155031_Chrome.jpg
Screenshot_20200630-154511_Chrome.jpg
Screenshot_20200630-154519_Chrome.jpg
Screenshot_20200630-154539_Chrome.jpg
So pot value is below potmin. But at same time throttle input is 100 percent.
Screenshot_20200630-154726_Chrome.jpg
Only disabling the board resets this bug.