Page 5 of 13

Re: Tesla Charger alternative firmware

Posted: Tue Feb 02, 2021 12:01 pm
by Jack Bauer
Thought about this. if you read the can back from one of the charger modules it tells you the max mains current. gen2 = 16A and gen3 = 32a if I'm remembering.

Re: Tesla Charger alternative firmware

Posted: Tue Feb 02, 2021 12:18 pm
by johu
That would be great. Do you know where in the CAN stream?

Re: Tesla Charger alternative firmware

Posted: Tue Feb 02, 2021 6:25 pm
by Jack Bauer
0x207 is the module 1 line status message. Available line current is in bits 32 to 40 as a 9 bit unsigned int with a scale of 0.06666. On the gen3 this will report as a little under 24A at power up and around 13 A on the gen 2 at power up.

Re: Tesla Charger alternative firmware

Posted: Tue Feb 02, 2021 9:01 pm
by johu
Great!
I continuously sample that message now, can you check for a valid value in "hwaclim"? It will read a little (like 7%) low due to the limitations if the scaling capabilities of stm32_can. I also realized that the scaling of cXiac was off, fixed now.

What is the max DC current of the gen3 charger? I found 18000/400 still yields 45A.

EDIT: just tested on my GEN2 charger, it displays 15A and with the 7% scaling error that is 16A

Re: Tesla Charger alternative firmware

Posted: Tue Feb 02, 2021 9:05 pm
by Bryson
johu wrote: Tue Feb 02, 2021 9:01 pm I also realized that the scaling of cXiac was off, fixed now.
That explains what I was seeing, thanks! Good catch.

Re: Tesla Charger alternative firmware

Posted: Wed Feb 03, 2021 3:22 pm
by johu
Also thought about the low voltage problem, i.e. using the charger with <200V batteries. The problem is that it will send 3.7 kW to the secondary side which results in 18A i.e. more than 15A of DC current. Now I could enforce a per-module DC current limit to make sure the DC current never exceeds 15A per module.

Re: Tesla Charger alternative firmware

Posted: Sun Feb 21, 2021 1:35 am
by Bryson
So I uploaded the latest firmware and gave it another shot. The AC current per phase (cXiac) is now scaled correctly, but it looks like hwaclim and/or aclim changes are preventing me from getting full juice. I'm only getting 5A per phase max.

I started a session with the old firmware, updated firmware, and now I'm stuck at a max charge of 15A AC.
IMG_2611.PNG
Screen Shot 2021-02-20 at 5.27.59 PM.png

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 2:17 am
by Bryson
One more thing for Johannes - based on what I'm reading in the description of Type 1 and Type 2 settings, the charger will always enforce a maximum AC current of 32A, even if the EVSE is telling it that it can do more. Is that correct? My EVSE regularly puts out a full 40A with other EVs, Tesla and otherwise, so I'm not sure this interpretation of J1772 single phase is 100% correct. Am I reading it wrong? Should cablelim just be set to whatever the evselim is?

You'll notice that with the 'old firmware' in my image above, the EVSE is putting out just under 8kW. At 240V, that's about 32A total, curiously equal to cablelim.

Here is the same charger, cable, EVSE on the 'pre-Johannes' firmware running at 40A (@240V = 9.6kW):
IMG_2407.PNG
edit, last thing: I made a window in the charger case and covered it with a layer of kapton, this definitely improved my WiFi:
IMG_2617.jpeg

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 7:18 am
by johu
Understood, will make some changes and let you test

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 1:13 pm
by jon volk
Bryson wrote: Mon Feb 22, 2021 2:17 am

edit, last thing: I made a window in the charger case and covered it with a layer of kapton, this definitely improved my WiFi:
IMG_2617.jpeg

There are similar range issues with the wifi module buried under the LDU case. I use this in an enclosure with automesh. It functions transparently and I can connect 10' away from the car.

https://github.com/martin-ger/esp_wifi_repeater

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 1:27 pm
by johu
Here is a new firmware that should fix the low current limit.

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 3:15 pm
by jon volk
Did you happen to change the SDO message ID to prevent collisions with inverter boards on the same bus?

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 3:31 pm
by Bryson
johu wrote: Mon Feb 22, 2021 1:27 pm Here is a new firmware that should fix the low current limit.
Thank you again, I’ll give this a go as soon as I have another window of time, hopefully an evening this week.

