Inverter Firmware v4.96.R

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

Inverter Firmware v4.96.R

Post by johu »

https://github.com/jsphuebner/stm32-sin ... ag/v4.96.R
  • Added chargepwmin parameter for synchronous converters like Prius
  • Re-introduced offset calibration at standstill
  • Starting PWM before closing contactor (only Prius Gen2
  • Detecting MG1 MCU of dual motor Prius Gen3 board
  • Fixed sine manual mode
  • "json hidden" command prints all parameters including hidden ones
You should upgrade to this firmware to be able to submit complete parameter sets to the database, including hidden parameters. It also improves charging with the Gen2 Prius inverter. It also re-introduces offset recalibration at stand still in FOC mode. I had removed this in v4.94.R as I thought it wasn't needed but it is, especially in winter with various temp coefficients.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
ManuFromParis
Posts: 31
Joined: Sat Feb 15, 2020 6:34 pm
Location: Near Paris

Re: Inverter Firmware v4.96.R

Post by ManuFromParis »

I'm afraid the decimal values for the CAN message ratio are not processed
:-/

if I try to enter a CAN message with 0.0125 or 0,0125, the command looks fine :

Code: Select all

http://192.168.4.1/cmd?cmd=can%20del%20speed%20599%200%208%200.0125
...but when I refresh the data, the CAN message's ratio seems to be stored as "0" because the speedometer remains silent.

:-/
911 SC with Tesla SDU & i3 pack
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware v4.96.R

Post by johu »

Well where in the change log does it say that I added this? ;)

But I just had an idea that would be backward-compatible. Any gain > 32 would be interpreted as a divider. I doubt anyone uses gains > 32.
So 32 would be interpreted as "divide by 1" i.e. output the internal fixed point scaling. So fstat with a gain of 32 would output 1 Hz as 32. Or 1.5Hz as 48. Now, if you enter 2560 it would be interpreted as fixed point divide by 80 (2560=80*32). Which is equal to a gain of 0.0125. So a speed of 1000 rpm would be output as a value of 400. If you want integer result you have to multiply the divider by 32 again, so 81920. then a speed of 1000 would result in an output of 12 on the bus.

EDIT: Still thinking out load. 81920 wouldn't fit in the 16 bits I reserved for this, so I better interpret as integer division. So 1000/2560=12.
I will see if I can interpret fractions on the command line so it is more handy to use. Or I just hand that off to the web interface...
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: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware v4.96.R

Post by johu »

Here is something for you to try.

So you can enter fractions, the firmware will convert it to divisor internally. I haven't changed the output yet, so 0.0125 will read back as 2560. The web interface will complain because the number is out of range but it will still send what you entered.

It means gain > 32 are no longer possible. I hope nobody needs them.
Attachments
stm32_sine.zip
(68.5 KiB) Downloaded 72 times
stm32-foc.zip
(68.44 KiB) Downloaded 82 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
ManuFromParis
Posts: 31
Joined: Sat Feb 15, 2020 6:34 pm
Location: Near Paris

Re: Inverter Firmware v4.96.R

Post by ManuFromParis »

johu wrote: Sat Nov 21, 2020 6:30 pm Well where in the change log does it say that I added this? ;)
lol, indeed but when I told you about it, you replied that you had this issue yourself on some car, so I assumed you were adding the topic on your to-do list...
8-)

Anyway, thanks a lot for that special version.
I'll try it tomorrow and let you know.

As the car will soon be tested for individual approval, the speedometer was really missing.
:D
911 SC with Tesla SDU & i3 pack
User avatar
ManuFromParis
Posts: 31
Joined: Sat Feb 15, 2020 6:34 pm
Location: Near Paris

Re: Inverter Firmware v4.96.R

Post by ManuFromParis »

Update : it works !
Even though the ratio I had to set was not 0.0125 (or 2560 = 80*32) because the gauge expected a fractionned value (in km/h) so eventually the correct ratio I needed for the value transmitted in the CAN Message was 400 (= 12.5 * 32).

Fortunately I was able to test several values compared to the "Speed Spot Value" with the car lifted, so in the garage and not on open road.

On the left : the speedo now correctly calibrated (filmed from the side, so with a slight offset).
On the right (with a little delay) : a variation of the "Gauge script" aplying the /80 ratio on the speed Inverter spot value on a customized Gauge design (fixed reference).

That /80 ratio was previously tuned on the road with a GPS as a reference, so I'm confident the new calibrated speedo will show correct value now !
8-) :twisted:



thanks a lot !
Yohannes : you're the best !!
:idea: 8-) :D

Note that :
- the modification of a CAN message needs you to UNMAP the message before setting another value (page refresh needed at each step)
- the new CAN definition needs to be "saved to flash" with the other parameters if you want it permanent.
911 SC with Tesla SDU & i3 pack
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware v4.96.R

Post by johu »

Great :)
Will be in the next release. Still hope nobody uses gain>32 but I guess we will find out when someone complains ;)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
ManuFromParis
Posts: 31
Joined: Sat Feb 15, 2020 6:34 pm
Location: Near Paris

Re: Inverter Firmware v4.96.R

Post by ManuFromParis »

Maybe you want to double-check that the stored calculated value has the correct ratio because it's quite surprising I had to offset the théorical value of 0.0125 to 12.5, considering that the gauge expects values from the CAN Message with a 0.1 ratio (or x10 depending on which side you're looking at it)
911 SC with Tesla SDU & i3 pack
yaroslav
Posts: 176
Joined: Tue Aug 13, 2019 4:32 pm
Location: Russia, Stavropol
Has thanked: 14 times
Been thanked: 5 times

Re: Inverter Firmware v4.96.R

Post by yaroslav »

Hi johannes, I wanted to ask what if you remove boost from the firmware, and make the current control, do you think it will work normally?
Ranen
Posts: 3
Joined: Sat Nov 28, 2020 10:25 am

Re: Inverter Firmware v4.96.R

Post by Ranen »

I hope I'g not askign a foolish question...

Has anyone made or released a state machine for the Sine or FOC software ?

Particular reason I am askig nis we are havign trouble gettign into Opmode=RUN. can get into manual run, spin a motor open loop, even seeing resolver (though very distorted wasveforms).
We are using a bench power supply instead of HV battery (seperate from inverter 12v). I figure it should work and no doubt there is something simple. looking through all the wiki and forums the only mention I can find of entering RUN mode is te command "start 1 " - which makes me think it should just work.

I'm not a brill software person and looking at teh github fiiles I have not found where Opmode gets set in the code (which would show the conditions required). Entirely possible I am using github all wrong !

Anyway, A state machine could be a useful thing for many people maybe.

Thanks,
R.
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 154 times
Been thanked: 960 times
Contact:

Re: Inverter Firmware v4.96.R

Post by johu »

Ranen wrote: Mon Nov 30, 2020 10:40 pm Has anyone made or released a state machine for the Sine or FOC software ?
Apparently not, do have drawing skills? I don't. Most "stateful" stuff happens immediately in "Ms10Task()" in stm32_sine.cpp . You will also find a variable called "status" on the web interface that tells you why the inverter is not entering run mode.
yaroslav wrote: Mon Nov 30, 2020 4:32 pm Hi johannes, I wanted to ask what if you remove boost from the firmware, and make the current control, do you think it will work normally?
I've tried this and it wasn't great. Basically tried to control the maximum phase current but it was constantly overshooting :?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply