Inverter Firmware 5.32.R

User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Inverter Firmware 5.32.R

Post by johu »

Finally there is a new release that addresses various safety concerns. In doing so it makes some things slightly more complicated but therefor well defined.

https://github.com/jsphuebner/stm32-sin ... ag/v5.32.R
  • Potential bug fix in scheduler
  • Throttle/torque limit for cruise control
  • Cruise control mode "button" removed because it cannot be cancelled if brake pedal switch fails
  • Brake pedal check at startup if cruise control is used
  • Safety critical control parameters now have a fixed mapping in one message with sequence and optional CRC check and can no longer be freely mapped. Your custom mapping will be deleted when running this software. Read here: https://openinverter.org/wiki/CAN_commu ... N_-_new%21
  • Cruise control only works when forward direction is selected, i.e. din_forward is high (use SwitchReversed if for your setup reverse is actually forward)
  • When sending cruise rpm preset via CAN din_cruise must also be activated
  • Explicitly Force 0 throttle when switching to neutral
  • In FOC ramp down field weakening when rpm limit is surpassed by 10% (overspeed protection)
  • Traction control added
  • Fixed in CAN SDO json printing
  • New way of mapping values to CAN via SDO: viewtopic.php?p=60996#p60996
  • Legacy terminal commands (list, atr, help, all) removed
  • Dodgy speed frequency output removed (until someone complains)
  • Display rotor direction and selected direction separately
  • Allow switching from neutral into rotor direction
Please test this, especially people who use the forward/reverse input. That topic should be settled for good.
It would also be helpful if someone with a safe, low voltage test setup could test the speed limiter even with a skewed syncadv like 0
And finally, as always, the sine variant is untested. Still put it up on github
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
muehlpower
Posts: 575
Joined: Fri Oct 11, 2019 10:51 am
Location: Germany Fürstenfeldbruck
Has thanked: 12 times
Been thanked: 103 times

Re: Inverter Firmware 5.32.R

Post by muehlpower »

The safety improvements have been discussed extensively, but this is the first time I've read about "Traction Control". How does it work?
arber333
Posts: 3265
Joined: Mon Dec 24, 2018 1:37 pm
Location: Slovenia
Has thanked: 80 times
Been thanked: 234 times
Contact:

Re: Inverter Firmware 5.32.R

Post by arber333 »

muehlpower wrote: Fri Sep 15, 2023 3:59 pm The safety improvements have been discussed extensively, but this is the first time I've read about "Traction Control". How does it work?
Me too!
The way i imagined OI traction control would be an input to OI from the ESP/ABS side of the car reducing regen so OI is inline with newest TUV requirements. Or is it?
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Inverter Firmware 5.32.R

Post by Ev8 »

Tried to update this morning but can’t seem to get the can throttle between my 2 Prius gen2 boards working, one board uses analog throttle then transmits pot and pot2 via canto the second board.

Tried
Pot Tx 1, 0,16,0
Rx 1, 0,16, 1

Pot2 Tx 1,12,16,0
Rx 1,12,16,1

No joy just cantimeout error
Noticed the extra Id and node options in communication, do these need to be the same or different?

Feeling pretty dumb today
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

muehlpower wrote: Fri Sep 15, 2023 3:59 pm The safety improvements have been discussed extensively, but this is the first time I've read about "Traction Control". How does it work?
Yes this is an acceleration rate limiter
Ev8 wrote: Sat Sep 16, 2023 9:45 am Tried to update this morning but can’t seem to get the can throttle between my 2 Prius gen2 boards working, one board uses analog throttle then transmits pot and pot2 via canto the second board.
Release notes :)
Safety critical control parameters now have a fixed mapping in one message with sequence and optional CRC check and can no longer be freely mapped.
I guess this was bound to happen. With this software there is no way to exchange throttle signal between inverters. Simply due to the lack of a running counter that can be mapped to CAN.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Ev8
Posts: 801
Joined: Sat Jan 30, 2021 11:05 am
Has thanked: 41 times
Been thanked: 149 times

Re: Inverter Firmware 5.32.R

Post by Ev8 »

Ah nuts that’s a shame, I guess it’s a limited use case mine, but will also effect anyone running Damien’s dual motor gen3 board, not that I can think of anyone
FFMan
Posts: 321
Joined: Mon Jul 25, 2022 7:59 pm
Location: Bicester, Oxfordshire
Has thanked: 8 times
Been thanked: 46 times

Re: Inverter Firmware 5.32.R

Post by FFMan »

