# Tesla 10Kw Open Source Charger Controller



## jackbauer (Jan 12, 2008)

So I've had a first look at the Tesla Gen 2 10Kw charger. Now , making one of these work as is with CAN messages is near on impossible due to the level of integration of the charger and the car. So I decided to have a look inside. Seems it uses 3 x 3.5kw modules linked back to a central logic board. Each modules connects to the logic pcb with 8 wires.

So far i have identified GND , +12v , +5v and a 500k canbus. Two lines seems to carry analog signals and one seems to be open circuit. Attached see some CAN captures from this internal network. I may be wrong but I bet it will be easier to work out these messages and get the individual charger modules to wake up.

So plan is to design a little breakout board so I can monitor the signals on a live car during the charge process and log the CAN messages.

Stay tuned


----------



## Tomdb (Jan 28, 2013)

Good start, however mind explaining what you hooked up and what you powered on?

Looks like the chargers all put out data, the same data.

example first message per unit: 0x207, 0x209, 0x20B.

14 messages a piece, that is quite a bit. But probably not all will be required.

Would you mind hooking up 230V to a charger section to see some data change?


----------



## jackbauer (Jan 12, 2008)

Video out soon.


----------



## nitrousnrg (Feb 25, 2016)

jackbauer said:


> So plan is to design a little breakout board so I can monitor the signals on a live car during the charge process and log the CAN messages.


This one could save you a bit of design time http://canable.io/


----------



## jackbauer (Jan 12, 2008)

Looks interesting. I mostly use an arduino due with savvycan for logging. I do also want to monitor all the lines and have a plug and play solution as I don't want to go cutting and soldering on another persons working car


----------



## nitrousnrg (Feb 25, 2016)

In that case I use a logic analyzer
www.saleae.com
You cant send can commands though, only sniffing.


----------



## e^2 (Jul 22, 2017)

How would you go about finding this charger? Mainly salvage yards?


----------



## jackbauer (Jan 12, 2008)

Progress so far on the charger :
https://www.youtube.com/watch?v=LqJ7HhS65po


----------



## Kevin Sharpe (Jul 4, 2011)

e^2 said:


> How would you go about finding this charger? Mainly salvage yards?


A search for "Tesla charger" on eBay finds 7 chargers for sale in the US today. Prices range from $550 to $1190 although you can find much cheaper examples via salvage.

What I really like about this open source development is the potential for a low cost ~22kW 3 Phase AC charger by using two in parallel... we have lots 22kW charging all across Europe 

Note that Damien is working on the "Gen 2" charger which can be easily identified by the lack of a Tesla identifier stamped on the metalwork. This version is the one to buy IMO. Here's why;

The "Gen 1" charger has a reputation for being less reliable than the "Gen 2" when fitted into the Model S. It's easy to identify with the word "TESLA" stamped on the metalwork. Jehu has a great video looking at whats inside here.

The "Gen 3" charger is lower power than the previous generations being restricted to 48A or 72A AC depending on the hardware version. It also appears to have the control board buried under the adhesive covered power boards. It's easy to identify with the Tesla "T" Logo stamped on the metalwork. Three great teardown videos are available here and a fourth which will remove the power PCB's (and hopefully reveal the controller) has been promised


----------



## dcb (Dec 5, 2009)

Kevin Sharpe said:


> What I really like about this open source development is the potential for a low cost ~22kW 3 Phase AC charger by using two in parallel...


Wouldn't that unbalance one of the phases? to the tune of 22kw?


----------



## Kevin Sharpe (Jul 4, 2011)

dcb said:


> Wouldn't that unbalance one of the phases? to the tune of 22kw?


On European cars contactors within the Tesla HVJB switch the AC so that it's applied in parallel to all charger 'modules' when using single phase, and to individual charger 'modules' when using three phase. This is detailed in the Tesla service manual (see photo).

Note that the Tesla "Gen 1" and "Gen 2" charger architecture supports a 'master' and a 'slave' charger, each containing three charger 'modules'. With three charger 'modules' the total capacity is ~10.5kW, with six charger 'modules' the total capacity is ~21kW 

If you want more info on the US cars then maybe this will help?

http://www.diyelectriccar.com/forums/showthread.php?t=181417


----------



## hbthink (Dec 21, 2010)

Hello,

I have a 2012 Toyota RAV EV which apparently uses the same Gen 1 charger would be happy to instrument it up during a charge session.

Steve


----------



## annerajb (Jul 27, 2016)

Kevin Sharpe said:


> The "Gen 3" charger is lower power than the previous generations being restricted to 48A or 72A AC depending on the hardware version. It also appears to have the control board buried under the adhesive covered power boards. It's easy to identify with the Tesla "T" Logo stamped on the metalwork. Three great teardown videos are available here and a fourth which will remove the power PCB's (and hopefully reveal the controller) has been promised


I haven't had a chance to continue the teardown but to correct a slight detail the adhesive covering the boards are not the issue I can remove them easily with my nails. 
The coils and magnetics are potted into place inside the metal casing of the charger. I have to unsolder every single coil and magnetics of all 3 power stages to lift all the boards up. Since I would like to use the charger afterwards removing the potting is out of the question apart from it being not accessible.


----------



## jackbauer (Jan 12, 2008)

Progress. Managed to isolate charger block one and get it to stay enabled separate from the Tesla logic board. It spits out 13 CAN IDs. Took a log. Its on the github : https://github.com/damienmaguire/Tesla-Charger

Question is : What now .....


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Question is : What now .....


Stick 10 in a box and start selling superchargers


----------



## Dxta (Oct 2, 2017)

I'm staying tuned already. So excited to be in here. I'm new though


----------



## jackbauer (Jan 12, 2008)

I've grabbed a few more logs of the internal CAN network and uploaded to github. Few things falling out of this :



The CAN busses are tied together and the control board broadcasts 5 IDs to all the charger modules
The charger modules pump out 15 CAN IDs each. Each ID is incremented by 2 and depends on a set of jumpers on each 12way interface plug on the module.
I suspect all these charger modules are programmed the same. The nasty stuff stopping us just running the charger is on the logic board. If I can get a capture from a car before , starting and during a charge event and play this back to the modules I think they will wake up. Of course I could be way wrong about this. I guess I'll know if a Falcon 9 first stage lands on my house.


----------



## Tomdb (Jan 28, 2013)

What can bus does the charger live on?

I believe there were guys who captured a couple of the can busses during various states.

What year of Models S would your charger appear in?


----------



## jackbauer (Jan 12, 2008)

Tom , this is an internal CAN network in the charger between the logic board and the charger power modules. It would not be available externally to the charger. It's a GEN 2 charger but not sure what years that would be ...


----------



## Tomdb (Jan 28, 2013)

I know you are talking about the internal.

But I am looking for the control messages to the main logic board.


----------



## jackbauer (Jan 12, 2008)

Ah sorry  On the wiring diagram it says "FC CAN". Not sure what that is....


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> Ah sorry  On the wiring diagram it says "FC CAN". Not sure what that is....


The chargers seem to be found on the powertrain CAN bus (BUS3). The same one that the inverters are on. The FC CAN seems to actually be single wire CAN from the super charger port. It runs to the BMS and charger and while I can't find it right now I believe it goes to the charge port too. Their schematics can be tough to follow - one device will have its pinout spread across 12 pages.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Ah sorry  On the wiring diagram it says "FC CAN". Not sure what that is....


Does this or this help?


----------



## jackbauer (Jan 12, 2008)

Video of today's antics : https://www.youtube.com/watch?v=ULadBnl7wgM


----------



## Tomdb (Jan 28, 2013)

How about getting some nice rubber gloves on and giving one block a 230VAC input that is fused at a low amperage.

Easily sus out what the AC input bytes are.


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> Video of today's antics : https://www.youtube.com/watch?v=ULadBnl7wgM


I took a look at your logs. Its hard to see much in there yet as really nothing is hooked up and so you have very limited information to find. The obvious immediately interesting things would be the pack voltage/current and the AC mains voltage/current. I would imagine that all of the boards report these things. 

It seems like even absent a log from a car you might be able to provide AC voltage to a module and perhaps even vary that voltage a bit to see if we can find the difference in the CAN traffic. Likewise, at a different time you might be able to provide voltage on the output of the charger in order to find where it reports the battery voltage that the module is seeing. This can likewise be varied to help find the difference. I'd think it would be pretty safe to do both tests with fusing. It'd sure help to narrow down some of the traffic you're seeing. I'm not sure why each module needs 15 messages. They must transmit an awful lot of information in there! Probably there would be temperatures as well. Do you happen to have a hair dryer for your luxurious locks? Perhaps you could heat one of the modules up and see what that does to the CAN messages.


----------



## jackbauer (Jan 12, 2008)

Rigged up the Variac and did a few logs on one module. Swept the mains input up and down , flicked it directly on and off 0,230vac. Rectified the variac and swept the dc input from 0 to 350vdc and then flicked it on and off 3 times on another log.

Used a 230v 100w filament lamp to limit current.

Logs on the github : https://github.com/damienmaguire/Tesla-Charger


----------



## jackbauer (Jan 12, 2008)

Looks like 0x0207 bytes 0 and 1 contains the mains voltage.

ID : 0x0227 byte 3 seems to contain battery voltage and relates somehow to byte2 ...


----------



## jackbauer (Jan 12, 2008)

So I think this will come down to the CAN messages. As it will be a few weeks before I get the capture from a car I'm going to jump the gun a little and work up a replacement open source logic board.

Basics I have in mind so far :



Due SAM3 processor with two CAN transceivers. One talks to the power modules the other talks externally.
USB port on board to program desired settings and upload firmware.
replicate as many of the Tesla external connections as possible e.g. control pilot , proximity etc
If anyone has any ideas or needs now is the time ....


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> If anyone has any ideas or needs now is the time ....


Great work as always 

Can you add support for multiple chargers like the Tesla master/slave architecture? Supporting up to four (~40kW) for high end car/truck applications and sixteen for home-brew Superchargers (yes I'm serious ) would be amazing.

Can you also consider how we support switching between one and three phase inputs? I guess we need a mechanism for the 'master' charger to switch contractors on the AC input?

Please include the ability to update the firmware externally... I don't fancy removing the charger each time 

And finally, can we have programable I/O on any spare pins so we can cope with all the things we've forgotten? iirc Collin/Jack at EVTV developed some innovative hardware that can be configured to support lots different I/O requirements and I believe that's available open source.


----------



## CKidder (Dec 12, 2009)

Kevin Sharpe said:


> Please include the ability to update the firmware externally... I don't fancy removing the charger each time


I wrote a CAN based bootloader for the Due at one point. I'll bet it could be improved, fixed up, and used for this kind of thing. I wrote it when attempting to create a motor controller with a SAM3X processor. Well, that turned out to not be the best idea but I could do firmware upgrades without having to open up the controller's case.



> And finally, can we have programable I/O on any spare pins so we can cope with all the things we've forgotten? iirc Collin/Jack at EVTV developed some innovative hardware that can be configured to support lots different I/O requirements and I believe that's available open source.


Well, I copied an existing design that had a push/pull output system. But, it had issues with phantom pulses on start up and it would have allowed shorting the power bus. It would have taken more work to make it really nice so I kind of gave up on that and instead went to some source and some sink outputs which are separate. But, I would think it'd be possible to put a standard optocoupler input and a sink output on the same pin pretty easily. Then people could use the digital I/O pins for either input or output but would be limited to sink outputs. That still could be a viable strategy. But, in reality I'm kind of dumb when it comes to hardware designs so I'd imagine it'd be a good idea to trust Damien to come up with something that works.


----------



## jackbauer (Jan 12, 2008)

So ganging the chargers up whether it be in a vehicle or Diy supercharger can be handled in software over the external CAN bus. We have lots of spare pins in the external connector so bringing out the USB or serial for software upgrades should be no problem. Likewise I'll come up with something for I/O expandability.

That said I'm not going to try and get it right first time here. I'll get a V1 board done fairly quickly so we can prove it works once I get a CAN capture from a car. It's a small pcb so minimum cost.

Connector hunting was fairly easy on this one. The internal connector for the power modules is a 24 way JST. Same as on the large drive unit logic board and the external connector is a 30 way Samtec IPS1-115-01-S-D.

Of course none of this will work if the CAN traffic is weird in some way or contains encryption etc etc. My sense of it is though they will keep the internal network simple but who knows.

Then it's on to the gen 3 charger .....


----------



## jackbauer (Jan 12, 2008)

So here is a look at where I am going with the logic board. Obviously not finished yet just a snapshot of current progress. I'm aiming to be pin compatible with the oem X042 connector so the Tesla inlet will connect right up and the charger will look after control pilot , latching etc.


----------



## Tomdb (Jan 28, 2013)

jackbauer said:


> Looks like 0x0207 bytes 0 and 1 contains the mains voltage.


So would this have a factor of 30, might be easier if you write a quick code to display the big edian of 0 and 1 in order to figure out if this is correct. Using multi meter to display the ac voltage.


----------



## Tomdb (Jan 28, 2013)

jackbauer said:


> ID : 0x0227 byte 3 seems to contain battery voltage and relates somehow to byte2 ...


It does, this time little edian, byte 3*256+byte 2. (guys if i get my big and little edian messed up please let me know ) 

Scaling 0.01V per bit


----------



## Tomdb (Jan 28, 2013)

Turns out that the FC-can, the single wire Fast Charge can is used for external communication.

Most pins on the charger are actually used to controller the contactors to switch between DC and AC charging. Plus couple of HVIL connections. 

No need for those in a DIY setup.


----------



## CKidder (Dec 12, 2009)

Tomdb said:


> It does, this time little edian, byte 3*256+byte 2. (guys if i get my big and little edian messed up please let me know )
> 
> Scaling 0.01V per bit


No, you're right. 0x207 bytes 0 - 1 are the mains voltage in big endian format with a seemingly 0.033333 scaling factor. It could be 0.03125 (1/32). I could be convinced of either and we'd need an accurate measurement of the voltage at peak to be sure. 

And 0x227 bytes 2-3 certainly do seem to be pack voltage in little endian format. A scaling factor of 0.01 gives a max voltage of about 324V. But, he said he went up to 350v. That would require a scaling factor of 1/92 or 0.010869565. That seems kind of far fetched. I don't know what's up with the pack voltage reading. I think you've got to be right about the 0.01 scaling factor but it just doesn't quite provide the voltage I expect.

I find this very odd because people don't normally mix big and little endian from the same device. Usually people try to keep things mostly either big or little on the bus to keep things simpler. But, it is possible that the consumer of each message is a different device and that those separate devices have a different endianness.


----------



## jackbauer (Jan 12, 2008)

Input voltage is a 9 bit unsigned int , little endian , bits 8 to 16


----------



## Tomdb (Jan 28, 2013)

That makes no sense to me.

Can you please provide an example?

0x207

0x14	0xAA

that would mean 

00010100	10101010

010101010

170

However:

0x13	0xA8

0001 0011 1010 1000

424

Plus an unsigned 9 bit int would with a 1 in the lift most bit would result in a value above 256 which is not possible for AC input voltage.

*However*

Damien what do you have for AC voltage in ireland? because if you just look at byte 1 (D2) it might just be a 8bit int which maxes out at 231


----------



## jackbauer (Jan 12, 2008)

ID 0x207 0x1A 0xE6 0x00

so 00E6 = 230v 

Max value 1FF = 511v


----------



## Tomdb (Jan 28, 2013)

Cool, as always we got to keep in mind that tesla ignore bytes

My excel formula 
=BITAND(BITLSHIFT(D3,8)+D2,511)

So you have 234V mains. But then again 511V makes sense, three phase power.


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> ID 0x207 0x1A 0xE6 0x00
> 
> so 00E6 = 230v
> 
> Max value 1FF = 511v


I agree, that looks nicer and smoother than the previous guess of the first two bytes being a 16 bit integer in big endian. Attached is a PDF graphing both on top of each other. You can see that they match *very* closely but that the new 9 bit version is smoother. I also graphed byte 0 as it tracks the mains voltage pretty much exactly but with a small value. It doesn't appear to be current as it is constant when voltage is constant. 

So, what does byte 0 encode anyway? Inquiring minds want to know!

Edit: Byte 0 is essentially the mains voltage / 9. Still no idea why it's there.


----------



## jackbauer (Jan 12, 2008)

Thanks Colin. Graph is very good. You can even see where I paused the variac on the way up and down. I got stuck working on the TM4 earlier in the year until I stopped thinking of CAN frames as bytes and more an array of bits then things made a lot more sense.

Not sure about byte 0. Perhaps something to do with the pfc booster? When I get a log from a charging car I hope this will make more sense.


----------



## jackbauer (Jan 12, 2008)

One of my great failures in life has been not getting Savvycan to run on linux. So i'm stuck with windoze. Did a 4 hour round trip last night to log a charge session. Guess what this morning? Bill decides to take a crap on my laptop. No more log files

Did find one interesting thing which I noted. Seems messages 0x042c , 0x043c and 0x044c carry the charge current request in bytes 2 and 3 relevant to each power module. Was very easy to see on the live graphs. Anyway , more logging to be done.


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> One of my great failures in life has been not getting Savvycan to run on linux. So i'm stuck with windoze. Did a 4 hour round trip last night to log a charge session. Guess what this morning? Bill decides to take a crap on my laptop. No more log files


Well, previously it was kind of a pain to compile SavvyCAN as it had external dependencies that you had to compile first and then place in the proper place. Now it just requires QT. I think it's easier to compile everywhere now and I know a lot of people do compile it themselves on linux. There are just so many LINUX variations that it's hard to come up with one executable that runs everywhere. I've thought about statically compiling the executable so that it has less dynamic library links that could mess up. At any rate, if you have GCC and QT 5.9 installed in LINUX you should now be able to easily compile it yourself.

It sucks that you lost your log files. I've thought about maybe adding a feature to do streaming logging so that it directly logs to file, flushing maybe every couple of seconds so that the most you'd lose during a crash is the last few seconds of log. There's no technical reason why this feature couldn't be added.


----------



## jackbauer (Jan 12, 2008)

Ok so got a new CAN log during a charge.

Message 0x42c 42 c4 1f 4a fe 00 00 00

Guess so far :

Byte 2 and 3 I think have the charge current command. Measured 12.6A into the pack.


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> Ok so got a new CAN log during a charge.
> 
> Message 0x42c 42 c4 1f 4a fe 00 00 00
> 
> ...


Well, without the log I'm just shooting in the dark but what about bytes 3 and 4 in little endian? That gives you a value of 0xFE4A which is -438. If all three modules are providing a third of the output current each then you'd expect right around 4.2 amps each. So, -438 could be the current in hundredths of an amp or -4.38A for that module. 

It makes sense to me anyway. Maybe it's right, maybe it's wrong.


----------



## Tomdb (Jan 28, 2013)

One remark would be, why would a charger use a signed command? 
Not like this charger is setup to do bidirectional.


Mind sharing the log with a short description of when you started the log and any values you recorded.


----------



## CKidder (Dec 12, 2009)

Tomdb said:


> One remark would be, why would a charger use a signed command?
> Not like this charger is setup to do bidirectional.


You might think so but I've seen them do it. Probably to keep the values in sync with the rest of the vehicle. Usually positive current is discharge and negative current is charge. So, keeping the chargers in negative range makes them work the same way as everything else when it comes to current reporting.


----------



## jackbauer (Jan 12, 2008)

Ok have a new log up on the github. Didn't want to upload a raw log as it's a friends car and I don't want him getting in trouble with Elon! This one is the 4 command messages from the charger logic board to the power modules : 
Logic_msgs_chg_start.csv

Events:
start capture
press ‘open charge port’ button
get out of the car
insert plug
Charging initalises
Charging commences
stop capture


Oh and SavvyCAN now compiles and runs on Linux


----------



## jackbauer (Jan 12, 2008)

Guess why we had the weird mains voltage /9 byte? Because I didn't ground the charger case during the test. Ground the charger case and they track. The damn thing is looking for an earth leak!!! It must have an earth leak detector built in!


----------



## Tomdb (Jan 28, 2013)

You played the capture back to one of the modules?

Going through the captures, bytes 1 (D2) and 4 (D5) are identical in all messages except 0x45C.

Messages 0x43C and 0x44C are identical

Attached the bytes from 0x42C


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Ground the charger case and they track. The damn thing is looking for an earth leak!!! It must have an earth leak detector built in!


I guess that explains the heavy duty earth strap and is also something we need to look out for on the HVJB


----------



## kennybobby (Aug 10, 2012)

That big strap connects to chassis? So how/where is chassis connected to earth ground? Does anyone have access to a Tesla to measure continuity between chassis and the ground terminal of the charge port?

During examination of Panasonic EVSE units i found that there is a deliberate leakage path from the mains line to the earth ground line that is used to detect a valid ground exists. It also has a ground-fault current detection circuit that uses a deliberate by-pass path to prove that the GFCD is working properly. 

The Tesla EVSE might have similar checks but haven't examined one in person. Maybe those same checks are also done inside the Tesla chargers.


----------



## Tomdb (Jan 28, 2013)

The ground pin in the charge socket connects to the chassis. Or atleast that is what the schematics say, plus this is required in the charging standards.


----------



## jackbauer (Jan 12, 2008)

Put together a log with 0x042c: Phase 1 charger command, 0x207 and 0x227 which contain charger mains voltage, battery voltage and charge current for phase one.


Block1_start_charge_msgs.csv


Not had a chance yet to do a playback as will need to move operations to the shed and hook up to a 360v battery and some serious power.


----------



## CKidder (Dec 12, 2009)

Tomdb said:


> You played the capture back to one of the modules?
> 
> Going through the captures, bytes 1 (D2) and 4 (D5) are identical in all messages except 0x45C.
> 
> ...


It's my guess that 0x42C controls the first module, 0x43C the second, and 0x44C the third. 0x45C is probably common to all three or something. If that guess is true then only the first module is getting activated so far. I'm not sure if that makes sense. 12.6A into a pack at 360v or so is 4.5kw which exceeds the rating of a single module. But, we don't know (or I don't know) the actual charge rate during this last log. It might not have been 12.6A. All I know is that you can see the charger ramp and then it stays constant but only in one message. As you said, the other two messages are the same but they don't seem to contain current requests in bytes 2-3 like the first message 0x42C does. 

However, all three messages go through a pattern in bytes 0,1,4. It's always 0x42 in byte 0 for all three messages. Byte 1 starts out at 0x60 for all three. It then goes to 0xC4 for all three and at the same time. Byte 4 starts out as 0x64 for all three then transitions through 0x68 then 0x69 then 0x6D. The 0xC4 in byte 1 does not happen until byte 4 is 0x6D. We stay 0x6D for a bit then drop to 0x6C then go to 0xFC on all modules. Eventually 0x42C (first module???) goes to 0xFE in this byte. This seems to indicate that the module should be ready to start charging. About 8 seconds after the byte goes to 0xFE a charge ramp happens in bytes 2 and 3. 

I'm attaching a graph that shows the charge ramp found in 0x42C bytes 2 and 3(little endian). Also in that graph is a mystery signal found in 0x45C bytes 0-1 which appears to be big endian and signed. It fairly closely matches the current ramp from 0x42C but it starts out hovering high and it goes negative for a little bit. I don't know what it means. Bytes 6-7 are similar to bytes 0-1 in 0x45C but they don't seem to quite make sense any way I try to graph them. Bytes 2-5 in 0x45C are fairly constant and I don't yet really have much of a guess at what they do.

But, to me it seems like the first three messages are commands and the fourth is a status feedback of some sort.


----------



## jackbauer (Jan 12, 2008)

Sorry guys my mistake. Was 8.4A of charge current.


----------



## Tomdb (Jan 28, 2013)

Damien, what charger did you plug into?

Wallbox, type 2? Single phase 16A or three phase? Looks like the charger is being mind full of 16A AC current limit.

Looks like in 0x227 bye 4 (D5) and byte 5 (D6) are the current feedback, looks like DC current in mA.

Multiplying this with the battery voltage in the same message, 0x227 byte 2 (D3) and byte 3 (D4) it would give you power, however this seems to nude 3.7 Kw. I do not know if this would be unreasonable. 

However it looks like as collin points out, 0x42C byte 2 (D3) and byte 3 (D4) contains a current demand, scaled a factor of 2. 

Will do some more digging to find some more info, however a bench test will easily allow you to sus out a if the findings are true.

As Damien mentioned, treat the bytes as a row of binary. 

Maybe these are just lucky numbers but, 0x42C 0x42	0xC4, if i take 0x2c4 I get 708, but you can trim the binary. 0010 1100 0100 to 010 1100 010 which is 354V or just about 3.7V per cell. But then again I might just be trying to make the numbers work.

AC current in 207 byte 5 (D6) and then bit 0 and 1 from byte 6 (D7) to make a 10bit integer, curve matches the dc current exactly, however it has a strange factor of 0.035amp per bit.


----------



## CKidder (Dec 12, 2009)

Tomdb said:


> Damien, what charger did you plug into?
> 
> Wallbox, type 2? Single phase 16A or three phase? Looks like the charger is being mind full of 16A AC current limit.
> 
> ...


Yes, all that seems to check out. I've created a DBC file that allows one to graph and investigate the values and all of that looks good and proper. 



> As Damien mentioned, treat the bytes as a row of binary.
> 
> Maybe these are just lucky numbers but, 0x42C 0x42	0xC4, if i take 0x2c4 I get 708, but you can trim the binary. 0010 1100 0100 to 010 1100 010 which is 354V or just about 3.7V per cell. But then again I might just be trying to make the numbers work.
> 
> AC current in 207 byte 5 (D6) and then bit 0 and 1 from byte 6 (D7) to make a 10bit integer, curve matches the dc current exactly, however it has a strange factor of 0.035amp per bit.


I don't think that 0x42 0xC4 encodes the pack voltage. 354v doesn't match the voltage reported in 0x227 bytes 2 and 3. The way it progresses doesn't look right either. But, not every guess can turn out. History has shown all my wrong guesses - it's all part of the fun.

But, yeah, I think you might be correct about the AC Current in byte 5 and 6.

I'm attaching the DBC file. It should have all the best guesses so far.


----------



## jackbauer (Jan 12, 2008)

We used a 16A single phase evse. Measured 235v ac input under load.

Could 0xc4 be the mains voltage?

I'll be running some tests soon.


----------



## Tomdb (Jan 28, 2013)

That explains why only one of the charger modules is coming on, plus it explains the 16A phase limit. 

Would expect a 16A AC phase limit to be sent to the module, however scaling is weird.

I think that allot can now be sussed out playing it back to one module and varying our findings. Does it look like the message has a checksum?


----------



## CKidder (Dec 12, 2009)

Tomdb said:


> That explains why only one of the charger modules is coming on, plus it explains the 16A phase limit.
> 
> Would expect a 16A AC phase limit to be sent to the module, however scaling is weird.
> 
> I think that allot can now be sussed out playing it back to one module and varying our findings. Does it look like the message has a checksum?


There appear to be no checksums to me. Usually anytime there is a checksum you also have a counter in the frame somewhere. There are no counters I can see and nothing that appears to be a checksum. 

The master board does send current commands to the three modules so I don't know whether there is any form of current limit per phase sent beside that. It might just be that the commands in 0x4?C don't go above what the power source can provide.

A kind of interesting quirk of international power is that, in the US, we almost always have 40 or 50A service anywhere there is 240v power. Only our 120V outlets are 15 or 20A fused. We basically only use 240V for dryers, stoves, heaters, etc so we need a lot of juice and thus the outlets are all 50A. As such, in the US I'd expect that a charger that detects 230V would try to turn at least two of the charge modules on and draw around 7kw. But, that's kind of irrelevant to the discussion. I just thought it was interesting.


----------



## jackbauer (Jan 12, 2008)

I'll be back home at the weekend for some serious testing. Traveling most of the week. I have two wires from the control board to the power modules that seem to do nothing. I wonder do the modules get the pilot signal or perhaps a ttl version of it. If so they would each know the limit of current available. We also know they measure the mains voltage.

So if each module knew they had 16 amps then they might report it in a message. 0x207 byte 4 and bit 0 of byte 5 arranged as an unsigned 9 bit int and multiplied by 0.066 give me roughly 16 amps. applying the same scaling to byte 5 bits 1 to 7 and byte 6 bits 0 and 1 give some interesting numbers.But i'm probably just making the numbers fit.

I'll make up a fake pilot signal and see if I can make them throttle up and down.

I kinda think this will just work Has anyone tried this before by the way? bypassing the charger logic board I mean.


----------



## okashira (Mar 1, 2015)

It may be better to pursue a method where the brain is completely replaced and you drive the power electronics directly.
That is what I (and Michal Elias) did with the Tesla inverter.


----------



## jackbauer (Jan 12, 2008)

okashira said:


> It may be better to pursue a method where the brain is completely replaced and you drive the power electronics directly.
> That is what I (and Michal Elias) did with the Tesla inverter.


That's exactly what I'm doing


----------



## okashira (Mar 1, 2015)

jackbauer said:


> That's exactly what I'm doing


Cool. Best of luck. contact me if I can be of help.

I have 3 or 4 10kw Tesla chargers sitting here....


----------



## jackbauer (Jan 12, 2008)

Picked up an EU charge port today.....


----------



## Tomdb (Jan 28, 2013)

those really the orange wires behind it?

Wonder how they fast charge then, because 4 wires two parallel. 

What size are they, 20mm2?


----------



## jackbauer (Jan 12, 2008)

Yes those are the wires. I'm guessing around 16mm square. Maybe a little bigger. Was in an S70 recently supercharging at 250amps!

....not that I would have had something connected to the SWCAN or anything .....


----------



## jackbauer (Jan 12, 2008)

Latest Tesla part is a EU high voltage junction box. Interesting to see how they label the AC wires and deal with the 3 power module connection in the charger. Anyway, regular charger hacking resumes tomorrow


----------



## jackbauer (Jan 12, 2008)

Guess what ? Once the charger case is grounded the two AC voltage values track perfectly


----------



## Tomdb (Jan 28, 2013)

Does this mean you had a chance to test the charger modules with a can playback?


----------



## DrJeff (Apr 24, 2015)

EU charger looks similar to the US one (shown below) apart from the extra 2 contactors...










Jeff


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> EU charger looks similar to the US one (shown below) apart from the extra 2 contactors...


Yeh, they have the same main PCB... hopefully only the contactors and firmware are different


----------



## jackbauer (Jan 12, 2008)

I got a few twitches out of the charge this morning but then the power went out due to a storm crossing over Ireland today 

Something else different on the EU HVJB. See that box on the front with some of the orange charge leads going to it? I think this is how they switch between single and 3 phase charging. Will investigate tomorrow.


----------



## Tomdb (Jan 28, 2013)

Looks like it, especially since only one of the connectors seems to have the capability. (single phase current limit)

Use your solar setup to test your tesla toys.


----------



## DrJeff (Apr 24, 2015)

There is another difference in the power connections to the chargers. It could be that Damien's was set up for two chargers, mine only had one.

In my version there are two bundles of six wires to the charger. They ran from the AC Master and DC Master plugs (on the main board of the HVJB) directly to the master charger on one side of the HVJB. A pair of straight 6-to-6 connection.

Damien's EU HVJB shows a connection to both the master and slave charger sides of the HVJB. I was expecting there would be another pair of 6-to-6 connections from the AC Slave and DC Slave plugs, but the cables suggest something different.

The differences could be a combination of EU and Single/Dual charges?

Jeff


----------



## wjones (Mar 4, 2012)

Are you sure it was a storm? seems rather a coincidence the power goes out in the neighbourhood when your'e tinkering...


----------



## jackbauer (Jan 12, 2008)

Ended up running my house for over 24 hours from batteries. Mains came back on this evening and I got the charger setup in the workshop feeding the test pack. These power modules are interesting beasts in themselves. They have their own built in HV precharge and main relay. So far if I dump the can capture into the module it precharges , closes the relay then faults out before delivering current. Going to get deeper into it tomorrow and see what I can find.....


----------



## Tomdb (Jan 28, 2013)

Good to hear you are making progress.

I wonder if it faulting because it sees an unexpected battery voltage.


----------



## CKidder (Dec 12, 2009)

I'd have to guess voltage irregularities as well. It's possible that the charger listens to BMS messages and faults if the reported voltage from the BMS isn't pretty close to the voltage it measures itself. I'd probably do a check like that if I were them. 

It sounds promising though! If it gets that far then that's a good sign. Maybe post a snippet of log of the bus from a little bit before the fault to a little bit after. It must be setting some sort of fault flag and maybe we can figure out what that fault flag means.


----------



## jackbauer (Jan 12, 2008)

It's alive!!!!!


----------



## Tomdb (Jan 28, 2013)

Please do indulge us Damien 

A youtube video coming? You capable of commanding a range of voltages and current already?


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Please do indulge us Damien
> 
> A youtube video coming?


Patreon is the place to go for the latest news


----------



## Tomdb (Jan 28, 2013)

Fully aware Kevin, and ofcourse im chipping in. 

Just waiting on that notification email.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Fully aware Kevin, and ofcourse im chipping in.


Sure... more of a reminder to other readers of this thread that developers need to eat


----------



## jackbauer (Jan 12, 2008)

The video :
https://www.youtube.com/watch?v=mOIgp3QFg78

So only very basic control at this point. Just turn on and ramp up until I chicken out. Lots more on the way


----------



## Tomdb (Jan 28, 2013)

Do you have a spreadsheet showing the messages decoded so far?

Might be easy to whip up a arduino sketch to control the charger with a due. 

The question ofcourse is how much of the can messages are really needed.


----------



## jackbauer (Jan 12, 2008)

That's on the cards for tomorrow Tom. Need to beef up my wiring and add cooling so I can let it run at full power then figure out the necessary messages. I know 0x045c is needed and it has some weird crc byte going on.


----------



## Tomdb (Jan 28, 2013)

Yes maybe built a setup on aboard, so you can use it as lab charger for any test pack or dc charging testing. 

Did it with a chevy volt unit, very handy even as a heavy duty power supply.


----------



## jackbauer (Jan 12, 2008)

Oh no. This is going in the Panzer


----------



## jackbauer (Jan 12, 2008)

Ok so in order to run phase one of the charger it takes 3 CAN IDs :

0x0368
0x042C
0x045C

I have uploaded a file to the github ph1_frames.csv
When this is played back to the phase 1 module and mains applies at the right time the module will go through power up and ramp up to 8.5A DC and stay there until the capture ends. Details of the Savvycan settings in the picture attached.

0x045c seems to indicate when the mains must be applied. Work progresses....


----------



## jackbauer (Jan 12, 2008)

0x045C seems to have a checksum of some type in bytes 0,6 and possibly 7. If I can figure this out it should be possible to write an arduino sketch to drive this puppy


----------



## jackbauer (Jan 12, 2008)

Uploaded charger power_run_ph1.csv this is a capture of phase 1 starting up , ramping up to 8.5A DC 320VDC, 15.5A AC, 230v 50hz. Mains switched manually around message number 700 in ph_frames.csv

And of course the power goes out again just as I'm about to film
Maybe Elon bought the power company.....


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> And of course the power goes out again just as I'm about to film
> Maybe Elon bought the power company.....


Maybe a Falcon 9 arriving overhead is a bit obvious


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> 0x045C seems to have a checksum of some type in bytes 0,6 and possibly 7. If I can figure this out it should be possible to write an arduino sketch to drive this puppy


Nope. None of those bytes present themselves as a likely CRC or security byte. A proper CRC would have a roughly even distribution of values and almost always is coupled to a counter byte or nibble so that the traffic continuously changes and the CRC/Security byte can then detect trouble easily and quickly. None of that is present. It appears to be three signals with byte 5 and 6 always being zero. The signals are fairly constant too, there just isn't a lot of variation here. Personally I'd try hard coding the data bytes to just one set of values and transmit it over and over. I'm thinking the actually interesting stuff is in the other IDs. I don't know what 0x45C is but I don't think it's that important.

Depending on which version of SavvyCAN you're using you could do lots of fun stuff to make the 0x45C message happen but always be static. If you have a recent enough version you could write a Javascript file that implements the suspected charging protocol directly and then edit it until it works. Or you can turn off transmission of 0x45C in the playback window and add it to the custom frames window triggered by your sending of one of the other messages. Or you could script just that part. Or you could use the fuzzing window but lock it to one ID (0x45C) and the bits you want set. Then fire that up at like 20ms and do your playback with just the other two. SavvyCAN has gotten really large and feature rich but unfortunately the jerk that wrote it never documented any of it. So if you have questions about how to do something just ask.


----------



## jackbauer (Jan 12, 2008)

Thanks Colin. I'll have a play tomorrow if the power is back on.


----------



## jackbauer (Jan 12, 2008)

Ok. New theory. One time today when I was doing a power run I forgot to install the fuse that bypasses my cooker element (approx 10R) on the hv dc side. The charger ramped up to 1.5A and hunted around that current value while holding the battery at exactly 370V until the capture ran out.

one of the last values of 0X045C is 0x57 0x90 0x15 0x2E 0x00 0x00 0x6A 0x8C

take bytes 0 and 1 in little endian so 0x9057 = 36951 x 0.01 = 369.51V

Could this be the voltage target ? Find out tomorrow. Same prat time, same prat channel


----------



## Tomdb (Jan 28, 2013)

Gents my findings so far.

And nice one on finding that. Mind sharing that capture so i can check if my findings are true?

Just found that the last bytes of that message, 0x045C read 0x8C6A or 359.46 V if divided by 100, plus then overlaying with the capture with the knowledge for damien this looks very much like a Voltage feedback from the control board (maybe from the battery). See updated document with graphs.


----------



## jackbauer (Jan 12, 2008)

The captures from today are up on github https://github.com/damienmaguire/Tesla-Charger

Looks good Tom


----------



## Tomdb (Jan 28, 2013)

I know, but is that including the one where you mention you hit 370V at 1.5A?

Got most of the commands found, so sending out message 0x368 at fixed values and then in message 0x42C steping byte 1 from 100 to 196 and then applying the AC voltage to see if the charger will click. 

Possibly you will also require in 0x42C to step change byte 4, looking at it there is a change it influeces/controls the precharge.

In message 0x45C byte 2 and 3 also do a step change. these sync up with byte 1 in 0X42C.


----------



## jackbauer (Jan 12, 2008)

Sorry no I didn't log that one. Can do tomorrow.


----------



## Tomdb (Jan 28, 2013)

Might I suggest Tweaking some values by hand, like what we think the voltage set point is to snuff it out. Same with the current value.

Then working on getting a script/arduino controlling the charger.


----------



## electro wrks (Mar 5, 2012)

Basic Tesla charger question: Does the Tesla DC fast charge(and possibly other DC fast charge protocols) go through the charger? If so, can it be enabled as well as the AC charging functions?


----------



## CKidder (Dec 12, 2009)

electro wrks said:


> Basic Tesla charger question: Does the Tesla DC fast charge(and possible other DC fast charge protocols) go through the charger? If so, can it be enabled as well as the AC charging functions?


In general, no. I don't have in-depth knowledge of the Tesla super charger but how fast charging tends to work is that the car has contactors that connect the car's battery straight to the DC fast charger itself. The fast charger then has all the charger goodies in it and handles the current and voltage limiting outside the car. The car reads voltage and current itself and sends commands to the external charger about what it would like to do. In an emergency the car always has the option to open its contactors. So, the on-board charger really isn't involved in all this but the battery management system most certainly is. Now, that all holds for CHAdeMO which I do know about. But, I can't imagine the super charger is any different.


----------



## jackbauer (Jan 12, 2008)

I suspect from the wiring diagrams and the complexity of the charger logic board that the charger handles the Supercharging control. One question for Colin : now can I tell the frequency of a message in Savvycan? going to attempt to write a simple program to get the charger to ramp up to 2A and stay there.


----------



## DrJeff (Apr 24, 2015)

jackbauer said:


> I suspect from the wiring diagrams and the complexity of the charger logic board that the charger handles the Supercharging control. One question for Colin : now can I tell the frequency of a message in Savvycan? going to attempt to write a simple program to get the charger to ramp up to 2A and stay there.


I suspected it was the HVJB that engaged or not the charger, and thus handled DC supercharging.

Jeff

Sent from my Nexus 7 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Time stamps.

looks like the contol messages 0x368, 0x42C and 0x45C are not as fixed as the response. varying from I believe 100ms to 200ms. or 5-10 messages/second


----------



## electro wrks (Mar 5, 2012)

DrJeff said:


> I suspected it was the HVJB that engaged or not the charger, and thus handled DC supercharging.


OK, in the Gen 1&2. It looks like the Gen 3 has the JB incorporated in the charger housing. This would be the next charger to hack with this feature, and up to 72A AC capacity: https://teslamotorsclub.com/tmc/threads/model-x-3rd-gen-72-a-charger-hacking.88952/


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> I suspect from the wiring diagrams and the complexity of the charger logic board that the charger handles the Supercharging control. One question for Colin : now can I tell the frequency of a message in Savvycan? going to attempt to write a simple program to get the charger to ramp up to 2A and stay there.


You can just look at timestamps but there are far more powerful options too. Under "RE Tools" you'll find "Frame Data Analysis" this window will tell you all sorts of things about a given ID - the number of bytes it has, the minimum time between frames, max time, average. It also can tell you which bits and bytes had changes and how many times a certain bit or byte had a certain value. But, I suppose you'd really be interested in the average inter-frame timing for each ID.


----------



## jackbauer (Jan 12, 2008)

Never knew that was there! Thanks Colin Looks like all 3 messages are on 100ms time interval.

Gotta get me a 72A charger


----------



## Tomdb (Jan 28, 2013)

I bett the charger will work with almost the same setup.

As why change something if it aint broke. And again three modules making up one unit.


----------



## jackbauer (Jan 12, 2008)

We have arduino control of the charger


----------



## Tomdb (Jan 28, 2013)

Yessss 

So you can make any voltage or current you want?

Now it would be fun to test it in a three phase setup, if you have a three phase socket to test from.


----------



## jackbauer (Jan 12, 2008)

Won't need three phase. Just 45Amps at 230v single phase for a full power run. Video on the way


----------



## Tomdb (Jan 28, 2013)

Shall I change your hard coded messages into something more useable?

Like setting output voltage and current plus ramp up time?


----------



## jackbauer (Jan 12, 2008)

Here is the video :
https://youtu.be/7GwXQtd7RPY

Yes please Tom. I need to spend some of that Patreon money on a programming book


----------



## jackbauer (Jan 12, 2008)

Uploaded 3phase_command_msgs_22kw.csv the github. We did a capture in my friends car today running from a 22kw 3 phase public evse. Car has dual chargers. Interesting thing is the command messages are identical for each power module. Should be very easy to run at full power.

Another finding today is the charger will work down to less than 150v and current increases with decreasing voltage for the same setpoint.


----------



## Tomdb (Jan 28, 2013)

Damien, did you command 150V?

Otherwise the charger is just hitting the constant current as defined in the control message.

how ever one of the parameters that get sent to the charger will contain the AC current limit.

Can you ask your friend if you can monitor the charger when you plug in the wall adapter charger, should be limited to 13Amp ac.


----------



## jackbauer (Jan 12, 2008)

No I didnt change anything just the pack voltage by moving a tap around the pack. With the same settings it charged 1.9A at 365v and 4A at 155V and 3A at 225v.


----------



## jackbauer (Jan 12, 2008)

Is there any pin on the DUE that would be best to use for reading the evse pilot signal? Or can it use any digital pin?


----------



## jackbauer (Jan 12, 2008)

Did a little more work on the charger logic board. 
https://github.com/damienmaguire/Tesla-Charger/blob/master/Charger_Gen2_V1 - Schematic.pdf

Keeping it simple for now. Might add RS232 for people not wanting to use CAN.


----------



## jackbauer (Jan 12, 2008)

Thanks to Tom's software and a few tweaks we can now turn the charger on and off , set a setpoint voltage and current. When the battery hits the voltage setpoint the charger ramps the current down to maintain the voltage. I suspect there is lots more functionality in here but basically : we got this thing


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> we got this thing


Congratulations to everyone who contributed... wonderful milestone


----------



## Tomdb (Jan 28, 2013)

jackbauer said:


> Thanks to Tom's software and a few tweaks we can now turn the charger on and off , set a setpoint voltage and current. When the battery hits the voltage setpoint the charger ramps the current down to maintain the voltage. I suspect there is lots more functionality in here but basically : we got this thing


Damien, did you play with different voltage setpoints to see if what is the lowest the charger will accept?

Glad to hear it works, does the Due now spit back the information from the charger?

Need to have a think about how to best read the pwm duty cycle on the pilot line. However there must be a part of the message which tells the charger the AC current limit.


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> Is there any pin on the DUE that would be best to use for reading the evse pilot signal? Or can it use any digital pin?


Well, it'd probably be most efficient to use one of the timer/counter pins (TIOA or TIOB pins). They can count pules and such for you which makes it a lot easier - just let the hardware figure out the pilot duty cycle for you.

Otherwise any digital pin could work but you'd have to very quickly check the state of the pin several times per second. Or, integrate it into an analog signal and then read that signal with one of the analog pins.

So, I guess that's three options. Doing TC mode with a TIOA/B pin is a bit more complicated in software but not so bad. Probably the easiest in software option is to turn the PWM pilot signal into an analog signal but that's more hardware for you to put on the board.

Oh, and congrats on getting it to work! Before you know it you'll have the whole car running on custom logic boards. Autopilot next, right!?


----------



## jackbauer (Jan 12, 2008)

Not had a chance as yet to determine the minimum voltage point. Didn't receive any messages back from the charger and didn't have a chance to investigate. Colin, I made a few mods to your charger dbc file and had it working very well with voltages and current and then of course forgot to save it! Will re do it asap. The autopilot logic board is a few weeks away

I might do a live stream in the shed with the charger so people can make requests.


----------



## jackbauer (Jan 12, 2008)

Quick video from yesterday : https://www.youtube.com/watch?v=BG4kYsoHe54


----------



## electro wrks (Mar 5, 2012)

Somebody get this man a Gen 3 charger, to also work on!


----------



## jackbauer (Jan 12, 2008)

Now for the fun part. Let's replace that paranoid Tesla logic board with a nice open source, chilled out version


----------



## prensel (Feb 21, 2010)

jackbauer said:


> One of my great failures in life has been not getting Savvycan to run on linux. So i'm stuck with windoze.


Well lucky you, i did manage to compile and run it on Debian9 and even was able to create a HOWTO writeup on Colin's github. 

I'm getting a Gen2 charger myself this week and have all the other stuff in place to follow in your footsteps...


----------



## jackbauer (Jan 12, 2008)

Components placed on the new charger logic board. I seem to be making a habit of replacing high component count Tesla boards with low component count versions


----------



## jackbauer (Jan 12, 2008)

Released the design files for V1 charger logic board.
https://github.com/damienmaguire/Tesla-Charger

Going to do my usual procedure of waiting a week before ordering boards to let my subconscious find all the screwups.


----------



## aeroscott (Jan 5, 2008)

you go ,how do you get so much done


----------



## jackbauer (Jan 12, 2008)

PCBs ordered for the V1 charger logic board. Also updated the design files over on Github with a few tweaks. Nothing major just tightening up the mounting hole positions and putting in a few headers for critical signals : https://github.com/damienmaguire/Tesla-Charger


----------



## okashira (Mar 1, 2015)

Interesting. I have 4 chargers sitting here on hand and may order a board to help with testing. I'm happy to tear 1 or 2 of them apart.


----------



## Kevin Sharpe (Jul 4, 2011)

looks like the open source supercharger is getting close


----------



## Tomdb (Jan 28, 2013)

Id would love to see the power supply/ breaker setup for those . 

So much copper.


----------



## annerajb (Jul 27, 2016)

Hello recorded a quick video yesterday. (Will upload later today)Unfortunately since I am at a family member house a few hours a day it's not as detailed as I wish. But wanted to chime in and let you guys know.that I figured out the pinout for the front contactor board of the 72 amp gen 3 charger. Working now on replaying Damien can messages to trigger one of the phases to output DC. Also working on creating a python file or Wireshark with all can messages we figured out so far and their format..
I also have a few can captures I am trying to get not sure how useful those would be.


----------



## Tomdb (Jan 28, 2013)

annerajb, did a phase come on when replaying the capture?

Otherwise try the arduino sketch, or atleast the code from it.


----------



## annerajb (Jul 27, 2016)

Haven't gotten around to replaying the captures. Will try playing the arduino sketch tonight. One reason why It may not work is that I have the control board still connected to all phases. Unless I cut the traces on the different phases PCB for can messages. It may cause interference or mixed messages to be sent. I will playback some captures to the phase if I can find a tool and convert the capture files to canplayer. I have saavvycan installed but the can messages are not the same format afaik.

I also compiled a excel with all can ids I seen from all captures (both mine and damien) and which fields are always the same. The idea is to make a python file that would alert when a can message has a value in a field we always seen as zero. (or different static values before)


----------



## jackbauer (Jan 12, 2008)

Don't forget you will have both a wake up and phase enable line to pull high if it is like the gen 2.


----------



## annerajb (Jul 27, 2016)

jackbauer said:


> Don't forget you will have both a wake-up and phase enable line to pull high if it is like the gen 2.


Yup, I believe pin 8 (the one besides the 5v for the MCU) on the phases appears to be a enable signal going up to around 2.3v before the charger phase times out. 

unfortunately, a coworker is using my lab PSU will see if I can get another one.

I also found out that the 0x54X and 0x10x canids appear to be either a boot progress message or a count up until disabling the phases/failing. They always count till 0x32FF and once they reach 0x32FF they shut down. 

Considering they never appear to show up for a successful charge session can capture I tend to think they are timeout messages. 

I made a python application to find anomalies in values the idea is that it notifies when it notices a pattern (data) on a can id we never seen before and prints the timestamp/message for figuring out what special did I do while charging it. (for example unplug one of the fuses of one of the phases while the other ones are charging)

Will work tonight on running the arduino sketch using a chipkit cmod and can breakout I have. (no due) 

Bonus Video:


----------



## Tomdb (Jan 28, 2013)

Mind sharing the raw can logs from the inter module communication?


----------



## annerajb (Jul 27, 2016)

Sure, Here are the 3 candumps from last night https://github.com/annerajb/Tesla-Charger/commit/b0c970402a8660a4bfaaf301e5d1977fcf22037f

As the name says there are 3 captures one with DC only one with AC only and one with both AC and DC and it includes the voltage of the DC and AC.
I verified the AC voltage seems to match what the L1 had. Don't recall if the DC feedback was correct.


----------



## Tomdb (Jan 28, 2013)

What format did you save it in?

Can you please explain what setup you got the captures with?


----------



## annerajb (Jul 27, 2016)

I connected a raspberry pi with a MCP2551 and MCP2515 and the linux mcp251x kernel driver.
The CANH and CANL are connected to the pin 5 (can L and pin 6can H ) on the third phase.
Since all 3 phases share the canbus it does not make a difference which phase is the can connected too. 
The control board of the charger is still in place and powered up. 

Bought up the can0 interface on linux/debian and ran the candump -L command 

You can replay this file back on any linux machine over a virtual can 

```
modprobe vcan
sudo ip link add vcan0 type vcan
sudo ip link set vcan0 up
```
Afterwards if you would like to replay the traffic you can run the canplayer command using the following line


```
canplayer vcan0=can0 < candump-ac119-dc-46.83-internal-controlboard.log
```
This will send the recorded can0 to the virtual vcan0 interface on the system
At this point I can open any linux can tool that supports socketcan and read the data. (later on I will try Savvycan)


----------



## Tomdb (Jan 28, 2013)

Okay,

so you plugged int 118-119Vac right?

You applied a 41-13V psu to the charger?


----------



## annerajb (Jul 27, 2016)

That's right it had connected a 46 volt 12 Series NCR18560B battery pack. AC was 118-119 measured with a fluke.


----------



## Tomdb (Jan 28, 2013)

Good then this is as follows:

AC feedback : 207 209 20B
DC feeback : 227 229 22B

All according to the decoding discussed in this thread.  oh boy oh boy why change something that is not broken.

With the control messages being as described too, so I would say test out one phase module to see what it does.


----------



## annerajb (Jul 27, 2016)

I will try to do so need to find a PSU to pull high the enable pins on the phase and find a way to isolate the control board without removing the phases. Worst case I am thinking of cutting the traces <_< and just soldering the wiring directly to the phase components


----------



## Tomdb (Jan 28, 2013)

Got good pictures of the inside of a gen3 and its connections? Should be easy remove power from one unit.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Got good pictures of the inside of a gen3 and its connections?


Have you seen Anner's videos? Here's the start of the teardown;


----------



## Tomdb (Jan 28, 2013)

Ofcourse I seen those, but no clear view of the rear end of the modules how they plug into the control board wedged below them.


----------



## annerajb (Jul 27, 2016)

Tomdb said:


> Ofcourse I seen those, but no clear view of the rear end of the modules how they plug into the control board wedged below them.


 Took a look and the rear has a header on a 90 degree angle smd soldered on the control board and thru hole on the charger phase. I was thinking of trying to remove all the solder from the thru hole and insert plastic or something to isolate the pin from the copper will give that a try later. 

I finally got power back here in Puerto Rico that should speed things up a bit. 

Also have we found the canids for the temperature sensors? I found 2 NTC on the boards of the gen 3 charger was thinking of sticking the soldering iron or a heatgun on them and see which can id starts changing.


----------



## annerajb (Jul 27, 2016)

Is this correct?
It's not giving me correct values with my 46.83v DC pack.
it's giving me for voltage 4359 and for current 53740 


```
elif message_id == 0x220:
                        dc_voltage = (recv_message.data[3] * 256) + recv_message.data[2]
                        dc_current = (recv_message.data[7] * 256) + recv_message.data[6]
```


----------



## bublik (Oct 3, 2017)

If we are talking about a second-generation inverter, then I managed to get more or less acceptable results in this way:

```
switch(frame->id){
	#ifdef START_A
		case 0x207:
		getACVoltageA =  frame->data.bytes[1];
		getACCurrentA = (frame->data.bytes[6] * 256 + frame->data.bytes[5]) / 29.0;
		break;
		case 0x227:
		getDCVoltageA = (frame->data.bytes[3] * 256 + frame->data.bytes[2]) / 94.0;
		getDCCurrentA = (frame->data.bytes[5] * 256 + frame->data.bytes[4]) / 1200.0;
		break;
	#endif
	#ifdef START_B
```


----------



## jackbauer (Jan 12, 2008)

You guys are going miles ahead of me Bare pcbs for the V1 logic board turned up today. Hope to get a few built next week.


----------



## jackbauer (Jan 12, 2008)

Bublik , have you got all three power modules running?


----------



## Tomdb (Jan 28, 2013)

annerajb said:


> Is this correct?
> It's not giving me correct values with my 46.83v DC pack.
> it's giving me for voltage 4359 and for current 53740
> 
> ...


Message should be 227


```
case 0x227: //dc feedback
      dccur = frame.data.bytes[7]*256+frame.data.bytes[6];
      dcvolt = frame.data.bytes[3]*256+frame.data.bytes[2];
      newframe = newframe | 2;
      break;

     Serial.print("  DC voltage : ");
     Serial.print(dcvolt/100,2);
     Serial.print("  DC current : ");
     Serial.print(dccur/1000,2);
```
And again, scaling can be off as i have not validated it. But its always good to start with nice looking numbers and then tweak it.


----------



## bublik (Oct 3, 2017)

jackbauer said:


> Bublik , have you got all three power modules running?


Yes, Damien, all three units work together) Largely thanks to your endeavor!


----------



## Tomdb (Jan 28, 2013)

bublik, a gen 2 charger?

What you using to control it?

have you found away to limit the AC current draw? Because that is one of the last things to figure out, for when you are charging off a limited supply.


----------



## jackbauer (Jan 12, 2008)

bublik said:


> Yes, Damien, all three units work together) Largely thanks to your endeavor!


Cool Any pictures ?


----------



## bublik (Oct 3, 2017)

Tomdb said:


> bublik, a gen 2 charger?


Yes



Tomdb said:


> What you using to control it?


ArduinoDUE)



Tomdb said:


> have you found away to limit the AC current draw? Because that is one of the last things to figure out, for when you are charging off a limited supply.


0x042c
frame.data.bytes[2]
frame.data.bytes[3]
Here, the limit of the current consumption by the AС is established



jackbauer said:


> Cool Any pictures ?


pictures will be tomorrow) today only this ...

Forgive me for possible misunderstandings) Google translated) is not all clear and answer, too, through Google-translator ...


----------



## Tomdb (Jan 28, 2013)

bublik said:


> Yes
> 
> 0x042c
> frame.data.bytes[2]
> ...


Can you share your programme please?

Is the DC battery current not done in those two bytes?


----------



## annerajb (Jul 27, 2016)

Tomdb said:


> Message should be 227
> 
> 
> ```
> ...


I will double check. But I am using a mask for the last digit of the CAN Id's 
I always set the last digit to 0 and only compare the first two to determine which can type of message it is. 
if it's a 0x22X (7,9,B) it goes ahead and does the code I shared (got it from your INO file) if it's 0x2XX it implements AC readings and has a different variable for which charger it came from (7, 9 or B)


----------



## annerajb (Jul 27, 2016)

Here is the code I am using (remember to update the interface name at the top of the python script)

https://github.com/annerajb/Tesla-Charger/blob/master/tesla_charger.py

If anybody finds new can id's or have better guess of more appropriate values for the existing ones let me know to update it.


----------



## jackbauer (Jan 12, 2008)

Uploaded the BOM for the V1 board to Github : https://github.com/damienmaguire/Tesla-Charger/blob/master/Charger_Gen2_V1_BOM.ods


----------



## bublik (Oct 3, 2017)

sorry guys(((


----------



## jackbauer (Jan 12, 2008)

Super cool Are you sending the same current command to all three modules?


----------



## jackbauer (Jan 12, 2008)

Good news is the charger board fits perfectly. Anyone spot the bad news? A free V2 board to the lucky contestant


----------



## Tomdb (Jan 28, 2013)

USB unusable while mounted 

But very nice fit otherwise.


----------



## electro wrks (Mar 5, 2012)

jackbauer said:


> Good news is the charger board fits perfectly. Anyone spot the bad news? A free V2 board to the lucky contestant


The lower right mounting hole is in the wrong place?


----------



## jackbauer (Jan 12, 2008)

Tom wins the prize


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> Tom wins the prize


Yes, the placement of the USB is not ideal but for the time being you could just hack the end off of a USB cord and solder the wires into the hole. It works perfectly fine but does mean you're stuck with that one cord.  Isn't making circuit boards just so much fun?!


----------



## jackbauer (Jan 12, 2008)

I'll probably just cut a bit out of the aluminium surround to let the plug fit. I'm lazy


----------



## jackbauer (Jan 12, 2008)

First prototype of the charger logic board picked up today


----------



## Tomdb (Jan 28, 2013)

Got a three phase outlet? Or a 48A outlet?


----------



## jackbauer (Jan 12, 2008)

I wired my workshop with a 50A breaker so full power should be possible


----------



## e^2 (Jul 22, 2017)

I had a question. Does this charger work on two phase or single phase?


----------



## jackbauer (Jan 12, 2008)

It will run on single or two phase or three phase.


----------



## e^2 (Jul 22, 2017)

That's awesome. Keep up the good work! I've been following this thread for a while. Wish I had been able to developed my programming and communication skills but I am stuck in electrical and electronics.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> I wired my workshop with a 50A breaker so full power should be possible


going to need an upgrade for the open source supercharger


----------



## annerajb (Jul 27, 2016)

woot great news damien.

on my end I finally got the Gen 3 charger wired up and it's now reading the DC voltage correctly. So the can messages appear to be the same format from Gen2. Next step will be to cut the traces to the Phase Control board and replay the arduino Tom File to see if I can charge my battery pack.

Will do later today and let you guys know if it also works.


----------



## jackbauer (Jan 12, 2008)

Hooked up a charger board on usb and loaded blink. To my utter surprise it worked

Nice work annerajb. Keep us posted. Don't forget you have about a 1 second window to connect mains AC at the right time in the CAN capture. Any earlier or later and it won't start charging.


----------



## Tomdb (Jan 28, 2013)

Did you manage to run the provide code i put together on the board?

I want to see charge pump some pixies.


----------



## jackbauer (Jan 12, 2008)

Sorry not yet Tom. Not enough hours in the day Will get to it.


----------



## annerajb (Jul 27, 2016)

I finally had time to cut the traces on one of the phases, Hook up a few wires and play around with the enable lines and the lab power supply.
Manage to turn it on by itself without the control board bugging me.
Gonna see if tonight I can start sending it the control commands for a charge from the arduino files.


----------



## jackbauer (Jan 12, 2008)

Getting ready to test the charger logic board


----------



## jackbauer (Jan 12, 2008)

Christmas Lights


----------



## jackbauer (Jan 12, 2008)

...aaannnd CAN bus works ...


----------



## Tomdb (Jan 28, 2013)

Who's software are you using?

Feel free to grab bit of the arduino code i threw togethor


----------



## jackbauer (Jan 12, 2008)

Using your code now Tom. Just getting a test setup in place today.


----------



## jackbauer (Jan 12, 2008)

Would anyone with one of these chargers be willing to do some software development in exchange for a free board?


----------



## Tomdb (Jan 28, 2013)

Wish I had one of those chargers, or any of the tesla stuff besides a battery.

Love to contribute for sure. 

Let me know if you want some features made that dont require testing?

For example writing the votalge and current setpoint to flash once you programmed it. 

This way it will boot and start charging if 12V is present and we can have it command the charges only when AC is detected.


----------



## jackbauer (Jan 12, 2008)

Thanks Tom. Sadly, genius here forgot to add an eeprom chip to this version of the board so the set points will need to be in the program. Will add to next rev.

The charger is a bit weird in that if ac is present before it asks for it it will fault out.


----------



## Tomdb (Jan 28, 2013)

Now that might not be true.

When you apply AC to the module and then send the 's' command to activate it, you can see how much you can wait before requesting it to charge. 

Built right into the software i made. 

https://store.arduino.cc/usa/arduino-due

512 KB of flash.


----------



## jackbauer (Jan 12, 2008)

huh.....I thought the Due had no data memory..


----------



## jackbauer (Jan 12, 2008)

Added a new file to github.
https://github.com/damienmaguire/Tesla-Charger/blob/master/Tesla_charger_Tom_v2_test.ino

This is activating all 3 power modules and sending current commands. Untested with power as yet. 

Tomdb, could you add a feature to select how many phase modules are enabled on the menu system?


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> huh.....I thought the Due had no data memory..


It doesn't exactly. But, you can write to the FLASH memory from within the program. This can be used as a form of data memory. However, unfortunately all of FLASH is zapped at once when you flash a new program to it so if you use FLASH memory it'll get zapped each and every time you upload a new program to it. That's SUPER annoying hence the use of an EEPROM chip.

The whole chip erase is more of a design issue with BOSSAC than anything else. If you wrote your own firmware updater it could rewrite only portions of FLASH and thus allow other parts to be used for storage. But, even then, the SAM3X has an erase pin and we all tend to expose it somewhere on the PCB. If someone pushes that button it's lights out for your stored settings in FLASH.


----------



## jackbauer (Jan 12, 2008)

Thanks Colin. Makes sense now It should be possible to have the setpoints as part of the program though? Just to validate the design.


----------



## Tomdb (Jan 28, 2013)

I would have calibration disappear with writing a new programme to it anyway.

How much time does it really take to re input your pack voltage and max charge current? 

Added the requested function Damien.


----------



## jackbauer (Jan 12, 2008)

Thanks Tom. Where can I find it?


----------



## Tomdb (Jan 28, 2013)

Github, made apull request now. Allow me as a writer then I can directly change the files.


----------



## jackbauer (Jan 12, 2008)

Thanks Tom. Don't know much about github I'm afraid. How do I add you ?


----------



## Tomdb (Jan 28, 2013)

It works now. Can you check if it works?

Also can you check the running one phase, and not switching the AC with the charger.

Would like to find out how fussy the modules are.


----------



## jackbauer (Jan 12, 2008)

Yep I'll run some tests tomorrow. I had the decoding turned off as it was swamping the serial window. Might be worth having that part write on one line.


----------



## Tomdb (Jan 28, 2013)

Change Debug to 0 instead of 1. That way you can actually use the canbus info, and not display it.


----------



## jackbauer (Jan 12, 2008)

So its good news and some bad news on the charger. Good news is the logic board and Tom's code work fine. I had Module 1 and Module 3 going full belt into a 120v battery today. Bad news is module 2 won't fire up. It seems to get most of the way through the sequence then faults out. Have a few ideas to test tomorrow.


----------



## Tomdb (Jan 28, 2013)

Even when just commanding the 2nd module?

Good to hear my code atleast controls the other two.


----------



## jackbauer (Jan 12, 2008)

Yeah I isolated it down to module 2 on it's own. No go. I did notice a drift in the line voltages reported over CAN and there are a few screws missing on this module. It may not be getting a good enough earth.

Wasn't there someone on here who got all 3 modules running a few weeks back?


----------



## jackbauer (Jan 12, 2008)

bublik said:


> sorry guys(((


Any ideas what this means? 

My phase 2 module is still fighting. I can ramp 1 and 3 up and down all day. Either something is special about the middle module (doubt it) or I have a faulty charger. Has anyone managed to run all three modules and willing to share?


----------



## Tomdb (Jan 28, 2013)

Swap the connectors, to see if it responds when you have it connected to the '1' phase connector. 

Good way to quickly troubleshoot.


----------



## jackbauer (Jan 12, 2008)

I read that Elon asks new hires some kind of question along the lines of if you walk a mile in three different directions and end up back at the same place where are you? I don't think I'll need to worry too much about that due to Tesla not having an R&D facility in Ireland and me not being much of a team player in any event. That said, he did take me to school with his charger for the past 48 hours.

With my newly minted logic board I started winding up the power into a 120v battery. I was too lazy to rig up to 240v. This was going to cost me of course but I didn't see that. Anyway, we have a problem. I can't command zero current and the charger is drawing more AC power then it is putting out DC power....hmmm....oh well,what could go wrong....


KABOOOMMM!


Say goodbye to power module number one and my right eyebrow. No camera rolling sadly as it would have been a big spike in views. Truly beaten, I slunk back to my cave never to touch a Tesla part again. Lesson learned.


Yeah Right! 



Isolated the charred remains of module one and on to number two. This time with a "safety resistor" in series with my battery. Same thing this time. Still can't command zero current. Anyone guess why yet?


Seems the power modules have two modes. Power limit mode and voltage limit mode. Switched to voltage limit mode and a curious behavior emerged. I could command the voltage limit perfectly and my current commands now applied to the AC RMS current from the mains. V300 , C2 would tell the charger I wanted 300vdc and I would allow 2 amps of AC current. Not enough? Too bad that's all you get. Go as high in DC voltage as this AC current will allow. V360 , C16 and you get what you see in the picture above.
Has anyone yet guessed why I can't command zero current with a 120v battery? The answer is in the question Perhaps Elon can use this as his new trick question for the fresh faced recruits...


----------



## Tomdb (Jan 28, 2013)

ahhaha got yah, trying to sink power into your charger are you? 

But Damien, did you get module 2 working in the end?


----------



## e^2 (Jul 22, 2017)

Agreed. Charger output impedance is too low so negative charge currents would get out of hand too quickly. Bummer!


----------



## kennybobby (Aug 10, 2012)

i'm not able to read between the lines here, so can someone expain what failed in the charger or what happened and why, in the interest of sharing technical information for everyone.

Just guessing from the picture of the glowing heater element, the second module was working and sending 9 Amps with a 16 Amp command, but it is much too cryptic to really understand what we are seeing.


----------



## jackbauer (Jan 12, 2008)

Added design files for V2 Charger control board to the Github :

https://github.com/damienmaguire/Tesla-Charger

Major changes :

Added 2M Serial EEPROM for parameter storage


Changed to a Vertical type B USB socket.


----------



## jackbauer (Jan 12, 2008)

Looks like I'm getting a new donation soon


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Looks like I'm getting a new donation soon


Very cool Christmas present


----------



## kennybobby (Aug 10, 2012)

i'm never going to work for Elon, i don't care about him or taking a quiz. 

But why did the charger fail--you never explained what happened?


----------



## jackbauer (Jan 12, 2008)

kennybobby said:


> i'm never going to work for Elon, i don't care about him or taking a quiz.
> 
> But why did the charger fail--you never explained what happened?


The charger power module blew because I took it out of it's comfort zone and didn't understand what I was doing. Nothing teaches like a failure 

Unlike say the Brusa chargers which are power AND current limited, the Tesla Gen2 charger is only power limited. If I connected a brusa nlg513 3.6kw or 12A to a to a 120v battery and tell it to go to full power it will ramp up to 12A and stop even though 12A x 120V is only 1.44Kw. Now, if I connect it to a 400V battery and tell it to go to full power what happens? It limits at 3.6kw or 9A. 

Now, lets try this with a Tesla charger module which has a 3.6kw power limit with no current limit AND whose current command relates to AC line current NOT battery current as I thought. I command 1A....no problem......2A ...no problem. See where this is going? I decided to command 10A. 10A x 230V = 2300W. Assuming no losses for the sake of simplicity that is about 19A DC at 120v. BOOOOOM.

A 240V battery (what i intend to use in my BMW project) will be fine.

Not being able to command zero current is related to minimum duty cycle on the output converter. Separate issue. As they used to say on Mythbusters : "We do this stuff so you don't have to"


----------



## jackbauer (Jan 12, 2008)

Kinda nice when things don't explode. Found some interesting info today. 



Charger modules can do 15A DC max
Minimum battery voltage to get full power is around the 200v mark
Can push 3.5kw at 210v Vbatt
Need to get working on some nice control software. Plan for tomorrow is to upgrade to a 50A AC breaker and wind up to 10kw


----------



## Tomdb (Jan 28, 2013)

You still using the code i put together?


----------



## jackbauer (Jan 12, 2008)

Yes Tom still using your code but fairly hacked up by now 

Wound up the new charger today to 30A AC input. Max that my current breaker can take. Tomorrow : 50A breaker time


----------



## jackbauer (Jan 12, 2008)

Full power

Video on the way.


----------



## jackbauer (Jan 12, 2008)

https://youtu.be/bPLqXCiArVM


----------



## Kevin Sharpe (Jul 4, 2011)

wow, that's impressive... congratulations


----------



## Martii (Jan 17, 2018)

annerajb said:


> I connected a raspberry pi with a MCP2551 and MCP2515 and the linux mcp251x kernel driver.
> The CANH and CANL are connected to the pin 5 (can L and pin 6can H ) on the third phase.
> Since all 3 phases share the canbus it does not make a difference which phase is the can connected too.
> The control board of the charger is still in place and powered up.
> ...


Could you share some more info about your raspberry pi setup? Why two different MCP chips? 

Sent from my Z1 using Tapatalk


----------



## annerajb (Jul 27, 2016)

Martii said:


> Could you share some more info about your raspberry pi setup? Why two different MCP chips?
> 
> Sent from my Z1 using Tapatalk


That was a typo I only used one MCP chip. Once you connect the single MCP CANH and CANL to the Gen3 you can read all can messages. Unless you cut the traces to the can lines from each phase. Before Hurricane Maria hit us I was working on controlling a single phase that had the traces cut.


----------



## Tomdb (Jan 28, 2013)

Connectors used in the Tesla charges and junction box GEN2

Power
connectors in the charger : Molex 43680-xxx6
Mating parts: Molex 44441-xxx6

Signal
Anyone have the spec for these connectors?


----------



## e^2 (Jul 22, 2017)

http://www.molex.com/molex/products...RIMP_HOUSINGS.xml&channel=Products&Lang=en-US

This shows it as a generic 6 position connector. It doesn't pictorially show your connector but it is listed in the list of part numbers.


----------



## jackbauer (Jan 12, 2008)

Just back home after two weeks in hospital. This Gen 3 Tesla charger was kindly donated by a viewer and arrived the day I left in the ambulance so only getting to open it up now. More hacking fun in the future Has anyone had success with the gen 3?


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Just back home after two weeks in hospital.


Welcome back Damien... we missed you


----------



## Tomdb (Jan 28, 2013)

I bett this one will be easy now. Unless you blow it up like you did the last one 

All joking aside, i believe Gen3 had the control board positioned in a way that removing it is not straight forward. However the canbus control should be relatively the same.


----------



## jackbauer (Jan 12, 2008)

First look inside the Gen 3 charger.


----------



## Martii (Jan 17, 2018)

jackbauer said:


> First look inside the Gen 3 charger.


Junction box on board? 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> Junction box on board?


Yes... teardown video posted further up thread iirc


----------



## jackbauer (Jan 12, 2008)

First V2 boards off the production line


----------



## Martii (Jan 17, 2018)

jackbauer said:


> First V2 boards off the production line


Sweet, great looking. 

Sent from my Z1 using Tapatalk


----------



## CKidder (Dec 12, 2009)

Maybe I missed it but did anyone ever post a reference for the connectors on a gen 2 charger? I'm interested in the best way to connect to the AC and DC sockets on the thing. I could probably easily figure out the AMPSeal connector on the other side. But, if someone has the part# it'd save me from looking it up. Thanks


----------



## Martii (Jan 17, 2018)

jackbauer said:


> First V2 boards off the production line


Damien,

What is IC5 for? I've checked schematics and was thinking that this is for activation of 12V per charger module. But after closer investigation I see that 12V goes directly to all modules?

Sent from my Z1 using Tapatalk


----------



## CKidder (Dec 12, 2009)

Martii said:


> Damien,
> 
> What is IC5 for? I've checked schematics and was thinking that this is for activation of 12V per charger module. But after closer investigation I see that 12V goes directly to all modules?
> 
> Sent from my Z1 using Tapatalk


IC5 is a transistor array that's used to create strong outputs from the board. It's used to do things like drive relays directly from the control board.


----------



## Martii (Jan 17, 2018)

CKidder said:


> IC5 is a transistor array that's used to create strong outputs from the board. It's used to do things like drive relays directly from the control board.


So this will be used to drive relays on the junction box? 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

CKidder said:


> Maybe I missed it but did anyone ever post a reference for the connectors on a gen 2 charger? I'm interested in the best way to connect to the AC and DC sockets on the thing.


I believe the crimp housing is Molex 44441-1006 (here)


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> So this will be used to drive relays on the junction box?


The two inverter contactors (see here)


----------



## jackbauer (Jan 12, 2008)

Thanks for that link Kevin. Always thought those connectors were a Tesla special but should have know they would use off the shelf. I must do a wiring diagram for the charger connectors. I only used 3 wires when testing : +12v , GND and a relay drive to turn on the mains.


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Thanks for that link Kevin. Always thought those connectors were a Tesla special but should have know they would use off the shelf. I must do a wiring diagram for the charger connectors. I only used 3 wires when testing : +12v , GND and a relay drive to turn on the mains.


Do you really need to use relay to turn on mains? 

Sent from my Z1 using Tapatalk


----------



## CKidder (Dec 12, 2009)

Martii said:


> Do you really need to use relay to turn on mains?
> 
> Sent from my Z1 using Tapatalk


It seems that unfortunately you do. The charger wants to see zero volts on the mains side until a certain point and then you can turn it on. There's a whole song and dance number to go through to make it work. It was discussed back in this thread somewhere.


----------



## CKidder (Dec 12, 2009)

Kevin Sharpe said:


> I believe the crimp housing is Molex 44441-1006 (here)


Indeed it is! I ordered parts from DigiKey and it all fits. Here is what I ordered:

044441-2006 (black instead of natural, they don't stock the 1006)
1718250100 (10-12ga female blade crimp connector)
0433750001 (14-16ga female blade crimp connector)

It looks like the wiring in the charger is around 14ga so I can probably use that for the external wiring too.

Now, my next question would be, what's the pinout? I'm guessing that red and black is probably AC hot/neutral for three phases? Are the white, brown, purple, and yellow wires the output DC to the battery? White being ground and the colored wires being positive? I don't seem to have any schematic for the car that lists this connections.


----------



## Martii (Jan 17, 2018)

CKidder said:


> Indeed it is! I ordered parts from DigiKey and it all fits. Here is what I ordered:
> 
> 044441-2006 (black instead of natural, they don't stock the 1006)
> 1718250100 (10-12ga female blade crimp connector)
> ...


Red and black is DC part. 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Unfortunately due to everyone using different colours I can understand the confusion.

Best part is the way Tesla connect to both connects is with completely orange jumpers.  However red and black are positive and negative. 

Did someone end up making an overview of the pinouts on the signal connectors with the new logic board installed?


----------



## Martii (Jan 17, 2018)

Tomdb said:


> Unfortunately due to everyone using different colours I can understand the confusion.
> 
> Best part is the way Tesla connect to both connects is with completely orange jumpers.  However red and black are positive and negative.
> 
> Did someone end up making an overview of the pinouts on the signal connectors with the new logic board installed?


It's done on Damiens github 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Not that I can see, I can see what signals go onto the connector on the board, but no translation to the connectors on the case.

Otherwise, I will measure the connections and create a nice little diagram for all.


----------



## jackbauer (Jan 12, 2008)

Reds are battery positive. Blacks are battery negative. White are AC Neutral and Colours are AC phase.


----------



## CKidder (Dec 12, 2009)

jackbauer said:


> Reds are battery positive. Blacks are battery negative. White are AC Neutral and Colours are AC phase.


Thanks, that does make perfect sense now that I think about it. So the reds and blacks can be paralleled together to get the full 10kw of charging then the input wires could be paralleled or run as separate phases. I have 208V, 240v, and 480v three phase available so I can go to full three phase and run each module off of a different phase. 

So, another question. The charger is rated to 400v supposedly. Am I to assume that I should not power it with 480V three phase?


----------



## jackbauer (Jan 12, 2008)

When I did some investigation on the EU HVJB it does indeed just parallel the DC wiring. The AC wiring is either paralleled for high current single phase or split to use phase to neutral on a 3 phase system. I'm not sure what the US version does but I'd say it just parallels the AC for high current single phase. I have only ran the charger from 230v single phase but did wind it up to 10kw for a few minutes. 

One thing to be very careful about is the current command. You are NOT commanding battery current but rather AC line current. What battery voltage are you planning to use? Don't make my mistake and try and run high current with a 120v pack


----------



## Tomdb (Jan 28, 2013)

Damien, OUT4 connects to which pin? Conn 2 pin 4.

That is the only signal I could not map.


----------



## Kevin Sharpe (Jul 4, 2011)

I can confirm the main PCB in the US and EU HVJB are identical. On the US HVJB two contractors are removed (K1 and K3) and a copper bus bar is used to short AC inputs L1/L2/L3 together.

I've traced out all the connections on the HVJB and have started producing a schematic which I'll share once complete. In the meantime here's the main HV AC/DC circuit excluding the current sense and fuse that supplies power to the Front HVJB.


----------



## Tomdb (Jan 28, 2013)

Got proximity detection coding in.
Working on the pilot signal, currently an detect the current limit set by the EVSE.

Still have to implement the start up handshaking. Also the choice of single or three phase setup is hard coded for now.
Unless someone makes a 'smart' junction box there should be no reason to change on the fly.

https://github.com/tomdebree/Tesla-Charger/blob/master/Gen2TeslaCharger/Gen2TeslaCharger.ino


----------



## jackbauer (Jan 12, 2008)

V2 Charger boards just in


----------



## Tomdb (Jan 28, 2013)

Was a bit too late last night (plus some beers in) and dumb me forgot to add the volatile definition to the variables. 
Solved now, the board reads the pilot signal dutycyle and calculates the AC current limit.

If the Proximity indicates a fully seated plug, it then defines the current limit per charger module. Currently the idea is just to share the current over the modules when in single phase connection. Might look at doing a fancy tiered system later.
In a three phase system the module just gets the current limit as is.

Now just to get an EVSE to test the functionality with to see if it will accept the sequencing I have.

Next bit to add to the code is:

Plug detection and Pilot signal will have the charger start automatically
Canbus controls for limits

In the image you see the serial stream showing, timestamp, AC limit from Pilot, Pilot dutycycle, and then Phase limit for a single phase setup.


----------



## jackbauer (Jan 12, 2008)

Nice work Tom I'll get some testing done next week.


----------



## Tomdb (Jan 28, 2013)

What are the part numbers for the signal connectors? 
Id like to make a loom instead of pushing almost fitting pins on the connector.

Damien, do you have an EVSE? Then I could make sure you have some code that will turn the charger on once it detects it is plugged into an EVSE and gets the Pilot signal.

Using Collins code any settings you send it via serial will be saved, thus upon booting it will retain these. Meaning that you could make it a complete standalone charger without the need to talk to it via can.

Unless ofcourse you want to be crazy and run a few of the units in parallel, then can monitoring and control is very handy.


----------



## jackbauer (Jan 12, 2008)

Part numbers for the plugs in the pictures. Have an evse and will test in the Panzer soon with the Ampera battery


----------



## Tomdb (Jan 28, 2013)

Now it should be possible to use the current setting to limit max AC current draw by the charger. 

Autostart almost works, however when the Pilot signal gets pulled low by, EVSE_Activate going high the pwm reading freezes. Thus it stops being dynamic and will not respond if the EVSE decides to derate for what ever reason or if the pilot signal stops all together.

Looking now where to scope to see what is happening, most likely an EVSE will not find the signal acceptable.


----------



## Tomdb (Jan 28, 2013)

Will do some more testing tomorrow, realised now that the pwm goes through a 1K resistor at the evse side. Dohhhhh

More to follow.


----------



## Tomdb (Jan 28, 2013)

Turns out it were two missing grounds.

Q1 and D5, easily solved with two bits of component leads to a ground through hole. 

Code is checked and working, pilot signal gets pulled to +/- 8.7V when plugged in. Then when the proximity is detected it pulls the pilot to 6V (after the fix).

So if anyone wants to try the code to see if the chargers now will kick on and an evse will provide AC power.
Might even be possible to skip the AC relay and just use the commands to the EVSE to trigger the AC power.


----------



## jackbauer (Jan 12, 2008)

Well spotted Tom. Amazing how these things get through all the checks. Time for a V3 board


----------



## jackbauer (Jan 12, 2008)

V3 design files released on Github along with new S/W from Tom.
https://github.com/damienmaguire/Tesla-Charger


----------



## Tomdb (Jan 28, 2013)

Borrowed an home charge adaptor from someone at work. 

Testing this weekend, just need to rig up something that will not kill me, as I do not have a proper type 2 socket. (Anyone got a spare in the UK?)


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> I do not have a proper type 2 socket. (Anyone got a spare in the UK?)


Are you looking for a Type 2 Charging Station? If you are, The Phoenix Works will install one at your home for £199 + VAT (here)


----------



## Tomdb (Jan 28, 2013)

Kevin, i am looking for a car socket.

However now using the home adapter I have been able to prove my coding did not work.

Proximity was set to the Type 1 spec (so with push button), however the Type 2 Proximity determines cable amperage.
Now added selectable Type 1 and Type 2 socket, this way you can determine if the power the EVSE will let you draw does not exceed the cable.

Also added a time-out to the Pilot line, so if the period is 20% off it sets the current limit to zero.

I got the green light to turn on and the 240Vac relay to click. 

Anyone found the temperatures in the can messages?


----------



## jackbauer (Jan 12, 2008)

Tom, you Sir are a steely eyed charger man Well done!


----------



## Tomdb (Jan 28, 2013)

Before anyone does extensive testing I would like to get the temperatures figured out so one knows when things are about to melt.

Anyone in need of being able to parallel two of these all of a single phase or split phase? As that would require me to add the functionality of being able to read above 52Amps AC on the pilot.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Anyone in need of being able to parallel two of these all of a single phase or split phase? As that would require me to add the functionality of being able to read above 52Amps AC on the pilot.


Several builds are planning to use two chargers and at some point we'll need an option to select between 1 and 3 phase (we'll add a relay to the HVJB to switch the AC fed to the chargers).

Oh, we will also want to support 10+ chargers at some point in the future for our open source SuperCharger


----------



## Tomdb (Jan 28, 2013)

In the software there already is one or two phase configuration, I suspect you do not want to change on the fly. As the hardware is complicated because messing up would mean quite a impressive direct short between three phases.

The next step is to do temperature monitoring, which is coming along quite well.

The idea is to have two modes of operation, Master and Slave. The slave just taking commands over CAN.

So for your super charger I would think all will run as slaves.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Kevin, i am looking for a car socket.


Ah, ok, VAN GILS have one in The Netherlands from a Tesla Model X (see here).

I also have a single phase Type 2 assembly from a BMW that I was going to put on ebay. Cost £100... PM if interested


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> In the software there already is one or two phase configuration, I suspect you do not want to change on the fly. As the hardware is complicated because messing up would mean quite a impressive direct short between three phases.


Not sure what you mean by "on the fly" but Tesla already switch the AC in a small box that staps onto the European HVJB (see slim metal box at bottom of this photo).


----------



## Tomdb (Jan 28, 2013)

Do they switch the modules from all being on one phase to each having their own phase?

Are the relays for the coupling of 'AC' lines onto the battery for DC fast charging?

The configuration to do the current command per module is based on if the modules share a phase or are in a three phase configuration.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Do they switch the modules from all being on one phase to each having their own phase?


Yes.



Tomdb said:


> Are the relays for the coupling of 'AC' lines onto the battery for DC fast charging?


Yes, the two (US) or four (EU) contactors on the HVJB PCB are only used to connect the 'AC' lines from the charging connector to the DC bus bars that connect to the battery, motors, and front HVJB.

I'll try to publish the HVJB schematic next week to clarify this. 



Tomdb said:


> The configuration to do the current command per module is based on if the modules share a phase or are in a three phase configuration.


Last time I drove a Tesla Model S it would automatically select between one phase, three phase, and DC configuration depending on what's available at the charging station. My guess is the charger is making this decision based on the voltage it senses on the 'AC' inputs.


----------



## Tomdb (Jan 28, 2013)

Kevin, i am looking forward to seeing the HVJB schematic for an EU box.

I have worked on the code some more, now the debug will show every 500ms instead of other code related. This makes it alot more readable.

The next step would be to actually charge a battery, however I am still waiting on parts to do it safely. Like the Type 2 Socket I ordered yesterday.

So if anyone has a charger with the opensource board in it and would like to do some testing please go a head, as I would like to prove out the code.


----------



## tiger82 (Sep 23, 2015)

We're putting together a dual Gen2 charger setup. At the track, ,we will have a separate 208V, 50 amp circuit going into each charger. We will no be using an EVSE. Are we going to be able to command > 40 amps so we can still obtain the 3.3kW/module?


----------



## Tomdb (Jan 28, 2013)

I could include a manual override, so that you can setup the charger to pull your desired AC current set by serial comms or can. 

And then have am input just to switch the charge on by applying 12V.

Anything is possible, but how would you control/set/monitor you charging voltage?


----------



## Martii (Jan 17, 2018)

Tomdb said:


> I could include a manual override, so that you can setup the charger to pull your desired AC current set by serial comms or can.
> 
> And then have am input just to switch the charge on by applying 12V.
> 
> Anything is possible, but how would you control/set/monitor you charging voltage?


I think going with ESP32 would be great so any settings can be done via BLE or WiFi using just mobile phone. ESP32 can has can support and more can be added via SPI and MCP 2515 

Sent from my Z1 using Tapatalk


----------



## tiger82 (Sep 23, 2015)

So the charger isn't current limited to 40A? I know that if you plug a Model S into a charger being fed with 208V instead of 240V, the charge power will be decreased proportionally. Yes, we were planning on starting charge when 12V was applied. We will run the charger flat out at in the constant current phase, with a CV setpoint of approx. 400V. We will have our datalogger and BMS both monitoring charging - as well as our eyes on the gauges.


----------



## Martii (Jan 17, 2018)

tiger82 said:


> So the charger isn't current limited to 40A? I know that if you plug a Model S into a charger being fed with 208V instead of 240V, the charge power will be decreased proportionally. Yes, we were planning on starting charge when 12V was applied. We will run the charger flat out at in the constant current phase, with a CV setpoint of approx. 400V. We will have our datalogger and BMS both monitoring charging - as well as our eyes on the gauges.


On the charger it says 48A, 16A per module and 45A DC. 

Sent from my Z1 using Tapatalk


----------



## tiger82 (Sep 23, 2015)

Thank you!


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Kevin, i am looking forward to seeing the HVJB schematic for an EU box.


First draft HVJB schematic released (see here) 

I'll produce something similar for the AC switching box in the near future


----------



## DrJeff (Apr 24, 2015)

Kevin Sharpe said:


> First draft HVJB schematic released (see here)
> 
> I'll produce something similar for the AC switching box in the near future


Hi Kevin,

Very useful diagram. Thanks.

Some component questions...

1) U1 (ACS758KCB-150B-PFF-T), F7 (100A) and J6 
- Is this the connection to the Front HVJB that links to all the HV accessories (cabin heater, AC, DCDC, coolant heater)?

2) J11
- For DC charging control and the economizer for the contactors?

3) Is the US version just a delete of two contactors and associated lines?

Thanks
Jeff


----------



## Tomdb (Jan 28, 2013)

Kevin Sharpe said:


> First draft HVJB schematic released (see here)
> 
> I'll produce something similar for the AC switching box in the near future


Where does the AC switching box live? I have not really noticed it on a Tesla.

Hoping to get my own Tesla Charger testing done tomorrow.


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> 1) U1 (ACS758KCB-150B-PFF-T), F7 (100A) and J6
> - Is this the connection to the Front HVJB that links to all the HV accessories (cabin heater, AC, DCDC, coolant heater)?


Correct, it's the power source for the Front HVJB.



DrJeff said:


> 2) J11
> - For DC charging control and the economizer for the contactors?


J11 plugs into the control board which has the CAN controller and monitors functions like the reed switches used to detect when the HVJB case is open and when the HV cable is disconnected.



DrJeff said:


> 3) Is the US version just a delete of two contactors and associated lines?


The EU and US versions use the same PCB. The only difference is the US build removes two contactors (which are not required because the Tesla charging connector only has two power pins unlike the EU charging connector which has four power pins).


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Where does the AC switching box live? I have not really noticed it on a Tesla.


It's a small metal box that bolts onto the AC output 'slot' on the EU HVJB (see photo in this post). It's switching the AC signals between the HVJB and the Chargers. I'll produce a drawing when I get a moment


----------



## annerajb (Jul 27, 2016)

Quick question. Not sure if off topic.

Does the HVJB contain the precharger resistance? Or is there any additional pre charger resistors in the car? The only picture I found of the RARA 23 Ohm Wirewound resistor appears to be too low to be able to precharge from 0v to 420v without exceeding the watt rating.


----------



## Martii (Jan 17, 2018)

annerajb said:


> Quick question. Not sure if off topic.
> 
> Does the HVJB contain the precharger resistance? Or is there any additional pre charger resistors in the car? The only picture I found of the RARA 23 Ohm Wirewound resistor appears to be too low to be able to precharge from 0v to 420v without exceeding the watt rating.


Ok I also have a question about precharge, not sure if this was mentioned before. What should I use as precharge. Also what is the sequence to be done manually if I wanted to use existing arduino code. I've built test rig based on arduino and MCP. The problem is I do enable at the power on and activate manually. I also have no precharge resistor connected. 

Sent from my Z1 using Tapatalk


----------



## jackbauer (Jan 12, 2008)

Precharge is handled in the Tesla battery by the bms. The drive unit and charger are both precharged from here. External or manual precharge will be required to run the charger stand alone.


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Precharge is handled in the Tesla battery by the bms. The drive unit and charger are both precharged from here. External or manual precharge will be required to run the charger stand alone.


So how to make manual one and is it needed to test charge? 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Charger will not work without seeing a battery voltage at the output.

So an easy way to do this would be with a light bulb across a contactor. So you wait for some time, or measure it using a multimeter befor closing the contactor.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> Charger will not work without seeing a battery voltage at the output.
> 
> So an easy way to do this would be with a light bulb across a contactor. So you wait for some time, or measure it using a multimeter befor closing the contactor.


So can I connect it directly? I see some sparks while connecting is this what precharge eliminates? 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

No you need to connect a resistance in series before making a direct connection.

I had time to get a setup built in the shed/garage, I can now say the code works. 
Latest code on github

Disclaimer, as always this is open source and I take no responsibility for how this information is used. You have a brain yourself, so please use it AC and HV are not to be taken lightly.


On that note, 10Amps works a treat. Chargers will respond to dynamic current and voltage adjustments.

Next step is to borrow an evse again and wire up my charge socket I just got in. This way I can test the timing to see if switching the EVSE on at the right time removes the need for an AC relay.


----------



## annerajb (Jul 27, 2016)

How do you calculate the resistance ohms so you know is not gonna have a surge exceeding it's watt ratings after connecting it?
My understanding is that the Tesla BMS has a relay and a precharge resistor that is closed to bring the voltage and charge the caps on the inverter before closing the main contractors. But I don't understand how they achieve this with a resistance rated to 5kw if it should receive around 7kw from the closing of the relay for the precharge.


----------



## Tomdb (Jan 28, 2013)

http://liionbms.com/php/precharge.php

http://www.diyelectriccar.com/forums/showthread.php/precharge-why-do-need-do-do-25419.html

Since the resistor will only see the actual power for a very short period of time. Most resistors can take alot of power many times its rating. 

Example : http://www.farnell.com/datasheets/2327272.pdf?_ga=2.189045539.923748377.1520616708-935843472.1517666509&_gac=1.94846702.1520450428.Cj0KCQiAuP7UBRDiARIsAFpxiRIE5epK8fxXL_EUVhFzittiw_HpwyFwMpdHUadDx129GU933s6MeSoaAiLlEALw_wcB

This series does 5x rated for 5 seconds


----------



## Martii (Jan 17, 2018)

annerajb said:


> How do you calculate the resistance ohms so you know is not gonna have a surge exceeding it's watt ratings after connecting it?
> My understanding is that the Tesla BMS has a relay and a precharge resistor that is closed to bring the voltage and charge the caps on the inverter before closing the main contractors. But I don't understand how they achieve this with a resistance rated to 5kw if it should receive around 7kw from the closing of the relay for the precharge.


Si what is the timing to make it run. I do everything manually except running can via arduino. What I do now.
1. Connect battery
2. Connect 12v then 5V and enable (I see can activity)
3. Feed it with can frames from github to switch it on
4. Connect mains
5. Set voltage via can
6. Set current via can

And nothing happens except extra can traffic. 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

using damiens open source board with my latest version of the code:
All info on github for hardware and code : https://github.com/tomdebree/Tesla-Charger



12V feed to controller and modules
hardware enable to modules to initiate can
Apply HV DC via precharge
Direct connect HV DC
Set Curren and Voltage via Serial to the Controller example : 'v300' 'c10'
activate via serial the charging 's1'
Switch AC mains as soon as the controller shows a setting update

So if you have any other hardware or software your results may vary.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> using damiens open source board with my latest version of the code:
> All info on github for hardware and code : https://github.com/tomdebree/Tesla-Charger
> 
> 
> ...


Is there any timeout if mains is feeded too late?


Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

i do not know, I just switched it by hand as soon as the controller posted that the charger is commanded on.

I will do some experimenting tomorrow with timing.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> i do not know, I just switched it by hand as soon as the controller posted that the charger is commanded on.
> 
> I will do some experimenting tomorrow with timing.


By controller you mean open-source board or some can message that shows up from the charger? 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

The opensource board, it is the controller of the Tesla charge modules.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> The opensource board, it is the controller of the Tesla charge modules.


So I'm doing it wrong as DC is connected before 12V or enable and also no precharge. So I need to find some simple precharge, I do have some resistor wire laying around but I'm not sure how many loops will do the job. 

Sent from my Z1 using Tapatalk


----------



## jackbauer (Jan 12, 2008)

Yes the charger modules time out after about 3 seconds if mains is not applied. I would advise you to buy or build one of the control boards as this takes out the messing and now has working software thanks to Tom.


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Yes the charger modules time out after about 3 seconds if mains is not applied. I would advise you to buy or build one of the control boards as this takes out the messing and now has working software thanks to Tom.


I plan to build one but Tesla charger I have came cheap that I'd like to make sure it works before I invest more. 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> I plan to build one but Tesla charger I have came cheap that I'd like to make sure it works before I invest more.


Investing in the open source controller hardware/software is the cheapest way I know of testing Tesla chargers


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Investing in the open source controller hardware/software is the cheapest way I know of testing Tesla chargers


Just for pure testing this board is overkill ;-) I use components laying around

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> Just for pure testing this board is overkill ;-) I use components laying around


afaik no-one has published the CAN messages for the Tesla controller board. If you wish to talk directly to the charger power modules without a controller you can work out the details by reviewing the hardware and software produced by Damien and Tom


----------



## jackbauer (Jan 12, 2008)

Looking at the Gen 3 charger today. First powerup test a success


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Looking at the Gen 3 charger today. First powerup test a success


Nice any closeup on how it's wired? 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

jackbauer said:


> Looking at the Gen 3 charger today. First powerup test a success


Nice one, any can sniffing going on? 
The big 'issue' with the gen 3 is the charger controller is buried in the charger and nearly impossible to free.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> using damiens open source board with my latest version of the code:
> All info on github for hardware and code : https://github.com/tomdebree/Tesla-Charger
> 
> 
> ...


So you're saying charger will know that battery was connected directly or via precharge?

Any hints on what's good for precharge? Light bulb 100W AC? 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> Any hints on what's good for precharge?


Damien often uses a heating element from an oven... see his videos for details


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Damien often uses a heating element from an oven... see his videos for details


I don't have one laying around :-( some parameters, schematics out there? 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> I don't have one laying around :-( some parameters, schematics out there?


Read the links in the post from Tom;

http://www.diyelectriccar.com/forums/showpost.php?p=968961&postcount=303


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Read the links in the post from Tom;
> 
> http://www.diyelectriccar.com/forums/showpost.php?p=968961&postcount=303


Ok found old kettle, 26 Ohm resistance might be good for such application. No sparks while connecting battery with this in series. 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Charger does not require to see precharge.

Power cycled mine a couple of times without disconnecting HV. 

Got some nice big cables in to do more AC testing, Would not want to crimp tiny cables to a nice new socket that should be good for 63A per phase. 

Going to use 8 AWG wire (8.37mm2) and powerpole PP75. http://uk.farnell.com/webapp/wcs/stores/servlet/ProductDisplay?catalogId=10001&langId=44&urlRequestType=Base&partNumber=2101985&storeId=10151

Should manage to get an EVSE sorted this week to see if my code plays nice.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> Charger does not require to see precharge.
> 
> Power cycled mine a couple of times without disconnecting HV.
> 
> ...


Now it's all clear. I'll keep battery pack connected then. Will have to check arduino can code one more time. 

Sent from my Z1 using Tapatalk


----------



## mikeydantonio (Mar 13, 2018)

Hello, is there a possibility that you could provide weight and volume estimates for the charger? Thank you.


----------



## Kevin Sharpe (Jul 4, 2011)

mikeydantonio said:


> Hello, is there a possibility that you could provide weight and volume estimates for the charger?


I already answered your question in the other thread;

http://www.diyelectriccar.com/forums/showthread.php?p=971009#post971009


----------



## Martii (Jan 17, 2018)

Can anyone have a look at this dump to see if it looks OK? I'm trying to charge at 120V 1A but nothing is happening. This dump is done via Linux can-utils candump.


----------



## Tomdb (Jan 28, 2013)

Got a picture of your setup?

The can messages do not look like you have three modules active.

Plus the code does currently not support 120Vac. As the modules get told what to expect.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> Got a picture of your setup?
> 
> The can messages do not look like you have three modules active.
> 
> Plus the code does currently not support 120Vac. As the modules get told what to expect.


I use just first module, 120V is on DC side AC is 230V.

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

I would try something like 3A instead of 1. What HV voltage are you commanding?


----------



## Martii (Jan 17, 2018)

Tomdb said:


> I would try something like 3A instead of 1. What HV voltage are you commanding?


I command 120V DC, 18650 battery pack is at around 111V DC. I might add another module to get 135V.

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

As the code we currently use works, you might try building it so it works for what ever you are using.

You can get it working on any arduino with a CAN shield, just change the pins and proper libraries. 

Did more testing, gotten the can decoding fixed for AC and DC feedback on currents. Also a can status output onto the external can bus.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> As the code we currently use works, you might try building it so it works for what ever you are using.
> 
> You can get it working on any arduino with a CAN shield, just change the pins and proper libraries.
> 
> Did more testing, gotten the can decoding fixed for AC and DC feedback on currents. Also a can status output onto the external can bus.


I'm using wemos lolin32 esp board and Colin library as it gives me almost 100% compatibility with your code. It's just matter of copying parts/functions I need and it compiles just fine. I think I see correct can messages and phase one module reacts to battery and AC voltages but somehow doesn't start charging when I follow the instructions given here. 

Sent from my Z1 using Tapatalk


----------



## Martii (Jan 17, 2018)

Tomdb said:


> I would try something like 3A instead of 1. What HV voltage are you commanding?


did try 3A no luck


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> did try 3A no luck


Can I suggest you buy or build Damien's board? This is known to work (I've used it here) and will save everyone a lot of time and effort


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Can I suggest you buy or build Damien's board? This is known to work (I've used it here) and will save everyone a lot of time and effort


Ok will try to source all the parts and order PCB.

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

My best guess would the that you are not timing the application of the 12V signals/can/AC correctly. 

I have not messed around with varying the can and 12V enable signal, this might also end up faulting out the charger.

Worked a bit more on cleaning up my code, gotten the currents to report nicely. Also implemented a crude status message on the external can bus. 

Will now start looking at getting an other mode setup where the charger controller will try to achieve CC on the DC side to a setpoint.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> My best guess would the that you are not timing the application of the 12V signals/can/AC correctly.
> 
> I have not messed around with varying the can and 12V enable signal, this might also end up faulting out the charger.
> 
> ...


Are there any special can commands? 

I was thinking about doing some math taking pack voltage into count (label on the charger claims wide DC charging range) and commanding AC current as it's done now to match asked DC current. Also this would let us doing some "fault management" so DC side never goes over 15 A per module (otherwise it blows up as Damien reported). 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

No special commands, just will make sure there are limits in place.

The reason you would want to run a current limit is due to a battery being cold or just a small pack. This way you can send it a DC current limit via can.

However most will not run into a charge limit of 45A, however when you got multiple units this might be needed.


----------



## Tomdb (Jan 28, 2013)

Small hickup in getting the DC current limiting in place. It seems that the message containing the DC current and Voltage does not transmitted enough to really make good use of it.

Guess for now using just AC current limit is good enough, you just need to use your brain when setting it instead of relying on the micro to do the thinking.

Need to figure out why some of the can messages are not being processed fast enough. Seems that the code is generating quite a bit of overhead, when it gets a serial command it takes a couple of seconds before it processes it.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> Small hickup in getting the DC current limiting in place. It seems that the message containing the DC current and Voltage does not transmitted enough to really make good use of it.
> 
> Guess for now using just AC current limit is good enough, you just need to use your brain when setting it instead of relying on the micro to do the thinking.
> 
> Need to figure out why some of the can messages are not being processed fast enough. Seems that the code is generating quite a bit of overhead, when it gets a serial command it takes a couple of seconds before it processes it.


I wouldn't bother reading DC. Just check the battery pack voltage into account. So let's say you want 2A DC charging on 120V battery battery pack. You're asking for around 240W of power. This roughly equals to 1.1A 230V AC. If someone asks 10A DC on 200V battery pack this equals to 2000W and that means 8.7A AC

Does it make sense? There can also be an option of reading AC voltage to make it more precise. 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

The issue is not that the data is not on the can bus, but the Arduino Due has too much overhead to get it all into the code.

Which sounds quite strange, so now I will look at which parts of the code cause this issue.


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> The issue is not that the data is not on the can bus, but the Arduino Due has too much overhead to get it all into the code.
> 
> Which sounds quite strange, so now I will look at which parts of the code cause this issue.


Hi Tom,

Are your code updates showing up in your GitHub, or in Damien's? I'm just not familiar enough with GitHub to know where the latest versions are.

Thanks
Jeff


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> I'm just not familiar enough with GitHub to know where the latest versions are.


Tom's is most active on the charger code;

https://github.com/tomdebree/Tesla-Charger/commits/master

For reference, here's Damien's charger code;

https://github.com/damienmaguire/Tesla-Charger/commits/master


----------



## DrJeff (Apr 24, 2015)

Hey Tom,

In your config.h code you assign some names (like DIG_OUT_1) that are used in the code to map to output pins on the connector X046.

Is it possible to assign pins to the other connector also? How did you know which pins are mapped to which output connectors?

Thanks
Jeff


----------



## Tomdb (Jan 28, 2013)

I drew up this schematic to help explain.

https://github.com/damienmaguire/Tesla-Charger/blob/master/Gen%202%20Charger%20Connections.pdf


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> I drew up this schematic to help explain.
> 
> https://github.com/damienmaguire/Tesla-Charger/blob/master/Gen%202%20Charger%20Connections.pdf


Yes, I spotted that diagram. I actually wired up connections to the CANH and CANL pins but never found any data. So the process would be...

1) define the mapping in config.h
2) assign the mapping as output in the code
3) write code to drive the output values

I see that CAN0 and CAN1 are initialized, with CAN1 referencing the external port. I found the CAN1.sendframe command, but I didn't see any data appearing on CAN1 at all (however I wasn't at the stage of charging).

Thanks
Jeff


----------



## Tomdb (Jan 28, 2013)

Depending on what version you are running, the control board only publishes on the can to the modules. My latest version should be sending out one status message.


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> Depending on what version you are running, the control board only publishes on the can to the modules. My latest version should be sending out one status message.


You are right, I'm not running the latest version so I'm not seeing any traffic on the external CAN lines. I'm testing out a V1 board with a GEN2 charger.

I'm seeing the connection now between Damien's full schematic (with the Digital pins identified (and referenced in the code) and how they tie into the connector (on the board) that runs to the external ports.

So would it be correct to say that CAN1 which is exposed on the external port, could also listen for frames that could replace (or replicate) the commands that the code is currently looking for on the serial port?

Thanks
Jeff


----------



## jackbauer (Jan 12, 2008)

Anyone looking for boards etc for this and other projects please see here :
http://www.diyelectriccar.com/forums/showthread.php?p=973825#post973825


----------



## Martii (Jan 17, 2018)

OK it works now  on ESP32


----------



## jackbauer (Jan 12, 2008)

Martii said:


> OK it works now  on ESP32


Well done. Photos? Video?


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Well done. Photos? Video?


I'll post some pics soon. I know now why this one was so cheap. Module nr 3 does just first click and it's not charging :-(

Sent from my Z1 using Tapatalk


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Well done. Photos? Video?


Here we go it looks nasty - hence so many mistakes before I got it right:









Here is inexpensive Wemos Lolin32 ESP32 development board ($5 from China) also cheap Ti 3.3V can transceiver also from China ($3). 









I have used some RC servo cables to connect per power module - easy to use









As I was fed up with timing I have installed 2 relays - one for charger activation and second for mains AC.









Finally full setup - few of my DIY RC 18650 battery packs out of used laptop batteries connected to give me 110V DC. Simple power supply (12V from 7s battery pack), and LM based 12V->5V voltage regulator.

Some Arduino code based on your work.


----------



## jackbauer (Jan 12, 2008)

Nice  I had the same problem. Module 2 in my first charger was dead. Would be very cool to get wifi control of the charger.


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Nice  I had the same problem. Module 2 in my first charger was dead. Would be very cool to get wifi control of the charger.


I was thinking more about Bluetooth, does not make you to disconnect from Wi-Fi you're already using.

Did anyone remove power module PCB? Maybe they're easy to fix? 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Hmm guess I should have looked at code the others helped write. Open source is great, but then again a fresh pair of eyes to proof read code is even better.

Delays in a main loop, thats a no-no. 


```
case 1://Charger on
--->  if (bChargerEnabled == false) <---
      {
        bChargerEnabled = true;
        switch (parameters.enabledChargers)
        {
          ....
        }
        delay(100);
        digitalWrite(DIG_OUT_1, HIGH);//MAINS ON
      }
      break;
