ElectricMotorcycleForum.com

  • April 28, 2024, 02:11:37 AM
  • Welcome, Guest
Please login or register.

Login with username, password and session length
Advanced search  

News:

Electric Motorcycle Forum is live!

Pages: 1 2 [3] 4 5

Author Topic: How to stop charging below 100%  (Read 5509 times)

MostlyBonkers

  • Hero Member
  • *****
  • Posts: 1323
    • View Profile
Re: How to stop charging below 100%
« Reply #30 on: July 24, 2017, 02:51:01 PM »

Hi Keith, I think there is only one reason to stop charging below 100% and that's before storing the bike for a long time.  ............

.........

I'm more interested in why you think it's  worth the bother to find a solution to a problem that doesn't exist. I don't want that to sound facetious, I just feel that people spend far too much time worrying about charging when they don't need to.

I for one I'm looking for a way to AUTOMATICLY limit charge level.
My employer provides EV power for electric vehicals so as long as I keep the battery level above 60-65% I wait until I'm at work to fully charge.

Thanks ESokolof.  I've managed to persuade our facilities manager at work to install some power in the loading bay where I park my bike. I was going to fully charge at home and then top up at work. I don't feel comfortable only charging at work just in case I have to leave work early for some reason (kids usually).  However, charging to  80% at home would mean I'd still have about 40% when I get to work. I'd only need to be plugged in for an hour or so to have enough juice to get home.

So, by charging to 100% at work and then from 60-80% at  home, I'll save another 2kWh of electricity each day at home compared to the method of just charging to full at home. That's about 35p a day or getting on for £50 a year with my current commute. Worthwhile and it means the bike spends most of the time standing with an 80% SoC. Better for the battery in the long term.

I also like togo's reasoning because he lives at the top of a hill! It just goes to show how many different use cases there can be that are difficult to think of unless you are in someone else's shoes.  I stand corrected! :-)



Logged

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #31 on: July 27, 2017, 02:03:22 AM »

Remmie> https://openhomeautomation.net/arduino-wifi-switch/

Oh, that is awesome.  30A measurement capability, https://www.amazon.com/DAOKI-Current-Sensor-Module-Arduino/dp/B00XT0PL20/ , relay would have to be upgraded for NA people (10A@110v isn't enough), and the optional wifi could be used to talk to a cell phone or a Raspberry Pi or even text you.

Thanks, remmie!

Keith> Success! ...

Awesome!

> publish the design and code, open source of course. ...

Can't wait to see it.

> ... A simple zener diode and resistor from the pack voltage will power the board, but not without some trouble....

I bet it gets hot.

> The simple answer is to just power the arduino with a usb charger. That works perfectly, but it is one more thing to connect and I really wanted to avoid that. Anyway, it works flawlessly now, charging stops predictably, the QuiQ turns off current, shows green for charge complete and then flashes red as it does when disconnected. All good. Both bike and pack are now happy with the charge termination method. I'll post more details when I wrap this project up.

A neat and tidy package for this would be a USB power outlet pass-through box, this kind,
https://www.amazon.com/Bestten-Outlet-Plugs-Universal-Charger/dp/B017KOZUUS/

> By the way, this device can be built for around $20 using the arduino mini and existing connectors, pretty sweet...

Yeah, that is sweet.  I'm thinking Adafruit Feather or an Adafruit Trinket.

> But I'm not inclined to mess with wifi, I like simplicity.

I'm skipping wifi too, for now, get something simple working first.  If a hard-coded value does the job, I'm done.

Thanks, Keith!
« Last Edit: July 27, 2017, 02:06:51 AM by togo »
Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Doug S

  • Hero Member
  • *****
  • Posts: 1626
    • View Profile
Re: How to stop charging below 100%
« Reply #32 on: July 27, 2017, 04:00:51 AM »

30A measurement capability, https://www.amazon.com/DAOKI-Current-Sensor-Module-Arduino/dp/B00XT0PL20/ , relay would have to be upgraded for NA people (10A@110v isn't enough)...

The chip on that module is an Allegro ACS712; I have a lot of experience where I work with a related ACS722 family. They're great chips; we use them at 220VAC, up to 30A, and we've never had one fail yet. They're certified for up to 297Vrms so I doubt we ever will. One of the functions of our product is to perform a true average power measurement on power delivered to the load, with typical line voltage ugliness, and we're able to do it better than the commercial power meters we've compared it to. I love those Allegro hall effect devices.
Logged
There's no better alarm clock than sunlight on asphalt.

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #33 on: July 27, 2017, 04:56:15 AM »

http://www.allegromicro.com/en/Products/Current-Sensor-ICs/Zero-To-Fifty-Amp-Integrated-Conductor-Sensor-ICs/ACS712.aspx

... says ACS72x are recommended for new designs.

But the ones available on amazon and ebay in convenient carriers are ACS712

I ordered the 30A version, since 110 volt times 10 amps is only 1100 watt.
Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Doug S

  • Hero Member
  • *****
  • Posts: 1626
    • View Profile
Re: How to stop charging below 100%
« Reply #34 on: July 27, 2017, 07:32:40 AM »