as i'm not using cruise at the moment many of the change listed do not suggest i need to be an early adopter here, but i am concerned about the no-load over-rev issue. I had an occurence driving the other day where the car jumped out of gear as it wasn't fully selected. I got some no load revs going and had a minor panic.

does this f/w address this issue, is it encapsulated in this statement 'In FOC ramp down field weakening when rpm limit is surpassed by 10%' ?

thanks
E46 touring
Phev rear motor, OEM inverter cabin heater and charger
BMW 9kwh & 12kwh packs
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

FFMan wrote: Tue Sep 26, 2023 11:12 am does this f/w address this issue, is it encapsulated in this statement 'In FOC ramp down field weakening when rpm limit is surpassed by 10%' ?
Yes, that's the supposed overrev protection though nobody has tested it yet. Would need someone with a low voltage testbench
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Bigpie
Posts: 1595
Joined: Wed Apr 10, 2019 8:11 pm
Location: South Yorkshire, UK
Has thanked: 75 times
Been thanked: 304 times

Re: Inverter Firmware 5.32.R

Post by Bigpie »

I have a low voltage bench test setup, but not followed latest updates. "In FOC ramp down field weakening when rpm limit is surpassed by 10%" I don't understand what this means.
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: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

Say you set fmax to 400 Hz and say upwards of 300 Hz field weakening is needed to prevent unwanted regen.
So far, shortly before reaching 400 Hz throttle input was limited as too not surpass 400 Hz. But field weakening current is not fully governed by throttle input but by the need to weaken the back EMF. When there is misalignment between what the software thinks field weakening current is and what the motor thinks it is -> field weakening current will produce torque, even with 0 throttle input.

Therefor there is now a limit for field weakening current as well, at 110%*fmax (440 Hz in our example). Before reaching that limit, field weakening current is ramped down, hopefully reaching an equilibrium where BEMF cancels out with inverter voltage and no more torque being generated.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: Inverter Firmware 5.32.R

Post by turnip73 »

Does anyone have any examples for using the new can message for safety critical control parameters in stm32-car, stm32-vcu or similar?
If not, no worries, I'll have a go.
I sent messages manually using CANUSB and can-utlis
turnip73
Posts: 34
Joined: Wed Dec 26, 2018 1:38 pm
Location: Greystones Ireland
Has thanked: 11 times
Been thanked: 14 times

Re: Inverter Firmware 5.32.R

Post by turnip73 »

I had a go at using the new can message for safety critical control parameters in stm32-car:

Code: Select all

   typedef struct {
    unsigned char SixBits:6;
    unsigned char TwoBits:2;
   } tEightBits;
   tEightBits canrun;
   tEightBits canio;
   canio.SixBits = Param::GetInt(Param::canio);
   canrun.TwoBits = g_canrun;
   canData[0] = 0 | canio.SixBits << 24 | canrun.TwoBits << 30;
   canData[1] = 0 | canrun.TwoBits << 14;
   can->Send(0x03F, canData);
https://github.com/hakanrolsson/stm32-c ... prius-gen2
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

Sorry, missed that one. Here's a version with the full set of parameters: https://github.com/jsphuebner/stm32-car ... r.cpp#L460
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
wacomg
Posts: 10
Joined: Mon Dec 21, 2020 12:27 pm
Has thanked: 1 time
Been thanked: 1 time

Re: Inverter Firmware 5.32.R

Post by wacomg »

Thanks !
It's really great to control all over CAN bus
I wrote an arduino uno code to send this control message via sparkfun CAN-BUS shield
you need sparkfun libraries and Ticker library to get it working

maybe it can be helpful for somebody

Code: Select all

#include <Ticker.h>

#include <Canbus.h>
#include <defaults.h>
#include <global.h>
#include <mcp2515.h>
#include <mcp2515_defs.h>

void P500MS();
Ticker timer1(P500MS, 500);

uint16_t SPot1 = 100;
uint16_t SPot2 = 100;
bool SCruise=false;
bool SStart=false;
bool SBrake=false;
bool SForward=false;
bool SReverse=true;
bool SBms=false;
uint8_t SCanRun1=0;
uint8_t SCanRun2=0;
int SCruiseSpeed=0;
int SRegenpreset=0;
unsigned short int i=0;
byte data[7];
long data2[2];

void setup() {
  Serial.begin(115200);
  
  if(Canbus.init(CANSPEED_500))  //Initialise MCP2515 CAN controller at the specified speed
    Serial.println("CAN Init ok");
  else
    Serial.println("Can't init CAN");

  delay(10);
  timer1.start(); //start the ticker.
}