```
Now it only changes the charger state and switches the modules and relay on if the previous state was off. This now by passes the delay of 100ms each time.


----------



## Tomdb (Jan 28, 2013)

Had to go test the code out in the garage, just 30 minutes of play time before my hands were getting a bit numb.

Have proven now all the can decodes properly. Still the serial input seems to bog it down hard, no idea yet why.

Latest Code Below:

https://github.com/damienmaguire/Tesla-Charger

Will start too look at structuring a command message for the canbus. 
Should not be too hard to implement as we only care about HV DC voltage and current Setpoint, plus a allow charge flag.


----------



## jackbauer (Jan 12, 2008)

Excellent work Tom


----------



## Kevin Sharpe (Jul 4, 2011)

Amazing!


----------



## Tomdb (Jan 28, 2013)

Written the bulk of the software with the following changes:
1 - Input 1 needs to be pulled to 12V to allow the charger to work, can function as an 'O' shit switch
2 - Can control structure applied
- Message just has an enable disable byte and voltage and current setpoint
- Timer to monitor if the control message comes in below 500ms, otherwise the charger times out and turns off


----------



## Tomdb (Jan 28, 2013)

Tested the new features.

The D1 input now works as enable line for the charger, this will allow you to easily stop charging disconnecting it from 12v. This can be done as a killswitch or by a BMS via a relay.

Can control works now, still working on verifying if the voltage regulation works. 

In order to have the current regulation do anything, I need to get the DC current regulation code working. 

As always, updated github code and included a pdf showing the implemented serial control.


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> Written the bulk of the software with the following changes:
> 1 - Input 1 needs to be pulled to 12V to allow the charger to work, can function as an 'O' shit switch
> 2 - Can control structure applied
> - Message just has an enable disable byte and voltage and current setpoint
> - Timer to monitor if the control message comes in below 500ms, otherwise the charger times out and turns off


Hi Tom,

I was looking through the new code and had some questions/queries...

Lines 331,332,333 : They all reference CHARGE1... looks like it should be 1,2 and 3

I'm testing with Damien's GEN1 board that doesn't have a EEPROM. While the code tests for EEPROM it looks like it will attempt a write to EEPROM even when disabled.

Does SetRXFilters... clear all filters (i.e. does not filter anything). I read Colin's documentation but wasn't sure what a "0,0" parameters would do.

Lines 177-180 Are these commented out because your in testing mode and only was to drive one charger brick?

Have you plans for any kind of charging profile logic?

In my setup (as currently) planned, I've got an AVC2 handling the handshake with the EVSE (but I don't fully understand yet how it knows what current setting to use). My Main Computer will monitor the BMS and individual cell voltages during charging, so I'll be using the CAN interface to drive the charger.

Thanks
Jeff


----------



## Jimbo69ny (Feb 13, 2018)

Following. I will buy a controller if you offer a reliable working product. 

Keep up the good work!


----------



## Tomdb (Jan 28, 2013)

DrJeff said:


> Lines 331,332,333 : They all reference CHARGE1... looks like it should be 1,2 and 3


Well Spotted, very well. Fixed. Then it does mean you can leave enable high and just turn it on and off via can control.




DrJeff said:


> I'm testing with Damien's GEN1 board that doesn't have a EEPROM. While the code tests for EEPROM it looks like it will attempt a write to EEPROM even when disabled.
> 
> Does SetRXFilters... clear all filters (i.e. does not filter anything). I read Colin's documentation but wasn't sure what a "0,0" parameters would do.


Yes currently no EEprom used, I will look at getting coding setup to use the SAM internal memory to save settings. Without using the EEprom you currently cannot save settings that are changed via the serial menus.



DrJeff said:


> Lines 177-180 Are these commented out because your in testing mode and only was to drive one charger brick?


Yes shortens startup times, only one working brick in my charger. So why power up the others. Please uncomment depending on the charger bricks you want to use.



DrJeff said:


> Have you plans for any kind of charging profile logic?


No, you tell it end voltage and max amps. The charging modules should then do the rest in terms of Constant Current and Constant Voltage. I would have the BMS determine those two values and tell the charger what to do.



DrJeff said:


> In my setup (as currently) planned, I've got an AVC2 handling the handshake with the EVSE (but I don't fully understand yet how it knows what current setting to use). My Main Computer will monitor the BMS and individual cell voltages during charging, so I'll be using the CAN interface to drive the charger.


I would strongly recommend fixing the missing grounds and using the controller with the propper handshaking and current limiting. This works fine, and will keep you from freaking out the EVSE.

Current regulation will work as follows:
1. AC max from wall
2. Reduced by max DC current request
3. Limited by thermals of modules


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> I would strongly recommend fixing the missing grounds and using the controller with the propper handshaking and current limiting. This works fine, and will keep you from freaking out the EVSE.
> 
> Current regulation will work as follows:
> 1. AC max from wall
> ...


The AVC2 doesn't offer a means of getting the maxcurrent from the EVSE (don't honestly know what the AVC2 does with the pilot signal). So to make sure the charger doesn't demand more than the EVSE can deliver, the pilot signal will have to be routed to the Damien's charger control board too. Your software will then interpret the signal and keep the current demand within limits. One use for the AVC2 would be to act as a relay for switching on and off the EVSE supply (12v power feed to the AVC2).

Here's a pic of my planned GEN2 V1 charger board test setup. The Relay is just switching on/off 120v mains with a 5v control wire. The Laptop will monitor the CAN coming from the battery and also from the charger board. The laptop will control the contactors in the battery (pre-charge circuit included) with 12v lines. I'll instruct the charger board for the test via the serial port to the USB on the charger.

So the test sequence will be...
0. Activate the BMS to send CAN status data
1. Close the contactor in the battery (HV to the HVJB)
2. Power up the charger (12v and GND)
(note: The USB alone causes the LED on the charger board to light up)
3. Send the voltage to the charger
4. Send the current level
5. Send command to start charging (this activates the mains relay at the right time)
6. Watch the ammeter hooked up to the HVJB HV lines - should hopefully see voltage rising up to the setting
7. Send command to stop charging
8. Open the contactors in the battery
9. Deactivate the BMS
10. Inspect the battery CAN logs

Jeff


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> The AVC2 doesn't offer a means of getting the maxcurrent from the EVSE (don't honestly know what the AVC2 does with the pilot signal).


Why use the AVC2? The charger will manage the EVSE interface and AC/DC charging :


----------



## DrJeff (Apr 24, 2015)

Kevin Sharpe said:


> Why use the AVC2? The charger will manage the EVSE interface and AC/DC charging :


Its a good question. If you're using the AVC2 for public charging then you're making the assumption that the EVSE will always be able to provide more current than the car's on board charger can consume. This may have been a reasonable assumption in the past, but it can't always be true.

I would assume that if the charger attempts to pull higher current than the EVSE allows, the EVSE goes into an error mode - having a hard time finding definitions on-line about what is supposed to happen. Maybe the charger just gets what it gets from the EVSE?


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> I would assume that if the charger attempts to pull higher current than the EVSE allows, the EVSE goes into an error mode - having a hard time finding definitions on-line about what is supposed to happen.


The EVSE tells the charger the maximum AC current it can consume from the grid using the pilot signal. For example the charger in my Tesla Roadster can consume 75A AC but I can use it with an EVSE set to 6A AC if I'm on the end of a long extension cable.

At some point we will also be able to set the charger AC current via software. However, even when we have this feature it would be foolish to ignore the maximum AC current level set by the EVSE because it's aware of the limitations of it's contactors, fuse, etc.

I can't imagine any scenario in which the AVC2 is useful with the Tesla charger


----------



## ga2500ev2017 (Jun 12, 2017)

DrJeff said:


> Hi Tom,
> 
> I was looking through the new code and had some questions/queries...
> 
> I'm testing with Damien's GEN1 board that doesn't have a EEPROM. While the code tests for EEPROM it looks like it will attempt a write to EEPROM even when disabled.





Tomdb said:


> Yes currently no EEprom used, I will look at getting coding setup to use the SAM internal memory to save settings. Without using the EEprom you currently cannot save settings that are changed via the serial menus.


Just throwing out a possibility. In my Arduino research I came across this article:

https://hackaday.com/tag/optiboot

which facilitates using Flash memory at runtime for saving configuration information using a special version of the Optiboot bootloader. May be worth considering using for the V1 boards.

ga2500ev


----------



## Tomdb (Jan 28, 2013)

Yes just use the charger to care of it all.

Got to love a loud thud and then two clicks from inside the tesla charger. 

Plugging works a treat. 






1. video starts off with charging
2. uplug and evse stops normally and so does the charger
3. plug in, and almost instantly Charger regonizes the plug and requests AC power
4. Click of the charger module to precharge 25sec
5. Click to start charging 32sec


This nights setup below.


----------



## Jimbo69ny (Feb 13, 2018)

Are there DIY instructions for dummies anywhere? Id like to use one of these too.


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> Are there DIY instructions for dummies anywhere? Id like to use one of these too.


If you build your own controller board then you are pretty much on your own with regards to support (you'll get some help here but you really need a solid hardware/software background because we all have day jobs).

If you buy a fully tested board from Damien then he'll hold your hand (I know from experience )

Whatever way you choose to go you can buy the various levels of hardware in Damien's webshop (here).


----------



## Jimbo69ny (Feb 13, 2018)

This unit? http://www.evbmw.com/index.php/evbm...-2-charger-logic-board-fully-built-and-tested

Does he ship to the us?
What about wiring? What do I need and how do I do it?

I have zero software experience so I am truly a newbie at this.


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> This unit? http://www.evbmw.com/index.php/evbm...-2-charger-logic-board-fully-built-and-tested


Yes, that's the fully tested and supported board 



Jimbo69ny said:


> Does he ship to the us?


Yes



Jimbo69ny said:


> What about wiring? What do I need and how do I do it?


Damien produces wiring diagrams for his products. You could try contacting him ([email protected]).



Jimbo69ny said:


> I have zero software experience so I am truly a newbie at this.


A very large part of any DIY electric car is software so I'm sure you'll be learning some new skills  Discuss your requirements with Damien and see what he suggests


----------



## DrJeff (Apr 24, 2015)

Some vids of testing a Tesla charger (GEN2 slave) with Damien's V1 control board. The board appears to have a very early version of the software loaded (possibly v1).

Since this is a slave charger, I was keen to find out if the control board and software would work - i.e. the slave board is internally identical to the master charger. All indications so far suggest it is an exact copy. If there were any differences they were in the Tesla control logic. To confirm this, I need to get the charger to charge!

Some interesting things to note...
- The charger consistently reported 2-3volts lower for the battery pack than the voltmeter.
- The Spark EV battery (when accessing through the pre-charger circuit) shows no voltage spike at all. This could be a sample frequency question, but further investigation is needed. Charger is not sensitive - but when the pack is hooked up to the Tesla drive unit - a spike will be a problem.
- I couldn't get the charger to flip into charging mode. It always reported 0 AC current and 0 DC current. This could be the timing of connecting the AC - but numerous attempts didn't affect it. The board may still be assuming 3 phase EVSE like power - don't know so proceeding carefully.

Next Steps
- Review the later version software to determine if there's a sequence to the 's', 'e', 'v', and 'c' commands.
- Update the controller software to the latest version.
- Implement a relay to connect the mains AC under the control of the charger board.

???? any guidance on the type of type of relay to get would be helpful ???? I'll eventually be charging on an EVSE US 240v single phase.


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> Some vids of testing a Tesla charger (GEN2 slave) with Damien's V1 control board.


Great to see your progress, thanks for sharing 



DrJeff said:


> Since this is a slave charger, I was keen to find out if the control board and software would work - i.e. the slave board is internally identical to the master charger. All indications so far suggest it is an exact copy. If there were any differences they were in the Tesla control logic. To confirm this, I need to get the charger to charge!


I *think* the firmware loaded into the power modules *may* be different on the slave and master chargers. When Damien was last in the UK we spent a couple of hours looking into some differences in behaviour between the two... unfortunately we were short of time and reached no conclusions so this is just a heads up


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Great to see your progress, thanks for sharing
> 
> I *think* the firmware loaded into the power modules *may* be different on the slave and master chargers. When Damien was last in the UK we spent a couple of hours looking into some differences in behaviour between the two... unfortunately we were short of time and reached no conclusions so this is just a heads up


Why would you care about Master/slave? 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> Why would you care about Master/slave?


Because the chargers people buy from wrecks are a mixture of both types and we need a solution that works regardless


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Because the chargers people buy from wrecks are a mixture of both types and we need a solution that works regardless


But are you guys sure there are master /slave ones? I bet both are the same when it comes to internal can messages. I would worry about that if we kept Tesla control board but it's gone. 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> But are you guys sure there are master /slave ones? I bet both are the same when it comes to internal can messages. I would worry about that if we kept Tesla control board but it's gone.


Please read my post again... we (Damien, my colleagues, and I) have seen unexplained differences between the master/slave power boards... we were using Damien's controller and talking directly to the internal CAN bus. We had a sample of 11 Gen 2 chargers which included a mix of hardware revision, slave/master, and (presumably) firmware revisions. When we have more time we will undertake a rigorous analysis to understand the issue... until then I just reverted to using a master charger and provided a heads up for Jeff so that he can potentially explain any differences he may find when using Toms latest code


----------



## Jimbo69ny (Feb 13, 2018)

Are the slave units only from the cars with dual chargers?


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> Are the slave units only from the cars with dual chargers?


Yes... the chargers are programmed as master/slave using the Tesla Toolbox (see Service Bulletin SB-13-44-010 for a useful guide) and you can sometimes tell them apart at the breakers when the Slaves have the HVIL loopback connector fitted.


----------



## Tomdb (Jan 28, 2013)

Kevin Sharpe said:


> Please read my post again... we (Damien, my colleagues, and I) have seen unexplained differences between the master/slave power boards...


Please get someone to do some testing with the latest software on a control board in a slave charger. Or ship me one.


----------



## Tomdb (Jan 28, 2013)

DrJeff said:


> Some vids of testing a Tesla charger (GEN2 slave) with Damien's V1 control board. The board appears to have a very early version of the software loaded (possibly v1).
> 
> ???? any guidance on the type of type of relay to get would be helpful ???? I'll *eventually* be charging on an EVSE US 240v single phase.


Please first of all flash the latest software version, this will provide way more feedback for diagnosis. 

Plus you are using an American Electron Tap, the chargers are expecting to be told what sort of voltage to expect. Current it is locked at 240Vac, or 'normal' wall juice, I shall create a variable to allow charging off of 110Vac.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Please get someone to do some testing with the latest software on a control board in a slave charger. Or ship me one.


Retesting is scheduled for the next couple of weeks when the latest controller boards arrive from Damien  If we get delayed I'll lend you a charger


----------



## Jimbo69ny (Feb 13, 2018)

Are any of you guys liquid cooling the charger? Would that be necessary?


----------



## Martii (Jan 17, 2018)

Jimbo69ny said:


> Are any of you guys liquid cooling the charger? Would that be necessary?


At full power you have to do liquid cooling 

Sent from my Z1 using Tapatalk


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> Please first of all flash the latest software version, this will provide way more feedback for diagnosis.
> 
> Plus you are using an American Electron Tap, the chargers are expecting to be told what sort of voltage to expect. Current it is locked at 240Vac, or 'normal' wall juice, I shall create a variable to allow charging off of 110Vac.


I've got 240vac EVSE for my Fiat500e, so I'll just switch over to that as the AC source.

I'll load the latest software today and runs some tests.

I've attached a SavvyCAN capture (CSV in ZIP) of the Slave Charger internal CAN network traffic. I also attached a PDF showing a comparison of the CAN codes from the Slave charger and the CAN codes mentioned in Tom's code. Good news is that all (apart from non-Tesla ControlID/StatusID) codes from the software are found in the Slave charger listing. However, all the codes from the slave charger are not mentioned in the software. When I looked through some of the SavvyCAN captures (CSV files) on Damien's github, the same pattern was true.

Jeff


----------



## jackbauer (Jan 12, 2008)

Sorry guys I'm just back from a trip so catching up. The difference between master and slave is not in the CAN messages but in how the mains is applied : Master chargers want to be in control of the mains supply. ie they tell the evse when to turn on and off. Slave chargers on the other hand expect the mains to be present BEFORE waking the power modules from sleep. If mains is not present and you wake a slave charger power module it will drop into a fault state. I hope that makes sense.


----------



## Jimbo69ny (Feb 13, 2018)

I have a 2014 Rav4 EV that was made by Tesla. It uses this Tesla charger. I want to add a second charger for faster speeds. Again, totally green to this. I dont know if the fact that I already have a master helps or not. Need to do some more digging.


----------



## Martii (Jan 17, 2018)

Jimbo69ny said:


> I have a 2014 Rav4 EV that was made by Tesla. It uses this Tesla charger. I want to add a second charger for faster speeds. Again, totally green to this. I dont know if the fact that I already have a master helps or not. Need to do some more digging.


You need to find out if you have this orange junction box too 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

jackbauer said:


> If mains is not present and you wake a slave charger power module it will drop into a fault state.


Any way of identifying a Slave versus Master power module?

Currently the voltage only gets applied post Hardware enable and CAN.

Added new feature to my code on github, now the controller checks which chargers have power (Voltage on both ends) and then determines how much power the charger should out to stay below a max DC current value.

This should be the 'only' dynamic value used to control the output of the chargers. (internal calculation on the controller will form this into AC current max, with all the various limits applied when needed)

Will look at getting what I think is required to make the charger work on 110Vac into the code, should be a simple value change in a control message.


----------



## Jimbo69ny (Feb 13, 2018)

Martii said:


> You need to find out if you have this orange junction box too
> 
> Sent from my Z1 using Tapatalk


Junction box? Do you have a photo of it?


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Any way of identifying a Slave versus Master power module?


Have you seen anything in the CAN traffic that looks like a Tesla firmware version?


----------



## Martii (Jan 17, 2018)

Jimbo69ny said:


> Junction box? Do you have a photo of it?


Check this thread for pictures 

Sent from my Z1 using Tapatalk


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Sorry guys I'm just back from a trip so catching up. The difference between master and slave is not in the CAN messages but in how the mains is applied : Master chargers want to be in control of the mains supply. ie they tell the evse when to turn on and off. Slave chargers on the other hand expect the mains to be present BEFORE waking the power modules from sleep. If mains is not present and you wake a slave charger power module it will drop into a fault state. I hope that makes sense.


If you say so I'm way more interested in slave ones this will not require extra effort for AC on timing. To be honest I'd love to use such one for my off grid battery bank charging. 

Sent from my Z1 using Tapatalk


----------



## jackbauer (Jan 12, 2008)

Kevin Sharpe said:


> Have you seen anything in the CAN traffic that looks like a Tesla firmware version?


Yes. Will add it to my list


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Yes. Will add it to my list


Sorry to add this to your list  I guess in an ideal world it would be helpful if we could reflash slaves so that they become masters... any programming connectors on the power modules?


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Sorry to add this to your list  I guess in an ideal world it would be helpful if we could reflash slaves so that they become masters... any programming connectors on the power modules?


I'm sure this is done via can 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> I'm sure this is done via can


Obviously that's how the Tesla Toolkit communicates with the charger. However, given we do not have access to the Tesla Toolkit, and we have limited development resources, it may be easier to reflash chargers if Tesla have exposed the programming interface on a connector. Obviously, if the charging connector is not available then we either develop the programming software ourselves or we provide a workaround for the slave chargers in the controller (which may not work if the EVSE interface has been disabled in the Tesla firmware).

Please remember that we are trying to help everyone who's purchased a Tesla charger, not just those who were lucky enough to buy Master chargers.


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Obviously that's how the Tesla Toolkit communicates with the charger. However, given we do not have access to the Tesla Toolkit, and we have limited development resources, it may be easier to reflash chargers if Tesla have exposed the programming interface on a connector. Obviously, if the charging connector is not available then we either develop the programming software ourselves or we provide a workaround for the slave chargers in the controller (which may not work if the EVSE interface has been disabled in the Tesla firmware).
> 
> Please remember that we are trying to help everyone who's purchased a Tesla charger, not just those who were lucky enough to buy Master chargers.


I was thinking communication is different but if the only difference is what Damien mentioned I don't see a problem to easily solve this via software on Damiens board. Especially that there is external can bus so master can communicate with slaves with ease. 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> I don't see a problem to easily solve this via software on Damiens board


I'm glad its 'easy'... any chance you'll contribute the code so that we can move onto other tasks?


----------



## Tomdb (Jan 28, 2013)

If Daimen could let me know what charger I have, is there a way to see it via the markings or sticker on the housing?

Then I can do some more testing.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> If Daimen could let me know what charger I have, is there a way to see it via the markings or sticker on the housing?


No external markings on most chargers (we've seen a couple with handwritten word 'slave' on them, and some arrive from breakers with the HVIL loopback connector fitted) which is not surprising given in many cases the second charger was added after initial build and then configured by the Tesla service personnel using the Tesla Toolbox software.

I've attached the Tesla Service Bulletin used to add the second charger


----------



## jackbauer (Jan 12, 2008)

Tom, you have a master charger.


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> I'm glad its 'easy'... any chance you'll contribute the code so that we can move onto other tasks?


If I only had slave charger laying around... 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> If I only had slave charger laying around...


How do you know the charger you have is a master?


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> How do you know the charger you have is a master?


Because it gets AC via relay almost a second later and is charging just fine. To be honest slave is way more attractive to me as there are almost none evse chargers around but plenty 3 phase 230V 16A sockets usually for free. Having slave charger I would do fine without relay. 

Sent from my Z1 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

A 3 phase relay should be easy to use. 

I could create a manual start mode, so you just need to pull a 12V input high and the charging starts.


----------



## Martii (Jan 17, 2018)

Tomdb said:


> A 3 phase relay should be easy to use.
> 
> I could create a manual start mode, so you just need to pull a 12V input high and the charging starts.


Tom it is easy to use but it's also something that can break and wears out over time. Anyway my charger 3rd module is faulty so I'd be looking for another one in few weeks time. 

Sent from my Z1 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> Having slave charger I would do fine without relay


Why wait? You can buy one today for 2899 USD + Shipping (here) 

Obviously, if you want to continue using low cost chargers from ebay or breakers then we need to understand the difference in the firmware running on master and slave power modules (and ideally reflash them both). What I said earlier today still stands;



Kevin Sharpe said:


> I *think* the firmware loaded into the power modules *may* be different on the slave and master chargers. When Damien was last in the UK we spent a couple of hours looking into some differences in behaviour between the two... unfortunately we were short of time and reached no conclusions so this is just a heads up


----------



## Martii (Jan 17, 2018)

Kevin Sharpe said:


> Why wait? You can buy one today for 2899 USD + Shipping (here)
> 
> Obviously, if you want to continue using low cost chargers from ebay or breakers then we need to understand the difference in the firmware running on master and slave power modules (and ideally reflash them both). What I said earlier today still stands;


Kevin, mine was 200 EUR and one module is down. Awesome price and sometimes you can get those even cheaper as broken but still great for my needs. 

Sent from my Z1 using Tapatalk


----------



## DrJeff (Apr 24, 2015)

Run with latest software (with some edits, see below)...

See serial port logs in the attached "Run Notes.txt" file.

- Loaded latest software (with the 240v/110v flag Mar 30th on Tom's github)
- Captured logs for...
--- Just USB to the controller card
--- With 12v and USB to the charger
--- With battery voltage connected
--- With AC (110v singlephase) connected
--- v372 command
--- c1 command
--- s command
------ Note: No messages or discernible changes from the s command (?)
------ No 12v enable set on DIG_IN_1 (which could be why no charging)

Observations

- after the v372 and c1 commands to the charger controller via the serial port, there was a 1+ second delay before the status messages restarted

Software edits...

// JEC 110v for this test
uint16_t ACvoltIN = 110; 
// AC input voltage 240VAC for EU/UK and 110VAC for US
// uint16_t ACvoltIN = 240;

// JEC - Singlephase
byte Config = 0;
//byte Config = 1;

// JEC - Added Serial.println()
Serial.print(totdccur * 0.005, 2);
// JEC - added newline for display
Serial.println();

// JEC - Added additional ) right before the ;
accur[0] = (uint16_t((frame.data.bytes[5] & 0x7F) << 2) | uint16_t(frame.data.bytes[6] >> 6)) ;
accur[1] = (uint16_t((frame.data.bytes[5] & 0x7F) << 2) | uint16_t(frame.data.bytes[6] >> 6)) ;
accur[2] = (uint16_t((frame.data.bytes[5] & 0x7F) << 2) | uint16_t(frame.data.bytes[6] >> 6)) ;


----------



## Tomdb (Jan 28, 2013)

If the serial does not change from off to on, it means indeed you have not been allowed to charge.

The D1 input is required to do any kind of charging.

Also you need to connect the AC voltage after submitting the 's' command and the serial terminal showing ON.


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> If the serial does not change from off to on, it means indeed you have not been allowed to charge.
> 
> The D1 input is required to do any kind of charging.
> 
> Also you need to connect the AC voltage after submitting the 's' command and the serial terminal showing ON.


I enabled the D1 input with 12v and the status messages indicate that it's HIGH.

While I was messing around, I vaguely remember something about Damien saying that it wouldn't do any charging under 200vac. I can't find the video clip with that information, so I could be completely imagining it, or it was something completely different. [maybe that was the small drive unit?  ]

I also was not getting a DIG_OUT_1 signal to activate the mains (via relay). I just hooked a 12v LED up to the line, but it never illuminates. Some checking to do on the pins. I also hooked up the AC prior to the 's' command (per Damien's "slave charger is different" comment) and after the 's' command but no joy.

Next steps for me...
- Add an Serial.print of the 'status' variable (to see if 's' is doing anything - as there is no feedback to suggest it got the command.
- Check the DIG_OUT_1 connection
- Wire up the EVSE 240vac source - use the AVC2 to get the EVSE into providing power.

Jeff


----------



## DrJeff (Apr 24, 2015)

Some more testing and checking...

code change...
// Commented out the Serial.Available check - 's' command doesn't have any further characters following it.
case 's'://s for start AND stop
// if (Serial.available() > 0)
// {
state = !state;
setting = 1;
digitalWrite(LED_BUILTIN, HIGH);
// }
break;

This code change allowed the 's' command to change 'state' value and then execute the enable chargers code.

I've attached the edited log from the test. You can see that the State updates, but I can't tell if the charger was actually charging (from the log). What outputs will change when charging is actually occurring?

Jeff


----------



## jackbauer (Jan 12, 2008)

The outputs are open collector so you need to connect the relay (or led and resistor) to +12v and the other side to the charger output.

I have a slave charger here on the bench and will as soon as I can begin testing.


----------



## Tomdb (Jan 28, 2013)

Jeff,

I notice one thing clearly happening, as soon as you do charger on all phases throw a fault. 

When exactly do you turn on AC voltage? Or do you have it controlled by a relay?

When the charger is charging, you will hear relays click then a short spike in AC current followed by another click. Then ac current and dc current.

Have you tried setting you voltage set point higher? This charger does not like the setpoint really close to the dc bus voltage, have seen some strange behaviour myself.


----------



## jackbauer (Jan 12, 2008)

Tomdb said:


> Jeff,
> 
> I notice one thing clearly happening, as soon as you do charger on all phases throw a fault.


This is exactly what happens with a slave charger. The mains must be on before waking the modules.


----------



## DrJeff (Apr 24, 2015)

Tomdb said:


> When exactly do you turn on AC voltage? Or do you have it controlled by a relay?
> 
> When the charger is charging, you will hear relays click then a short spike in AC current followed by another click. Then ac current and dc current.


Hi Tom,

I got clicking and buzzing !!!! 

Commands v375, c1, s

Connected AC power (manually) < 1 second after the 's' command. (Yesterday's failed test had AC power before the 's' command).

I've zipped and attached the full run log from the test. Test finishes by just pulling the AC.

Test sequence
- USB to the charger controller card
- 12v to the charger
- 12v to DIN_1_IN
- (LED connected to 12v and DIN_1_OUT (as GND) but it was always lit)
- Battery connected to HVJB/Charger
- v375
- c1
- s
- (< 1 sec later) connected AC 110v single phase
- click, buzz, click from the charger!

Jeff


----------



## Tomdb (Jan 28, 2013)

DrJeff said:


> Hi Tom,
> 
> I got clicking and buzzing !!!!


Doesn't the clicking of those relays just get you excited. 

Looking at the log, all seems fine do not trust the ac current feedback.
Currently the AC current feedback from the modules is still wrong. I have been looking at this for a while and it still baffles me. If anyone with a bit more arduino/can bus decoding experience can try and crack it.


Jeff, since you are running in 'single' phase mode the current setpoint 'c' will be split equally to all charger modules, this is so that when using an evse it will nicely behave.


----------



## jackbauer (Jan 12, 2008)

Tomdb said:


> Doesn't the clicking of those relays just get you excited.


Imagine how I felt the first time it happened


----------



## DrJeff (Apr 24, 2015)

jackbauer said:


> Imagine how I felt the first time it happened





Tomdb said:


> Doesn't the clicking of those relays just get you excited.


Many thanks to Damien and Tom on getting the charger controller working. Very excited to have 10kW EVSE capable charging for the TesLorean. Awesome engineering and coding.

I recently swapped my DeLorean hood for one with a gas flap (a little door on the hood/bonnet just in front of the driver). It will now be fitted with a J1772 port. Now that I have a means of recharging the battery I can get back to testing the Tesla small drive unit.

Jeff


----------



## Kevin Sharpe (Jul 4, 2011)

DrJeff said:


> Many thanks to Damien and Tom on getting the charger controller working. Very excited to have 10kW EVSE capable charging for the TesLorean. Awesome engineering and coding.


That is great news!


----------



## jackbauer (Jan 12, 2008)

Getting started on the Gen 3 charger


----------



## Tomdb (Jan 28, 2013)

How you thinking of replacing that control board?


----------



## jackbauer (Jan 12, 2008)

Tomdb said:


> How you thinking of replacing that control board?


That will be the subject of the next video

In the meantime got the ball rolling on a Github for the Gen 3 :
https://github.com/damienmaguire/Tesla-Gen3-Charger


----------



## jackbauer (Jan 12, 2008)

Gen 3 Charger powered up :
https://youtu.be/PMedmbeu8nU


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Gen 3 Charger powered up


Excellent progress 

Can you confirm they have no AC input switching for the modules? Looking at the latest Tesla Model S/X data for the European cars it looks like they use one power module 5.5kW (24A) on single phase and three power modules 16.5kW (24A per phase) on three phase.

Do you know whether the 11kW (48A) charger has two or three power modules?


----------



## jackbauer (Jan 12, 2008)

There is no AC switching inside the charger. The logic board must command the EVSE to energise at the right time. I can say that the time allowed is much tighter on the Gen 3 than the Gen 2 to apply mains before the charger throws an error. Gen 2 gives about a 2 to 3 second window. Gen 3 its about half that.

The Gen 2 11kw charger has 3 modules with max 16A each.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> The Gen 2 11kw charger has 3 modules with max 16A each.


sure... do you know how many power modules are inside the 48A Gen 3 charger? Logically it's three but the Tesla website is unclear now that they only supply the 72A charger in Model S and X.


----------



## jackbauer (Jan 12, 2008)

Kevin Sharpe said:


> sure... do you know how many power modules are inside the 48A Gen 3 charger? Logically it's three but the Tesla website is unclear now that they only supply the 72A charger in Model S and X.


Three modules.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> There is no AC switching inside the charger.


ok cool... so for the Gen 3 charger (72A EU version) it's either 5.5kW single phase (24A x 230V) or 16.5kW three phase (24A x 3 x 230V).

and for the 48A EU version it's *probably* 3.6kW single phase (16A x 230V) or 11kW three phase (16A x 3 x 230V).

So, the decision on whether to buy the Gen 3 US or EU version depends very much on whether you will use the charger on three phase... and if you want to switch between single and three phase then the Gen 2 charger can be modified easily because the AC signals are exposed


----------



## jackbauer (Jan 12, 2008)

Getting near time to charge Der Panzer for the first time


----------



## Tomdb (Jan 28, 2013)

Nice, how does that magic phase box work?
Do I need to add some code in the charger control logic?


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Nice, how does that magic phase box work?
> Do I need to add some code in the charger control logic?


I'll post a schematic of the Tesla 'phase box' next week... I will also produce a PCB that fits inside the HVJB that emulates the external 'phase box' functionality


----------



## Jimbo69ny (Feb 13, 2018)

I see the website only has a board for Gen 2 Tesla chargers. I found a good deal on a supposedly working Gen 1 charger. Is there a board available for Gen 1 chargers?

Here is a link to the Gen 2 charger board. http://www.evbmw.com/index.php/evbm...-2-charger-logic-board-fully-built-and-tested


----------



## jackbauer (Jan 12, 2008)

Sorry no. I have never even seen a Gen 1 charger. Boards available now for Gen 2 and working on Gen 3.


----------



## Jimbo69ny (Feb 13, 2018)

jackbauer said:


> Sorry no. I have never even seen a Gen 1 charger. Boards available now for Gen 2 and working on Gen 3.


There are a bunch of Gen 1's on ebay. https://www.ebay.com/itm/2013-Tesla...e=STRK:MEBIDX:IT&_trksid=p2060353.m1438.l2649

My Rav 4 EV also uses a Gen 1 charger.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Nice, how does that magic phase box work?
> Do I need to add some code in the charger control logic?


I've started work on the 'magic phase box' (here)... the good news is it appears to be entirely automatic


----------



## jackbauer (Jan 12, 2008)

Well, if someone wants to send me a gen 1 charger ....


----------



## Jimbo69ny (Feb 13, 2018)

jackbauer said:


> Well, if someone wants to send me a gen 1 charger ....


I would if I could afford to. hahaha


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> I would if I could afford to. hahaha


have you considered crowdfunding? If those who are interested in the Gen 1 charger work together then I'm sure Damien can be 'persuaded' to develop a controller for you


----------



## Jimbo69ny (Feb 13, 2018)

Kevin Sharpe said:


> have you considered crowdfunding? If those who are interested in the Gen 1 charger work together then I'm sure Damien can be 'persuaded' to develop a controller for you


I am not looking to be the lead on anything like that. I'd rather wait and watch for a gen 2 or 3 unit.


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> I'd rather wait and watch for a gen 2 or 3 unit.


The Gen 2 charger is a much more practical solution for most people and much more reliable than Gen 1


----------



## Kevin Sharpe (Jul 4, 2011)

For the benefit of anyone reading this, here is what we know about the European version of the Tesla Gen 2 charger;

The single charger supports ~3.7kW (16A x 230V) single phase and ~11kW (16A x 230V x 3) three phase.

With the addition of the 'AC switch box' (here) the single charger supports ~7.4kW (32A x 230V) single phase and ~11kW (16A x 230V x 3) three phase.

Dual chargers supports ~7.4kW (32A x 230V) single phase and ~22kW (32A x 230V x 3) three phase. In this configuration the 'AC switch box' is not required.


----------



## Jimbo69ny (Feb 13, 2018)

What are you guys paying for your chargers?
I found one used for $1000. The seller says that it was a dealer pull off. He says, "The car was updated and the unit has been replaced by us (tesla)
I didn't have a chance to test it, but I sold few and none of them have a problem"

It is a gen 2 charger. Is it worth the risk? If it is defective, has anyone successfully repaired these?
​


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> What are you guys paying for your chargers?


'retail' prices are typically in the 500-1000 USD price bracket for Gen 2 chargers from a reputable breaker (i.e. one that offers a warranty). If you consider how much we were paying for chargers a couple of years ago they are an absolute bargain 



Jimbo69ny said:


> It is a gen 2 charger. Is it worth the risk? If it is defective, has anyone successfully repaired these?


All our conversions are using the Gen 2 because today it's the only Tesla charger with a solid controller. I doubt that many chargers will be repaired because the required expertise is 'expensive' and the chargers are 'cheap'.


----------



## Jimbo69ny (Feb 13, 2018)

Kevin Sharpe said:


> 'retail' prices are typically in the 500-1000 USD price bracket for Gen 2 chargers from a reputable breaker (i.e. one that offers a warranty). If you consider how much we were paying for chargers a couple of years ago they are an absolute bargain
> 
> All our conversions are using the Gen 2 because today it's the only Tesla charger with a solid controller. I doubt that many chargers will be repaired because the required expertise is 'expensive' and the chargers are 'cheap'.


If anyone finds a working Gen 2 or 3 charger let me know. I have been watching ebay and havent seen too many. Id like to get a charger and the board you guys developed.


----------



## Martii (Jan 17, 2018)

Jimbo69ny said:


> If anyone finds a working Gen 2 or 3 charger let me know. I have been watching ebay and havent seen too many. Id like to get a charger and the board you guys developed.


I was lucky to get one for around 200 USD but one module is not working. Still good bargain. 

Sent from my Z1 using Tapatalk


----------



## jackbauer (Jan 12, 2008)

Wanted to say a big thanks to Tomdb on here for his excellent work on the charger logic board software. Did my first test today and it worked very well

www.youtube.com/watch?v=1qrLTbC2--U


----------



## Tomdb (Jan 28, 2013)

Eventually 

However due to some very kind contributes I shall be able to do more development very soon. 

We now still need to figure out if the power module itself will thermal limit or that the control ECU is required to do that. We would not want to go around cooking chargers.

Damien, would you mind sabotaging your cooling loop and capture some serial info while charging to see if the modules start pulling power when they get hot?


----------



## Kevin Sharpe (Jul 4, 2011)

Congratulations... a major milestone


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> If anyone finds a working Gen 2 or 3 charger let me know. I have been watching ebay and havent seen too many.


"tatty" charger with broken connector but probably worth a punt at $400 

2012-2015 TESLA MODEL S ON-BOARD CHARGER CHARGING UNIT 1014963-00-K


If you miss that one then how about this for $700?

2016 Tesla Model S On-Board Charger Charging Unit TPN: 1014963-00-K


And this is ripe for a low offer (been on sale for two months);

2016 Tesla Model S On-Board Charger Charging Unit 45A PN:1014963-05-B


----------



## Jimbo69ny (Feb 13, 2018)

Ive been watching those same chargers too. I wish I knew if the $400 one worked. Its only about a 3-4 hour drive away from me. Although it does say "Slave". Have you guys been successful making those work just like the masters?


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> I wish I knew if the $400 one worked. Its only about a 3-4 hour drive away from me.


The seller has a 60 day returns policy... is it not worth buying one of Damien's boards to test the charger? Remember this is a 10kW OEM charger for $400 



Jimbo69ny said:


> Although it does say "Slave". Have you guys been successful making those work just like the masters?


We know that slaves work (iirc Jeff's charger is a slave)... they are different from masters and my hope is that eventually we can update the firmware to make them into masters once again. If this is a concern then the $700 charger is an absolute bargain


----------



## Tony Bogs (Apr 12, 2014)

Didn't you forget a few items? Like plumbing?


----------



## Tomdb (Jan 28, 2013)

until someone has tried a 'slave' charger with the latest software and an EVSE we will know if it works.

If Jeffs charger is an 'slave' I do not know how his worked differently from what we have seen so far.


----------



## Jimbo69ny (Feb 13, 2018)

I am so tempted but I know very little about this. I am trying to keep up with you videos and updates but it all is quite technical. 

Do I need to know CAN in order to install his board and complete the project? Are there any other special circuits or stuff that needs to be included? I have been looking at the Elcon chargers because the connections seem pretty simple. Unfortunately their max is 6.6 kw and they are pretty expensive.


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> I am so tempted but I know very little about this.


Today this is not a 'novice' project... eventually I think we'll have a kit of parts and instructions that 'anyone' can follow but we need to get several of the current builds on the road first.

If you need a charger today buy a supported third party product. If you can wait then in six months I think the Tesla charger will be a viable option


----------



## jackbauer (Jan 12, 2008)

Thanks to Tom's work on the software this is fast becoming a plug and play design. You don't need any can knowledge. Give it 12v , tell it your battery parameters and hook up a j1772 charge port and the logic board does the rest. There is a lot more it can do but that is the basics.


----------



## prensel (Feb 21, 2010)

What is the lowest DC voltage these chargers will work with ?

I'm at the point of either using three Brusa chargers or one modded Tesla charger for my 48S /196V Leaf pack.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> hook up a j1772 charge port and the logic board does the rest


Is this also true for the Gen 2 slave charger? In the Model S the slave chargers don't monitor Proximity or Pilot signals from the EVSE and while logic would suggest this functionality is handled by the Tesla control board alone, I guess it could be used by the power boards via CAN (that said, I can't find the CAN connections for the slave chargers on the Tesla wiring diagrams ).

Do 'we' have a good handle on the firmware differences between master and slave power boards today? I'm just trying to understand whether we know enough to encourage people to buy chargers and whether my advice for novices to wait six months for a tested solution is out of date


----------



## Tomdb (Jan 28, 2013)

If someone has the open source logic board and a slave charger, Id say wire it up and test it. that will be the easiest way of knowing if it matters.

Once I get another charger I can start working on the slave/master setup.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> If someone has the open source logic board and a slave charger, Id say wire it up and test it. that will be the easiest way of knowing if it matters.


I'll be able to do that in a couple of weeks when my controller boards arrive 

Do the Gen 2 power boards have any obvious programming connectors? iirc Damien found some on the Gen 3 power boards.


----------



## jackbauer (Jan 12, 2008)

Did someone mention logic boards?  

First batch of V3 boards arrived today.


----------



## jackbauer (Jan 12, 2008)

V3 board tested today in the Panzer. Memory function and autostart on plug in work perfectly.


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> V3 board tested today in the Panzer. Memory function and autostart on plug in work perfectly.


That's perfect timing, we need two  

http://www.diyelectriccar.com/forums/showthread.php?p=993770#post993770


----------



## Tomdb (Jan 28, 2013)

*Software Update 01/05/18
*

Damien verified the flash memory works, so the following is now implemented:
-12V boots the arduino
-Once a charge request is recieved, over serial or chargeport (to be tested) or can(to be tested)
-All Charger Modules activated, and then enabled (yet to add not sending can messages until this happens, right now continous)
-Charging starts as before
-When the charging stop command is recieved over serial or chargeport (to be tested) or can(to be tested)
- Modules shutdown

Also included is a fix to allow the removal of 12V on IN1 to stop EVSE based charging.

Beta Feature: DCDC command can messages on external canbus, sent continuously at the moment.

Code can be found on my Github, I recommend that the code on Damiens Github will be only 'fully' validated versions.

Remember this is open source, thus use it while using your brain HV and AC voltage will kill you.


----------



## Tomdb (Jan 28, 2013)

Thanks to a open source support I have been able to test my new features with an EVSE.

I can now confirm all is still working well. Thus I can now move on to other features.

Outstanding requests;
1 - Master and Slave mode
2 - State Machine for DCDC control, now just on
3 - investigate cooling power reduction
4 - Charge port lock actuation (requires some hardware investigation)


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Thanks to a open source support I have been able to test my new features with an EVSE.






Tomdb said:


> Outstanding requests;


Can we add to the list CHAdeMO and CCS DC fast charge? I'm not sure whether Damien, yourself, or a third party wants to offer this as a paid for upgrade (or fund the development via crowdfunding?), but the charger controller board is probably the logical place for this functionality


----------



## Martii (Jan 17, 2018)

I'd love to see such feature myself too but chademo needs some more stuff like 12V power to the car relay for charging start. This would mean that the board would need some more changes?


Kevin Sharpe said:


> Can we add to the list CHAdeMO and CCS DC fast charge? I'm not sure whether Damien, yourself, or a third party wants to offer this as a paid for upgrade (or fund the development via crowdfunding?), but the charger controller board is probably the logical place for this functionality


Sent from my LEX720 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> This would mean that the board would need some more changes?


Of course the board will change but that's nothing new (we're already on Rev 3) and I believe the supercharger charging is controlled by the charger


----------



## Martii (Jan 17, 2018)

AFAIR Damien already has experience with Chademo so let's hope he'll be able to help.


Kevin Sharpe said:


> Of course the board will change but that's nothing new (we're already on Rev 3) and I believe the supercharger charging is controlled by the charger


Sent from my LEX720 using Tapatalk


----------



## Kevin Sharpe (Jul 4, 2011)

Martii said:


> AFAIR Damien already has experience with Chademo so let's hope he'll be able to help.


He does and I know it's on his todo list... the purpose of my post was to suggest Tom updates his list to include these features so that people reading this forum know what's coming


----------



## Tomdb (Jan 28, 2013)

Kevin Sharpe said:


> Can we add to the list CHAdeMO and CCS DC fast charge? I'm not sure whether Damien, yourself, or a third party wants to offer this as a paid for upgrade (or fund the development via crowdfunding?), but the charger controller board is probably the logical place for this functionality



Chademo requires:

-two contactor control outputs -> This is no issue
-dedicated canbus -> preffered and should be easy to implement on the due

-Software -> nice and easy to do as it is just can messages.

CCS
-Home Plug Phy -> expensive interface hardware
-IEC/ISO 15118 compatible protocol -> have not found any simple documentation on it
-CCS compliant software -> Agian once the whole communication stack and layers are know this is just software

I would thus suggest going one step at a time. I think Master/slave to enable the safe use of dual chargers should be the next target.

Hardware wise, getting a H-bridge on the V4 and an additional canbus.


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> Chademo requires:
> 
> -two contactor control outputs -> This is no issue
> -dedicated canbus -> preffered and should be easy to implement on the due
> ...


It's pretty easy and I suspect our first implementation will be using the Tesla CHadeMO adapter because it's available at low cost and plugs into a Type 2 (and Tesla) socket 



Tomdb said:


> CCS
> -Home Plug Phy -> expensive interface hardware
> -IEC/ISO 15118 compatible protocol -> have not found any simple documentation on it
> -CCS compliant software -> Agian once the whole communication stack and layers are know this is just software


I'm a member of CharIN and have access to the various documents we'll need. I also have a colleague who's contributed to the OpenV2G project (here) 



Tomdb said:


> I would thus suggest going one step at a time. I think Master/slave to enable the safe use of dual chargers should be the next target.


Completely agree... one of the outstanding questions is whether we can use Slave chargers on their own... if not, we'll need a way of reprogramming them as masters.


----------



## jackbauer (Jan 12, 2008)

For anyone interested in a cheap logic board :
http://www.diyelectriccar.com/forums/showthread.php/tesla-gen-2-charger-logic-board-195969.html


----------



## jackbauer (Jan 12, 2008)

I have published a list of the power and signal connectors for the Gen 2 charger :


https://github.com/damienmaguire/Tesla-Charger/blob/master/connectors.pdf


----------



## Tomdb (Jan 28, 2013)

Anyone else run a logic board in a charger?

Looking for some feedback on the basic functions so we can iron out some more bugs.


----------



## Jimbo69ny (Feb 13, 2018)

I am very surprised that no one has hacked the gen 1 charger. I see those everywhere for sale. Its a shame. I hope someone can hack that one too some day.


----------



## Tomdb (Jan 28, 2013)

*Update 18/05/18*

-Can Control Implemented
Requires message every 500ms
Message contains HV setpoint and max AC module current

The module connected to the charging port pilot and prox signal should be coded as the master. The other module only requires 12V gnd CanH CanL and then D1 to 12V.

Serial command to programme Can Mode send 'x' with one of the following ;
0 - No Can control, only reports out normal frame
1 - Can Master, sends out control frame on ID 0x300
2 - Can Slave, listens for ID 0x300 its output frame is incremented by one.

I need a setup with two charger to correctly test this functionality. Main interest is if there is a need for a delay of requesting the EVSE to provide power.

Note: if the EVSE reports less than 15Amps available the Can Master will not wake the Slave charger. For testing purposes this can be reduced.

I have seen Chris and Kevin both have nice dual charger setups, so you guys want to give the new code a go?

Currently only test by imitating a Can Master with an Arduino and also logging a Charger with the Can Master role.

Also this point in time only a master and slave pair can work. But nothing is stopping you from just chaining more slaves on the bus  also the controller does not need to be another charger.


----------



## blf0005 (Mar 30, 2018)

Hi Tom,
My name is Blakely and I'm a software engineer in the US in Georgia working on an EV project. I will have dual chargers here shortly, waiting on the second one to arrive at the moment. I've just started to focus may attention on the chargers and I'd be happy to help you test and debug things as needed. 

First though I was hoping someone could advise me just a bit on the wiring the charger is expecting to see to function. I've been reading over your code just now and the pinout on Github but I'm not able to get any activity out of the charger just yet. Mind you I'm working on a bench for now so I'm simulating the evse connections. 

So correct me if I'm wrong, but the charger needs 12v and Gnd to pins B1 and B7 respectively and then the control pilot to pin B5 and the proximity to B11. Is there anything else required to bench test the charger?

If you don't mind just briefing me on how you are bench testing these things I would greatly appreciate it!


----------



## Tomdb (Jan 28, 2013)

Connections should indeed be;
A3 to 12V

B1 to 12V
B7 to GND

B5 Control Pilot
B11 Proximity 


What does the serial terminal tell you?


----------



## blf0005 (Mar 30, 2018)

Well I did not have A3 to 12v so that was likely the issue. The serial terminal just gave 0 values for all parameters and said everything was off.

Also wondering the best way you have come up with to simulate the control pilot and the proximity? It appears after my quick run through of the code that when the charger is not set to auto enable, the control pilot and proximity are not needed and you can command the charger manually is that right?


----------



## Tomdb (Jan 28, 2013)

Correct.

A3 is the enable line, or D1 IN in the serial output.

Yes you can just put in settings and turn it on, if the charger is not in Can or Autostart mode.


----------



## blf0005 (Mar 30, 2018)

Perfect thank you! I'll give it a go here shortly.

Side note, I will be utilizing dual chargers and the EVTV GEVCU to run the car so I am hoping I will be of value in putting together the necessary libraries for the charger to be more or less plug and play with the GEVCU in the coming weeks.

Looking forward to it!


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> I am very surprised that no one has hacked the gen 1 charger. I see those everywhere for sale. Its a shame. I hope someone can hack that one too some day.


Gen 1 chargers were pretty unreliable and that's why we focused on Gen 2


----------



## Kevin Sharpe (Jul 4, 2011)

blf0005 said:


> PSide note, I will be utilizing dual chargers and the EVTV GEVCU to run the car


Is the GEVCU still in active development? Word on the street is that the latest version had some issues


----------



## blf0005 (Mar 30, 2018)

Tomdb said:


> Correct.
> 
> A3 is the enable line, or D1 IN in the serial output.
> 
> Yes you can just put in settings and turn it on, if the charger is not in Can or Autostart mode.


One more question, without an AC inout and a DC source connected, is the charger always going to default back to state 0 despite being commanded otherwise?


----------



## blf0005 (Mar 30, 2018)

Kevin Sharpe said:


> Is the GEVCU still in active development? Word on the street is that the latest version had some issues


I'm not exactly sure if it is in "active development" but It is the most customizable thing out there that I have been able to find which is why I went that route.


----------



## Martii (Jan 17, 2018)

Yes you need DC and AC to make it click.


blf0005 said:


> One more question, without an AC inout and a DC source connected, is the charger always going to default back to state 0 despite being commanded otherwise?


Sent from my LEX720 using Tapatalk


----------



## blf0005 (Mar 30, 2018)

Well, I had a chance to make my first attempt at getting output from the charger tonight but wasn't successful the first try. It got late so I called it quits before I did something dumb because I got tired. Anyhow, I wanted to confirm my wiring once more with those of you that have already done this. I didn't think to take a screen capture of the serial terminal or anything but I will make sure to do that next time.

Here is how I set it up

On the front I/O: A3 and B1 to 12v, B7 to Gnd and no other connections.

On the AC/DC I/O: Yellow AC wire to Hot 120v adjacent white AC wire to Neutral, Then the pos/neg closest to the side of the case to DC +/- per the attached picture.

Now for my settings I set max AC current to 10A and max DC current to 5A just for the sake of the first test. Auto start disabled and only module 1 enabled. My battery was 172v (which the power module was reading correctly) and my requested DC voltage was 180v

The Serial terminal backed confirmed all of these settings. With the Battery hooked up to the charger, I then applied mains voltage and entered 'S2' to begin the charge. I did not attempt to time the charge request in any way. The mains were applied to the charger for 30+ seconds before I sent the charge command. Once sent, the serial terminal switched to displaying the three power modules information but did not show any AC voltage.

My few questions are 1) did I get the wiring correct? 2) does the charger case need to be grounded? I've seen this mentioned before 3) does the timing of the mains voltage application matter? I know it did early in development but I am not sure now.

Thank you guys a ton for any help and reading my rambling!


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> I have seen Chris and Kevin both have nice dual charger setups, so you guys want to give the new code a go?


Sorry for the delayed response... I'm currently busy on other projects but will test this at some point


----------



## Martii (Jan 17, 2018)

AC and DC are exactly the same. So looking at your picture pins on right go to module 1. So your AC is connected to module 3 not 1. Otherwise everything is looking OK.


blf0005 said:


> Well, I had a chance to make my first attempt at getting output from the charger tonight but wasn't successful the first try. It got late so I called it quits before I did something dumb because I got tired. Anyhow, I wanted to confirm my wiring once more with those of you that have already done this. I didn't think to take a screen capture of the serial terminal or anything but I will make sure to do that next time.
> 
> Here is how I set it up
> 
> ...


Sent from my LEX720 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Ground the case and connect negative 12V to the case too. 

And as Martii said same pinouts on ac and dc. 

plus looking at the serial output you will see the modules report dc connection and the AC connection.


----------



## blf0005 (Mar 30, 2018)

Thank you guys! I'll give it another go tomorrow afternoon. When you say ground the case, What exactly are you referring to? I was thinking ground the 12v gnd to the case is there another ground to make?


----------



## jackbauer (Jan 12, 2008)

You need to connect AC mains power ground to the charger case. It looks for a leakage current on startup and with no ground it will fail this test. AC power needs to be applied within about a 2 second window during the startup process. Not before and not after. It would be a good idea to use evse mode for initial testing as this is dealt with in software on the logic board.


----------



## Jimbo69ny (Feb 13, 2018)

Kevin Sharpe said:


> Gen 1 chargers were pretty unreliable and that's why we focused on Gen 2



Oh I didnt know that. I have a gen 1 Tesla charger in my Rav EV and it has worked perfectly. 

Gen 2 chargers are in 2016 - 2018 cars right? I am watching for one.


----------



## blf0005 (Mar 30, 2018)

jackbauer said:


> You need to connect AC mains power ground to the charger case. It looks for a leakage current on startup and with no ground it will fail this test. AC power needs to be applied within about a 2 second window during the startup process. Not before and not after. It would be a good idea to use evse mode for initial testing as this is dealt with in software on the logic board.


Alright, Excuse my ignorance as Im not an electrical engineer so that part of this whole thing is a bit foreign to me. So I believe I have all my connections correct on the signal side of the charger, and Now I see that I had the AC power going into module 3 instead of 1 so I will correct that, but I have just a few more questions on the AC hookup and the best way to test the whole system. 

On the AC hook up, using a standard 110v to pull power off of, In the image label Hot, neutral, and ground, I believe I want the neutral wire going to the white module 1 AC input wire and then the hot wire to the Brown module 1 AC. So when you say ground the AC to the case are you referring to the third ground pin in the image or the neutral leg of the AC? 


I'll be sure to better document my attempt tonight.


And also, as for implementation, I had planned not to have the charger handle the 1772 handshake but instead to command the charger to charge from the VCU. Since the application of AC power timing is so critical, I am assuming the care will just have to be taken with the timing of everything on the VCU side in controlling a mains relay to each charger. Is that correct? Basically I was hoping to have the VCU do the handshake with the EVSE and then apply AC to both chargers and have them sit in wait until I am ready for them to output power. It sounds thought That I will have to perform the handshake and then wait to apply the mains to the chargers until I am ready. Sorry if this is all confusing. Once I get the basics of this figured out I will be much more helpful with the code side of things!
Thanks!


----------



## Tomdb (Jan 28, 2013)

Please do not do that.

As Damien says, the Charge will do all that. You want dual chargers, we got you covered.

Charger does the EVSE handshaking, thus also the power on request to the EVSE timed perfectly with enabling of the modules. This will also be the same for the dual setup.

Currently there are three can control options:
1 - Can Mode: Master Elcon ; listen for the Elcon command messages, these include max charge voltage, dc current and charge enable.
2 - Can Mode: Master ; No external Can Control, all limits are based upon internal setpoints saved in flash.
3 - Slave : This mode will only work with autostart (evse comms) turned off, pure canbased control requiring Master charger or external AC control and Can Master. 

Once I get some more testing done on the new version of the code I will upload it again to github. 

Updates:
1. Can Mode: Master Elcon
2. AC (Plug) present output, allows the application of HV via BMS or relay logic before enabling charger


----------



## blf0005 (Mar 30, 2018)

Well the reasoning for that was specific to our project. Our two chargers are not paralleled together but instead each charge a separate bank of batteries. So my plan was to monitor SOC of both banks of batteries and split the available power from the evse between the two chargers in order to help ensure the two banks charge at the same rate. 

In most cases uneven charging shouldn't be an issue and I can just split the power evenly between the two chargers and allow them to top balance the two packs. In that case the master/slave setup should work fin for me as long as both chargers put out the exact same amount of power.


----------



## Tomdb (Jan 28, 2013)

Uhm, why two packs that are separate in one vehicle and two chargers fed of the same ac input again chargint the packs separate?

If the packs are literally duplicates or the same voltage just connect them in parallel when using the vehicle/installation and then do the same when charging. (Please PM me more details)

However, currently still to be implemented is slave IDs, so you could run two chargers in slave mode and keep the control totally within your VCU. 

Current power split is done via AC power, so the Master charger will allow the Slave to charge when there is enough power available. 

However when running in slave mode you just tell it the Max Charge voltage and Max AC current draw per module.  Rest of the magic is then up to you.


----------



## blf0005 (Mar 30, 2018)

In short, our car operates at 700V which necessitates charging the two halves of the bank separately. I was planning to have the VCU vary the charge current to each half of the bank to keep them charging evenly. I believe I can probably run them in master slave configuration, but have the VCU send charge limit commands over Canbus. This way the Charger still handles the 1772 handshake and enables both chargers with a zero current command and then simply waits to hear otherwise from the VCU.


----------



## Martii (Jan 17, 2018)

I don't think Tesla charger will let you do zero current.


blf0005 said:


> In short, our car operates at 700V which necessitates charging the two halves of the bank separately. I was planning to have the VCU vary the charge current to each half of the bank to keep them charging evenly. I believe I can probably run them in master slave configuration, but have the VCU send charge limit commands over Canbus. This way the Charger still handles the 1772 handshake and enables both chargers with a zero current command and then simply waits to hear otherwise from the VCU.


Sent from my LEX720 using Tapatalk


----------



## blf0005 (Mar 30, 2018)

Martii said:


> I don't think Tesla charger will let you do zero current.
> 
> Sent from my LEX720 using Tapatalk


Doesn't necessarily need to be zero current, I just need to devise a way to have only one charger do the 1772 handshake and then bring both chargers online. Then I will just give them different CAN IDs and have the VCU monitor the charging and throttle up or down one charger or the other in order two keep both halves of the pack charging evenly. 

It's not as big of an issue if they are able to top balance, but that won't always be the case.


----------



## blf0005 (Mar 30, 2018)

Tomdb said:


> (Please PM me more details)


Tom, I've tried to send you a PM a couple of times but it's not showing up in my sent messages folder. Let me know if you didn't get it. Thanks


----------



## Tomdb (Jan 28, 2013)

*UPDATE 23/05/18*

NEW Open Source Tesla Charger (OSTC) Code

https://github.com/tomdebree/Tesla-Charger

Currently verified and working in this release:

1-Can Mode: Master Elcon, can control to Elcon charger structure implemented, CAN ID 1806E5F4 
2-Verified working of Can Mode: Master, after all the changes 
3-output 2 pulls to ground when the charger detects a plug on proximity (bms wake up request for HV)

To be verified:
1 - Working of the Can Mode:Slave, together with an OSTC in Can Mode: Master or Master Elcon
2 - Thermal limiting of modules
3 - CV stage
4 - Operation with Orion BMS or the sorts.


////

Handshaking, will occur when plugging in. The EVSE will recognise an ev is present and wait for the ev to initiate a request. 
In Can Mode: Master Elcon, the charger waits till the BMS/VCU sends the can message to start and only then will it initiate charging and request AC to switch on.
In Can Mode: Master, the charger will initiate charging as soon as D1 is high


----------



## blf0005 (Mar 30, 2018)

Alright, I worked with the charger some more tonight but I'm still having issues. I feel like it may be something simple that I'm missing so hopefully one of you can help me figure this out. 

I got everything wired up (Control pilot, Proximity, 12v to A3 and B5, Gnd to B11) I grounded the 12v and the AC to the case as well. The 1772 handshake was working properly and the EVSE was giving AC power to the charger. However, I could not get the charger to come on. I tried with both autostart on and off with no success either way. The board is running the latest version of the code.

With Autostart off, the S2 command did not bring the charger online for some reason. You can see in the attached screen capture of the serial terminal what the charger did. Also attached are pictures of the setup in general.

Any help is greatly appreciated!


----------



## Tomdb (Jan 28, 2013)

Use the 's' command to change states.

Please set CAN Mode to Master with 'x1'

And Autostart to on with '1'

Please set you voltage and current limit to what you want.

And then plug in/turn on the evse.

If you can capture the whole serial log of that and share it in txt format.


----------



## Jimbo69ny (Feb 13, 2018)

What plug are you guys using with your chargers? Tesla or j1772?


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> What plug are you guys using with your chargers? Tesla or j1772?


In Europe Tesla use a modified Type 2 connector. Type 2 ("mennekes") is electrically compatible with Type 1 ("J1772") and is fitted to most OEM vehicles.

In the US Type 1 ("J1772") is the most prevalent connector at public charging locations. You could use the US Tesla connector on your build but you'd then need an adaptor for J1772 charging.

Obviously, if you want to do rapid charging then you need to look at CHAdeMO or CCS.


----------



## Kevin Sharpe (Jul 4, 2011)

If you enjoy Damien melting spanners then you'll enjoy this;

http://www.diyelectriccar.com/forums/showpost.php?p=1004602&postcount=18


----------



## Tomdb (Jan 28, 2013)

The OSTC does not care what plug you fit.

you just need to provide a few thing:
1-Control Pilot
2-Proximity Pilot
3- Protective Earth to vehicle chassis or 12V ground. (very critical )
4- AC input of any flavour (110-230VAC 1-3Ph)

the only things which currently are adjustable are : Type 1 or 2 (SAE or ISO due to difference in proximity, type 2 has cable limits and type 1 uses a switch to interrupt charge)

Then you need to define your module configuration, in single phase or three phase this is to have the current limit split appropriately.

There should be some master slave testing happening soon. 

Still looking to get my hands on a 'slave' charger as in a charger that was configured by Tesla as a slave. Without one it will be a bit harder to fix the apparent issue (im still doubting there is one) when using the open source board.


----------



## Jimbo69ny (Feb 13, 2018)

I found a gen 3 with a 60 day warranty (he's not sure if it works) for $400 and a gen 2 tested and working for $575. 



I read that the board is hard to get to in a gen 3. Is the gen 3 still the better deal?


----------



## annerajb (Jul 27, 2016)

Board is impossible to get but the protocol is the same based on the video damien did. The gen 3 also provides more amps than a gen2 depending on your application that may be a requirement it also includes the high voltage junction box for the charger plug so possibly a item that you do not have to buy. 
I got the pinout for the contactors on that gen3 charger hv junction section. Haven't had a chance to figure out how to drive them thru the pin.


----------



## Martii (Jan 17, 2018)

Jimbo69ny said:


> I found a gen 3 with a 60 day warranty (he's not sure if it works) for $400 and a gen 2 tested and working for $575.
> 
> 
> 
> I read that the board is hard to get to in a gen 3. Is the gen 3 still the better deal?


I would go with Gen3 if you still prefer Gen2 I'd be interested to get one. 

Sent from my LEX720 using Tapatalk


----------



## jackbauer (Jan 12, 2008)

Just to be very clear we are talking about the Version 3 board for the Gen 2 charger. I do not as yet have a board designed to run the Gen 3 charger. As mentioned though I did a video on the Gen 3 charger. Please check that out for more information.
https://www.youtube.com/watch?v=PMedmbeu8nU


----------



## Kevin Sharpe (Jul 4, 2011)

Jimbo69ny said:


> I read that the board is hard to get to in a gen 3. Is the gen 3 still the better deal?


The Gen 2 charger has working controller hardware/software today and is a known entity used by a number of people on this forum (i.e. good support). The Gen 3 charger has no working controller and lots questions remain about how/when we will have a working solution (we don't even know whether we can fit a controller inside the case).

My advice is stick with the Gen 2 charger because it works today. In the future you can replace it with a Gen 3 charger if/when a working solution exists. You can then sell your Gen 2 charger


----------



## Jimbo69ny (Feb 13, 2018)

jackbauer said:


> Just to be very clear we are talking about the Version 3 board for the Gen 2 charger. I do not as yet have a board designed to run the Gen 3 charger. As mentioned though I did a video on the Gen 3 charger. Please check that out for more information.
> https://www.youtube.com/watch?v=PMedmbeu8nU



Ok. Ill keep looking for a gen 2 charger. I am hoping to find one that cost less than $575.



Thanks


----------



## Kevin Sharpe (Jul 4, 2011)

Tesla Gen 2 Master/Slave chargers in Chris Hazell's R32 Skyline build


----------



## Tomdb (Jan 28, 2013)

Looks like currently the Code will work even on a so called Tesla 'Slave' charger.

Have made a few updates to my code: https://github.com/tomdebree/Tesla-Charger

*Changes 02/06/18*

-Serial command to change phases connected to charger 'p' followed by amount
-Serial command to change socket type 't' followed by type (1 or 2)


Need to get more testing done a dual charger setup to see how robust it is at the moment.

As always, code is Open Source and proven to work on Open Source hardware but please use it only if you know what you are doing. I will not take responsibility for any misuse.


----------



## Tomdb (Jan 28, 2013)

Quick test showing the Plug detect output working.

This output will pull low when the charger detects a plug inserted, this signal can be used to then act as a request to the battery to apply HV and allow charging to commence.


----------



## jackbauer (Jan 12, 2008)

Nice work Tom


----------



## blf0005 (Mar 30, 2018)

I was finally successful in getting both of my chargers working! I cleaned up my wiring and used the proper Molex connectors for everything this time and it worked like a charm.

I was getting an AC current reading that appeared to me to be off by a factor of 10 from what I was measuring with my meter and what the charger was reporting in the Serial stream. I was measuring ~3-4A and the charger was reporting around 30A to 40A.

Is it possible that on line 550, the multiplication factor should be 0.6666 instead of 0.06666? 

-Blakely


----------



## Tomdb (Jan 28, 2013)

There is still some bugs in the canbus packet decoding. 

Need to have a look at trying to sort it, when you draw roughly 5 amps it seems the numbers start making sense again.


----------



## jackbauer (Jan 12, 2008)

Next rev of the hardware will incorporate a real time clock and backup coil cell battery to allow for time scheduled charging


----------



## jackbauer (Jan 12, 2008)

After about 30 emails with the subject line "The USB connector doesn't fit" I'll post my now standard template reply here :


"The idea for the usb connector is to drill a hole in the top cover of the charger. Blank this with a grommet. This way software can be updated and parameters changed when the charger is buttoned up".


I am dumb for sure, but not that dumb


----------



## Kevin Sharpe (Jul 4, 2011)

jackbauer said:


> Next rev of the hardware will incorporate a real time clock and backup coil cell battery to allow for time scheduled charging


Very cool... can you also add control lines for the CHAdeMO and CCS contactors? And maybe CAN and HPGP interfaces as well? Then we're ready for DC charging


----------



## Tomdb (Jan 28, 2013)

Now you can adjust the socket type and amount of phases connected.

This however threw me when helping someone out.  if you do not tell it what socket type it has it will not work.

Attached is a overview of the serial commands and a recommended serial setup list.


----------



## Cyco90 (Nov 26, 2017)

Hi All,


My name is Ryan and I'm a mechanical engineer working with EPower Racing in Vancouver, Canada. Our vehicle is a custom-built tube frame racer powered by a motor out of a P85 Model S wrapped up in a body from an AC Cobra. We're trying to upgrade our charging setup to "fill up" faster on track days and I've been trying to implement your system here with a Gen 2 charger we've picked up.


I feel like I'm most of the way there, but the charger kept reporting a fault. I'm supplying 240AC/60Hz single phase (North American residential high voltage) and commanding 130VDC out in an effort to apply charge to a battery measuring 118VDC on my voltmeter. I've attached a log of the serial output from my testing last night. I did also try using the 'x1' command and repeating the procedure but forgot to save the log. I do indeed have 12V attached to A3 and B1, 12V ground to B7, but I do not have a connection to B5 or B11 as I've simply wired the AC in through a terminal block.



My procedure is to hit the 's' command and immediately after plug in my mains voltage. I get the pair of happy clicks a couple seconds apart and the serial output shows it reading voltage. It seems like it tries a couple of times to feed current but then kicks out and stays off. The Fault flag also shows as something being detected, but I'm unable to figure out what. I wasn't recording CAN traffic during testing.


Can anyone give me a clue as to what I'm missing?


Thanks,
-Ryan


----------



## jackbauer (Jan 12, 2008)

Your battery voltage is too low. If you try charging anything much lower than 200v it's boom time. Watch my videos.


----------



## Tomdb (Jan 28, 2013)

Also, only apply AC power post commanding on with 's' for the most reliable result.

The case of the charger says 50V minimum output, so it should be fine. So try raising the ac current limit to 2A and then retrying with the right sequence. 

You planning on running two chargers in master slave configuration without an evse?

If so please have an external breaker and rcd as you are getting into a level of power where it is no longer a joke. Plus a nice big red 'oh shit' button to cut voltage to the enable lines for a safe shutdown.


----------



## Tomdb (Jan 28, 2013)

Updated my serial command cheat sheet.

It now includes some 'test' setups to get anyone started.


----------



## prensel (Feb 21, 2010)

Tomdb said:


> Updated my serial command cheat sheet.
> 
> It now includes some 'test' setups to get anyone started.



Tom,


The test with the EVSE says:


_‘x1’ – set it to can mode Master
‘a1’ – set it to autostart mode
‘c5’ – 5 amp ac input limit per phase
‘vxxx’ – xxx replace with end voltage limit
‘t2’ – set to type 2 socket or set it to ‘t1’ for the type 1 socket ‘p3’ – if all modules are on their own phase, else use ‘p1’ 
_
_To initiate charge connect HV to charger and insert EVSE plug into socket.
_
_
_
_If all works as expected change the input limit to match the wiring and breaker limits. _







But when using an EVSE with the ControlPilot the EVSE is taking care of the max input limit /current isnt it ?


----------



## Tomdb (Jan 28, 2013)

Yes and no, how can the EVSE know you got bad wiring in your car. 

So you can this way limit based on the DC or AC wiring to you charger or the socket you have on your setup.

This limit is the last one that is applied when calculating max AC draw.


----------



## prensel (Feb 21, 2010)

Tomdb said:


> This limit is the last one that is applied when calculating max AC draw.





Ok, just to be clear:
For example the EVSE CP says max AC is 5A, the charger setup says 10A, the charger is limiting itself to 5A ?
Or when the EVSE says max is 10A, the charger setup is 5A, it is also limited itself to 5A ? 



So the least amount of AC current defined either from the CP or the charger setup is the one thats is active ? The least restrictive is the most effective ?


----------



## Tomdb (Jan 28, 2013)

the steps are as follow:

when using an evse

current request:
1. EVSE max current
2. 1 phase or 3 phase, one phase is divide by 3 and 3 phase is do nothing
3. if the current request is now larger than the AC limit (amount of phases respecting) limit it to AC current max setting.

This way the lowest value always wins. And this way everyone remains happy, expect if you set your AC current limit wrong in your car/vehicle.


----------



## DrJeff (Apr 24, 2015)

Trying today to get the charger working with an EVSE J1772 USA single phase 240 configuration...

- Somehow '255' got stored for the parameters.type on the EEPROM. Needed to increment the EEPROM_VERSION in Config.H to force it to (on the next run) load a '1' for Type1 (i.e. J1772). After this it correctly detected the Proximity signal.

- I couldn't get 'auto charging' to work. Once HV DC applied, and EVSE plugged in, I still needed to input 's' on the Serial Monitor to make it start charging.

- Some odd behavior once it started...
1) All the modules activated, but flickered a number of times, relays clicking
2) DC request for 1000V listed in the log!

- I tried with 3A request to start with and on a second run increased this to 6A, but got the same behavior.

Attached is the log (edited for brevity) showing the startup and some activity I believe occurred as the modules activated/deactivated (LEDs on/off).

Any help interpreting this would be much appreciated.

Thanks
Jeff


----------



## Tomdb (Jan 28, 2013)

```
Module Cur Request: 1000 DC total Cur:0.09 DC Setpoint:380
```
the 1000 is the 1amp request from the module. 

also your 380V charge request is quite low if the battery is already at 367V, this does cause issues i believe.

It does not look like the software here is at fault.

How did you have it working before?
Please write all the variables after you update the software.


----------



## blf0005 (Mar 30, 2018)

I've got a quick question about how to wire the AC input to the charger. I am in the US so I'll be running on single phase 240v. I understand that in that case all modules parallel, but do you split the hot and neutral wires and run them to all 3 modules, or only put Ac power to module #1?


----------



## Tomdb (Jan 28, 2013)

It turns out the 'p3' 'p1' did not get recognised properly.

This has been fixed and verified by myself. Please let me know if that fixed any issues. 

https://github.com/tomdebree/Tesla-Charger


----------



## jackbauer (Jan 12, 2008)

Today I got to run the Gen 2 charger from 3 phase power for the first time courtesy of a nice old 100kva smokey diesel generator



One of the things I worried about was the neutral current when running the 3 modules at full power as it would be almost 50A AC on the neutral and 16A per phase. However, when running on 3 phase, the modules shift their PFCs by 120 degrees resulting in almost zero neutral current.


----------



## Jimbo69ny (Feb 13, 2018)

The gen 1 chargers aren’t glued together like the others.


----------



## Tomdb (Jan 28, 2013)

I can now confirm, the slave mode, can master and standalone work.

Latest code: https://github.com/tomdebree/Tesla-Charger

just a quick explanation on the Can Modes, set by 'x' followed by number:
0-Standalone, to be used when no slaves are connected (version with elcon control to follow)
1-Master, to be used when a slave charger is connected on can
2- Master Elcon, to be used when a slave charger is connected on can and control commands are sent via can by other controller
3- Slave, to be used with other charger configured as Master or Elcon master


----------



## Kevin Sharpe (Jul 4, 2011)

Tomdb said:


> I can now confirm, the slave mode, can master and standalone work.


Thanks Tom 

In a couple of weeks I'll have access to 3 Phase in the workshop and will use this on a regular basis


----------



## pm_dawn (Sep 14, 2009)

This is excellent new.

I have both a master and a slave Gen2 charger waiting for surgery.

Its going to be awesome.
Three phase when ever I can get to it......
All the chargepoint in our city has three phase 32A Type 2 tethered EVSE.
I will be able to use the 22kw power from them 


Cant wait to setup the testbench.

Big thanks to Damien and Tom for this great work..

/Per


----------



## jackbauer (Jan 12, 2008)

Seems this thread is back.....for now....


----------



## Martii (Jan 17, 2018)

I recently stumbled on slave charger as I suppose as it's happy charging with AC on at all times. Also it's way quicker as first click happens almost instantly after I command charging on. Also even delayed AC works well. Weird?


jackbauer said:


> Seems this thread is back.....for now....


Sent from my LEX720 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Slave chargers make no difference.

I got one working without changing a thing in code.

Updated github code below

https://github.com/damienmaguire/Tesla-Charger

Changes:

- Introduction of simple DC current limit, calculation:

DC voltage/AC voltage* DC current limit = AC current limit

if you want this to not be used just set the DC current limit to 45 amps.


----------



## Tomdb (Jan 28, 2013)

More updates on the software.

I have had the request to allow changing of the external canbus speed.

Now using command '1 250' you get a speed of 250k baud and using '1 500' you get a speed of 500k baud ect.

Github
https://github.com/tomdebree/Tesla-Charger

Anyone currently running the opensource board please feedback any issues or requests.


----------



## Tomdb (Jan 28, 2013)

*Update 09/08*

Added feature:
'd' for display stored parameters in eeprom - this will give you a dump that you can save for later reference, or loading into a 'fresh' charger.

plus will help me/us out when you have issues.

note: currently untested as I am on vacation.

Github:
https://github.com/tomdebree/Tesla-Charger

I wonder how many chargers are currently on active duty with the opensource board and code. I know of +/- 10 so far,most of which are in the UK.


----------



## Cyco90 (Nov 26, 2017)

Hi all,


I posted a month back or so about trying to get the open source board and charger system working, and I was having some issues getting the charger to enable. The good news is I did get it working and charging at 10kW, though we haven't put it into "active use" quite yet. Thanks everyone here for all their hard work, It's a really clean solution to getting a homebrew charging system working!



I've been trying to get a second unit (also master) working independently, and have been having some weird troubles there. I've taken a board that's working with my first charger, plugged it into my second charger, and it's failed to operate. I don't have a log on hand, but it seems the measurements of DC voltage and AC current are way off. My 360V battery is being reported as 504-506V on each module, and all three modules report a constant AC current in of 29.86A even when no current is present. When I plugged in a 36V battery into the DC output, the modules reported the voltage to be 44V and an AC current of 29.86A even though my AC supply wasn't plugged in. The sequence of audible clicks is correct, and the LEDs on each module operate in the same fashion as the first (working) charger. 



Has anyone encountered faulty readings like this? It's a salvaged Gen2 master charger, the same as my first unit, so I suppose it's possible that the second unit is damaged, although it looks to be in perfect physical condition. I expected to be able to swap boards between the two units and have them operate identically.


-Ryan


----------



## blf0005 (Mar 30, 2018)

Tomdb said:


> *Update 09/08*
> I wonder how many chargers are currently on active duty with the opensource board and code. I know of +/- 10 so far,most of which are in the UK.


We will be running dual chargers active duty here in about a week. 
I am wondering though about the outputs on the charger. Are they switch to ground with an internal pull-up or are they switch to 12v with an internal pull down? thanks!


----------



## DrJeff (Apr 24, 2015)

Cyco90 said:


> ... but it seems the measurements of DC voltage and AC current are way off. My 360V battery is being reported as 504-506V on each module, and all three modules report a constant AC current in of 29.86A even when no current is present. When I plugged in a 36V battery into the DC output, the modules reported the voltage to be 44V and an AC current of 29.86A even though my AC supply wasn't plugged in. The sequence of audible clicks is correct, and the LEDs on each module operate in the same fashion as the first (working) charger.
> 
> Has anyone encountered faulty readings like this? It's a salvaged Gen2 master charger, the same as my first unit, so I suppose it's possible that the second unit is damaged, although it looks to be in perfect physical condition. I expected to be able to swap boards between the two units and have them operate identically.
> -Ryan


Hi Ryan,

I have noticed that between the three modules on my first charger - two would agree on the battery voltage and one would be 2-5V lower. Nothing like the voltage difference you are seeing. The consistent readings were 1-2V away from my voltmeter reading. My second charger exhibits similar variances.

Jeff


----------



## DrJeff (Apr 24, 2015)

I've having on-going charger problems, fitted with Damien's Gen2V3 board. I've now tested on a different charger and am seeing the same symptoms/data reported as with my first charger (nothing like testing with spare $1000 parts!).

So it pretty much boils down to...
1. Charger (Controller) is not externally wired up correctly
2. Charger module firmware (for the version of chargers I have) is slightly incompatible with Damien & Tom's software
3. I've configured Tom's software incorrectly
4. Controller board is not working correctly
5. Power source to the Charger/Controller is not sufficient (amps/continuity)

Symptoms
Software reports that AC voltage and DC battery voltage correctly. Software also reports HI on the Enable (IN1) line. All the LEDs come on, relays click, FLT flag set almost immediately, AC Current climbs for 1-2 seconds and then drops to a minimal level (doesn't report 0 on all three modules - but so close to zero to be zero). All three modules reset (LEDs flicker off/on) about every 5 seconds.

1. External Connections
- 12v and ground provided to the charger
- internal CAN lines connected to an EVTV CANDUE
- IN1 connected to 12v
- LATCH not connected
- external CAN not connected
- OUT1 not connected

2. My chargers are 00-K and 00-J versions.

3. V400, C7, Type 1, 120V, singlephase. Also tested with a US EVSE (240v, singlephase, 40A)

4. I swapped the Controller board from charger 1 to charger 2 for the test - changing nothing else

5. I've got the 12v/GND to the module connected to a power supply box I built out of an old computer PSU.

Potential things to chase
- How to ensure the charger isn't seeing a loss of isolation?
- 12v power supply isn't dropping and causing the modules to reset?
- What software configs have other US users had success with?
- How to 'debug' the controller board (is it glitching the module enable lines?)

Jeff


----------



## Tomdb (Jan 28, 2013)

Jeff Please load my latest version and get it to spit out 'd'.

https://github.com/tomdebree/Tesla-Charger/tree/master/Gen2TeslaCharger


----------



## Frigzy (Sep 18, 2016)

electro wrks said:


> Basic Tesla charger question: Does the Tesla DC fast charge(and possibly other DC fast charge protocols) go through the charger? If so, can it be enabled as well as the AC charging functions?


It's probably way to late for the reply, but yes - on-board charger is actively participating in the fast charging process. It does:
1) Communicating with an EVSE over a single-wire CAN.
2) Processing prox/pilot.
3) Helping with voltage and current measurements.
4) Helping with an isolation test and a leakage test.


----------



## DrJeff (Apr 24, 2015)

I'm welcoming any ideas people might have on the Tesla Gen2 charger and how to get it working fully. *Especially interested in anyone in the US who has gotten the charger working on single phase AC power.*

Update on the status of my charger testing...
- Discovered that I can charge with any 1 or any 2 of the 3 modules, but I just can't get all 3 modules to charge at the same time
- Same charging behavior across two separate chargers
- Supplied the charger with two different 12v power sources (PSU and via the Tesla DCDC converter) but no difference in charging behavior
- Charger takes 12v 0.6amps with 1 module, 1.3amps with 2 modules, but for 3 modules it drops back to 0.6amps (but never enters a charging mode).
- No difference charging with 120v or 240v (singlephase)
- No difference charging at 1A/module, 2A, 3A, 3.5A...

Setup...
- US spec chargers 1014963-00-K and 1014963-00-J
- 120v AC input, Singlephase
- DC charging 400v target, battery currently at 369v
- Gen2 v3 charger controller from Damien (EVBMW)
- Latest software from Tom de Bree

What this rules out...
- Malfunctioning charger (two chargers produce exactly the same result)
- 12v power source to the charger


----------



## piotrsko (Dec 9, 2007)

Bet you have some configured as masters


----------



## Jimbo69ny (Feb 13, 2018)

This might be a long shot but does anyone have a fully functioning charger built that they are interested in selling? I dont think I could build one of these on my own and I would love a working 10kw charger.


Id like to add a charger to my range extending trailer.



I live in the New York USA.


----------



## tiger82 (Sep 23, 2015)

Further to Ryan's post (Cyco90), we purchased a 3rd charger and successfully got that running. It looks like there was a problem with one of the other chargers. Both working chargers exhibit identical behaviour. Using a 240V single phase input at 42 amps, we get 26 amps DC output to our 350V pack (9.2kW). Next step is to see if we can parallel the chargers for 18.4kW out. This should charge our modified Bolt Pack in just over 2 hours!

The only issue seems to be that both chargers read the AC current incorrectly. They show the 42 amp input as ~ 32 amps. We will probably just change the scaling factor. 

Jeff: We don't seem to exhibit any of your symptoms, so I don't think the problems are associated with North American models. The chargers that are working are PN104963-00-L and E. The one that doesn't work is a -E. We are using home made Gen2 boards and running the latest Tom de Bree software.


----------



## DrJeff (Apr 24, 2015)

tiger82 said:


> ...
> The only issue seems to be that both chargers read the AC current incorrectly. They show the 42 amp input as ~ 32 amps. We will probably just change the scaling factor.
> 
> Jeff: We don't seem to exhibit any of your symptoms, so I don't think the problems are associated with North American models. The chargers that are working are PN104963-00-L and E. The one that doesn't work is a -E. We are using home made Gen2 boards and running the latest Tom de Bree software.


Thanks for the update, good to rule out another source of issue (US vs Euro, and threephase vs singlephase).

Working on one or two modules (of the three) I also get odd AC Current readings - I pulled the data with SavvyCAN and the bits Tom's software is looking at are definitely the set of bits that are varying (thus likely to be carry a real value), so scaling could be a solution. Need to think about how to validate the current reading.

I'm 99% sure I've got two working chargers. For my "any two modules work, but not all three" the next item I'm chasing is the control board.

Jeff


----------



## Tomdb (Jan 28, 2013)

Good to hear someone else has gotten 'US' chargers working. I am hoping it is not a firmware level change issue.

However, worked a bit more on the canbus decoding, AC current is now working.

DC current regulation is not finished, so in this version of the code it is turned off again.

As always my code on github.

https://github.com/tomdebree/Tesla-Charger

Please do not post any guesses in this thread, only facts based on real tests. This is to keep it a clean and technical discussion.


----------



## Cyco90 (Nov 26, 2017)

Further to Doug's (tiger82) update, just today we managed to get our two chargers working in parallel to charge our modified Bolt pack at 18.3kW. Due to power restrictions, we had one charger pulling power from a residential source (240V single phase) and the second was powered by a 12kW generator. We're located in Canada so that's NA residential high voltage. We're using Damien's v2 board design and were running a version of Tom's code from mid-July for this test. I'll likely update the software to the latest version once I have a chance to.



-Ryan


----------



## jackbauer (Jan 12, 2008)

I'm often amazed at how electronics designs can hide little problems that only come out under a specific set of circumstances. Gassing up the Panzer today in advance of the dyno day on Saturday I noticed something strange. Even with no power going to the charger the red 5v led was illuminated and the hv contactors were commanded on. I use a standard 12v 4 pin automotive relay on the OUT2 pin of the logic board to command cooling and hv on when the charger detects ac present. Well, the ULN2003 has a series of inverse flyback diodes connecting each output to 12v. Seems the coil resistance of the relay was just low enough to let a little current trickle through, which started to power up the mcu, which then tried to bootup, which then tickled the ULN inputs and so on.


Looks like the V4 board will be happening sooner then I thought I'll replace the ULN2003 with some of the nice beefy NCV8401 parts I used on the drive unit logic boards.


----------



## Cyco90 (Nov 26, 2017)

Just wanted to add on to Doug's (tiger82) update. We managed to parallel our two working chargers last week for a combined 18.3kW output! We are running Damien's V2 boards on both units with a version of Tom's code from mid-July. I'm planning on updating the software on both boards when I've had a chance to read through all the changes. One charger was being powered by Canadian residential high-voltage (240V single phase) while the other was off of a 12kW generator. No problems getting them to run nicely with each other. The load was a modified Bolt pack that sits at ~400V when fully charged.


-Ryan


----------



## Martii (Jan 17, 2018)

jackbauer said:


> I'm often amazed at how electronics designs can hide little problems that only come out under a specific set of circumstances. Gassing up the Panzer today in advance of the dyno day on Saturday I noticed something strange. Even with no power going to the charger the red 5v led was illuminated and the hv contactors were commanded on. I use a standard 12v 4 pin automotive relay on the OUT2 pin of the logic board to command cooling and hv on when the charger detects ac present. Well, the ULN2003 has a series of inverse flyback diodes connecting each output to 12v. Seems the coil resistance of the relay was just low enough to let a little current trickle through, which started to power up the mcu, which then tried to bootup, which then tickled the ULN inputs and so on.
> 
> 
> Looks like the V4 board will be happening sooner then I thought I'll replace the ULN2003 with some of the nice beefy NCV8401 parts I used on the drive unit logic boards.


Also I just noticed that C35 on the schematics says 680uF but I think it should be 68uF. Am I wrong? 

Sent from my LEX720 using Tapatalk


----------



## joromy (Feb 27, 2018)

Hi, I'm new on this tread.
Got jackbauers controller cards today.

Any suggestions on what to do and not to do!?

Will use 3-phase EVSE, and canbus control from BMS.


----------



## jackbauer (Jan 12, 2008)

C35 is 680uF


----------



## pm_dawn (Sep 14, 2009)

Hi all!

Does the C35 really need to be 160v rated.
And the BOM is a bit confusing on that component.

MPN and Description points to a 68uF cap.
But schematic and value shows 680uF

Best Regards
/Per


----------



## Martii (Jan 17, 2018)

I did get 160V one and it's so big that you can't close the lid.


pm_dawn said:


> Hi all!
> 
> Does the C35 really need to be 160v rated.
> And the BOM is a bit confusing on that component.
> ...


Sent from my LEX720 using Tapatalk


----------



## jackbauer (Jan 12, 2008)

It's 680uF 25v


----------



## pm_dawn (Sep 14, 2009)

jackbauer said:


> It's 680uF 25v


Thanks !
That was a bit more reasonable.....

I'll order that then!

Regards
/Per


----------



## joromy (Feb 27, 2018)

Hi, got the boards from Damien a few days ago.
Have connected it to USB, and communication is established.

Do I have to choose any baudrate on the serial monitor?
Can I read version from serial monitor?
Can I connect it to 230V 3 phase!!???

Have only 230V 3 phase at home, on the road it's 400V +N

First on test bench with 230V single phase.
Later with 3 phase EVSE connector on the car.


----------



## Martii (Jan 17, 2018)

Sure you can connect 3 phase. 

Sent from my LEX720 using Tapatalk


----------



## blf0005 (Mar 30, 2018)

An update on our project here in the US. Ive got both chargers working now, Ive successfully run them both in a master/slave configuration as well as a slave/slave where the VCU is controlling them. I'm actually running them in a series configuration to charge two halves of a larger bank. 

All is well as far as controlling goes; however, one of my units is faulty and will only run on two of the three modules and at a reduced rate as well. The other works perfectly so I'll be sourcing another unit and everything will be good to go.

Ive run them both on 110 as well as 240 single phase. Currently running code that I wrote specific to our application but I have tested them both on an older version of Tom's code as well. I have not run anything recent within the last two months of his though.


----------



## joromy (Feb 27, 2018)

Martii said:


> Sure you can connect 3 phase.


230V 3 phase.
Yes when i think of it, I agree.
Connecting it in "delta" since there is no N, would work on the bench.

The standard on EVSE is "star" connection if you have 3 X 230V chargers, or "delta" if you have 3 X 400V chargers.

Since I'm going to use a EVSE connector, this would not be very practical or safe.
If there isn't a star delta black box somewhere???


----------



## Martii (Jan 17, 2018)

I don't understand what your problem is. You have 3 phases and 3 modules. You connect one phase per module and use 3 phase relay. You command charger to start all 3 modules to work provide AC via relay and charge at desired speed. 

Sent from my LEX720 using Tapatalk


----------



## joromy (Feb 27, 2018)

Martii, if I connect it in "delta" for use at home. (230V 3 phase)

And then connect it to a charging point (400v 3 phase) without changing to "star" it will blow it up.


That's why I have to go for 1 phase charging at home.


----------



## Martii (Jan 17, 2018)

Where do you live? Europe? You get 400V between phases only. My so called 400V socket has 5 pins ( phase 1,2,3, neutral and earth). Where do you see the problem when connecting the charger? 

Sent from my LEX720 using Tapatalk


----------



## Martii (Jan 17, 2018)

https://en.wikipedia.org/wiki/Type_2_connector you have the same config at level 2 charging point. 

Sent from my LEX720 using Tapatalk


----------



## boekel (Nov 10, 2010)

Martii said:


> Where do you live? Europe? You get 400V between phases only. My so called 400V socket has 5 pins ( phase 1,2,3, neutral and earth). Where do you see the problem when connecting the charger?
> 
> Sent from my LEX720 using Tapatalk


there are old networks with 230V between phases, don't know for sure where, all phased out in the Netherlands afaik, Belgium maybe. rest of the world? don't know.

But...don't the chargers just work at 120VAC also? then 130V between phase and neutral (if you have a neutral?) would also work?


----------



## Martii (Jan 17, 2018)

It doesn't matter there is level 2 standard and it has 3 phases separate in the plug. Also at home in Europe I'm getting 3 phases separate in the socket. 

Sent from my LEX720 using Tapatalk


----------



## joromy (Feb 27, 2018)

This is how tesla has recommended to do it.









This will give 12.7kW power from a 32A AC outlet.
Going to use this for my other EV also, so the note makes me wonder???

Sorry Martii, didn't want to start an argument.
Just want to be sure, before I start to connect to power.


----------



## Martii (Jan 17, 2018)

Sure no problem. The charger (gen2) does 16A per phase so almost every level 2 charger can deliver up to 11kW of power. This also depends on the DC side. Your battery pack needs to be well above 200V DC. 

Sent from my LEX720 using Tapatalk


----------



## boekel (Nov 10, 2010)

joromy said:


> This is how tesla has recommended to do it.
> 
> View attachment 109825


that way only 2 of 3 charger modules are used?


----------



## Martii (Jan 17, 2018)

You also connect L3 to the charger with common ground/PE. The L3 is not connected on the drawing but should be.


boekel said:


> that way only 2 of 3 charger modules are used?


Sent from my LEX720 using Tapatalk


----------



## joromy (Feb 27, 2018)

boekel said:


> that way only 2 of 3 charger modules are used?


Ref: 230V 3 phase without N.

Yes your right, I can live with that.
At least I could swap between charging with 1 phase 3.6kW, 230V 3 phase 7.3kW and 400V 3 phase at full power.

An extra relay (1PDT) could connect the last one. But it needs to be off when connected to 3 phase 400V.

Wonder how tesla is doing this. They must have an extra contactor, that connects charger board 2 and 3, when connected to 1 phase.

Does anyone have a diagram on how the tesla i wired from plug to charger.


----------



## joromy (Feb 27, 2018)

Using type 2 EVSE:

This could work.









If implemented, the controller could engage the 2PDT relay if only module 1 sees AC voltage.
Thus connecting all modules in parallell, for 230 1 phase.

Controlling the 3PDT relay would need some hardware sensing of missing N or AC voltage level.

If connected to 400V none of the relays are engaged.

Q: Tomdb, could this be implemented in code?
Q: To all, how are you dealing with switching between 1 phase and 3 phase?


----------



## Martii (Jan 17, 2018)

If anybody interesed I have this esp32 development board available for sale as I'm doing another revision and will move to KiCad. 

This is based on Damiens design v3.

Works fine. Code is almost identical except it uses esp32 libraries for can. It's missing ips1-115 connector. Lolin32 with working included. Will try to make github repository for design and code during the winter time. 

If interested please PM me.









Sent from my LEX720 using Tapatalk


----------



## Martii (Jan 17, 2018)

Forgot to mention that I'm selling at cost so will be around 90 EUR plus shipping. I live in EU. 


Martii said:


> If anybody interesed I have this esp32 development board available for sale as I'm doing another revision and will move to KiCad.
> 
> This is based on Damiens design v3.
> 
> ...


Sent from my LEX720 using Tapatalk


----------



## swoozle (Nov 13, 2011)

jackbauer said:


> It's 680uF 25v


Does anyone have a good part number for this cap? 

I ordered from Mouser (US) a 680uf cap of the same size as the part number listed in the BOM and it was too big (18 mm diameter). I should have checked. There's no way that is fitting on the board. Looks like it should be a 12mm diameter part?

Oh, and at least in the US at Mouser and Digikey the IPS1-115-01-S-D-PL connector isn't available. It's now IPS1-115-01-L-D. Not a huge difference but if you're doing a straight copy-paste part number search, this will get you there.


----------



## Martii (Jan 17, 2018)

Did the same mistake. Those from BOM are huge and even if diameter would fit they are also too tall so the lid wouldn't close later on. I went with 10 mm diameter and it's about right. Still not that easy to solder. Anything with diameter higher than 10mm (like 12,5mm) will need reflow soldering. Sometimes easy to do in small kitchen oven with soldering paste. Hot air gun would also work fine. 

UCL1E681MNL1GS looks fine but has only 2000 hours life. I would go with 5000 and above. 



swoozle said:


> Does anyone have a good part number for this cap?
> 
> I ordered from Mouser (US) a 680uf cap of the same size as the part number listed in the BOM and it was too big (18 mm diameter). I should have checked. There's no way that is fitting on the board. Looks like it should be a 12mm diameter part?
> 
> Oh, and at least in the US at Mouser and Digikey the IPS1-115-01-S-D-PL connector isn't available. It's now IPS1-115-01-L-D. Not a huge difference but if you're doing a straight copy-paste part number search, this will get you there.


Sent from my LEX720 using Tapatalk


----------



## Martii (Jan 17, 2018)

VZH-681M1ETR-1313

This one looks quite good.

I'm not sure if 10V or 16V cap wouldn't be enough here. There is more choices if so. 

Sent from my LEX720 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Update to code:
Now contains a watchdog just incase the charger hangs it will reset.

https://github.com/tomdebree/Tesla-Charger

Changes planned:

Add a RTC for timed charging
Add a 'sleep' after charging is completed


----------



## jackbauer (Jan 12, 2008)

So I seem to get about 3 or 4 emails or messages a week from people regarding the incorrect part number and description of C35 on the charger logic board. When someone can be bothered to lookup the schematic for the correct value, go to Mouser or digikey and lookup the correct part, purchase that part and ensure it fits, download the BOM and amend it and then submit the amended BOM on Github. That is when I'll change it. After all I do this for every board and every part. Not much to ask for a free design is it?


----------



## Tomdb (Jan 28, 2013)

*Updated Code 12/11/18*

Have now worked my new found menu structure into this beauty. 

https://github.com/tomdebree/Tesla-Charger/tree/master/Gen2TeslaChargerV2

-----------------------------------------------------------------------------


One thing to note is if the charger is acting up for some reason, unplug usb and power cycle the charger. The due sometimes likes to hang, this does not occur when no usb is attached.


----------



## Martii (Jan 17, 2018)

Nice one, good job.


Tomdb said:


> *Updated Code 12/11/18*
> 
> Have now worked my new found menu structure into this beauty.
> 
> ...


Sent from my LEX720 using Tapatalk


----------



## Tomdb (Jan 28, 2013)

Ofcourse what is an interface overhaul without an update to the manual.


----------



## swoozle (Nov 13, 2011)

Tomdb said:


> *Updated Code 12/11/18*
> 
> Have now worked my new found menu structure into this beauty.


Thank you!


----------



## swoozle (Nov 13, 2011)

jackbauer said:


> So I seem to get about 3 or 4 emails or messages a week from people regarding the incorrect part number and description of C35 on the charger logic board. When someone can be bothered to lookup the schematic for the correct value, go to Mouser or digikey and lookup the correct part, purchase that part and ensure it fits, download the BOM and amend it and then submit the amended BOM on Github. That is when I'll change it. After all I do this for every board and every part. Not much to ask for a free design is it?


OK, I gave it a shot. Not that familiar with github; I opened an issue and attached a corrected BOM. Let me know if it should be submitted some other way.


----------



## jackbauer (Jan 12, 2008)

Thanks very much. BOM now updated


----------



## Martii (Jan 17, 2018)

jackbauer said:


> Thanks very much. BOM now updated


Maybe with the v4 of the board you plan to move to esp32? I've seen final board at EVTV and looks great. 

Sent from my LEX720 using Tapatalk


----------



## swoozle (Nov 13, 2011)

Tomdb said:


> *Updated Code 12/11/18*
> ...
> One thing to note is if the charger is acting up for some reason, unplug usb and power cycle the charger. The due sometimes likes to hang, this does not occur when no usb is attached.


Given this, and the general awkwardness of having a USB cable sticking out the top, are there other ways of getting the in-process charge data out of the unit? 
I'm particularly interested in the temperatures, but other data would be good to access as well.
Thanks!


----------



## Martii (Jan 17, 2018)

Yes there is another canbus where you can send some info if you want. Another option is to use for example ESP32 and check desired things over wi-fi.


swoozle said:


> Given this, and the general awkwardness of having a USB cable sticking out the top, are there other ways of getting the in-process charge data out of the unit?
> I'm particularly interested in the temperatures, but other data would be good to access as well.
> Thanks!


Sent from my LEX720 using Tapatalk


----------



## swoozle (Nov 13, 2011)

Tomdb said:


> *Updated Code 12/11/18*
> 
> Have now worked my new found menu structure into this beauty.
> 
> ...


Tom, I notice that you have a whole section of code at the bottom commented out, including the part where it writes changes to eeprom (which explained why mine weren't saving). Should I roll back to V1 until you get to this or is there an easy fix?

Thanks


----------



## Tomdb (Jan 28, 2013)

Shit, you are right. Let me update the code for you, I knew I missed something.

Updated it should now save.


----------



## swoozle (Nov 13, 2011)

Thanks Tom.

Partial success in getting it working today. Apparently Module 2 is dead.

Proximity Status : Connected AC limit : 15600 /Cable Limit: 0 /Module Cur Request: 1667 /DC total Cur:4.30 /DC Setpoint:168 /DC driven AC Cur Lim: 35706
766597 State: 1 Phases : 0 Modules Avtive : 3 ON D1 H
Phase 1 Feebback // AC present: 1 AC volt: 245 AC cur: 2.13 DC volt: 162 DC cur: 2.09 Inlet Targ: 216 Temp Lim Cur: 15 32 25 EN:1 Flt:1 Stat:1001101
Phase 2 Feebback // AC present: 1 AC volt: 245 AC cur: 0.00 DC volt: 156 DC cur: 0.00 Inlet Targ: 216 Temp Lim Cur: 15 25 25 EN:1 Flt:1 Stat:100000
Phase 3 Feebback // AC present: 1 AC volt: 244 AC cur: 2.07 DC volt: 161 DC cur: 2.19 Inlet Targ: 216 Temp Lim Cur: 15 25 25 EN:0 Flt:1 Stat:1001101

1 - Auto Enable : ON
2 - Modules Enabled : 123
3 - Can Mode : Master 
4 - Port Type : 1
5 - Phase Wiring : 1
6 - DC Charge Voltage : 168V
7 - AC Current Limit : 5A

This is running off of a 240V one phase EVSE.
As someone else noted, 12V power consumption scales with the number of modules active. This sucks power like 3 are active but #2 is not producing anything. This was confirmed by experimenting with having various modules active and by measuring EVSE current draw and DC output with a clamp meter.

Is there any troubleshooting possible for a bad module?

Also, I looked through the source but couldn't figure these out. Hopefully they aren't dumb questions:

What is Inlet Targ? Source says it's a target temp?

What are the "Temp Lim Cur" numbers? The second one is obviously the actual module temp, but what are the 15 and 25 values?

What is EN: ("module enable feedback on the module"?) and why does it flicker on and off?

Thanks!


----------



## Martii (Jan 17, 2018)

I don't think you can repair dead module as they are impossible to disassemble and even disclosed electronics is converted with some kind of glue.

How big 12V consumption do you see? I would just unplug dead module and use charger as 7kW one.


swoozle said:


> Thanks Tom.
> 
> Partial success in getting it working today. Apparently Module 2 is dead.
> 
> ...


Sent from my LEX720 using Tapatalk


----------



## swoozle (Nov 13, 2011)

Martii said:


> I don't think you can repair dead module as they are impossible to disassemble and even disclosed electronics is converted with some kind of glue.
> 
> How big 12V consumption do you see? I would just unplug dead module and use charger as 7kW one.
> 
> Sent from my LEX720 using Tapatalk


Oh it's not a lot, 1.1A for all modules active if I recall. And if the module isn't activated it doesn't use power.

Yes, my plan is to use the two modules. I doubt I'll ever miss the 3rd module. I was more asking to see if there was something obvious I was missing.


----------



## Tomdb (Jan 28, 2013)

Have you tried just commanding Module 2 to work?

I would need a can capture to do some digging around in.

But there can be multiple reasons why the module is dead.

What does the stat value due during the capture for the dead module?


----------



## swoozle (Nov 13, 2011)

Tomdb said:


> Have you tried just commanding Module 2 to work?
> 
> I would need a can capture to do some digging around in.
> 
> ...


Only Module 2 active looks like so:

Proximity Status : Connected AC limit : 15600 /Cable Limit: 0 /Module Cur Request: 5000 /DC total Cur:0.00 /DC Setpoint:168 /DC driven AC Cur Lim: 5000
109216 State: 1 Phases : 0 Modules Avtive : 1 ON D1 H
Phase 1 Feebback // AC present: 0 AC volt: 0 AC cur: 0.00 DC volt: 0 DC cur: 0.00 Inlet Targ: 0 Temp Lim Cur: 0 0 0 EN:0 Flt:0 Stat:0
Phase 2 Feebback // AC present: 1 AC volt: 246 AC cur: 0.00 DC volt: 156 DC cur: 0.00 Inlet Targ: 216 Temp Lim Cur: 15 29 25 EN:0 Flt:1 Stat:100000
Phase 3 Feebback // AC present: 0 AC volt: 0 AC cur: 0.00 DC volt: 0 DC cur: 0.00 Inlet Targ: 0 Temp Lim Cur: 0 0 0 EN:0 Flt:0 Stat:0

Module temp is a little elevated only because I was running Module 1 by itself for awhile with no active cooling.

At first I thought the stat value for 2 is always 10000, but it isn't. I've attached a full run from plugging in the J1772 plug until pulling it out. 

Does CAN debug spit out all of the can traffic? I'll try that when I get a chance to play with it again.

Thanks


----------



## swoozle (Nov 13, 2011)

Tom (or Damien or anyone else?),

Re the control board serial output, I looked through the source but couldn't figure these out. Is there another source of more info?

What is Inlet Targ? Source says it's a target temp? It's reading 216 though. 

What are the "Temp Lim Cur" numbers? The second one is obviously the actual module temp, but what are the 15 and 25 values?

What is EN: ("module enable feedback on the module"?) and why does it flicker on and off for an active module?

What do the status bits indicate?

Thanks


----------



## swoozle (Nov 13, 2011)

The charger appears to use little power when not active (~100 mA). Do folks leave it on all the time?


----------



## Tomdb (Jan 28, 2013)

swoozle said:


> Tom (or Damien or anyone else?),
> 
> Re the control board serial output, I looked through the source but couldn't figure these out. Is there another source of more info?
> 
> ...


I have not done much diving into this. the Temp Lim Cur are numbers relating to derating requirements. However I believe this are just informative and the module derate as required. 

EN, no idea what it 'really' is yes all modules show it changing.

Status bits are states the module can be in, used for diagnosing.


----------



## mfor1000 (Aug 22, 2017)

Hi Guys,

Thanks for the hard work Tom and Damien, I have the board up and running and am charging! 

Do you have a switch going to DIG_IN_1 as a manual on-off for the charger?
(I bypassed the logic for this in the code for now just to get it working).

Also, When the charger modules start up, I lose USB connection and it won't come back until I power them down down. Have you ever seen this?

Thanks,
Matt


----------



## Tomdb (Jan 28, 2013)

Hello Matt,

The USB can be fussy. It has known to cause chargers to misbehave. These issues usually go away if you remove the usb and then power cycle it.

I have not really had USB drop out will connected.

DIG_IN1 is used as an interlock, so a back up to the internal voltage control. This usually should be controlled by a BMS.


----------



## mfor1000 (Aug 22, 2017)

Tomdb said:


> Hello Matt,
> 
> The USB can be fussy. It has known to cause chargers to misbehave. These issues usually go away if you remove the usb and then power cycle it.
> 
> ...


Thanks for the fast reply! 

Just to be clear, that is pin A3 from the connection picture? Also, are you sending 12V, or 3.3V?

Thanks...


----------



## Tomdb (Jan 28, 2013)

Yes Pin A3, Dig-IN1 has to be high, tied to 12V.


----------



## mfor1000 (Aug 22, 2017)

Tomdb said:


> Yes Pin A3, Dig-IN1 has to be high, tied to 12V.


Perfect...Thanks. 

I found that the USB doesn't drop out if the laptop is plugged in to its power supply. Must be some kind of weird ground loop thing. Thanks for your help!

Matt...


----------



## mfor1000 (Aug 22, 2017)

I'm seeing pulsing while charging. It looks like modules may be switching on and off for some reason, however it does continue charging and recover.

Attached is a plot from my juice-box app with the spikes in it. The graph at the bottom is the kW while charging.

Has anyone had this issue?

Thanks...


----------



## Martii (Jan 17, 2018)

mfor1000 said:


> I'm seeing pulsing while charging. It looks like modules may be switching on and off for some reason, however it does continue charging and recover.
> 
> Attached is a plot from my juice-box app with the spikes in it. The graph at the bottom is the kW while charging.
> 
> ...


Are you using Damiens board? 

Sent from my LEX720 using Tapatalk


----------



## mfor1000 (Aug 22, 2017)

Martii said:


> Are you using Damiens board?
> 
> Sent from my LEX720 using Tapatalk


Yes, his board and Tom's software. Overall it charges ok, but I'm concerned about the dropouts.


----------



## Martii (Jan 17, 2018)

mfor1000 said:


> Yes, his board and Tom's software. Overall it charges ok, but I'm concerned about the dropouts.


I suspect one of the charger modules is faulty. Try to charge with each module separately for longer periods of time to see if those spikes also happen with each one. 

Sent from my LEX720 using Tapatalk


----------



## cancer038 (Nov 28, 2018)

I read from the first page to the new page. Very nice developments. but the application would be more beautiful as in the picture to check. Is it possible?


----------



## ga2500ev2017 (Jun 12, 2017)

cancer038 said:


> I read from the first page to the new page. Very nice developments. but the application would be more beautiful as in the picture to check. Is it possible?


Of course it's possible. But as I always tell my student developers:

"Make it functional, then make it pretty."

The folks here, including Damien and Tom, have done outstanding work and have made great progress so far. I'm sure they would tell you themselves that it's at most an early beta. Given that buttoning down the core functionality is the critical priority, it may be awhile before it happens.

ga2500ev


----------



## cancer038 (Nov 28, 2018)

ga2500ev2017 said:


> Of course it's possible. But as I always tell my student developers:
> 
> "Make it functional, then make it pretty."
> 
> ...


thank you. I don't know programming. but I'm following. I can apply it to my car if it happens.


----------



## Jimbo69ny (Feb 13, 2018)

How hot do these chargers get in real world use? I am wondering how large of a cooling system I need for it. I assume it doesn't need a heater correct? I feel stupid for asking that but thought I should make sure.


Also, the Tesla gen 2 charger does not have the Tesla "T" stamped in it. I see some do have the T. What is the difference? 



I dont trust myself to make the board and upload working firmware so a friend who built one for someone else on this forum is doing it for me. 



Thanks!


----------



## Jimbo69ny (Feb 13, 2018)

Can anyone tell me how hot these chargers get from full power use? I am wondering if I can put it in series with my 85kwh pack cooling system or if it needs its own cooling system. 

Thank you


----------



## Martii (Jan 17, 2018)

I'm sure you can have both on the same cooling loop. 

Sent from my LEX720 using Tapatalk


----------



## cancer038 (Nov 28, 2018)

Martii said:


> I'm sure you can have both on the same cooling loop.
> 
> Sent from my LEX720 using Tapatalk


how to cooling system starts. canbus or relay?


----------



## Martii (Jan 17, 2018)

As you wish may be relay or canbus depending on what your car supports out of the box 

Sent from my LEX720 using Tapatalk


----------



## cancer038 (Nov 28, 2018)

martii said:


> as you wish may be relay or canbus depending on what your car supports out of the box
> 
> sent from my lex720 using tapatalk


thank you martİİ


----------



## swoozle (Nov 13, 2011)

I hope you are still around as I am seeing this as well. I'm seeing a lot of variation in the charging voltage measured and resulting current commanded. The voltage is generally 2-3 volts higher than the actual pack voltage and jumps around up to 5 volts. I'm not charging at a particularly high current (8A per module) or voltage (my pack is 160V). But the large variation makes it difficult to set a charge voltage limit as it results in premature charge termination.
Did you get any further in solving this?
Thx



mfor1000 said:


> I'm seeing pulsing while charging. It looks like modules may be switching on and off for some reason, however it does continue charging and recover.
> 
> Attached is a plot from my juice-box app with the spikes in it. The graph at the bottom is the kW while charging.
> 
> ...


----------



## Martii (Jan 17, 2018)

swoozle said:


> I hope you are still around as I am seeing this as well. I'm seeing a lot of variation in the charging voltage measured and resulting current commanded. The voltage is generally 2-3 volts higher than the actual pack voltage and jumps around up to 5 volts. I'm not charging at a particularly high current (8A per module) or voltage (my pack is 160V). But the large variation makes it difficult to set a charge voltage limit as it results in premature charge termination.
> 
> Did you get any further in solving this?
> 
> Thx


Do you have ground connected to the charger chassis? 

Sent from my LEX720 using Tapatalk


----------



## swoozle (Nov 13, 2011)

Martii said:


> Do you have ground connected to the charger chassis?
> 
> Sent from my LEX720 using Tapatalk


Low voltage ground I assume. I do, but I will check the integrity of that connection.


----------



## jackbauer (Jan 12, 2008)

I have stated multiple times in multiple locations. Despite the claims of the label on the charger working between 50v and 450v this is NOT the case. Below around 200v DC the charger power modules become very unstable. The more under 200v you go the more unstable. I blew one up in my face trying to charge a 120v battery at 5 amps. 



When you issue a current command you are not issuing a DC current command rather an AC input current command. So with 230vac in lets say i command 10amps and I have a 300v battery. This is fine as the charger takes in 2.3kw (ignoring losses) and makes 300v dc at whatever current is allowed by a 2.3kw power limit. Everyone is happy. Now if we use the example above but substitute a 100v dc battery. The Tesla charger can not current limit its dc output. Just power limit. So it takes 2.3kw (again ignoring losses) and tries to pump 23 amps into a 100v battery. Boom.


As you go under 200v the control loop really struggles to hold the setpoint current due to the above situation. I recently fitted a Gen 2 charger to my E39 with a 192v nominal battery voltage. I had to amend the software in quite a few ways to work around the problems this introduces. During the initial parts of the charge cycle when the battery is under 200v the modules frequently shut down due to the inability of the control loop to hold current set points. The software gets around this by detecting the fault bits in the charger CAN status messages and simply resets the whole show. As the battery increases in voltage these resets become less and less frequent and the current holds much more steady. This software is available on github :
https://github.com/damienmaguire/Tesla-Charger/tree/master/BetaSW


I hope that clarifies the situation. I would be very careful indeed charging a 160v nominal pack.


----------



## swoozle (Nov 13, 2011)

jackbauer said:


> I have stated multiple times in multiple locations. Despite the claims of the label on the charger working between 50v and 450v this is NOT the case. Below around 200v DC the charger power modules become very unstable. The more under 200v you go the more unstable. I blew one up in my face trying to charge a 120v battery at 5 amps.
> 
> 
> 
> ...


Thanks Damien. Yes, you were clear about the DC current limit and risk of blowing the modules but I didn't pick up on the related control loop stability issues. I'll give your rev a try.


----------



## JSJFIN (Oct 10, 2017)

I think there is bug in source code:
https://github.com/damienmaguire/Te...en2TeslaChargerV2/Gen2TeslaChargerV2.ino#L340

line is:
bChargerEnabled == false;
probably should be:
bChargerEnabled = false;


----------



## jackbauer (Jan 12, 2008)

Well spotted. Thanks


----------



## Kevin Sharpe (Jul 4, 2011)

future project development and support is over on the open inverter forum (here)... join us


----------



## swoozle (Nov 13, 2011)

What kind of reported temps are ok with the charger?

Maybe I should split that up:

What kind of temps are you folks seeing in normal operation?

At what temp does it start reducing the current?

Thanks


----------



## Kevin Sharpe (Jul 4, 2011)

swoozle said:


> What kind of reported temps are ok with the charger?
> 
> Maybe I should split that up:
> 
> ...


Support is now on the Open Inverter forum;

Tesla Charger Support Thread


----------

