Tesla Charger alternative firmware

Topics concerning the Tesla front and rear drive unit drop-in board
Post Reply
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Tesla Charger alternative firmware

Post by johu »

I have developed an openinverter-style firmware for the Gen2 Tesla charger, more specifically the boards with STM32 processor like V5aB2.

UPDATE:
Manual in the wiki: https://openinverter.org/wiki/GEN2
Download link: https://openinverter.org/files/stm32_charger.zip
Shop link: https://openinverter.org/shop/index.php ... duct_id=67


UPDATE2:
the firmware will be published as open source soon. If you want to grab it earlier jump on to patreon: https://www.patreon.com/openinverter

I have annoyed Damien by sending him outside in the freezing cold to test it in his BMW :P It works.

More specifically it features
  • All features of the original firmware
  • openinverter parameter handling via web interface
  • openinverter spot value handling via web interface
  • Over The Air update via bin file
  • Plotting and logging
  • DC current set point
  • external CAN control
External CAN control requires routing to internal CAN bus onto the external header as shown on the picture. It has quite a few IDs on it so check for collisions with your existing CAN infrastructure before doing this.
I have mapped out CHAdeMO so it will accept like this

Code: Select all

#0x102 - 8 - 0 udclimh udcliml idcspnt 0 canenable soc 0
Sending SoC will allow implementing a SoC limit in the charger and might be handy for just displaying it.
It will also generate the 108 and 109 message CHAdeMO style.

The firmware won't be open sourced for now. Damien will probably put it on boards he sells off his shop and I will offer the binary via my shop for the likes of 20€ or so. I will put together a short manual before putting it up.
Attachments
IMG_20210104_172638.jpg
screenshot2.png
screenshot1.png
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Tesla Charger alternative firmware

Post by joromy »

Looks great!
Has the issue with Amp draw jumping up and down, been solved?
Then I want one.
Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
User avatar
New Electric Ireland
Posts: 172
Joined: Sun May 31, 2020 12:22 pm
Location: Ireland
Been thanked: 1 time
Contact:

Re: Tesla Charger alternative firmware

Post by New Electric Ireland »

This is great news :D

Given it's closed source can we expect some support for this going forward? I'm sure most people would happily pay more for a product with support or for an option to purchase support as required.

Edit: one other request... can you find a way of locking the wifi board in place? We need to pass vibration testing and would like to use the existing boards rather than produce a new one.
In Ireland we undertake training & open source RND for the New Electric group, 5 companies converting boats, buses, cars and trucks to electric drive since 2008.
P.S.Mangelsdorf
Posts: 753
Joined: Tue Sep 17, 2019 8:33 pm
Location: Raleigh, NC, USA
Has thanked: 89 times
Been thanked: 92 times

Re: Tesla Charger alternative firmware

Post by P.S.Mangelsdorf »

johu wrote: Mon Jan 04, 2021 4:34 pm
I have mapped out CHAdeMO so it will accept like this
#0x102 - 8 - 0 udclimh udcliml idcspnt 0 canenable soc 0
Sending SoC will allow implementing a SoC limit in the charger and might be handy for just displaying it.
It will also generate the 108 and 109 message CHAdeMO style.
Ok please excuse the dumb question:
Does this mean the charger control board can also handle implementing CHADEMO? i.e. a separate CHADEMO control board would not be needed if running a Tesla charger with this control board/firmware? Or is this communication with the CHADEMO board?
If at first you don't succeed, buy a bigger hammer.

1940 Chevrolet w/ Tesla LDU - "Shocking Chevy" - Completed 2023 Hot Rod Drag Week
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

joromy wrote: Mon Jan 04, 2021 6:03 pm Looks great!
Has the issue with Amp draw jumping up and down, been solved?
Then I want one.
We didn't observe this behaviour today, maybe it was a quirk in legacy software.
New Electric Ireland wrote: Mon Jan 04, 2021 6:10 pm This is great news :D

Given it's closed source can we expect some support for this going forward? I'm sure most people would happily pay more for a product with support or for an option to purchase support as required.

Edit: one other request... can you find a way of locking the wifi board in place? We need to pass vibration testing and would like to use the existing boards rather than produce a new one.
Thanks :)
Support will be handled like for all other products, no support by default but can be bought by the hour when needed. I will compile a quick start guide for the firmware.
Locking the module in place would require an extra production step where you put a blob of glue on it. It doesn't fit a locking header.
P.S.Mangelsdorf wrote: Mon Jan 04, 2021 6:11 pm Ok please excuse the dumb question:
Does this mean the charger control board can also handle implementing CHADEMO? i.e. a separate CHADEMO control board would not be needed if running a Tesla charger with this control board/firmware? Or is this communication with the CHADEMO board?
It implements the charger side of CHAdeMO. So say you have a BMS that talks CHAdeMO you could connect it to the charger and it would work. It's just a neatly standardized way to exchange info between charger and car via CAN.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
joromy
Posts: 371
Joined: Fri Jun 28, 2019 12:56 pm
Has thanked: 1 time
Been thanked: 3 times

