Welcome to Tesla Motors Club
Discuss Tesla's Model S, Model 3, Model X, Model Y, Cybertruck, Roadster and More.
Register

HPWC Hacking

This site may earn commission on affiliate links.
I think it would be great to have another talented developer contributing to OpenEVSE. I think it is a shame there are so many similar but parallel projects out there. I think if we all worked together we would advance charging station capabilities faster.

Probably true.

The earliest version of the OpenEVSE boards (not pubicly released), had a logic controlled GFCI which used 4 logic gates to create a flip flop and set reset hardware circuits. It worked fine but added a lot of complexity to the layout. The hardware logic did not add any redundancy to the circuit, as the dependancy was just moved elsewhere. The hardware based GFCI was reliant on 4 components instead of just 1 but... it does not rely on firmware at all. I can dig up the schematics if you would like them. In the end OpenEVSE went with simplisity.

No worries. Was just thinking out loud. I've had instances with a bad batch of AVR microcontrollers in particular with unexplained lock ups where the WDT didn't even trigger a reset for an extended period while all outputs remained static at their last values as if the clock had just stopped. Something like this happening when the GFCI should trip would be bad. :(
 
For what it's worth, there is still a gray area here with regard to the NEC; one might have a solid argument that a non-commercial EVSE is part of the appliance and is therefore outside of the scope of the NEC.

For example, the UMC is not listed, but it's a piece of EVSE.
 
For what it's worth, there is still a gray area here with regard to the NEC; one might have a solid argument that a non-commercial EVSE is part of the appliance and is therefore outside of the scope of the NEC.

For example, the UMC is not listed, but it's a piece of EVSE.

There are certainly arguments either way... and being a gray area I'll take whichever one works with the situation. lol.

I'll stick with safety always and obvious code compliance when possible, however.
 
For what it's worth, there is still a gray area here with regard to the NEC; one might have a solid argument that a non-commercial EVSE is part of the appliance and is therefore outside of the scope of the NEC.

For example, the UMC is not listed, but it's a piece of EVSE.

True, However it is a lot easier to get away with it if the EVSE has a plug. The argument may not be as strong if it is hard wired.

- - - Updated - - -

Here is my first dynamic pilot test with the python code...

Using OpenEVSE and Open Energy Monitor I am reading solar output and then dynamically adjusting the charging rate to soak up as much solar as possible.

Solar_Dynamic_pilot_1.jpg



Once available power is too low to support charging at the J1772 minimum OpenEVSE goes to sleep.

Solar_Dynamic_pilot_2.jpg



IMG_20150411_172539.jpg
 
I've been thinking about doing something about the same as you guys.. except, I want to add advanced scheduling and user interface capabilities as well. For example, I want it (the evse) to read my agenda and have it figure out how much charge I need to have for that.

Current target for hardware platform is: A beagle bone black (http://beagleboard.org/BLACK) which has all the hardware an evse needs (so ADC and PWM) but is a "real" computer so I can run webservers, databases, add a cheap USB wifi dongle etc..
 
Model S nor responding very well to pilot increases

I put the Model S on my OpenEVSE setup to dynamically adjust the pilot based on solar output.

Yesterday, I had the Leaf on as the pilot ramped down and it worked great.

This morning I put the Tesla on and it started at 9A then ramped up to 10A then 11A and it failed to go up to 12A, 13, 14 and 15.... Later this afternoon we will see if it properly follows the pilot down...
 
Getting back to this project, finally.

Did some tinkering today. The way Tesla drives the contactor in the HPWC is.... interesting. Here's how it works.

The contactor has a coil that is 240V *DC*. It has a resistance of about 7.5k ohms. So Tesla's solution to powering it was to feed 240VAC into a bridge rectifier, get ~340V DC (peak) out the other end, smooth it with a 10uF cap, then power the contactor with a 3k ohm 6.5W rated resistor in series with it via an opto-isolated solid state relay IC... This gives the result of driving the contactor so it sees 240V DC and draws ~32 mA (7.7W)... but it also means that the 3k-ohm resistor is bleeding off a bunch of power... a bit over 3W in order to get the needed ~100V drop. Doesn't sound like much, but it explains why that resistor is ridiculously hot when the HPWC is in operation. Personally I think this is a pretty bad design overall. Anything that's going to bleed heat like that continuously should have a way to stay cool, IMO. This resistor just generates heat inside a sealed enclosure for hours at a time.

My IR pics show that it gets over 300 degrees F easily. I believe I've spotted it at 400+ at some point. Pretty hot.

While a more elegant solution would probably be better, I'll probably stick with the same method for closing the contactor, except with a few resistors in parallel to better distribute that 3W load.

For now I'm working on a board that allows this contactor to close from the 12V signal that the pre-made OpenEVSE boards use, and includes a microcontroller for communicating with the OpenEVSE board, the HPWC LED strip board, and a WiFi module. This should be able to get me heading in the right direction for a prototype.

Eventually I'll migrate everything to one board that is a drop in replacement for the HPWC board.
 
Getting back to this project, finally.

Did some tinkering today. The way Tesla drives the contactor in the HPWC is.... interesting. Here's how it works.

The contactor has a coil that is 240V *DC*. It has a resistance of about 7.5k ohms. So Tesla's solution to powering it was to feed 240VAC into a bridge rectifier, get ~340V DC (peak) out the other end, smooth it with a 10uF cap, then power the contactor with a 3k ohm 6.5W rated resistor in series with it via an opto-isolated solid state relay IC... This gives the result of driving the contactor so it sees 240V DC and draws ~32 mA (7.7W)... but it also means that the 3k-ohm resistor is bleeding off a bunch of power... a bit over 3W in order to get the needed ~100V drop. Doesn't sound like much, but it explains why that resistor is ridiculously hot when the HPWC is in operation. Personally I think this is a pretty bad design overall. Anything that's going to bleed heat like that continuously should have a way to stay cool, IMO. This resistor just generates heat inside a sealed enclosure for hours at a time.

My IR pics show that it gets over 300 degrees F easily. I believe I've spotted it at 400+ at some point. Pretty hot.

While a more elegant solution would probably be better, I'll probably stick with the same method for closing the contactor, except with a few resistors in parallel to better distribute that 3W load.

For now I'm working on a board that allows this contactor to close from the 12V signal that the pre-made OpenEVSE boards use, and includes a microcontroller for communicating with the OpenEVSE board, the HPWC LED strip board, and a WiFi module. This should be able to get me heading in the right direction for a prototype.

Eventually I'll migrate everything to one board that is a drop in replacement for the HPWC board.

Liquid Sky used the same contactor for the Wattzilla (80A UL listed Charging station based on OpenEVSE components) with a similar driver board. The reason beacuse the contactor is small, cheap and opens super fast...

You should be able to drive relay without another board, just modify the value of the SSR input resistor for 12v.
 
  • Informative
Reactions: hiroshiy
The right way to drive it would be to PWM the drive signal such that the initial pull in was full power and then within about 50ms after pull-in, it reduces to a level that will comfortably hold the contacts closed when hot, but will waste a lot less power. This is easy to do with software, but could also be done with a simple 555 timer driver circuit. Make sure the PWM frequency is high enough to avoid chatter. I'd think 500hz or so would suffice.
 
  • Helpful
Reactions: Ulmo
Wow, any reasons you can see why they did it that way? Maybe it was cheaper to use this specific contactor with the contraption they made VS having to buy a 240VAC coil?

I figured they'd use a 12V DC coil, since they needed 12V DC for the J1772 stuff anyway. A 240VAC coil would have made sense too. *shrugs* What do I know...

Liquid Sky used the same contactor for the Wattzilla (80A UL listed Charging station based on OpenEVSE components) with a similar driver board. The reason beacuse the contactor is small, cheap and opens super fast...

You should be able to drive relay without another board, just modify the value of the SSR input resistor for 12v.

Yeah, the SSR and such are the board I was referring to. The contactor doesn't have anything on it on its own, so need the driver circuitry since I'm not using the Tesla control board that has their version of the contactor driver circuit on board.

The right way to drive it would be to PWM the drive signal such that the initial pull in was full power and then within about 50ms after pull-in, it reduces to a level that will comfortably hold the contacts closed when hot, but will waste a lot less power. This is easy to do with software, but could also be done with a simple 555 timer driver circuit. Make sure the PWM frequency is high enough to avoid chatter. I'd think 500hz or so would suffice.

Yeah, I was actually just getting ready to experiment with PWM on it now. Going to try to get the hold power usage down and see if I can get it to consistently engage and hold using an ATtiny85 8-DIP chip with a software PWM driving the solid-state-relay chip. That should make that voltage drop resistor stay cooler if it works. If I find some good values that work I can just level shift the 12V signal from OpenEVSE for now to an input pin on the ATtiny to signal for the contactor to close.

It looks like the SSR chip I have has up to 1ms propagation delay, so 500 Hz should be a safe PWM rate.

I've confirmed the Tesla control board does NOT PWM the relay. It just drives it continuously through the circuit described above.

Working on testing this all out now.
 
Last edited:
I figured they'd use a 12V DC coil, since they needed 12V DC for the J1772 stuff anyway. A 240VAC coil would have made sense too. *shrugs* What do I know...
Well, then it would require a much bigger 12v supply, why do it if you can get a 240v coil probably for the same price.

Yeah, I was actually just getting ready to experiment with PWM on it now. Going to try to get the hold power usage down and see if I can get it to consistently engage and hold using an ATtiny85 8-DIP chip with a software PWM driving the solid-state-relay chip. That should make that voltage drop resistor stay cooler if it works. If I find some good values that work I can just level shift the 12V signal from OpenEVSE for now to an input pin on the ATtiny to signal for the contactor to close.

You can eliminate the resistor if you PWM, that's the whole point. PWM will only deliver the power needed rather than burning off the excess as heat.
 
Well, then it would require a much bigger 12v supply, why do it if you can get a 240v coil probably for the same price.

Yeah, maybe. The whole 240 VDC coil thing definitely threw me off though.

You can eliminate the resistor if you PWM, that's the whole point. PWM will only deliver the power needed rather than burning off the excess as heat.

Well, it can't hurt to leave it there either. Will ensure that the voltage across the coil is around 240VDC regardless.

Seems the little solid state relay IC I'm using doesn't do too well with PWM. With an input 250 Hz signal at 80% duty cycle I end up with about a 32% duty cycle on the output side. Seems to be more turn-on delay than turn-off delay. If I go to 500 Hz 80% duty cycle the output side barely turns on at all.

Also at 250 Hz 80% duty cycle / ~32% on the output the little SSR chip heats up quite a bit. Much more than if it is just constantly on. It's operating temperature rating is ~150F, and the FLIR shows it at ~130F when doing this. At 200 Hz/90% Duty the SSR shows > 150F. :(

The contactor does stay closed and is pulling very little power while doing this though. I haven't tested the contactor staying closed under load using this PWM setup, though.

Probably need a better SSR to do a good PWM drive. :(
 
The right way to drive it would be to PWM the drive signal such that the initial pull in was full power and then within about 50ms after pull-in, it reduces to a level that will comfortably hold the contacts closed when hot, but will waste a lot less power. This is easy to do with software, but could also be done with a simple 555 timer driver circuit. Make sure the PWM frequency is high enough to avoid chatter. I'd think 500hz or so would suffice.

Is the theory of operation of using a PWM signal that you are reducing a rectified 340V DC voltage down to an average 240V by adjusting the pulse on time? ie. the PWM signal is "on" 240/340 = 70% of the time?

Also, why wouldn't you just use a 240V AC coil? Just cost?
 
I'd choose a different SSR or just roll your own with a MOSFET and opto. Having it run hot is not a good sign, that means it's slow to turn on/off and is operating in a partially saturated field mode with high loss.

The reason they used that Curtis-Albright EV contactor is it's relatively low price and compact size. They don't make an AC coil version so they'd have to look elsewhere. Also, AC coils in contactors are tricky to get right and it's not uncommon to hear them buzzing which would not be appropriate for Tesla's design, and would likely generate a lot of warranty claims.

I've built similar "economizing" drive circuits for these exact same contactors for EV conversion projects. Makes me wonder if Tesla is economizing their contactors in the battery pack. Wk, they are using the TE EVC-500's right? The datasheet on those REQUIRES an economizer to avoid overheating:
AMP+ High Voltage Contactors (EVC) 500-500L in Relays Contactors & Switches | TE Connectivity

If you look they have 3 models and 2 come with built-in economizer circuits and the other one states "external economizer required". They have a 3 ohm coil to ensure rapid pull in and probably a big spring to break fast, so that's why they have around 50 watts dissipation at 12v.

Here's an except from the Datasheet:
Tesla-Contactor.png


They show a recommended PWM frequency of over 16khz (to avoid audible noise possibility) and a duty cycle of 20-30% with a 100ms hold-off. Those numbers seem very conservative, I bet you can go much lower on the duty cycle and still have reliable hold and contact pressure as long as you aren't subjecting the thing to high mechanical shock forces and/or vibration. (as might be found in a road-going vehicle)

Interesting to note that they state the minimum hold current as 650ma which would equate to a duty cycle of 17% not 20%. Maybe they just rounded up. Still, that's about 8 watts, so they are definitely being conservative.
 
I'd choose a different SSR or just roll your own with a MOSFET and opto. Having it run hot is not a good sign, that means it's slow to turn on/off and is operating in a partially saturated field mode with high loss.

The reason they used that Curtis-Albright EV contactor is it's relatively low price and compact size. They don't make an AC coil version so they'd have to look elsewhere. Also, AC coils in contactors are tricky to get right and it's not uncommon to hear them buzzing which would not be appropriate for Tesla's design, and would likely generate a lot of warranty claims.

I've built similar "economizing" drive circuits for these exact same contactors for EV conversion projects. Makes me wonder if Tesla is economizing their contactors in the battery pack. Wk, they are using the TE EVC-500's right? The datasheet on those REQUIRES an economizer to avoid overheating:
AMP+ High Voltage Contactors (EVC) 500-500L in Relays Contactors & Switches | TE Connectivity

If you look they have 3 models and 2 come with built-in economizer circuits and the other one states "external economizer required". They have a 3 ohm coil to ensure rapid pull in and probably a big spring to break fast, so that's why they have around 50 watts dissipation at 12v.

Here's an except from the Datasheet:
View attachment 97257

They show a recommended PWM frequency of over 16khz (to avoid audible noise possibility) and a duty cycle of 20-30% with a 100ms hold-off. Those numbers seem very conservative, I bet you can go much lower on the duty cycle and still have reliable pull in as long as you aren't subjecting the thing to high mechanical shock forces and/or vibration. (as might be found in a road-going vehicle)

Interesting to note that they state the minimum hold current as 650ma which would equate to a duty cycle of 17% not 20%. Maybe they just rounded up. Still, that's about 8 watts, so they are definitely being conservative.

Interesting.

Well, with the lack of definitive spec on the 240V DC coil version of this contactor (highest I found was for 96V I believe), I think for now I'm just going to drive it the same way Tesla does, except with the minor improvement of splitting that waste heat from the resistor among a few resistors in parallel. I have some 9k ohm 5W resistors that seem to be doing the job when setup in parallel. There are plenty of HPWC in the wild that are operating fine like this, so, not going to do something that could potentially affect reliability.

I did up a driver board that uses this method and it seems to work fine. The contactor gets just as hot being driven by my test board as it does in the one on the wall in my garage. (J1772 signal to close the contactor, no load).

Going to work on the OpenEVSE portion next...