void loop() 
{
  timer1.update();
}

void P500MS(){
  tCAN message;
  SCanRun1 +=1;
  SCanRun2 +=1;

  message.id = 0x3F; //formatted in HEX
  message.header.rtr = 0;
  message.header.length = 8; //formatted in DEC
 
   
   long Pot = SPot1 & 0xFFF;
   long Pot2 = SPot2 & 0xFFF;
   long canio = ( SCruise | SStart<<1|SBrake<<2|SForward<<3|SReverse<<4|SBms<<5 ) & 0x3F;
   long ctr = SCanRun1 & 0x3;
   long cruise = SCruiseSpeed & 0x3FFF;
   long regen = SRegenpreset & 0x7F;

   data2[0] = Pot | (Pot2 << 12) | (canio << 24) | (ctr << 30);
   data2[1] = cruise | (ctr << 14) | (regen << 16);
   
  message.data[0]= (data2[0]) & 0xFF;
  message.data[1]= (data2[0]>>8) & 0xFF;
  message.data[2]= (data2[0]>>16) & 0xFF;
  message.data[3]= (data2[0])>>24 & 0xFF;
  message.data[4]= (data2[1]) & 0xFF;
  message.data[5]= (data2[1]>>8) & 0xFF;
  message.data[6]= (data2[1]>>16) & 0xFF;
  message.data[7]= (data2[1])>>24 & 0xFF;

mcp2515_bit_modify(CANCTRL, (1<<REQOP2)|(1<<REQOP1)|(1<<REQOP0), 0);
mcp2515_send_message(&message);
  
}
alexbeatle
Posts: 155
Joined: Sun Jan 03, 2021 6:12 am
Has thanked: 46 times
Been thanked: 15 times

Re: Inverter Firmware 5.32.R

Post by alexbeatle »

johu wrote: Thu Sep 14, 2023 4:33 pm Please test this, especially people who use the forward/reverse input. That topic should be settled for good.
Loaded this firmware to SDU V6. My direction is set by switches: dirmode:Switches. Forward and reverse are swapped i.e when seldir=Forward; motor spins in reverse and rotordir=Reverse and vice versa.
Has the option to swap signals in the UI been removed?

Edit: ok. I found that there's a signal swap option in the UI. Gonna test it tomorrow.
image.png
alexbeatle
Posts: 155
Joined: Sun Jan 03, 2021 6:12 am
Has thanked: 46 times
Been thanked: 15 times

Re: Inverter Firmware 5.32.R

Post by alexbeatle »

alexbeatle wrote: Sun Oct 15, 2023 2:58 am Loaded this firmware to SDU V6. My direction is set by switches: dirmode:Switches. Forward and reverse are swapped i.e when seldir=Forward; motor spins in reverse and rotordir=Reverse and vice versa.
Has the option to swap signals in the UI been removed?

Edit: ok. I found that there's a signal swap option in the UI. Gonna test it tomorrow.
image.png
Here you are. When dirmode:Switches, it spins in the opposite direction of the direction selection. Selected reverse, but spins forward in the below.
image.png
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

Oh, that's funky. Could it be related to the reversed phase order that catphish had found?
I'm guessing this issue isn't new but now through revealing rotor direction it becomes visible.

It might not happen with FOC, will check later.

What would be the proposed fix? Correct phase order? Or introduce pinswap to sine firmware allowing to swap PWM channels 1 and 2?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

I have tested the direction issue with FOC and indeed it does not appear.
I have the inverter constantly in Forward direction because I select reverse with the gear box. So I drove forward and both seldir and rotordir showed Forward. Then let it roll backward in Forward gear and rotordir changed to Reverse
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

alexbeatle wrote: Thu Oct 19, 2023 3:52 am Here you are. When dirmode:Switches, it spins in the opposite direction of the direction selection. Selected reverse, but spins forward in the below.
image.png
Added an issue for this: https://github.com/jsphuebner/stm32-sine/issues/40

Please help finding the post where catphish discovered the reversed field rotation
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Mitchy
Posts: 82
Joined: Sun Nov 14, 2021 12:16 pm
Has thanked: 2 times
Been thanked: 36 times

Re: Inverter Firmware 5.32.R

Post by Mitchy »

viewtopic.php?p=52723#p52723

Is this something relating to the issue?