Re: Tesla Charger alternative firmware

Posted: Mon Feb 22, 2021 3:49 pm
by johu
jon volk wrote: Mon Feb 22, 2021 3:15 pm Did you happen to change the SDO message ID to prevent collisions with inverter boards on the same bus?
Ah forgot, will hard-code it to 5 (i.e. 0x505) next time.

Re: Tesla Charger alternative firmware

Posted: Sat Feb 27, 2021 5:48 pm
by Bryson
Well gents, I learned something this morning!

1. New firmware works great, thank you Johannes! I charged up to 37A, limited by constant voltage charge (EVSE does 39.4)
2. The Tesla charger doesn't like more than 420V set point. It looks like this may have been my issue. I played with different values and was able to quickly reproduce the cycling issue. I'd suggest limiting the max values at 420V instead of 430V based on this learning.

Note that this testing was done purposely in the constant voltage range of charging to attempt to trigger some of the high voltage cycling issues I've been seeing, nothing here is in the lower SOC constant current range.

Off to the office now...
IMG_2630.PNG
* these should all be VOLTS not AMPS. Oops

Re: Tesla Charger alternative firmware

Posted: Fri Mar 05, 2021 6:50 pm
by johu
Thanks! I guess I will make this the new version then. While also dropping max voltage to 420V.

Re: Tesla Charger alternative firmware

Posted: Sun Mar 21, 2021 8:16 pm
by Boxster EV
Thought it was about time I moved over to this gig.

I've had my free five mins of juice and just purchased a pin. :D

Re: Tesla Charger alternative firmware

Posted: Sun Apr 04, 2021 3:31 pm
by jon volk
Question on the CAN control. Does the charger need to receive a full array of data for a 0x102 rx message or is it fine just receiving a 1 or 0 on byte 4 for enable? Does this message also override or act as a replacement for the hardware enable wire? Working on reducing hardware i/o for anything that can be done over CAN.

Re: Tesla Charger alternative firmware

Posted: Sun Apr 04, 2021 4:28 pm
by johu
You'll need to send all items except SoC as they'd be set to zero otherwise. Could certainly remove the enable wire in that case but currently it is required.

Re: Tesla Charger alternative firmware

Posted: Fri Apr 09, 2021 5:57 pm
by johu
I did some testing today to control the charger via CHAdeMO protocol and realized and reports "Connector locked" and "enabled" bits in the wrong byte (Byte 4 instead of 5). Concerns message 0x109. Have updated the wiki
I will change it in the next release, be aware you need to change your custom VCUs should you upgrade your charger from version 1.06.R or earlier

Re: Tesla Charger alternative firmware

Posted: Fri Apr 09, 2021 6:19 pm
by jon volk
On a side note, I've had no issues in 2.5 months of usage on my own charger as well as various public J1772 charge stations.

Re: Tesla Charger alternative firmware

Posted: Fri Apr 09, 2021 6:28 pm
by johu
Very good to know!

Re: Tesla Charger alternative firmware

Posted: Wed May 05, 2021 6:19 pm
by johu
As you might have seen here I'm using a Gen2 Tesla charger as CHAdeMO EVSE. I had to make some small changes to the software to make it work:

- Fix the 0x102 message (enable bits now start at bit 40, not 32)
- Added an "enablepol" parameter to start charging when the enable pin is LOW

Internally I added a pull-up resistor to the enable pin. You can also use this parameter to skip the enable pin all together. Try it, pin stays valid over all future upgrades.

EDIT: when I say "make it work" I only made changes that I anticipated. Actual test is tomorrow.

Re: Tesla Charger alternative firmware

Posted: Thu May 06, 2021 10:53 pm
by EV_Builder
Which board version does it support and if you don't have the wifi module, will it spit out over COM native or COM USB?
I have a fast flashing LED but nothing more/less..

Re: Tesla Charger alternative firmware

Posted: Fri May 07, 2021 6:47 am
by johu
Both interfaces work, just no update over USB possible. Works on all STM32 based hardware, gen2 and gen3
https://openinverter.org/wiki/GEN2

Oh, my CHAdeMO test didn't go well, it turns out I have a super charger charger :?