Cutting power to EVSE concerns

My Nissan Leaf Forum

Help Support My Nissan Leaf Forum:

This site may earn a commission from merchant affiliate links, including eBay, Amazon, and others.

Todd1561

Active member
Joined
Sep 29, 2019
Messages
29
Location
North Carolina
As a solution to my earlier thread about stopping charge at 80% I’ve come up with a solution of writing a program that queries the carwings API for current SOC, calculates charge time to reach 80%, and sends a command to an Arduino to turn on a relay for the calculated time. This relay in turn powers a large, high quality 60 amp contactor that controls power to the EVSE outlet. Once the time duration is reached the arduino turns off its relay which turns off the contactor.

My question is whether or not cutting power abruptly from the EVSE on a regular basis will be a problem? Typically, you’d unplug the charge handle from the car and in theory there could be some negotiation happening there. I’m not familiar with the J1772 protocol. In my search I’ve only come across some anecdotal evidence or arcing when pulling the plug on a running EVSE. That shouldn’t be a problem as this contactor is designed to regularly switch loads over twice what the EVSE would be pulling.

I only found one similar project of a guy controlling a contactor with a manual timer and presumably there were no ill effects, but can’t hurt to ask. Post found here: https://www.mynissanleaf.com/viewtopic.php?f=9&t=17111&start=20#p531892

Thanks!
 
I'm a bit rusty on these things, so bear in mind that I may get some of the details wrong below.

My concern is that the AC input of a typical EV charger is a boost converter, to achieve near-unity power factor. You need a boost converter, because at 20% of peak mains voltage, you need to be drawing 20% of peak mains current, but 20% of peak mains voltage is a lot less than the battery voltage. A boost converter is an inductor and diode in series, with a semiconductor switch between them. The inductor is the component closest to the AC input. There is a diode bridge in there, but it will continue conducting, and can be ignored for the purpose of this discussion.

This means that if you happen to interrupt the charger near the peak of AC current, the inductor is going to want to keep that current going, so your contactor is going to have a hard time switching off that current. In other words, it will tend to arc. The arc will only last till the next zero crossing of the AC current, so it's not catastrophic. However, if the contactor does manage to sever the current abruptly, the inductor will kick up a high voltage in an attempt to keep that current going. That's what inductors do: they have to obey E = L. dI/dt ; E is the EMF (voltage) across the inductor, L is the inductance, and dI/dt is the rate of change of current. If you cut off the AC current instantly, then dI/dt is very large, so E becomes very large, easily several thousand volts. If you've ever played with an inductor and a flashlight battery as a kid, you'll know all about this inductive "kick".

This large and sudden increase of voltage across the inductor could damage the charger. I think that a properly designed charger would have snubber components designed to absorb the inductor's energy safely, which at the same time would prevent the contactor or breaker turning off power to the charger from arcing so much. In cheaper chargers, these may be undersized, so that after a few such interruptions, the snubber components wear out (usually open circuit, meaning that they don't affect the operation of the charger, except that they no longer have their protective effect). Hopefully, in a production EV, they don't skimp on these snubber components.

So I think that this is the gamble you take when frequently interrupting the charger input: you're gambling that the charger designers have included the snubber circuit, and that they paid the extra to size them correctly, and that the repeated absorbing of the inductor's energy doesn't wear them out eventually anyway.
 
Personally, I would not do that. The charger in the car might not like the sudden loss voltage at full current. I would somehow simulate the the push of the release button or the loss of the pilot signal before opening the contactor.
 
Hmm thanks guys. Wish I had looked into this before buying a $90 contactor ha. After just some initial research it seems just opening the pilot signal wire isn’t ideal either as it will likely result in faults logged on the car. Naturally, it’s hard to get a definitive answer to much of this.

I’m surprised getting something to not charge is proving to be so difficult!
 