May also be related to the Current CT Swap?
viewtopic.php?p=50975#p50975
resocorp
Posts: 6
Joined: Fri May 01, 2020 8:41 pm
Location: Nigeria
Has thanked: 8 times
Been thanked: 3 times

Re: Inverter Firmware 5.32.R

Post by resocorp »

johu wrote: Tue Sep 26, 2023 11:17 am Yes, that's the supposed overrev protection though nobody has tested it yet. Would need someone with a low voltage testbench
Hello, semi newbie here, is overrev protection happening here? https://youtube.com/shorts/FIkmbk81ihI?feature=share motor doesn't spin above about 2500rpm and can suddenly stop when releasing the throttle. dc voltage is about 200V. Thanks.
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

Likely something else. Maybe throttle going out of range. Post your parameters here and perhaps a plot of potnom & speed
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
resocorp
Posts: 6
Joined: Fri May 01, 2020 8:41 pm
Location: Nigeria
Has thanked: 8 times
Been thanked: 3 times

Re: Inverter Firmware 5.32.R

Post by resocorp »

Here it is.

Code: Select all

{
  "iqkp": 32,
  "idkp": 32,
  "curki": 20000,
  "vlimflt": 10,
  "vlimmargin": 2500,
  "fwcurmax": 0,
  "syncofs": 32000,
  "lqminusld": 2,
  "fluxlinkage": 90,
  "syncadv": 10,
  "polepairs": 4,
  "respolepairs": 2,
  "sincosofs": 2048,
  "encmode": 4,
  "fmax": 200,
  "numimp": 60,
  "dirchrpm": 100,
  "dirmode": 1,
  "snsm": 23,
  "pwmfrq": 2,
  "il1gain": 3.18,
  "il2gain": 3.18,
  "udcgain": 3.78,
  "udcofs": 310,
  "udclim": 540,
  "snshs": 0,
  "pinswap": 15,
  "modmax": 37836,
  "potmin": 1000,
  "potmax": 3000,
  "pot2min": 1000,
  "pot2max": 3000,
  "potmode": 0,
  "throtramp": 100,
  "throtramprpm": 20000,
  "throtcur": 1,
  "brakeregen": -50,
  "regenramp": 100,
  "regentravel": 30,
  "offthrotregen": 0,
  "cruiseregen": -30,
  "regenrampstr": 10,
  "brklightout": -50,
  "bmslimhigh": 60,
  "bmslimlow": -1,
  "udcmin": 0,
  "udcmax": 400,
  "idcmax": 326,
  "idcmin": 0,
  "idckp": 2,
  "idcflt": 9,
  "tmphsmax": 150,
  "tmpmmax": 300,
  "throtmax": 100,
  "throtmin": -100,
  "accelmax": 100,
  "accelflt": 3,
  "chargemode": 3,
  "chargecur": 0,
  "chargekp": 50,
  "chargeki": 10,
  "chargeflt": 3,
  "chargepwmin": 10,
  "chargepwmax": 90,
  "idlespeed": -100,
  "idlethrotlim": 100,
  "idlemode": 3,
  "holdkp": -0.25,
  "speedkp": 0.25,
  "speedflt": 5,
  "cruisemode": 0,
  "cruisethrotlim": 50,
  "udcsw": 168,
  "udcswbuck": 224,
  "tripmode": 1,
  "bootprec": 0,
  "pwmfunc": 0,
  "pwmgain": 0,
  "pwmofs": 5000,
  "canspeed": 1,
  "canperiod": 0,
  "nodeid": 1,
  "controlid": 63,
  "controlcheck": 1,
  "manualstart": 0,
  "manualiq": 0,
  "manualid": 0
}
Image
Attachments
plot2.JPG
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

Yes, throttle goes out of range. You have set potmax=3000 where in reality it reaches 4095. Same with pot2.

Please can someone rewrite throttle calibration done with the web interface? This is super outdated https://openinverter.org/wiki/Schematic ... rottle_pot

EDIT: you might also want to skim over this one
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
johu
Site Admin
Posts: 5791
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 157 times
Been thanked: 1024 times
Contact:

Re: Inverter Firmware 5.32.R

Post by johu »

Just been in a call with resocorp
It is a Gen2 inverter on a Gen3 transaxle. It was very misbehaving.
Main culprit: pinswap was no correct (should be 7 in this case) and syncofs was the opposite one, i.e. where field weakening becomes field strengthening. Changed from 32000 to 0 and I think that was pretty much it.

Also I sent him the firmware which ignores Desat from the power stage because it was too triphappy. Like in A2 after I swapped in another power stage
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply