Tesla Charger alternative firmware

Topics concerning the Tesla front and rear drive unit drop-in board
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 »

Thanks. I unpacked the file and it begins with a lower case ‘c’ already. I repacked it and sent it to my home computer for uploading when I’m back.

When I run index.html from my desktop in both safari and chrome, I don’t see anything on the page. I’m on my work Mac right now, JavaScript is indeed enabled, perhaps it’s time to try a windows machine.
Attachments
7077D24F-9915-4AD0-AAE8-E6C698C2E05C.png
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

No gauges.html generates dynamically but index.html should show something. I have seen it working on Safari, not sure what the deal is.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

Ah yes index.html works normally but without the plot, thanks

Screen grab with error log from Chrome. Should I just load the unpacked file directly? The plot chart shows up when I unpack within the same directory and reload index.html
Attachments
Screen Shot 2021-01-20 at 12.14.19 PM.png
0EF1BB0E-34E3-43FE-A015-C9089D13A5DD.png
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

ok, same as here. The other errors are just because its not running on the webserver.

What does the error log show when opening on 192.168...?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

Javascript errors when connected to the ESP:
Screen Shot 2021-01-20 at 7.27.51 PM.png
And after pressing Start Plot:
Screen Shot 2021-01-20 at 7.32.06 PM.png
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

No error message about loading chart.min.js but then it doesn't find the "Chart" class.
Not finding subscription.js is normal when you're not subscribed to anything. Maybe add it as an empty file, see if that helps?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
Jack Bauer
Posts: 3564
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 93 times
Contact:

Re: Tesla Charger alternative firmware

Post by Jack Bauer »

Just to update from my end, full charge (about 8kwh) on the E39 this morning without a single drop off.
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 »

Mine is happily charge cycling as intended with no unwanted behavior after fixing my self induced SDO collisions. Cant really comment on the drop out as it's been charging overnight and my garage wifi connection hasnt been working well.
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Thats good news.
I hope Bryson gets the plot running so we can hunt the glitch down. I'm suspecting one of the chargers raises an error flag. Anyone know the conditions that raise the error bit?

Could it be a CAN problem? Bryson have you routed CAN externally? If so, is it properly terminated?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

I haven’t routed CAN externally - other than modifying the C3 capacitor I’m running an unchanged v5 board. I’ll boot into windows tonight and give that a shot, some googling shows that there can be many causes of not finding Chart, and sometimes it is related to browser choice.

Are you guys using PCs? IE browser?
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
Jack Bauer
Posts: 3564
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 93 times
Contact:

Re: Tesla Charger alternative firmware

Post by Jack Bauer »

Ubuntu / firefox here.
I'm going to need a hacksaw
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 »

Troubles continue. I tried loading locally from a windows machine using Chrome, IE and firefox with the same net results:
- unpacking chart.min.js.gz in the local directory gets the plot to show (but doesn’t work when I load the unpacked file to SPIFFS)
- same errors from the console log in Firefox on my PC:
316969AF-925C-42F4-A891-767A51C09124.png
At this point I’ll start investigating different ways of loading that source file, as it seems that’s where the immediate problem is. Maybe I can persuade a software dev at the office to help me out..

edit: GOT IT. I reprogrammed the ESP and it's working as designed now, finally. My guess is that I must not have left enough room for the file system in the flash. I went with 512KB for the filesystem this time around.

Tomorrow am I'll get the car on the charger for a proper log, whew.
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
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 »

Re-configured my garage wifi extender. The log doesn't seem to show any drop out. The sample interval is every 10 seconds, so it may miss something.
graph.JPG
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 »

Jon, it looks like you're cutting your charge off while still at pretty high current. Are you going to >90% SOC? I didn't see the issue appear until later in the charge taper curve.

Johannes, a couple plot logs attached. I only logged phase 3 current to keep the plot a little cleaner:
Screen Shot 2021-01-22 at 9.01.21 AM.png
Screen Shot 2021-01-22 at 9.01.31 AM.png
Screen Shot 2021-01-22 at 9.01.55 AM.png
Screen Shot 2021-01-22 at 9.01.58 AM.png
Screen Shot 2021-01-22 at 9.02.08 AM.png
And logging state vs the three phase currents:
Screen Shot 2021-01-22 at 9.07.27 AM.png
Screen Shot 2021-01-22 at 9.07.39 AM.png
Screen Shot 2021-01-22 at 9.08.09 AM.png
Screen Shot 2021-01-22 at 9.18.04 AM.png
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

