Author Topic: Arduino based PWM diversion control system  (Read 14525 times)

WillEert

  • Full Member
  • ***
  • Posts: 139
Re: Arduino based PWM diversion control system
« Reply #120 on: July 26, 2017, 08:47:39 PM »
I have the car charger working withe the diversion control. You could not do this without the ability of reading and writing from the Classic and getting the WBJr data. The OpenEVSE system uses a command system called RAPI. Here is link to the RAPI code.

https://github.com/OpenEVSE/open_evse/blob/stable/rapi_proc.h

The charger sleeps at night and in the morning, when there is energy available for charging turns itself on at the minimum charge rate. As more energy becomes available for the car it increments the charge rate up and then as less is available decrements the charge rate down.
I am going to lower the baud rate as I have had one instance of a garbled LCD screen that appears to be a baud symtom. Also I would like to read from the EVSE so it feeds back to the diversion control. I have ordered a spare controller unit so I can play with it on the bench.

Attached is the charger code. It is stand alone code that is not integrated with the diversion control to make it easier to understand. The code is a form of energy management system as it chooses wheer to put excess energy not required by the batteries. It is well commented.

Will
24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 3x Magnum 4448, homecooked diversion system
+ 15 Heliene 330 mono, Classic 150

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 1694
Re: Arduino based PWM diversion control system
« Reply #121 on: July 26, 2017, 10:27:15 PM »
That is some cool stuff Will ! You get stuff done .
Now all I need is an EV - ha ha .  I am looking forward to drive via sun.

Larry
system one
Classic 150 , 5s4p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system two
Classic 150 ,5s 135 watt Kyocero , 16s Calb 100AH LiFePO4 , Outback VFX 3648 inverter
system three
Midnite KID MPPT 24 DC in to  12 volt AGM batterie

BenNelson

  • Newby
  • *
  • Posts: 1
Re: Arduino based PWM diversion control system
« Reply #122 on: November 14, 2017, 09:44:14 AM »
Hi Will,

Thank you SO MUCH for working on this! (Along with everyone who HELPED Will work on this!)
I just got HOME POWER issue 182 yesterday. The best part of the whole magazine was your letter describing this system! (I came to this web page from the link in the article.)

I've just started working with Arduino and also recently discovered the fact that the control signal from EVSEs is variable without causing an EV to error out. Pretty much the only EVSE I've found that lets you easily modify the output current is the OpenEVSE. (On most EVSEs, the signal is set by the physical circuitry inside the box - usually just a particular resistor!)

I've also been interested in learning more about Whole Home Energy Monitoring systems and starting learning a bit from the Open Energy Monitor web page. (https://openenergymonitor.org)On there, there's at least one person who used the monitoring system to then control the output of the OpenEVSE. When I'm done, I'd like to have an energy monitoring system which generally directs whatever EXTRA solar I have to my electric car. I happen to be on a grid-tie system, but it's not always advantageous to "sell" the power back to the utility.

Thank you for your write-up in HOME POWER. It had enough detail for people to really understand what you are doing, without getting bogged-down in technical details.

I'm glad to see that there are other people out there experimenting and taking a lead in how we can best make, direct, and use electrical energy.
« Last Edit: November 14, 2017, 10:24:44 AM by BenNelson »

mtdoc

  • Full Member
  • ***
  • Posts: 241
Re: Arduino based PWM diversion control system
« Reply #123 on: November 15, 2017, 02:11:21 PM »
Hey Will,

I'm very interested in your OpenEVSE diversion project as well. We have a Chevy Volt and just added a Chrysler Pacifica PHEV. I have an OpenEVSE kit ready to assemble and am planning installation of a second large PV system this summer (hopefully using the new Midnite inverter!).   Ultimately would love to develop a smart diversion system to manage EV charging.

