E-MotorWerks JuiceBox - an open source 15kW EVSE

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.
ImpactVector said:
That's good to know. I need to look at that code harder to understand how it works. Sounds like changing the pilot is a good way to go! Thanks!

There's a pretty good write up explaining the protocol here: https://code.google.com/p/open-evse/wiki/J1772Basics" onclick="window.open(this.href);return false;
Including the duty cycle to amps equation.

I think the JB code does it through atmel's built in PWM feature, which should make it easy to change.
 
Levi8than said:
ImpactVector said:
That's good to know. I need to look at that code harder to understand how it works. Sounds like changing the pilot is a good way to go! Thanks!

There's a pretty good write up explaining the protocol here: https://code.google.com/p/open-evse/wiki/J1772Basics" onclick="window.open(this.href);return false;
Including the duty cycle to amps equation.

I think the JB code does it through atmel's built in PWM feature, which should make it easy to change.

correct.

void setOutC() {

around line 780 is where the PWM logic is. Find where it's called from in the main loop and change there.

V
 
I've actually been staring at that for the last 30 min. Somewhere along the way I must have screwed up the trim pot measure timing because its now reading 60 amps and won't change.

I changed it in the software and that worked...Now to work out what broke it :/
 
Aha victory! Got everything working like I want to.. All I need now is more confidence that it won't catch fire. I'll buy a smoke detector tomorrow and then let it rip :)
 
0660a798753d5fe285cbe104eebbfb21_zps293060f7.jpg


Top left screen.
Volts and amp meter

Top right screen
16x2 lcd screen connected to arduino. Via i2c. Tells amps, volts plus how much power has been used, current time, internal temperature, charge status etc..

Below top right.
Surface mount USB A female port. Makes it easier to connect and flash. No need to pull the cover.

Bottom right
Timer Override switch. Normally the timer is programmed to start at midnight and run till 7am. Push this button and the bezel lights up and charging begins.
 
Hey ImpactVector,

Dorian from Electric Motor Werks here. You've really done a bang-up job modding your JuiceBox! Impressive stuff! Would you be okay with us featuring your modifications (and your photos) in a revision of our assembly manuals? We're trying to make some modifications available in our manuals, with instructions and stuff so anyone can do awesome mods like yours.
 
Dorian said:
Hey ImpactVector,

Dorian from Electric Motor Werks here. You've really done a bang-up job modding your JuiceBox! Impressive stuff! Would you be okay with us featuring your modifications (and your photos) in a revision of our assembly manuals? We're trying to make some modifications available in our manuals, with instructions and stuff so anyone can do awesome mods like yours.

No issue. If you need anything else let me know and I'll be happy to help!
Also if you have customers in atlanta that need help I would be happy to assist if they have assembly problems etc.
 
Guys,
I charged overnight perfectly but noticed this morning that when I turned the car on it was complaining about a charger fault. How have you guys gotten around that ?

I tried to suppress the Pilot signal input until its charging time but that hasnt worked.
I tried to stay outside the charging loop logic until its time. That hasnt worked either.

Somehow the car knows when it gets plugged in. Now to try stopping it from complaining :/
 
One other tip. I got a nicely sealed range plug (or you could get a Dryer version) from Frys (or any appliance store) to connect to my charger.

I got this one: http://www.frys.com/product/3831737?site=sr:SEARCH:MAIN_RSLT_PG" onclick="window.open(this.href);return false;
For $9 I couldn't beat it at HD for the plug head alone!

If your <4ft away from your outlet this is the win! Nicely sealed and easy to use! Even comes with the lug ends on !
 
ImpactVector said:
Guys,
I charged overnight perfectly but noticed this morning that when I turned the car on it was complaining about a charger fault. How have you guys gotten around that ?

I tried to suppress the Pilot signal input until its charging time but that hasnt worked.
I tried to stay outside the charging loop logic until its time. That hasnt worked either.

Somehow the car knows when it gets plugged in. Now to try stopping it from complaining :/

The key is in the transition state between State B and State C. I am not at all familliar with the JuiceBox code but this is what should happen with a timer.

Charging station has timer set and is in State A. Pilot = 12v DC. 1khz wave is off.

EV plugs in and pulls pilot down to 9v.

Charging station is NOT ready due to timer so it does not turn on the 1khz pilot, just sit at 9v DC. When timer expires turn on the pilot and charging will begin.

If a end timer expires during charge, turn the pilot off to indicate the charging station is no longer ready to supply power. Ev should return to state B 9v and the relay can be opened.
 
ImpactVector said:
Guys,
I charged overnight perfectly but noticed this morning that when I turned the car on it was complaining about a charger fault. How have you guys gotten around that ?

I tried to suppress the Pilot signal input until its charging time but that hasnt worked.
I tried to stay outside the charging loop logic until its time. That hasnt worked either.

