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

WillEert

  • Full Member
  • ***
  • Posts: 122
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: 1445
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: 236
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: 1445
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: 2625
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: 122
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