Your project looks great.  But you GitHub link appears to be broken.. :(.   Any updates appreciated.

Thanks!
Array 1: Sanyo HIT225 X 8 on Wattsun tracker. Array 2: Evergreen ES-E-225 X 12 on shed roof. Midnite e-panel with Outback GVFX3648, FNDC and Classic 150 X 2. 436 AH AGMs. Honda eu2000i X 2.

paul alting

  • Jr. Member
  • **
  • Posts: 64
    • http://paulalting.com
Re: Arduino based PWM diversion control system
« Reply #124 on: November 15, 2017, 06:10:14 PM »
The link to OpenEVSE above from Will is not quite correct as it was pointing to a file that no longer is at that location.

The GitHub repo is okay though and the correct link should be as follows:
https://github.com/OpenEVSE/open_evse
This links to be base repo for OpenEVSE and from there you can access the files and code for Arduino.

OpenEVSE GitHub site is a collaborative of a number of people and you can also see more at their official site:
http://www.openevse.com/

For RAPI code, there are two locations for two different codes, and are as follows:
From OpenEVSE GitHub: https://github.com/OpenEVSE/open_evse/tree/stable/utils/rapi_checksum

From lincomatic GitHub : https://github.com/lincomatic/open_evse

Where you will find the actual files for rapi_proc Arduino code.
https://github.com/lincomatic/open_evse/blob/stable/rapi_proc.cpp
https://github.com/lincomatic/open_evse/blob/stable/rapi_proc.h

Sam Lin aka GitHub member Lincomatic is a contributor to OpenEVSE.

Hope that clears things up for people  :)

Will, sounds like you have been making great strides in developing your system and wonder if there is a link to the article mentioned in 'Home Power' ?
Also, it would be good to see a schematic of your connection or wiring layout if you have.
_____________
Paul - VK7KPA
« Last Edit: November 15, 2017, 06:14:06 PM by paul alting »
6 x 200W PV into home-brew 6 stage MOSFET charge controller : Microhydro 220Vac 3 phase IMAG
8 x 400Ah LiFeYPO4 Winston : Latronics LS2412 inverter
QuadlogSCADA control and monitoring system : Tasmania, Australia : http://paulalting.com

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 1694
Re: Arduino based PWM diversion control system
« Reply #125 on: November 15, 2017, 08:34:47 PM »
Will's article in Home Power magazine issue 182  is on page 21 in the Mailbox letters from readers section. I just looked on Home Power website and they don't let people download articles without subscription though sometimes they will post some articles on their web page.  His six paragraph letter probably doesn't have any other info than is already on this forum topic  , though it is a good concise summary of his project. Maybe when Will gets on he can post his letter on here.

Larry 
system one
Classic 150 , 5s4p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system two
Classic 150 ,5s 135 watt Kyocero , 16s Calb 100AH LiFePO4 , Outback VFX 3648 inverter
system three
Midnite KID MPPT 24 DC in to  12 volt AGM batterie

boB

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 2709
Re: Arduino based PWM diversion control system
« Reply #126 on: November 16, 2017, 07:40:32 PM »

Great article letter Will !

boB
K7IQ

WillEert

  • Full Member
  • ***
  • Posts: 139
Re: Arduino based PWM diversion control system
« Reply #127 on: November 19, 2017, 09:10:27 PM »
Thanks for the comments on the letter to Home Power. I am pleased they printed it however I have not read it as I get a "solid" copy in the mail, which has not yet arrived. I attach the two sketchs I am running in the diversion control at this time. I have not made any changes fo a couple of months now and the control is working very well. I get most of the power available to the array. Excess power, not needed by the batteries is sent to the HWT. The control limits KW to the HWT and sends excess to the EVSE.

The EVSE is on the CLSC 11 sketch however it gets input from the CLSC 10 for some data. The control is two arduino Megas that communicate by TTL serial with each other. Each Mega also uses one port for uploading and the serial display. Each Mega also uses one port to read and write to their attached Classic 150 using RS232. CLSC 11 uses it's last port to do TTL serial with the openEVSE for car charging.

