Inverter Firmware v4.97.R

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

Inverter Firmware v4.97.R

Post by johu »

Did a few small fixes in firmware, it is especially worth upgrading if you're running synchronous motors as low speed stuttering is diminished. Also if you want to scale values on the CAN bus with a gain < 1 this release is for you.

https://github.com/jsphuebner/stm32-sin ... ag/v4.97.R
  • Removed Prius MG1 detection, wasn't reliable
  • Added support for CAN scaling < 1. But now you cannot scale up more than 32!
  • FOC: running offset calibration continuously while idle
  • > smoother low speed operation
  • Custom charge PWM handling for Prius hardware (alpha, needs testing)
  • Bugfix in temp calc module when reaching lower limit of lookup table use minimum
  • Force precharge off in bootloader, also fixes Tesla misdetection
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Inverter Firmware v4.97.R

Post by ZooKeeper »

I'll give it a load and test soon! Thanks for the continued work and updates, it is REALLY appreciated!
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Inverter Firmware v4.97.R

Post by ZooKeeper »

I have not run the motor, but noticed some things:

1) MTMP is much closer to rational :D
2) PC does not latch on @ power up
3) DC now latches on @ power up, even when UDC is < udcmin
4) I had to change udcofs from about 320 to 270 to get it to match the meter (trivial and likely my error to begin with)

I attached my current param file and will connect the motor soon.
Attachments
4.97.R FOC params 8-Jan-21.json
4.97.R FOC
(1.27 KiB) Downloaded 239 times
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
User avatar
johu
Site Admin
Posts: 6713
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1542 times
Contact:

Re: Inverter Firmware v4.97.R

Post by johu »

Please elaborate. Precharge stopped working entirely? Instead DC switch immediately closes?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Inverter Firmware v4.97.R

Post by ZooKeeper »

The PC signal (pin 16) now seems to work correctly, but I am not using that feature, so further testing is needed later. Conversely, yes, the DC signal (Pin 15) now does latch on immediately and I have not been able to convince it to switch off.

It should be understood that I do not claim to have a through understanding of all the relevant settings for these controls. I will wire up my Leaf relay board to the Prius modules I have and do some "real" testing of the PC and DC controls this weekend.

<EDIT> Yes, PC on for a second or two at VCU power up, then opens. DC is on 100% of the time, only way to open is to remove ground from the VCU, even with udc = 0 and tripmode=off. Current params attached.
Attachments
4.94.R FOC Params 9-Jan-21.json
9-Jan-21
(1.28 KiB) Downloaded 263 times
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Inverter Firmware v4.97.R

Post by tom3141 »

Has anyone else had this precharge issue with the new firmware? I’m wary of updating to it if so but I’d like to try out the smoother low speed operation fixes.
User avatar
johu
Site Admin
Posts: 6713
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1542 times
Contact:

Re: Inverter Firmware v4.97.R

Post by johu »

I checked the last changes and didn't find any to the contactor code...
So it is certainly NOT happening with 4.94.R? And then you just flash 4.97.R and the DC relay immediately closes as you power up the board?
What are your spot values, can you post them?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Inverter Firmware v4.97.R

Post by tom3141 »

Thinking about it, I have a separate emergency cut off that I can use to keep the main contactor open. I will try the new firmware with this open and check the values of the precharge and main contractor outputs. I’ll let you know if I have any problems.
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Inverter Firmware v4.97.R

Post by tom3141 »

I’ve updated the firmware and didn’t have any precharge issues. The low speed improvements seem to have worked too. Thanks!
User avatar
johu
Site Admin
Posts: 6713
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1542 times
Contact:

Re: Inverter Firmware v4.97.R

Post by johu »

Great! DC-switch control also working as expected?

@ZooKeeper: could it be some kind of hardware issue?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
tom3141
Posts: 157
Joined: Sat Dec 22, 2018 2:29 pm
Location: North Yorkshire

Re: Inverter Firmware v4.97.R

Post by tom3141 »

johu wrote: Sun Jan 17, 2021 5:02 pm Great! DC-switch control also working as expected?
Yes, everything worked as expected. :)
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Inverter Firmware v4.97.R

Post by ZooKeeper »

johu wrote: Sun Jan 17, 2021 5:02 pm @ZooKeeper: could it be some kind of hardware issue?
Anything is possible. I have an incandescent lamp connected from 12v & DC control, it lights immediately when the VCU is powered.

