Raycreed said:I sent emotorwerks an e-mail, maybe they can tell me something I don't know.
chris1howell said:It kinda sounds like your unit thinks it is on L1 and is maxing out the pilot at 16A. I do not know how the L1/L2 detection works on Juicebox but I have read that on L1 it is a fixed value and L2 uses an analog pot for adjustment.
// read the average input AC voltage
// this function should ONLY BE CALLED in setup()
// time constant of the RC filter: 27k * 3.3uF = ~0.09s - enough to smooth 60Hz signal
float read_V() {
float V_AC=240; // default is 240
float V_Ard_pin=analogRead(pin_V)*Aref/1024.;
delay(8); // measure 180 degrees away by AC phase to smooth out any remaining ripple on A1 pin
V_Ard_pin+=analogRead(pin_V)*Aref/1024.;
V_Ard_pin/=2;
#ifdef PCB_81
// for PCB versions before 8.3,
// THIS FEATURE IS IN BETA AND MAY NOT WORK ON THE FIRST VERSION OF THE BASE BOARDS WITHOUT TWEAKING FIRMWARE
// specifically, you may need to tweak the voltage threshold between 120V and 240V input voltage
// (line starting with 'if(V_Ard_pin >' below). (1) connect JuiceBox to 120V, measure the voltage on pin A1 of the Arduino
// (2) connect JuiceBox to 240V, measure the voltage on pin A1. Set the threshold to the voltage in the middle between
// these two values
// with 200k resistor from AC rectified line, we have 0.8mA peak primary current at 120VAC
// and 1.6mA at 240VAC
// according to PC817X1 opto's datasheet, CTR is 80-160% at 5mA
// typical curve suggests 80% of that at 2.5mA, 50% at 1mA
// therefore, we have a secondary peak current of 0.3-0.6mA at 120VAC, 1-2mA at 240VAC
// this corresponds to a secondary voltage drop: 0.3-0.6V or 1-2V per 1k of secondary resistance
// (actually clipped to 5V since we are using 5v supply)
// also, need to take into account that we see the significant current only at the positive peak of AC wave
// generally, for ~1/4 of the period for 120VAC and 1/3rd for 240VAC
// finally, the average drop within over the drop time is ~1/2 of the peak drop
// putting it all together, we expect average drop of 0.04-0.08V per 1k for 120VAC and 0.16-0.32V per 1k for 240VAC
// (with some clipping starting at 3-5k - really becoming visible at 5-7k)
// Example: 4.7k secondary - 0.2-0.4V and 0.8-1.5V drops
// Example: 10k secondary - 0.4-0.8V and 1.2-2.2V drops
// Using 10k secondary, place mid-point at 1V drop, or 4V threshold
// cap at 4.9V to prevent from defaulting to 120V in case when no PC817 installed at all
if(V_Ard_pin > 3.5 && V_Ard_pin<4.9) V_AC=120;
#endif
#ifdef PCB_83
// in 8.3 and later, the implementation changed to measurement using the GFCI current sensor
// ~200x division factor for voltage (total gain of test loop is ~1.2e-2)
// (306 from RMS voltage on sensor = 680x on the opamp, 0.5x due to half-wave rectification, 0.9x for converting to average from RMS)
// (3.9e-5x from 0.39V/A sensor sensitivity with 390R shunt resistor, 0.0001A/V voltage-to-current conversion on a 10k resistor)
//
// if no GFI installed, cannot measure voltage - default to 240V
#ifdef GFI
V_AC=150*(V_Ard_pin-V_Ard_pin_0);
#else
V_AC=240;
#endif
#ifdef DEBUG
sprintf(str, "V_AC: %d", int(V_AC));
printJBstr(0, 9, 2, 0x1f, 0, 0, str);
#endif
if(V_AC < V_AC_threshold) { // midpoint between 120 and 208V
V_AC=120;
} else if(V_AC < 224) { // midpoint between 208V and 240V
V_AC=208;
} else {
V_AC=240; // default fall-back value
}
#endif
return V_AC;
}
Raycreed said:So im not much for code, but should I go to Microcenter and order an Ardurino usb programmer so I can reprogram it?.. starting to wander if this EVSE is over my head lol.
Raycreed said:http://www.microcenter.com/product/389986/OSEPP_FTDI_Breakout_Board
This is what they had at microcenter, i'm going to run out today and get it, hopefully it will work in fixing my 120/240 issue.
now looking at the code, where exactly do I put "240" so its always defaulting to 240 v? do I put it in between the Parenthesis after Read_v?
Thanks all for the help
inV_AC=read_V();
inV_AC=240;
//------------------------------ MAIN SWITCHES -----------------------------------
// #define DEBUG 1 // this results in many additional printouts
// the following results in much more frequent reporting of data by JuiceBox to EmotorWerks servers
// PLEASE DO NOT USE in your JuiceBox UNLESS AUTHORIZED BY EMotorWerks - this overloads our servers
// and slows down the system for everyone. JuiceBoxes that consistently report more frequently than
// every ~1 minute will be permanently banned from our network
// #define DEBUG_WIFI
#define AC1075
const int R_C=120; // this is the value of the shunting resistor. see datasheet for the right value.
const int V_AC_threshold=160; // normally 164 (midpoint between 120V and 208V
// #define CT_8349-1500
// #define CT_8420-1000
// #define CT_3100
// #define JB_WiFi // is WiFi installed & we are using WiFlyHQ library?
// #define JB_WiFi_simple // is WiFi installed and we are just pushing data?
// #define LCD_SGC // old version of the u144 LCD - used in some early JuiceBoxes
//#define PCB_81 // 8.1 version of the PCB
#define PCB_83 // 8.3+ version of the PCB, includes 8.6, 8.7 versions
#define VerStr "V8.7.0" // detailed exact version of firmware (thanks Gregg!)
#define GFI // need to be uncommented for GFI functionality
#define trim120current
// #define BuzzerIndication // indicate charging states via buzzer - only on V8.7 and higher
//------------------------------- END MAIN SWITCHES ------------------------------
#define PCB_81 // 8.1 version of the PCB
//#define PCB_83 // 8.3+ version of the PCB, includes 8.6, 8.7 versions
//#define GFI // need to be uncommented for GFI functionality
#define trim120current // This one is optional, it will guarantee that your adjustment pot still works even if 120 is detected.
Raycreed said:My Juicebox is marked as version 8.3. I have the programmer, and from what you said it sounds pretty simple. hopefully this works
// per J1772 standard:
// 1% duty = 0.6A until 85% duty cycle
// after that, 1% = 2.5A up to 96%
if(outC<51) {
duty=PWM_res*outC/60.;
} else {
duty=PWM_res*(0.64+outC/250.);
}
duty = 500; // <-- add this line, overrides calculation above. 500 = 50% = 30 amps.
Raycreed said:I would love to make changes and upload to the Arduino, but every time I try to upload, it says "expected constructor, Destructor or type conversion before "*" token, as well as a few more errors.. this is unedited firmware that I downloaded from emw, and its not letting me load it to the EVSE because of these errors...
I'm trying to do this while the unit is unplugged.. do I need to program it while its plugged in? :?
Serial monitor is showing a repeating display showing Volts, amps, duty, etc.
Raycreed said:Yep, just tested it, it works at 6.6kw now.. Thanks Lev for all the help!
Did you need to make any changes to the code?
Raycreed said:Did you need to make any changes to the code?
Yea, just the read_V, my juicebox is 240v hookup only, but thats ok, I'll just use the nissan evse for L1 charging.
Levi8than said:It's been raining the last couple of days, and I expect it to continue. This is pretty much the first heavy rain since I installed my Juicebox. The juicebox is indoors, with the cable run out through a little door and the end being stored on a printed PLA hanger:
I'm not sure if sharing images this way works. Let's try it:
It's been working flawlessly since early January when I got it working. And now for the second day in a row, my car is reporting an EV system panic and not charging completely. The car is set to charge to 80%. Today I only got 75%, yesterday I only got 72%.
Do you think the rain is to blame? It's the only thing I know that has changed. And do I contact Nissan because there's an issue on their end, or look at the plug coming from my juicebox? Any thoughts? Everything I've looked at suggests that charging in the rain should be fine, and that the access door is properly drained.
Enter your email address to join: