Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Solar PV control input to vary Charging current #20

Open
arwooldridge opened this issue Nov 2, 2019 · 2 comments
Open

Add Solar PV control input to vary Charging current #20

arwooldridge opened this issue Nov 2, 2019 · 2 comments

Comments

@arwooldridge
Copy link

arwooldridge commented Nov 2, 2019

On tethered units ( most home chargers?) the PP analogue input is unused, so could be used for proportionally controlling charging current depending on Solar PV power available. The variable voltage control could be from the Solar PV inverter if available, or from a mini, resistive loaded, solar cell to mimic the Solar PV, or from a directional energy monitor sensing excess PV power over consumer load. zappy style.
For example something like this in SetCurrent()
unsigned int demandcurrent;
if(!config) current = current * 10; // multiply by 10 (current in Amps x10 (160= 16A) )
else { demandcurrent= current * 10; //using fixed cable so can vary current using PP
ProximityPin(); // because it does the A/D on PP ( could just call A/D routine instead)
//current=(unsigned int)round(160.0 * ADRES/1024.0); // 160 is 16A for 4kwatt PV system
//might need to let menu to change this value.
current=160uL * ADRES/1023; //also works but 160 * ADRES can overflow as unsigned int.
if (current> demandcurrent) current=demandcurrent;
}
//if ((current >= 60) && (current <= 510)) DutyCycle = (unsigned int) (current / 0.6); // calculate DutyCycle from current
if ((current >= 48) && (current <= 510)) DutyCycle = (unsigned int) (current / 0.6); //ARW change to 5 amp min for Tesla. Not yet tested on other EV's but should work.
//ARW but change pilot test from 3-9% to 3-7%
//ARW Tesla charging current drops to zero when duty cycle < 83
else if ((current > 510) && (current <= 800)) DutyCycle = (unsigned int) (current / 2.5) + 640;
// else DutyCycle = 100; // invalid, use 6A
else DutyCycle = 80; //ARW use 4.8A for tesla and it stops charging

NB with this code the EVSE remains in charging state C throughout but the EV drops the charge current to zero below a 5A demand
The above code tests OK on Tesla with variable current 5A to 16A
The internal 1K pullup to 3.3V ensures correct default operation if PP not connected.
A simple series switch to disconnect the analogue input ensures default operation if you need to charge with no Sun.

@arwooldridge
Copy link
Author

Refined the code and tested OK Tesla mode and non Tesla mode.
Forked new repository at https://github.com/arwooldridge/smartevse_variablePV and switch to the smartevse_VariablePV branch
Works on PP input with Solar cell 53x30mm loaded with 60 ohm or analogue input from PV inverter or directional energy monitor ( scale to suit 3.3v max PP input) or variable pot or switched resistors to 0 volts
Select 5A in Mincurrent menu to get 5A tesla charging mode ( Tesla charging will stay in state C at zero current if DutyCycle drops below 82) else reverts to non Tesla charging for Mincurrent 6A or more.

@arwooldridge
Copy link
Author

arwooldridge commented Nov 27, 2019

Some different ways to use the PP input for variable charging.
pp_variable_charging2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant