Page 1 of 2

Inverter Firmware v4.87.R

Posted: Wed Jul 15, 2020 3:42 pm
by johu
Just drafted a new release:
https://github.com/jsphuebner/stm32-sin ... ag/v4.87.R
  • Removed parameters that don't need changing (and cause problems when changed)
  • Added "AlwaysForward" direction mode that defaults to forward unless reverse pin is high
  • Allow swapping PWM outputs 2 and 3
  • Allow dirchrpm up to 20000
  • Use latest libopencm3
  • Add special heat sink temperature code for Prius Gen2 power stage
  • Removed PWMSTUCK fault, it was too irritating
pinswap now generally requires stopping and restarting the inverter.

Re: Inverter Firmware v4.87.R

Posted: Wed Jul 15, 2020 6:24 pm
by Bigpie
Is the pinswap in this release what is needed for gen3 prius inverter for current sensors on phases 1 and 3?

Re: Inverter Firmware v4.87.R

Posted: Wed Jul 15, 2020 6:46 pm
by RetroZero
Wow, been busy have we? Thanks, I'll give it a go to upload in next few days along with resistor in parallel.

Re: Inverter Firmware v4.87.R

Posted: Wed Jul 15, 2020 7:57 pm
by johu
Bigpie wrote: Wed Jul 15, 2020 6:24 pm Is the pinswap in this release what is needed for gen3 prius inverter for current sensors on phases 1 and 3?
Yes, set it to PWMOutput23

Re: Inverter Firmware v4.87.R

Posted: Thu Jul 16, 2020 8:29 am
by Bigpie
Thanks.

Re: Inverter Firmware v4.87.R

Posted: Tue Jul 21, 2020 6:46 am
by damian.lo
Hello,

I would like report, that after upgrading from 4.76.R-foc to 4.87.R-foc with Leaf inverter I have no regen at all. The rest works for now good, smooth like previously, but maybe You know why it's like this?

Re: Inverter Firmware v4.87.R

Posted: Tue Jul 21, 2020 10:23 am
by Kevin Sharpe
Johannes is on holiday for a couple of weeks;

viewtopic.php?f=9&p=14314#p14310

Re: Inverter Firmware v4.87.R

Posted: Tue Jul 21, 2020 11:30 am
by damian.lo
Thanks Kevin, so for now fastest way will be back to 4.76.R :)
Regards,
D.lo

Re: Inverter Firmware v4.87.R

Posted: Tue Jul 21, 2020 12:17 pm
by Kevin Sharpe
damian.lo wrote: Tue Jul 21, 2020 11:30 am Thanks Kevin, so for now fastest way will be back to 4.76.R :)
Or, someone on the forum who understand the source can help you 8-)

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 03, 2020 7:21 am
by johu
I've tested 4.87.R with the Leaf motor and have regen as always. Maybe some new parameter is holding you back?

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 03, 2020 9:29 am
by damian.lo
Later, when I will back to home I will send parameters from old and new firmware to comparision. It can be like this, that after upgrade some parameters are by default off?

From another thread - my BMW 116 is officially approved and I have already green plates so thank You and all of guys for support :) more info in my project.

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 10, 2020 7:55 pm
by fransoa
Hi,
I'm having a similar problem. I went from the 4.57 version to the 4.87 on a Tesla LDU and I have the same problem: no more regen. I checked all the settings: everything seems normal and the update has retained the initial values. Back to version 4.85 with "flim = 0.3": no regen, back to version 4.76: erroneous inverter temperature! I'm stuck. Unless a return to version 4.57 ?

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 11, 2020 12:36 am
by jon volk
I’m on 4.85 and don’t have any regen issues. Mine is driven off a brake pressure transducer so I can’t comment on throttle off regen.

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 11, 2020 8:21 am
by johu
Would be good if you post your parameter files and a screenshot of spot values while in Run mode (I should really add a facility to post spot values as well)

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 17, 2020 7:05 am
by fransoa
These are my settings. New tests: same result. potnom is always >= 0.
I handed the 4.57 version to get some regen