camasleaf said:
I would somehow simulate the the push of the release button or...
Alas, at least the early leafs don't heed this pin, which I think is a shocking violation of the J1772 standard. [ Edit: I WAS WRONG! See this post and the two after it. Sigh. ] So if it's true about pilot loss causing faults to be logged, you'll need something a little more sophisticated to go to the not charging state, or similar. Though I think that the vehicle usually initiates that state, so it might not be so easy. [ Edit: in fact, you'd need "negative resistance" to achieve it, or reducing the standard 1K resistance in the EVSE, which might cause other problems. Plus, the charger probably just would not notice. ] Maybe setting the pilot to +12V (state A, not connected), or - 12V (state F, unknown/error) might cause it to stop charging, without logging an error.

Failing that, you might have to switch to a low PWM duty cycle, perhaps one (like 5%) that maps to less than 6A, the minimum allowed by the standard. Then use the contactor anyway, to save power (including auxiliary battery power).

As the OP mentions, it's surprising that this is so difficult!
 
I'd put a small relay inside the EVSE that interrupts the pilot line, instead. That way, the car and EVSE take care of turning the power on and off and you avoid doing so while the car is pulling current. If you use a double throw relay, you can put whatever voltage you need to have there to convince the car that it's not an error on the other side of the relay.

Edit: Here's a decent rundown on J1772. Looks like you'd want -12v on the pilot line when you are interrupting the pilot, but 0v may work, too.

https://openev.freshdesk.com/helpdesk/attachments/6004101511
 
Yep that's the approach I think I'll take. Seems to be the general consensus of the best way to do it. It'll also simplify the setup as it won't require a large contactor. I was trying to avoid having to open up the EVSE and void that warranty. I'll report back when I have a chance to make this change. Thanks everyone!
 
You might be able to use something like this and just control it directly from your phone:

https://www.amazon.com/MHCOZY-Wireless-Switch-applied-control/dp/B0752P57ZG

61u6%2B8LscML._SL1000_.jpg
 
That's essentially what I'll be doing, except with an Arduino, which be able to handle a little more logic. The product you found would make for a very compact modification, however. Thanks for sharing.
 
davewill said:
Edit: Here's a decent rundown on J1772. Looks like you'd want -12v on the pilot line when you are interrupting the pilot, but 0v may work, too.
https://openev.freshdesk.com/helpdesk/attachments/6004101511
That .pptx (PowerPoint presentation file) didn't open for me in Libre Office. The same site has a PDF however with presumably the same information, and it's a smaller file size (5 MiB versus 8 MiB).
 
Thanks everyone for the input. I’ve put together the final solution tonight and it seems to be working well. It works as follows:

A powershell script runs at the same time every night, it starts by querying the Nissan carwings API to get my current SOC. The script then calculates the time required to get to my 75% set point. Then it sends a TCP command to a PoE powered arduino to turn on a relay for that calculated time. The relay is what breaks/connects the pilot wire and stops/starts charging.

The car doesn’t seem to have any problems with this and still reports the plug connected even when the relay is off. I was worried that by breaking the pilot connection the car would report it not plugged in and allow you to drive away.

Modifying the EVSE was pretty easy, once you get the caps off the torx security screws. The pilot line is the smallest of the 4 wires and just terminates to a ring terminal.

I can provide more info on any of this if there’s interest.

Thanks again for the help!
 
Sounds great. You might want to add hourly checks during the charging period to handle weird cases like plugging in after the start time.
 
Not a bad idea, my solution to that was just to start the schedule pretty late at 1am. With 1 kid and another on the way our days of staying out past 1am are pretty much non-existent :)
 
Another idea that occurred to me was adding a switch mounted on the outside of the EVSE, either connected to an input on the Arduino or (if you want to be more failsafe) between the Arduino and the relay, that would override the timer and force the EVSE to be on. That way if you need to charge in the middle of the day, or want to go to 100%, all you have to do is flip the switch.

