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.
Re: Inverter Firmware v4.96.R
Posted: Fri Nov 20, 2020 3:33 pm
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 :
...but when I refresh the data, the CAN message's ratio seems to be stored as "0" because the speedometer remains silent.
:-/
Re: Inverter Firmware v4.96.R
Posted: Sat Nov 21, 2020 6:30 pm
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...
Re: Inverter Firmware v4.96.R
Posted: Sat Nov 21, 2020 7:45 pm
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.
Re: Inverter Firmware v4.96.R
Posted: Sat Nov 21, 2020 9:38 pm
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...
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.
Re: Inverter Firmware v4.96.R
Posted: Mon Nov 23, 2020 2:30 pm
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 !
thanks a lot ! Yohannes : you're the best !!
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.
Re: Inverter Firmware v4.96.R
Posted: Mon Nov 23, 2020 3:15 pm
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
Re: Inverter Firmware v4.96.R
Posted: Mon Nov 23, 2020 4:23 pm
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)
Re: Inverter Firmware v4.96.R
Posted: Mon Nov 30, 2020 4:32 pm
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?
Re: Inverter Firmware v4.96.R
Posted: Mon Nov 30, 2020 10:40 pm
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.
Re: Inverter Firmware v4.96.R
Posted: Thu Jan 07, 2021 5:41 pm
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