There are not enough Classic 150 ports left for "follow me" so Classic 11 follows Classic 10, using Arduino code, when Classic 10 floats. Both Classics have exactly the same Absorb and Float setpoints as the system seems to work best when it is set up that way.

Classic 10 is doing the diversion into the domestic hot water tank. It needs to be fast as it is PWMing the SSR. It gets a thermostat signal from Classic 11 if the HWT gets to setpoint (which it does in the summer or if the heating system is S/D). It stops PWM to control the tank temperature.  It also calculates a setpoint for use by the EVSE, to increase or decrease the car charge rate, when the thermostat is active and no power is flowing to the HWT. In addition Classic 10 calculates the Magnum inverter load for use by the EVSE load shedding function. There is an amp limiting function which prevents excess amp flow to the batteries. ClSC 10 calculates this and both Classics are controlled simultaneously with this function. Amp limit control is quite convoluted. The WBJr is invaluable.

CLSC 11 follows behind CLSC. It forces float and does amp limit control as required. It senses the DHWT temperature and sends the thermostat signal to CLSC10 when required. It has the EVSE control in it.

I have put the pinouts in each sketch. The sketches are well commented - in particular CLSC 11 as it was developed later. I have had experience now attempting to follow other coders programs and it can be difficult to try to understand what the person is doing sometimes, let alone how they are doing it.

I am happy, with in the boundaries of my time, to help out anyone who is attempting to get the OpenEVSE charger or a diversion system working. David (DGD) and Paul (Alting) both gave me invaluable time and help as I developed this sytem and learned coding which I am grateful for.

Will
24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 3x Magnum 4448, homecooked diversion system
+ 15 Heliene 330 mono, Classic 150

mtdoc

  • Full Member
  • ***
  • Posts: 241
Re: Arduino based PWM diversion control system
« Reply #128 on: November 28, 2017, 12:36:09 AM »
Thanks for the additional info Will.

I'm going to revisit this once I get my new system installed - hopefully this coming summer.
Array 1: Sanyo HIT225 X 8 on Wattsun tracker. Array 2: Evergreen ES-E-225 X 12 on shed roof. Midnite e-panel with Outback GVFX3648, FNDC and Classic 150 X 2. 436 AH AGMs. Honda eu2000i X 2.

WillEert

  • Full Member
  • ***
  • Posts: 139
Re: Arduino based PWM diversion control system
« Reply #129 on: March 15, 2018, 11:18:45 AM »
I have managed to get the arduino reading from the OpenEVSE to the control. Here is a stand alone sketch showing the method I am using to read the charge state of the car into the control.

Will
24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 3x Magnum 4448, homecooked diversion system
+ 15 Heliene 330 mono, Classic 150

dgd

  • Hero Member
  • *****
  • Posts: 1707
    • Lorylink
Re: Arduino based PWM diversion control system
« Reply #130 on: March 16, 2018, 12:59:26 AM »
..interesting, I will be trying this, thanks for your perseverence with this project
Dgd
Classic 250, 150,  20 140w, 6 250w PVs, 2Kw turbine, MN ac Clipper, Epanel/MNdc, Trace SW3024E (1997), Century 1050Ah 24V FLA (1999). Arduino power monitoring and web server.  Off grid since 4/2000
West Auckland, New Zealand

WillEert

  • Full Member
  • ***
  • Posts: 139
Re: Arduino based PWM diversion control system
« Reply #131 on: May 05, 2018, 04:49:58 PM »
I don't really think this applicable to anything Classic or Arduino but it is a form of humor.