Somehow the car knows when it gets plugged in. Now to try stopping it from complaining :/

No, charging my 2013 leaf has been working perfectly. I have my leaf configured to start charging at 12:10 am, to take advantage of the cheaper electricity my provider offers between midnight and 7am. Here's what happens from my point of view: When I initially plug my leaf in, the JB relay clicks on, the leaf beeps, then the JB relay clicks off and sits in state B while the leaf does its light flash game for a few minutes, then stops flashing until charge time. At charge time, my leaf beeps again, the JB goes to state C, the relay closes and it begins to charge. Works just fine. When it's finished, the leaf beeps again, the JB relay clicks off and goes back to state B it sits there in that state until I unplug the cable. I'm not pulling the full 30 amps because my line voltage was drooping more than I was comfortable with. I'm only pulling about 25 amps while charging. But it's fine for me because most nights I only need to go from 40% to 80% and that's done in 2 hours or so.

Now, if you started from 8.6.5, you shouldn't need to muck with the charging loop to make this work, because I've confirmed it does work with stock components. Definitely don't suppress the pilot signal, or stay out of the charger loop. Or else the charger won't know the leaf is connected and the leaf won't know the charger is connected. That's not necessary. I'm assuming you are using the leaf's built in charger, so stick with that.

In an earlier message you mentioned that your input voltage droops to 208V from 238V during charging. This would be my first place to check. I'll bet the car isn't happy seeing a voltage this low. And if it droops further than that at a time when you are not measuring the voltage, I could see the car complaining about that.
I'm willing to bet that you have 10 gauge or smaller wiring from your breaker to your plug, and that's just not thick enough copper to support 30.2 amps for a long time. I'd recommend you try tuning your pilot line down until your input voltage only droops 5% when your vehicle is pulling max amps. It's unclear to me whether NEC actually recommends 3% or 5% (is there an expert on this out there?), but I don't think it really matters as long as nothing in the circuit is getting very hot. Hot would imply an arc, which would explain your voltage loss but would also generate a lot of heat. There are many places this could be happening. You could listen and look at the breaker at night while your car is charging. If there were an arc, you'd see it in the dark and hear a hum or buzzing sound. Then you could tighten up the connection (after throwing the main breaker of course: be safe). Don't forget the relay connections inside the box, and make sure your end lucks are properly attached. Give them a tug. If they slip , they're not tight enough. I don't have a big enough crimp tool, so I added some flux and solder to the inside of the lug and folded the wire over to create a lump inside the lug, then pushed my wire in, clamped with my vice, then used a propane torch until the flux bubbled out and the solder flowed. I'm satisfied that I've got a good connection that isn't going anywhere. But this is overkill. Crimping alone should be fine if it's done properly.

After checking for arcs and tuning down the pilot line to limit your voltage drop, if you're still having issues you could try swapping out your breaker and tightening up the connections everywhere on the path from breaker to outlet (again, with the power off: be safe). Also make sure your breaker is at least 25% larger than the amount of current you are pulling through the line. Otherwise the magnetic breaker may hum or sit on the cusp of throwing.

Let me know if any this helps. Good luck.
 
Joe,
Thanks.
I think the one thing I didn't point out is my JB has been modified for an internal timer. My leaf (base model) only has the off timer so it would more than likely only start charging at 5 to finish by 7am.
While this sounds good I don't like it! My rationale is if I wake up early and want to go to the gym...my battery may not be charged! If I move my finish timer to 5am, I may not get a full charge (when at 10% etc.)

Rather than deal with that I built my JB to start @ 11pm and turn off at 7am unless the override button is on (this is in the JB).My leaf charger timer is off. If I get up at 5 I can just unplug and go.

On the voltage drop- I am not sure why the JB sees 208V and my other gauge (and multimeter) see 238V while charging. I am baffled by that one but figured it might be PCB damage? I'm not sure. Lugs are tight, everything is crimped very well (Hydraulic press with dies). No noise from the breaker (60 amp). I only have the charger set to 30amps right now. Any idea why the JB would see a different voltage?
I do certainly appreciate the help! Thanks for your feedback!

Chris-
I really appreciate that. I'm going to look and see what I can do to fit those requirements! Thanks!!
 
ImpactVector said:
On the voltage drop- I am not sure why the JB sees 208V and my other gauge (and multimeter) see 238V while charging. I am baffled by that one but figured it might be PCB damage? I'm not sure.

You cannot possibly see 238V AC before charging AND 238V AC while charging. That's not reasonable. You should see some droop on the voltage while pulling 30 amps. Even if you've only got 50 feet of 10 gauge, you should droop to at least 235. If you see no droop, then I don't think you're measuring properly. Can you double check?
 
Levi8than said:
ImpactVector said:
On the voltage drop- I am not sure why the JB sees 208V and my other gauge (and multimeter) see 238V while charging. I am baffled by that one but figured it might be PCB damage? I'm not sure.

You cannot possibly see 238V AC before charging AND 238V AC while charging. That's not reasonable. You should see some droop on the voltage while pulling 30 amps. Even if you've only got 50 feet of 10 gauge, you should droop to at least 235. If you see no droop, then I don't think you're measuring properly. Can you double check?

I have 245~246 before and 238v when charging. It drops 7 V. so 201watts is converted to heat ?
 
ImpactVector said:
I have 245~246 before and 238v when charging. It drops 7 V. so 201watts is converted to heat ?
Okay this sounds better. Apologies for questioning it. That's about a 3% drop, which is expected. I'll bet you've got about 115 feet of 10 gauge to the box then.
This is right.

And yeah, 200 watts of heat isn't a big deal. It's distributed across the whole 115 feet of the wire and air and it's not that big of a deal.
A 200 watt heater even if it were contained to a small area doesn't get very hot.

To investigate your fault issue we need to look at something else. Maybe the timer stop is opening the relay while the car is still charging, rather than updating the pilot line first and then giving the vehicle time to cleanly stop charging. I'll look at the code.
 
Based on what Ive heard here I can probably make my code much simplier.

I found this code in the firmware for pushing a button and turning off the charger to disconnect the car:
Code:
 Timer1.setPwmDuty(pin_PWM, PWM_res); // this should produce a steady +12V signal on a pilot pin
So what I would do is have a while loop that says
Code:
 Timer1.setPwmDuty(pin_PWM, PWM_res); // this should produce a steady +12V signal on a pilot pin
while (!ReadyToCharge)
{
if(ReadyToCharge)
   break
else
  delayinsecs();
}
Timer1.setPwmDuty(pin_PWM, duty); //resets the signal and code continues on


Thoughts ? Would that work ?
 
ImpactVector said:
Thoughts ? Would that work ?
If I am reading this right you set pwm on the first cycle regardless. That sounds wrong. Also where did the safety check go? Post the full file if you can.
 
Levi8than said:
ImpactVector said:
Thoughts ? Would that work ?
If I am reading this right you set pwm on the first cycle regardless. That sounds wrong. Also where did the safety check go? Post the full file if you can.

I looked at it a second ago and thought it looked wrong.
Below is stock firmware + the while loop logic

Code:
if(state==STATE_C) {
            // vehicle requested NON-VENTILATED power - this is our MONEY state
            int ctrlBtn_cnt=0;
  
            // commence charging
            setRelay(HIGH);
            printClrMsg(F("Starting Charge!"), 1000, 0x1f, 0x3f, 0);
            myclrScreen();
  
            timer=millis(); // start timer
            timer0=timer;
            
            n=0;
            
            //+++++++++++++++++++++++++++++++++++++++++++ inner CHARGING loop!
            while(getState(1)==STATE_C) { // break on anything else
              // set the output current - can be changed DURING the charges without a restart
              // by turning the pot
              setOutC();
              // reset the duty to the right value
 //-----------Start additional code 
              ReadyToCharge=1;
          while (!ReadyToCharge)
              {
                ReadyToCharge=ReadyToChargeCheck();
            if(ReadyToCharge){
              Timer1.setPwmDuty(pin_PWM, PWM_res); // this should produce a steady +12V signal on a pilot pin
               break;
            }
            else
              delayinsecs(20);
              
              }

//-----------------end additional code
              Timer1.setPwmDuty(pin_PWM, duty); 
      
              n++; // cycle counter
          
              delay(meas_cycle_delay); // reasonable delay for screen refresh

              // check if the control button is held for more than 10 cycles
              if(LCD_on) {
                if(digitalRead(pin_ctrlBtn)==0) ctrlBtn_cnt=0;
                ctrlBtn_cnt++;
                if(ctrlBtn_cnt>10) {
                  printClrMsg(F("Breaking per user\nrequest! Unplug\nfrom car"), 3000, 0x1f, 0x3f, 0);
                  // attempt to set output pin back to +12V
                  Timer1.setPwmDuty(pin_PWM, PWM_res); // this should produce a steady +12V signal on a pilot pin
                  // wait until user unplugs
                  while(getState(0)!=STATE_A);
                  break;
                }
              }
 
ImpactVector said:
Levi8than said:
ImpactVector said:
Thoughts ? Would that work ?
If I am reading this right you set pwm on the first cycle regardless. That sounds wrong. Also where did the safety check go? Post the full file if you can.

I'm confused. Is this doing anything?

ReadyToCharge=1;
while (!ReadyToCharge)

That will never be true.

[edit]: Also My recommendation is that you move whatever delay you'd like to add to be BEFORE flipping the relay.
Don't muck with the output trigger signal, but rather just delay flipping the relay, but leave setoutc alone.
 
Back
Top