{
"boost": 1850,
"fweak": 258,
"fconst": 450,
"udcnom": 350,
"fslipmin": 1.31,
"fslipmax": 3.03,
"fslipconstmax": 9,
"polepairs": 2,
"respolepairs": 1,
"encmode": 1,
"fmax": 500,
"numimp": 36,
"dirchrpm": 300,
"dirmode": 1,
"snsm": 12,
"pwmfrq": 1,
"pwmpol": 0,
"deadtime": 63,
"ocurlim": -2500,
"il1gain": -1,
"il2gain": -1,
"udcgain": 7.5,
"udcofs": 0,
"udclim": 400,
"snshs": 0,
"bmslimhigh": 100,
"bmslimlow": -20,
"udcmin": 300,
"udcmax": 400,
"idcmax": 5000,
"idcmin": -5000,
"tmphsmax": 85,
"tmpmmax": 300,
"throtmax": 100,
"throtmin": -100,
"iacmax": 5000,
"ifltrise": 10,
"ifltfall": 3,
"chargemode": 0,
"chargecur": 0,
"chargekp": 80,
"chargeki": 10,
"chargeflt": 8,
"chargemax": 90,
"potmin": 50,
"potmax": 4095,
"pot2min": 4095,
"pot2max": 4095,
"potmode": 0,
"throtramp": 5,
"throtramprpm": 20000,
"ampmin": 0.34,
"slipstart": 50,
"brknompedal": -25,
"regenramp": 5,
"brknom": 30,
"brkmax": -25,
"brkcruise": -30,
"brkrampstr": 20,
"brkhistr": 1000,
"brkhistp": 1000,
"brkout": -50,
"idlespeed": 150,
"idlethrotlim": 50,
"idlemode": 1,
"speedkp": 0.37,
"speedflt": 7,
"cruisemode": 1,
"udcsw": 0,
"udcswbuck": 0,
"tripmode": 0,
"pwmfunc": 0,
"pwmgain": 100,
"pwmofs": 0,
"canspeed": 0,
"canperiod": 0,
"fslipspnt": 0.84,
"ampnom": 0.34,
"version": 4,
"hwver": 3,
"opmode": 0,
"lasterr": 0,
"status": 256,
"udc": 5.31,
"idc": 0.12,
"il1": -3,
"il2": 3,
"ilmax": 3,
"uac": 0.12,
"il1rms": 3.96,
"il2rms": 4.93,
"boostcalc": 59200,
"fweakcalc": 8.06,
"fstat": 0.84,
"speed": 0,
"cruisespeed": -1,
"turns": 34,
"amp": 1704,
"angle": 24.62,
"pot": 19,
"pot2": 21,
"potnom": 0,
"dir": 0,
"tmphs": 28.75,
"tmpm": 34.53,
"uaux": 16.43,
"pwmio": 1536,
"canio": 0,
"din_cruise": 0,
"din_start": 0,
"din_brake": 0,
"din_mprot": 1,
"din_forward": 0,
"din_reverse": 0,
"din_emcystop": 1,
"din_ocur": 1,
"din_desat": 1,
"din_bms": 0,
"cpuload": 1.09
}

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 17, 2020 9:57 am
by johu
udc is near zero, can you repeat with inverter actually in RUN mode?
Otherwise I don't see anything unusual just yet

EDIT: two things I spotted:
idclim is very low at 400V and might cause unwanted overvoltage trips
I don't see forward or reverse selected

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 17, 2020 7:09 pm
by fransoa
Hi, these parameters are saved on road : throttle up, in waiting from regen.