We were coming home the other day in the Bolt and had 25%SOC and showing about 90 Km range remaining on what is affectionately known as the guess-o-meter. Suddenly I received the warning - Low Propulsion Power Speed Reduced (or words to this effect). The Bolt slowed to about 50 Km/hr and I thought - gee - seems very early to run out of power with 25% and 90 Km showing. Within seconds the SOC  "bars" went from a very restful Green color to orange and black and stated to disappear. Within 1 Km we were by the side of the road with no power or range showing - dead in the water. We do not subscribe to OnStar nor do we have a cell phone ( no service where we are). Walking is healthy and sometimes the only option. After accessing a phone a neighbor got us home and I loaded my generator in ICE car.

At first the Bolt did not like the generator electrical quality but after I sped it up we met its parameters and it started charging. You can meet a lot of nice people in rural Manitoba who see the gas can (for the generator) beside your car and stop to help. Upon seeing an electric car they do not know if they should just laugh or drive away quickly pondering their near escape.

Turns out (most likely) that the Bolt is similar to other SOC systems in that they need to get completely full periodically to reset and know what the SOC actually is. Charging using an offgrid system and not worrying about a lithium battery bank needing to get completely full it seems I confused the Bolt system by going too long without giving it a "full" charge. Something the EV designers, I am sure, did not anticipate. Oh to be a square peg in a world of round holes.

Is the future of tow trucks to have a large battery bank on board and a very nice quick charger available to help out with this kind of problem?

Bolt booked for a diagnostic this week to ensure we do not have a low cell group problem. Most unlikely but a remote possibility.

Will
24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 3x Magnum 4448, homecooked diversion system
+ 15 Heliene 330 mono, Classic 150

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 1694
Re: Arduino based PWM diversion control system
« Reply #132 on: May 05, 2018, 10:55:53 PM »
Do they do firmware updates for the Bolt ? So if they discovered problem with SOC and fixed it - can you as a consumer load it in ? Or does the deal have to do it ? And wonder if they would give a detail of things they fixed or just say the generic  updates.

Larry
system one
Classic 150 , 5s4p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system two
Classic 150 ,5s 135 watt Kyocero , 16s Calb 100AH LiFePO4 , Outback VFX 3648 inverter
system three
Midnite KID MPPT 24 DC in to  12 volt AGM batterie

WillEert

  • Full Member
  • ***
  • Posts: 139
Re: Arduino based PWM diversion control system
« Reply #133 on: May 06, 2018, 09:06:51 AM »
They do firmware updates for the Bolt. It appears with the SOC that they are increasing the definition of the battery voltage measurement. From what they said it sounds to me like increasing the # of bits in the ADC. Also they are doing a radio upgrade. At this time you cannot turn the radio off!! You can mute it but not turn it off. In an all electric car this has to wondered at. You cannot do the firmware upgrades yourself. They are called a recall and done by the dealer at no cost.

The Bolt uses Canbus and using an Arduino with a suitable reader ODP reader all battery data can be obtained by a person who is not afraid to learn.

Here is link to good article on Bolt battery packs.

https://electricrevs.com/2018/04/02/new-details-emerge-as-a-few-bolt-ev-packs-continue-to-fail/

Will
24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 3x Magnum 4448, homecooked diversion system
+ 15 Heliene 330 mono, Classic 150

ClassicCrazy

  • Hero Member
  • *****
  • Posts: 1694
Re: Arduino based PWM diversion control system
« Reply #134 on: May 06, 2018, 01:58:00 PM »
You can't turn the radio off ? That is so odd ! Be fun to put a switch on the power lead to it , shut it off , and see if the whole car shuts down - ha ha !

I just looked at that article and looks like they are using onstar to send data up to the mothership all the time - so that radio must be part of the onstar system and they want the data from you !

Larry
« Last Edit: May 06, 2018, 02:01:09 PM by ClassicCrazy »
system one
Classic 150 , 5s4p  Kyocera 135watt , 12s Soneil 2v 540amp lead crystal for 24v pack , Outback 3524 inverter
system two
Classic 150 ,5s 135 watt Kyocero , 16s Calb 100AH LiFePO4 , Outback VFX 3648 inverter
system three
Midnite KID MPPT 24 DC in to  12 volt AGM batterie