P.S. I'm sure that a lot of people would be interested to see pictures and code for what you've done. It would be very handy for a lot of people.
 
I know @mux is very busy with his battery extender business, but I recall him mentioning that "80% charging" can be easily implemented using the "man in the middle" CANBUS device that he designed:

https://mynissanleaf.com/viewtopic.php?t=26040&start=10#p531734

Hopefully he's made progress on that front...

I recall that @dala purchased this device from muxsan, perhaps he could look into what coding would be needed to make the muxsan CANBUS device act like a transparent bridge in all respects, other than spoofing the SOC value.
 
davewill said:
Another idea that occurred to me was adding a switch mounted on the outside of the EVSE, either connected to an input on the Arduino or (if you want to be more failsafe) between the Arduino and the relay, that would override the timer and force the EVSE to be on. That way if you need to charge in the middle of the day, or want to go to 100%, all you have to do is flip the switch.

P.S. I'm sure that a lot of people would be interested to see pictures and code for what you've done. It would be very handy for a lot of people.

A physical switch would be a good addition for that purpose. For me it's all done in software. I made a simple app for my phone so I can override the schedule, change the target charge % or force an immediate charge from anywhere in the world. I'm happy to put together some legitimate docs with pics that cover this project. Some of it is pretty specific to my needs and require a 24x7 running server, which probably won't be practical for most people, but I have all that overhead already for other purposes. But I can highlight where people could use some alternatives that would make this more generic. I'll post back here when I've got something together.

alozzy said:
I know @mux is very busy with his battery extender business, but I recall him mentioning that "80% charging" can be easily implemented using the "man in the middle" CANBUS device that he designed:

https://mynissanleaf.com/viewtopic.php?t=26040&start=10#p531734

Hopefully he's made progress on that front...

I recall that @dala purchased this device from muxsan, perhaps he could look into what coding would be needed to make the muxsan CANBUS device act like a transparent bridge in all respects, other than spoofing the SOC value.

I came across this thread early on in my searching, too. If this ever becomes a real product then it would likely be the ultimate answer. Presumably much more self-contained and could be used outside of the home at public charging stations. That's probably the biggest drawback to my solution, it only works at my house. I don't see us doing much public charging so for me it's not a big concern, but may be for others. A CANBUS solution would also not be dependent on having a subscription to the Nissan Connect service and all the headaches that go along with integrating with that API. Hopefully someone develops a product some day.

Todd
 
coulomb said:
... the early leafs don't heed this pin, which I think is a shocking violation of the J1772 standard. ...

This is really shocking and unbelievable violation of the standard; i had read this post but never experienced it until this last friday.

i came home from the daily ~45 mile commute and plugged in to get a couple of hours of L2 in order to go downtown for a hockey game. Normally i plug in at night and it is ready in the morning. But i pressed the trigger--and nothing happened, the blue lights were on and blinking and i didn't hear the snap of contactors.

i sure didn't want to pull the plug with current in the OBC and across the Main Contactors and cause a ration of damage.

So i tried pressing the "charge off" button on the left knee dash, then pressed the start button and the charge "off" button, still with no success. Finally pressed the brake pedal and start button, and then the contactors snapped off (the car didn't start while chargging). Quite a hassle and PIA especially when it's dark and rainy.

And potentially damaging to the OBC and contactors. Maybe that big 2700 uF 420VDC capacitor in the OBC is big enough to hold up the PFC buss long enough for a graceful shutdown?
 
nlspace said:
Maybe that big 2700 uF 420VDC capacitor in the OBC is big enough to hold up the PFC buss long enough for a graceful shutdown?
Definitely. I didn't realize that brake+start would stop the charge. So I've been stopping a charge by removing the J-1772 plug. I always expect nasty arcing, but so far it never seems to happen. I wonder if it detects the loss of pilot signal before the AC disconnects, and does a graceful disconnect anyway. I'd still way prefer that it heeded the proximity switch.
 
Back
Top