... says ACS72x are recommended for new designs.

I saw that, but I didn't see significant if any differences in the data sheets. I'm guessing it's just standard part rotation as a newer, cheaper part becomes available.

We aren't actually using either of those where I work -- we use a 3.3V (non-obsolete) version rather than the 5V-only flavor. The exact part number escapes me at the moment.
Logged
There's no better alarm clock than sunlight on asphalt.

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #35 on: July 27, 2017, 11:06:59 AM »

At 1A, the 5v power supply on this unit is too anemic to run a raspberry pi, but good enough to power an arduino.  And it has room for the smaller ones.

« Last Edit: July 28, 2017, 10:57:45 PM by togo »
Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: How to stop charging below 100%
« Reply #36 on: July 30, 2017, 06:40:24 PM »

My arduino design is still evolving, but it is now close enough for a detailed preview. I keep thinking of new features as usually happens when a computer is included. Here are pictures, schematic and preliminary code. It works but it isn't finished. I'm going to add a solid state relay for ac control. That will need a heatsink. I'm not sure yet whether I'll just control the on board charger or switch the QuiQs too. And it can now enable packs for discharge so it may become my Tesla Wall if I can find an inverter. It works very well right now and can communicate with a laptop or run independently.

Code: [Select]
/* Y Cable Controller for Zero Motorcycle use 7/28/2017 Keith Thomas Version 1.0
  Arduino Nano program to control the enable lines between external chargers and the bike or power pack(s).
  Purpose is to end the charging cycle at less than full charge or 100% SOC, can also enable packs for discharge
  Method is to measure the pack voltage while charging and turn the enable signal off when a desired setting is reached.
  Pack voltage is reduced by a 10/304 resistive divider, ADC 0-1023, 4.096v full scale reference
  Design adjustment range for at least 50% to 100% SOC, with +/- 2.4% accuracy, 0.12v resolution
  Dial nominal reading is 102 to 120, 18 volt range, 0-100 dial
*/
// I/O constants
const int acRelay = 2; // D2 is control for AC relay
const int packEnable1 = 3; // D3 pull up to close pack contactor
const int packEnable2 = 4; // D4 second pack
const int enableOut1 = 7; // Charger 1 enable
const int enableOut2 = 8; // Charger 2 enable
const int ledPin = 13; // LED connected to digital pin 13
// A0 is set potentiometer wiper
// A1 is pack voltage divider
// A2 is charger 1 enable

// voltage constants
const int packMin = 842; //105V max, 102.5 nominal, min < 50% SOC
const int packMax = 986; //117.2V min, 120.0 nominal, max > 100% SOC
const float packMinF = 102.49;
const float packMaxF = 120.01;

// variables
boolean disabled = false; //use to latch enable at stop
int packV; //voltage of battery pack
int setV;  //setting potentiometer 0-1023
int packMap; //pack voltage typical range mapped to 0-1023
int enableV; //analog enable measure 0-1023
float setMap; //set voltage mapped to pack range for serial out
float readMap; //pack voltage adc mapped to real voltage for serial out

void setup() {
  digitalWrite (acRelay, HIGH) ; //AC on initially
  digitalWrite (enableOut1, LOW) ; //pull low to disable charging
  digitalWrite (enableOut2, LOW) ; //second charger disable
  digitalWrite (packEnable1, HIGH) ; //pull up pack enable
  digitalWrite (packEnable2, HIGH) ; //pull up second enable
  pinMode(acRelay, OUTPUT);  // drive ssr control
  pinMode(enableOut1, INPUT);  // Hi-Z to allow enable pass through
  pinMode(enableOut2, INPUT);  // Hi-Z to allow enable pass through
  pinMode(packEnable1, INPUT);  // Hi-Z unless pack enable
  pinMode(packEnable2, INPUT);  // Hi-Z unless pack enable
  pinMode(ledPin, OUTPUT); // use built in LED as charging indicator
  digitalWrite(ledPin, LOW); // charging LED off
  Serial.begin(9600); // report activity if usb has serial terminal
  Serial.println();
  Serial.println("Y Cable Controller");
  delay(1000); // wait for things to settle before measuring
  digitalWrite(ledPin, HIGH); // LED on to indicate measuring and enabled
}

void loop() {
  setV = analogRead(A0); // read knob setting
  digitalWrite(ledPin, HIGH); // charging
  setMap = mapf(setV, 0, 1023, packMinF, packMaxF);
  Serial.print("set ");
  Serial.print(setMap);
  packV = analogRead(A1);
  readMap = mapf(packV, packMin, packMax, packMinF, packMaxF);
  if (packV == 0) {
    readMap = 0; // not connected to pack
  }
  Serial.print("  pack ");
  Serial.print(readMap);
  Serial.print(" ");
  Serial.println(disabled);
  delay(500);
  packMap = map(packV, packMin, packMax, 0, 1023); // map(value, fromLow, fromHigh, toLow, toHigh)
  if (not disabled) {
    if (packMap > setV) { // voltage exceeds setting, disable
      pinMode(enableOut1, OUTPUT);
      pinMode(enableOut2, OUTPUT);
      digitalWrite(ledPin, LOW); // LED off to indicate charging stopped
      disabled = true;
      Serial.println("Set voltage reached, charging disabled.");
    }
  }
  digitalWrite(ledPin, LOW); // LED off
  delay(100);
}