Re: Tesla Charger alternative firmware

Post by joromy »

Really happy, if the current jumping up and down issue has been fixed.
Have installed 4 Tasla chargers, and it has been the same issue every time.
It is worse at full power, not so much at low amps.

Damien says: "Yes that's quite normal"
viewtopic.php?f=10&t=78&start=50#p1707
viewtopic.php?f=10&t=78&p=14265&hilit=normal#p14265

Thomas A. Edison “I have not failed. I've just found 10,000 ways that won't work"
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla Charger alternative firmware

Post by jon volk »

Exciting stuff, particularly since I'm already using external CAN.

I noticed that was an occasional firmware crash that would require a power cycle to reset on the previous version. It hasn't been annoying enough to look further into it but Ill give this setup a shot.


The jumping up and down I believe may be a CAN timing and/or filtering issue on the charger side. Since I'm running my external can, if I introduce a bunch of other messages onto the bus, this current drop gets worse. If I limit CAN activity of other components when the unit puts out a charge enabled message, it seems to be pretty decent.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
Bratitude
Posts: 783
Joined: Thu Jan 02, 2020 7:35 pm
Location: Canada
Has thanked: 57 times
Been thanked: 168 times
Contact:

Re: Tesla Charger alternative firmware

Post by Bratitude »

if I understand correctly, with the chademo communication protocol implemented, one could set up a gen2 charger as a chademo “charger” ? Would just need to produce the charger “start stop”, and “connection check” signals?
https://bratindustries.net/ leaf motor couplers, adapter plates, custom drive train components
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Charger alternative firmware

Post by Jack Bauer »

A new board rev will be available soon to support the new firmware. Just simple things like a solder jumper to bring out the can to the external connector, extra filtering on the wifi etc. I'd like to thank Johannes for doing this and I was quite warm in thermals and a snow suit during testing. Why do you think I like Lanzarote so much. Damien don't do cold:)

Once again to address the ramping issue : Yes I have seen it, no I don't know the cause , Tom has said its down to thermal limiting in the modules. It may indeed turn out to be a can issue and like all things we do here the more minds we have working on it the faster it will be fixed.
I'm going to need a hacksaw
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Bratitude wrote: Tue Jan 05, 2021 4:30 am if I understand correctly, with the chademo communication protocol implemented, one could set up a gen2 charger as a chademo “charger” ? Would just need to produce the charger “start stop”, and “connection check” signals?
Yes exactly. You could wire the "charge allow" pin from the vehicle (it is pulled to GND when vehicle allows charging) to a PNP transistor, which in turn would switch 12V on the enable pin "IN1" of the charger. Then you have full redundancy.
Out1 on the external connector could be used to turn on the vehicles charge relays.

I'm sure Damien would enjoy testing it in his snowsuit :P
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: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

So, getting close to releasing. Jack Bauer will do one more test, then the firmware will become available for download. It works like this

- If you buy fully assembled boards from Damien, you will get a fully working board
- If you make your own board from JLCPCB the firmware will allow 5 minutes of charging and then stop
- You then go to the shop, specify the serial number(s) of your board(s) and buy as many pins as you need. You will receive the pin for each board, enter it via the web interface and will have unlimited charging thereafter.
- Patreons who have been supporting me longer than 6 months will get a free pin per $5. More details will be published there soon

Now, I'm looking for 5 volunteers who will go through the registration process and test the charger in their setup in exchange for a free pin.
Ideally I would like to test 5 different setups
- 1 phase wall outlet in the US
- 3 phase wall outlet (EU)
- 1 phase EVSE
- 3 phase EVSE
- Charger as CHAdeMO EVSE

If you're interested please describe your setup here.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla Charger alternative firmware

Post by jon volk »

I can certainly address 1 phase EVSE, probably 1 phase 120v wall outlet if I can find my hacked up extension cord with molex on the end.

Gen2 on v5 board
32kwh of Chevy volt packs
48a capable openevse
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Very good.

I started updating the wiki: https://openinverter.org/wiki/GEN2
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Tesla Charger alternative firmware

Post by EV_Builder »