ah, it worked :)
So what we see in the top plot:
It charges 3A (presumably 9A total). The flags toggle between 1 and 5. Firmware adds 4 every 100ms and checks if the next CAN message resets it back to 1 (or 0 or 2). Timeout check. All normal so far, no timeouts, for that it would need to stay at 5 for 2s.
Then the current tapers down quite controlled and about 1-2s later charger 2 signals an error. State machine drops out of run mode, restarts all chargers and cycle begins again.

Next plot almost same but charger 3 signals an error, next plot also charger 3. Last plot doesn't show errors, must be outside of plotted range. Only charger that never shows an error is charger 1. Can you try enabling only charger 1? Type "set chargerena 1" into custom command. set chargerena 7 to enable all again.

What have you set udcspnt to? Could it be reaching that and actually it is not a set point but an over voltage limit? Can you
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: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Aha, more plots :)
So yes it seems charger 1 works good while the others drop out for some reason. Maybe it would be good to disable modules as AC current drops below x A. They might not be happy to charge at too little current?
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

udcspnt is set to 430V, was 426V, I'm seeing udc on phase 1 get up to 425V via the plot before it ramps back down. I've also set udclim to the same 430 for now. Pack is currently sitting around 410V with no charge activity.

I agree with your suspicion about turning on fewer phases deliberately at lower current. The odd part is that it seemed to work fine when I had iac set to a lower number previously when I had the max stuck at 16. Here's a plot with just phase 1 turned on:
Screen Shot 2021-01-22 at 9.32.48 AM.png
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Ah ok so you're right on the edge of what the chargers can do. So with chargerena=1 you also don't get continuous charging but no error flags either.

I can write code for shutting down chargers later, will post the binary here.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
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 »

The flag does drop to 0 with chargerena=1, that would mean I’m still getting an error, right? Left side of the above plot
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
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 »

One more update. When I set aclim to 20A, I get the charge cycling again:
Screen Shot 2021-01-22 at 10.20.38 AM.png
When I set aclim to 15A, I got a steady charge for a couple minutes (at 1.5A/phase = 4.5A?), then cycling began again. udc is showing about 420v when this happens:
Screen Shot 2021-01-22 at 10.21.25 AM.png
Screen Shot 2021-01-22 at 10.22.23 AM.png
Off to work now, I don't think I'll be able to test more until tonight or tomorrow. I'm left wondering if these can't actually charge above 420V
‘70 jag XJ6, GS450h drivetrain, 102s Tesla pack
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Possible, in a Tesla they would never go above 400V I suppose? Maybe if you lower udcspnt to 420V it will just do a CV charge. 4.12V per cell. I can also compile a software with the limit set to 440V, maybe it will accept that.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
User avatar
mdrobnak
Posts: 692
Joined: Thu Mar 05, 2020 5:08 pm
Location: Colorado, United States
Has thanked: 1 time
Been thanked: 5 times

Re: Tesla Charger alternative firmware

Post by mdrobnak »

They do go over 400, not sure about 420. I know the CHAdeMO adapter starts at 408V...
User avatar
Jack Bauer
Posts: 3564
Joined: Wed Dec 12, 2018 5:24 pm
Location: Ireland
Has thanked: 1 time
Been thanked: 93 times
Contact:

Re: Tesla Charger alternative firmware

Post by Jack Bauer »

I have designed a new controller for the Gen3 Tesla charger based on the STM32F103 which can use the new firmware. Will also be 100 euros cheaper for the full kit. Full sources for the board on github : https://github.com/damienmaguire/Tesla-Gen3-Charger
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 »

2568FA4C-8962-4665-AB40-43695D3E50B4.png
Formerly 92 E30 BMW Cabrio with Tesla power
User avatar
johu
Site Admin
Posts: 6227
Joined: Thu Nov 08, 2018 10:52 pm
Location: Kassel/Germany
Has thanked: 228 times
Been thanked: 1272 times
Contact:

Re: Tesla Charger alternative firmware

Post by johu »

Yay :)
Now I should increase the parameter limits so you can make use of the mighty 18 kW. What would be the new limits? Would be neat to be able to detect whether we are running gen2 or gen3.
Support R/D and forum on Patreon: https://patreon.com/openinverter - Subscribe on odysee: https://odysee.com/@openinverter:9
Post Reply