Page 4 of 13

Re: Tesla Charger alternative firmware

Posted: Wed Jan 20, 2021 7:49 pm
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.

Re: Tesla Charger alternative firmware

Posted: Wed Jan 20, 2021 7:51 pm
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.

Re: Tesla Charger alternative firmware

Posted: Wed Jan 20, 2021 7:53 pm
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

Re: Tesla Charger alternative firmware

Posted: Wed Jan 20, 2021 11:34 pm
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...?

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 3:37 am
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

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 10:27 am
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?

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 10:33 am
by Jack Bauer
Just to update from my end, full charge (about 8kwh) on the E39 this morning without a single drop off.

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 1:56 pm
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.

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 4:53 pm
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?

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 5:42 pm
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?

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 5:57 pm
by Jack Bauer
Ubuntu / firefox here.

Re: Tesla Charger alternative firmware

Posted: Thu Jan 21, 2021 9:30 pm
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.

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 2:12 pm
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

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 5:05 pm
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

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 5:27 pm
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

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 5:32 pm
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?

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 5:38 pm
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

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 6:05 pm
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.

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 6:10 pm
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

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 6:26 pm
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

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 6:54 pm
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.

Re: Tesla Charger alternative firmware

Posted: Fri Jan 22, 2021 7:14 pm
by mdrobnak
They do go over 400, not sure about 420. I know the CHAdeMO adapter starts at 408V...

Re: Tesla Charger alternative firmware

Posted: Sun Jan 31, 2021 12:14 pm
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

Re: Tesla Charger alternative firmware

Posted: Sun Jan 31, 2021 12:27 pm
by jon volk
2568FA4C-8962-4665-AB40-43695D3E50B4.png

Re: Tesla Charger alternative firmware

Posted: Tue Feb 02, 2021 11:48 am
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.