Jack Bauer wrote: Tue Jan 05, 2021 8:19 am It may indeed turn out to be a can issue and like all things we do here the more minds we have working on it the faster it will be fixed.
Is there any opensource version which could be used for debugging?
Hope to get there soon then i will start contributing...
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
Bratitude
Posts: 783
Joined: Thu Jan 02, 2020 7:35 pm
Location: Canada
Has thanked: 57 times
Been thanked: 168 times
Contact:

Re: Tesla Charger alternative firmware

Post by Bratitude »

I have a wall outlet to molex cable I made for testing the charger. Happy to set up the charger with that. And with j1772.


Tesla gen2
V5 board
18kwh Gen2 volt battery
12kw (300v) outlander phev battery
32amp evse
https://bratindustries.net/ leaf motor couplers, adapter plates, custom drive train components
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Also good. Any three phase people?

We will see if the current drop issue persists with this firmware.
I'm not 100% sure how the CAN messages are sequenced in the original firmware, but there was a problem with the STM32 when sending out more than 3 CAN messages at once. The stm32-can module handles that by queueing messages and sending them out once the interface is ready again.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla Charger alternative firmware

Post by jon volk »

EV_Builder wrote: Sat Jan 09, 2021 10:38 pm
Jack Bauer wrote: Tue Jan 05, 2021 8:19 am It may indeed turn out to be a can issue and like all things we do here the more minds we have working on it the faster it will be fixed.
Is there any opensource version which could be used for debugging?
Hope to get there soon then i will start contributing...
The gen5 software on Damiens GitHub or mine are workable enough to debug the current dropout. It runs St HAL drivers.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
EV_Builder
Posts: 1199
Joined: Tue Apr 28, 2020 3:50 pm
Location: The Netherlands
Has thanked: 16 times
Been thanked: 33 times
Contact:

Re: Tesla Charger alternative firmware

Post by EV_Builder »

I got EU 3 Phase 400V. It's standard / default in Holland (Single phase 40amps is fased out).
I dont have yet a battery with BMS yet to test it or an Gen 2 Tesla...Yet...
Converting an Porsche Panamera
see http://www.wdrautomatisering.nl for bespoke BMS modules.
User avatar
Jack Bauer
Posts: 3563
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 87 times
Contact:

Re: Tesla Charger alternative firmware

Post by Jack Bauer »

Right, I'm opening odds on how long it takes for Johannes or me to get the "The charger keeps stopping every few minutes! I want a refund" email.
I'm going to need a hacksaw
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla Charger alternative firmware

Post by jon volk »

But Damien. I need 100% charge rate, not 99.68%
Formerly 92 E30 BMW Cabrio with Tesla power
Bryson
Posts: 179
Joined: Sat Jan 25, 2020 6:22 am
Location: California
Has thanked: 1 time
Been thanked: 4 times

Re: Tesla Charger alternative firmware

Post by Bryson »

Happy to help test this on my setup as well: single phase EVSE in the US, Gen2v5 board, charging to 425v max and currently experiencing the current drop issue. Also happy to pay for the firmware since it seems my situation is the common one.
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Let the testing begin :)

Damien reports the current drop issue is FIXED!

Please follow this manual to install, register and run the software: https://openinverter.org/wiki/GEN2#Comm ... age_manual

Well, instead of going via the web shop send me your serial number via private message.

Report any problems that you run into. Except one: "my charger only runs for 5 minutes" !!
Attachments
stm32_charger.zip
(30.76 KiB) Downloaded 167 times
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla Charger alternative firmware

Post by jon volk »

So, inquiring minds want to know. Where was issue in drop?

Will upload the code tomorrow hopefully and fire off SN.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 5684
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 153 times
Been thanked: 960 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

jon volk wrote: Mon Jan 11, 2021 6:51 pm So, inquiring minds want to know. Where was issue in drop?
Basically the STM32 has a 3 message CAN send FIFO. So if your code is like
can_send();
can_send();
can_send();
can_send();

Then the last message will be dropped. To get around this you have to implement a software FIFO that stores the excess messages until the hardware FIFO is free again and then sends them out. That's exactly what the CAN module in libopeninv does and that is why building your software on top of stm32-template is super king :D
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
jon volk
Posts: 572
Joined: Wed Apr 10, 2019 7:47 pm
Location: Connecticut
Been thanked: 2 times

Re: Tesla Charger alternative firmware

Post by jon volk »

Ahhhhhhh that makes sense. In the code I messed with, I had broken the messages into 2 batches. Since then on other projects I started making a message handler that would put a 1ms delay in once the 3rd mailbox was full to allow them to send before trying to stuff more in. That seemed to work but was pretty ugly. In messing with the vcu code, the libopen stuff seems to work much more elegantly haha.
Formerly 92 E30 BMW Cabrio with Tesla power
Post Reply