float mapf(float x, float in_min, float in_max, float out_min, float out_max)
{
  return (x - in_min) * (out_max - out_min) / (in_max - in_min) + out_min;
}
« Last Edit: July 30, 2017, 07:01:48 PM by Keith »
Logged
2016 Zero FX, 2014 KTM 1190

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #37 on: July 30, 2017, 10:47:38 PM »

Awesome.

This is the solid state relay I bought, comes with heatsink, kind of large and bulky:

https://smile.amazon.com/gp/product/B0087ZTN08/

at 25A it's suitable for onboard charger but not for SCv2 above 3.3kw

In my application, I'm only planning to do onboard-charger, when I do rapid-charge I'm on the road, in a hurry, and usually monitoring with chargepoint app (or zero voltage app if i stay in bluetooth range).

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #38 on: July 30, 2017, 10:53:20 PM »

I use a WeMo Insight switch with an IFFF rule to shut off power once consumption drops below threshold.

Nice.  More details, please?  Screenshots or something?
Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Scope

  • Newbie
  • *
  • Posts: 14
    • View Profile
Re: How to stop charging below 100%
« Reply #39 on: July 30, 2017, 10:57:08 PM »

I use a WeMo Insight switch with an IFFF rule to shut off power once consumption drops below threshold.

Nice.  More details, please?  Screenshots or something?




Sent from my iPhone using Tapatalk
Logged

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: How to stop charging below 100%
« Reply #40 on: July 31, 2017, 02:31:09 AM »

That WeMo configuration won't do partial charging. The consumption rises during charging so a cutoff at a higher consumption than the initial rate would do it if it can be programmed for that. The WeMo is just saving the "vampire power" by turning off power after the charging stops at 100%.
Logged
2016 Zero FX, 2014 KTM 1190

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #41 on: August 01, 2017, 04:18:59 AM »

A quick google search finds discussions of setting the threshold, Keith:

'Select "Edit" from the main Devices screen in the App. You can then change the standby threshold to your requirements.'

Scope, what value were you able to set?  Can it be in the hundreds of watts?
Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: How to stop charging below 100%
« Reply #42 on: August 03, 2017, 06:23:41 AM »

I installed the WeMo app but I can't get to the settings without a device. My google results found that maybe IFTTT could be used to detect a threshold and react to stop charging, but the direction, from low watts to high, and the required very high wattage threshold value make WeMo unlikely to be a real possibility for this purpose.  But I'm prepared to be wrong if it can be made to work.
Logged
2016 Zero FX, 2014 KTM 1190

togo

  • It's like flying. But with more traction.
  • Hero Member
  • *****
  • Posts: 1638
    • View Profile
Re: How to stop charging below 100%
« Reply #43 on: August 05, 2017, 04:49:36 AM »

here's an example of turning off a battery charger that normally uses 100w and goes down to 12w and then 2w when done.

http://cooltechtrends.com/tips-and-tricks-of-wemo-insight-smart-plug

of course we need at least 10x that

i do like the ifttt recipe concept from the perspective of

- notification

- no soldering, so scales to more people

i don't like it from the perspective of

- it doesn't work without internet

- it doesn't work without companies running servers, and eventually they may change policies

- it doesn't work with rapid-chargers

- no one who has one has told us what the upper range of the "standby" detection setting is, and the dumbed-down manufacturer site and forums are devoid of specs.

Logged
our knowledge about Zeros collects here: https://zeromanual.com/

Keith

  • Sr. Member
  • ****
  • Posts: 269
    • View Profile
Re: How to stop charging below 100%
« Reply #44 on: August 05, 2017, 06:10:36 AM »

I'm convinced that WeMo could easily be used to stop charging after a set time, and then notify that it has done so. Useful, but it would require both calculating a time interval and being online. So far WeMo doesn't look promising for using charger power consumption with a threshold to stop at a desired state of charge, but that might be possible and would be all off the shelf components.

The design that I am currently refining could be mass produced commercially at a reasonable cost and imho it does the job nicely with none of the disadvantages you have listed. But production probably won't happen, I am no entrepreneur, maybe someone will adopt the idea. My concept leads to an integrated package with simplified connections compared to my present Zero provided setup with on board plus two Quiq chargers and a Y cable. I'm going to add switches to control which chargers get power so 15, 20, or 50 amp service can be used, ssr control to sequence turn on and shut off when the desired charge is reached, and a delay option to allow unattended charging to start later if desired. The same design could handle the fast chargers used by those bikes with more kwh than my FX.

My goal is to make it just as convenient to do partial charging as it is to just plug in and get 100%. Maybe even more convenient, with fewer power cords and dc connectors to juggle than I use now.
Logged
2016 Zero FX, 2014 KTM 1190
Pages: 1 2 [3] 4 5