Arduino based PWM diversion control system

I am a bit fanatical about using surplus energy from wind and solar systems.  I just had an article published in Home Power magazine about this subject.

I like using Tristar controllers in diversion mode and then triggering more usable diversion (AC water heating) from that using my Tristar Follower idea.  That’s my latest trick anyway and I am proud of it.  It’s done using hard-wired analog electronics.

However it turns out that there are folk out there who like things a lot more complicated, and I must say it looks like quite a lot of fun too.   Will Eert wrote to me to tell me about his Arduino based PWM diversion control system that talks to his Midnite Classic controllers and uses surplus solar energy to heat his water tank based so as to limit maximum current into the battery, and limit its voltage to the prevailing charging setpoint.

You can learn a lot more about Will’s project on the Midnite discussion forum here.

Here is a basic summary of what it does:

  1. The control uses a series of PID controllers to divert under various conditions. This means it modulates diversion at a variable rate based on the amount of power available. The control normally turns on when there 10w available of excess power anywhere in the system.

  2. The control has a dynamic high amp limiter which uses the WBJr amps for an limit amp signal. This lets me “over array” the battery bank but not worry about putting too many amps into the the battery bank (when conditions permit) while still being able to utilize the full output capacity of the array at all times.

  3. The control diverts power based on high amp flow to the batteries. This lets the control divert in Bulk if the excess power is available. I adjust this set point 5 amps lower than the dynamic amp limiter. At present I only divert into one HWT element which is two KW in size. If the amp diversion is at maximum then the amps to the battery increase and the dynamic amp limiter limits array output.

  4. The control also diverts power based on voltage. It always maintains the batteries within .3V of the battery charge setpoints. The divert setpoints are set .3V lower than the Classic charge setpoints. When the divert setpoint is exceeded diversion starts automatically. It is possible to be amp and voltage diverting while dynamically amp limiting at the same time.

  5. The control reads the Classic setpoints and adjusts its setpoints to match. This means that once the control is setup all the owner needs to do is adjust their Classic as they desire. The diversion control will make all needed adjustments to its setpoints to ensure diversion continues to happen optimally.

  6. The control diverts at 10HZ. This is tunable however this frequency keeps the inverter very happy.

  7. If the HWT tank thermostat opens the PIDs turn off and the Classic limits array output. Fully automatic.

Thanks for documenting all of this, Will!  I love it.

This entry was posted in construction, Diversion load control. Bookmark the permalink.

3 Responses to Arduino based PWM diversion control system

  1. David Simms says:

    This is an interesting post.
    I, too, have developed a DIY controller that diverts excess power to a dump load. I would call my system “experimental” and the controller is the same. Unfortunately, I don’t live an off-grid life, as was once the case. However, the little solar system has allowed me to learn a bunch of stuff and to experiment, simply because my system is small and I haven’t had to depend on it for all of my electricity.
    Presently, one 175 w Sharp solar panel is running one 8.1 cu ft SunDanzer freezer and a 16cu ft (RF19) Sunfrost fridge. This load is kept in an attached, unheated garage. My initial hypothesis was that the load would track the solar availability. The garage temps vary from 7deg to 20+ deg and the freezer/fridge internal temps are held at -15 and 4 deg, respectively. A ‘discretionary’ part of the load is a 1/4hp air compressor. To date, all has performed very very well but that’s another story.
    The controller is the evolution of several designs and it has been working flawlessly for 5+years. It consists of a PIC16F684 programmed in MikroPascal. I also learned Eagle to lay out the circuit board and I etched my own boards which had been obtained on Ebay.
    This PIC is the smallest that has a PWM module and, of course, it also has an ADC that is used to sense the system voltage. With this unit, I began by using 5khz but quickly reprogrammed the PIC to use 20khz because the 5khz buzz was annoying. Depending on the clock speed -I used the onboard 8Mhz clock to minimize the number of components- the PWM will go over 200khz.
    The AdC senses the voltage through a simple voltage divider that uses a pot in order to adjust the voltage. Although this is working fine, my next design will use an op-amp in the sensing circuit and will use a software selectable voltage. I guess that I’ll have to get motivated to move onto the next version but, this one works so well that I haven’t done so. A large electrolytic capacitor is needed to stabilize the battery voltage because we are, in effect, trying to measure a voltage that the PWM is constantly changing.
    The PWM output pin, of the PIC, is wired to a couple of FET drivers that manage a pair of IRF3710s capable of switching 57A each. This is overkill and the weak link, insofar as current handling, would be the circuit board itself. Prior to using this pair of parallel MOSFETs I had used a single IRF540 which did just fine. I wanted to practice hooking FETs in parallel though. I’ve already partially assembled the output stage of the next version and it consists of six IRF 540s but, that’s another story.
    The software is no more than a single page but I don’t have any LCD displays and, as mentioned, I use a pot for the voltage selection. Any adjustments have to be made by watching a a separate voltmeter. yes, the next version will show that info on the LCD.
    At present, I don’t bother with an equalizing voltage because this would be handled by my Ebay solar controller. It will limit the battery voltage to 30 volts which is fine.
    Insofar as my circuit is concerned, it allows the batteries to go to 29.6 v (bulk charge voltage for these batteries) before cutting back to 28.2 v . The maximum charge rate of the system is about 5A or 6A depending on light conditions. The unit reacts instantly to a load coming on or off (these cooling units use Danfoss compressors which take only about 1.5A at 24 volts DC) so the regulator often diverts current even when one of the compressors is running.
    Insofar as managing the operation of the regulator, when it has reached 29.6V, it turns on a timer. It will remain in float mode (28.2 v) for 3 hours ie. it may turn on and off depending on load and solar isolation but it won’t have to go back up to 29.6v until the 3 hours are up. The idea here was to a) allow the batteries to burn off any accumulated sulphation by waiting until 29.6 was reached and b) to not leave the regulating voltage at 28.2 v either. This strategy is working well. generally, the batteries will go to 29.6v only once or twice a day, if at all.
    Since battery health is one of my primary concerns, I like the fact that I often hear a slight bubbling in the batteries. Water consumption is very little, the electrolyte is at about 1.3 whenever I check it and there is a difference of, at most 0.02 volts, between the 6v cell blocks. Since the batteries are 10 years old, I’m quite happy.

  2. hugh says:

    I have also just heard from Pete Gruendeman as follows:

    “I have created a MPP tracking controller specifically to use my 1.2kW PV array to power my electric resistance water heater. I will talk about this as part of my presentation at the Midwest Renewable Energy Fair, June 16-18th. I am on at 2:30 on the 17th.:

    I totally agree that any charge controller worth buying, especially a high voltage step-down type should have diversion terminals WITH working MPPT to power a water heater and that people should now plan on oversizing their PV arrays just to have surplus to send to their water heaters. Then they would almost never run out of electricity and their backup device would be a propane water heater. “

    • David Simms says:

      Oversizing systems and complementing solar with wind also ensures the health of the battery bank.

Leave a Reply

Your email address will not be published. Required fields are marked *