{
"boost": 1850,
"fweak": 258,
"fconst": 450,
"udcnom": 350,
"fslipmin": 1.31,
"fslipmax": 3.03,
"fslipconstmax": 9,
"polepairs": 2,
"respolepairs": 1,
"encmode": 1,
"fmax": 500,
"numimp": 36,
"dirchrpm": 300,
"dirmode": 1,
"snsm": 12,
"pwmfrq": 1,
"pwmpol": 0,
"deadtime": 63,
"ocurlim": -5000,
"il1gain": -1,
"il2gain": -1,
"udcgain": 7.5,
"udcofs": 0,
"udclim": 400,
"snshs": 0,
"bmslimhigh": 100,
"bmslimlow": -20,
"udcmin": 300,
"udcmax": 400,
"idcmax": 5000,
"idcmin": -5000,
"tmphsmax": 85,
"tmpmmax": 300,
"throtmax": 100,
"throtmin": -50,
"iacmax": 5000,
"ifltrise": 10,
"ifltfall": 3,
"chargemode": 0,
"chargecur": 0,
"chargekp": 80,
"chargeki": 10,
"chargeflt": 8,
"chargemax": 90,
"potmin": 50,
"potmax": 4095,
"pot2min": 4095,
"pot2max": 4095,
"potmode": 0,
"throtramp": 5,
"throtramprpm": 20000,
"ampmin": 0.34,
"slipstart": 50,
"brknompedal": -40,
"regenramp": 5,
"brknom": 30,
"brkmax": -40,
"brkcruise": -30,
"brkrampstr": 20,
"brkhistr": 1000,
"brkhistp": 1000,
"brkout": -50,
"idlespeed": 150,
"idlethrotlim": 50,
"idlemode": 1,
"speedkp": 0.37,
"speedflt": 7,
"cruisemode": 1,
"udcsw": 0,
"udcswbuck": 0,
"tripmode": 0,
"pwmfunc": 0,
"pwmgain": 100,
"pwmofs": 0,
"canspeed": 0,
"canperiod": 0,
"fslipspnt": -1.31,
"ampnom": 0,
"version": 4,
"hwver": 3,
"opmode": 1,
"lasterr": 0,
"status": 0,
"udc": 383.59,
"idc": 0,
"il1": 3,
"il2": 1,
"ilmax": 5,
"uac": 0,
"il1rms": 6.96,
"il2rms": 5.37,
"boostcalc": 1691.4,
"fweakcalc": 282.18,
"fstat": 22.25,
"speed": 706,
"cruisespeed": -1,
"turns": 141,
"amp": 0,
"angle": 73.43,
"pot": 18,
"pot2": 20,
"potnom": -0.03,
"dir": 1,
"tmphs": 31.87,
"tmpm": 40.62,
"uaux": 16.43,
"pwmio": 1024,
"canio": 0,
"din_cruise": 0,
"din_start": 0,
"din_brake": 0,
"din_mprot": 1,
"din_forward": 1,
"din_reverse": 0,
"din_emcystop": 1,
"din_ocur": 1,
"din_desat": 1,
"din_bms": 0,
"cpuload": 25.09
}

Re: Inverter Firmware v4.87.R

Posted: Mon Aug 17, 2020 7:39 pm
by johu
Can you temporarily disable the idle speed controller?

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 6:07 am
by fransoa
I tried this without a good result just by putting idlespeed=0
I'm going to do the test again as soon as I'm at the workshop by putting idlemode=3.
For information: if I have my foot on the brake (din_brake=1) there is no regen either.

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 7:06 am
by fransoa
Hi, test done: idlemode=3 and idlespeed=0. Still no regen

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 7:06 am
by fransoa
Hi, test done: idlemode=3 and idlespeed=0. Still no regen

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 9:46 am
by johu
Ok, more debugging needed.
I have attached a firmware that will display the various values of potnom as it trickles through the processing pipeline. Can you get to the state where it should regen, but doesn't and then post the values of potnom1...7 and potnom?

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 10:48 am
by fransoa
I'm doing the test quickly.
I recently encountered on a vehicle that worked well the following problem: quite often I can not pass the inverter in START because of an overCURRENT error. it's totally random, the temperature doesn't do anything and I can't find the cause. I searched the source code for the causes of this error when the engine is shutdown and no current is consumed. If you have a idea... this noon the vehicle is stopped on this error

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 11:20 am
by johu
fransoa wrote: Tue Aug 18, 2020 10:48 am I'm doing the test quickly.
I recently encountered on a vehicle that worked well the following problem: quite often I can not pass the inverter in START because of an overCURRENT error. it's totally random, the temperature doesn't do anything and I can't find the cause. I searched the source code for the causes of this error when the engine is shutdown and no current is consumed. If you have a idea... this noon the vehicle is stopped on this error
Gate driver errors also report as OVERCURRENT, I reckon it's that

Re: Inverter Firmware v4.87.R

Posted: Tue Aug 18, 2020 11:56 am
by fransoa
Do you think the problem is the inverter, the electronic card or the wiring? If the inverter starts, the vehicle works very well as long as you don't stop the inverter. It is impossible to determine the result of the START, if it fail, we wait a few minutes or few hours and it works again. I controlled the internal temperatures and electronic card temperatures: everything seems okay. Now I can not do the test of your version because START does not pass ...