But... as you may recall, I have changed some resistors for the Toyota mTemp modification and it is certainly possible, if not likely, that I botched something :(

I cannot attest to how the DC signal behaved previously (firmware, resistors etc) as it was not tested at that time.
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
Isaac96
Posts: 656
Joined: Sat Oct 05, 2019 6:50 pm
Location: Northern California, USA
Been thanked: 2 times
Contact:

Re: Inverter Firmware v4.97.R

Post by Isaac96 »

I'm having no issues with precharge on 4.97 (sine). Also the 'autoresume' feature is great since I haven't had time to tune yet.
User avatar
johu
Site Admin
Posts: 6713
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1542 times
Contact:

Re: Inverter Firmware v4.97.R

Post by johu »

Ok. You can also measure the gate voltageof Q2. When it is 3V3 the controller actually intents to switch it on. If it is 0, either the FET is blown or something outside the controller is not right. You can measure the resistance from drain to source, i.e. dc-switch output to GND with everything unplugged. It must be infinite or far from 0 anyway.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
ChazFisher
Posts: 53
Joined: Wed Jul 03, 2019 1:32 am
Location: Central Virginia, USA

Re: Inverter Firmware v4.97.R

Post by ChazFisher »

I'm trying to learn by compiling the code myself, so I've got Code::Blocks loaded up and running. For now I've just downloaded the v4.97.R from Github as a zip file. I'm getting an error that the compiler can't find an include file: libopencm3/stm32/F1/nvic.h. Sure enough, there's no include file by that name in that folder - what am I missing?

EDIT: What I haven't wrapped my head around yet is the use of Python as part of building the libopencm3 library. I'm going to assume my issue is related to that. I'm fumbling my way through that part of the build now. So some background information would really be helpful. Thanks!

EDIT AGAIN: So now I see in the makefile where scripts are run to created these header files:
.genhdr:
@printf " GENHDR $*\n";
$(Q)./scripts/irq2nvic_h ./$*;
Are these python scripts being run to create the repetitive code?
Chaz Fisher
Slowly creeping up on that e-motorcycle.
User avatar
johu
Site Admin
Posts: 6713
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 368 times
Been thanked: 1542 times
Contact:

Re: Inverter Firmware v4.97.R

Post by johu »

I never noticed that python was used as it is just present in any linux distro. But yes it runs a number of "genhdr" scripts as first step, which suspiciously sounds like code generation :)
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
ChazFisher
Posts: 53
Joined: Wed Jul 03, 2019 1:32 am
Location: Central Virginia, USA

Re: Inverter Firmware v4.97.R

Post by ChazFisher »

johu wrote: Mon Jan 18, 2021 8:56 am I never noticed that python was used as it is just present in any linux distro. But yes it runs a number of "genhdr" scripts as first step, which suspiciously sounds like code generation :)
Thanks. In a strange way, my stubborn refusal to build a Linux machine is helping me learn. If they had "just worked," I probably wouldn't have dug into actually decoding and understanding the makefiles.

The last time I used Unix, I literally used a Teletype machine to log into a mainframe computer. From there I moved to writing Basic programs to do data plots on a Tektronix 4052. Now that you know how old I am, thanks for your patience! :lol:
Chaz Fisher
Slowly creeping up on that e-motorcycle.
ChazFisher
Posts: 53
Joined: Wed Jul 03, 2019 1:32 am
Location: Central Virginia, USA

Re: Inverter Firmware v4.97.R

Post by ChazFisher »

So the solution on my machine was a slight modification of the instructions for Windows on the libopencm3 github page. Instead of using msys to get a Linux-like CLI, I used cygwin. And I simply made sure the $PATH included everything I needed, rather than use the "export PATH" command in the instructions. With that, everything built correctly, both the libopencm3 and the Rev 4.97R firmware.
Chaz Fisher
Slowly creeping up on that e-motorcycle.
User avatar
ZooKeeper
Posts: 507
Joined: Mon Mar 30, 2020 10:23 pm
Location: USA

Re: Inverter Firmware v4.97.R

Post by ZooKeeper »

johu wrote: Sun Jan 17, 2021 7:33 pm Ok. You can also measure the gate voltageof Q2. When it is 3V3 the controller actually intents to switch it on. If it is 0, either the FET is blown or something outside the controller is not right. You can measure the resistance from drain to source, i.e. dc-switch output to GND with everything unplugged. It must be infinite or far from 0 anyway.
Q2 is DOA, but I am sure I have a suitable substitute, especially considering I have no intention of using a relay that will pull 24A cont.
Huebner VCU controlling a Gen2 Prius Inverter powering an MGR
"Talent is equally distributed but opportunity is not." - Leila Janah
Post Reply