Continuous tweaking of AUX2 threshold for maximum PWM output

Started by cpfl, May 19, 2015, 07:17:52 PM

Previous topic - Next topic

cpfl

The problem:

I have a small solar installation, just 2160 watts, so I want to ensure that I make the maximum possible use of all available power.

One of the best ways of doing so, is to direct any spare solar capacity to a water heater or to a space heater, using either DC or AC power. I opted for AC for its lower cost and greater availability of the necessary components, ie Solid State Relays (SSRs) and heater elements.

I played around with AUX2, setting the mode to WASTE NOT HI. The initial parameters were set to width, 3 volts and threshold, -0.7 volts. This setting seemed to reduce any CFL flicker generated by the inverter, and allowed the charge controller do its job of charging the battery bank without any perceptible delay in reaching target charge states.

All appeared to be going well during the bulk state and to a lesser extent the absorb state, until the float state was reached. It was then that it became very apparent that I needed to tweak the threshold setting. Upon adjustment down to -2.4 volts, the maximum possible benefit was again gained from the available solar power. The benefit was quickly lost when the clouds appeared. The threshold was then too great and the water heater took power from the battery bank, until the clouds disappeared again.

I needed an automatic system of AUX2 parameter tweaking that did not involve me wearing out the charge controller buttons.

The solution:

Since I was already using the Raspberry Pi for monitoring, it seemed like a natural extension to use it for monitor and control purposes.

Modifying the excellent newmodbus program source code, it now reads the battery voltage and increases or decreases the threshold setting so that the resulting change in battery voltage is always 0.2 volts below the target voltage. A simple script lets the program run every few seconds.

The weather has not been ideal recently, but I do have some graphs demonstrating the system. Additional, more convincing, graphs will be posted when the weather improves.

The question:

Could this functionality be included in a future revision of the Classic firmware?
Off-Grid in a 320 sqft tiny home (plus 320 sqft attached workshop) in Texas, USA: Midnite Solar Classic 150, Magnum Energy MS4448PAE, 9 x Kyocera KD240 (2160 watts) + 9 x Kyocera KU265 (2385 watts), 16 x GC2 (400AH 48V), Raspberry Pi (ethernet & RS485 monitoring).

dgd

Cpfl,

An interesting solution to keeping that threshold setting at optimum.
However, I would imagine that for most Classic users, the Aux2 will not be available to use for SSR  pwm control - it will be used as the input for the WBjr.

An alternate solution would be to use one of the pwm pins on the rPi to directly control the SSR.
As you already read battery voltage and other parameters into the rPi then these can be used to generate the pwm duty cycle for the SSR.

I have outlined in one of my Arduino posts the logic I use in pwm'ing the SSR

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




  cpfl,

      I am interested in your results. I run a 4.4kw system doing AC diversion into a HWT. I have had similar results to yours when attempting to use the AUX2 PWM function for diversion. I needed a width of at least 3 to keep the inverter operating smoothly and also had to change the threshold depending upon conditions. I had problems with diversion starting to early and also not turning off when required. Altering the Threshold by controlling to a setpoint looks like an easy solution to these problems if good control is consistently achieved.

Will
(1)24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 4x Magnum 4448, homecooked diversion system;(2)15 Heliene 330 mono,Classic 150;(3)2X6 Hansol345mono, 2 stand alone Hotspot ACDC12C Minisplit heat pumps.(4)15 Hanwha Q cell 400 1/2 cell, Classic 200: (5)1X6 HanwhaQcell 400 1 Hotspot minisplit ACDC18C

cpfl

Will,

I have been happy with the results obtained so far.

See attached.

Chris.
Off-Grid in a 320 sqft tiny home (plus 320 sqft attached workshop) in Texas, USA: Midnite Solar Classic 150, Magnum Energy MS4448PAE, 9 x Kyocera KD240 (2160 watts) + 9 x Kyocera KU265 (2385 watts), 16 x GC2 (400AH 48V), Raspberry Pi (ethernet & RS485 monitoring).

WillEert

Hi Chris,

Thanks for posting the trend of your system. The inverter output control looks good. How well does the battery voltage control to setpoint while your system is diverting excess energy to your diversion load? Can it cope with sun / cloud / sun / cloud and not draining the batteries before it shuts down at the end of the day?

Thanks again

Will
(1)24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 4x Magnum 4448, homecooked diversion system;(2)15 Heliene 330 mono,Classic 150;(3)2X6 Hansol345mono, 2 stand alone Hotspot ACDC12C Minisplit heat pumps.(4)15 Hanwha Q cell 400 1/2 cell, Classic 200: (5)1X6 HanwhaQcell 400 1 Hotspot minisplit ACDC18C

cpfl

Will,

On my system, having the Pi maintain the battery voltage at 0.2 volts below the charge controller target does not interfere with the charge controller state. It takes a larger voltage drop before that happens.

Also, it does not seem to harm the charging of the battery bank, although the charge controller target could be increased by 0.2 volts in order to compensate if necessary.

The battery voltage drops when the sun is obscured or is setting, so the Pi reduces the PWM frequency at AUX2. When the sun reappears, it increases the PWM frequency at AUX2. It cannot drain the battery bank.

Chris.
Off-Grid in a 320 sqft tiny home (plus 320 sqft attached workshop) in Texas, USA: Midnite Solar Classic 150, Magnum Energy MS4448PAE, 9 x Kyocera KD240 (2160 watts) + 9 x Kyocera KU265 (2385 watts), 16 x GC2 (400AH 48V), Raspberry Pi (ethernet & RS485 monitoring).

WillEert

Hi Chris

Thanks for your reply. It seems that you have found a very easy way to overcome the shortcomings of the AUX2 PWM  system.It looks like you do not so much  vary the threshold value but instead vary the PWM frequency rate. Are you using a PID control for this?

Thanks again.

Will

Will
(1)24 ET 185 mono, Classic 150,8x Surrette 6CS25p, 4x Magnum 4448, homecooked diversion system;(2)15 Heliene 330 mono,Classic 150;(3)2X6 Hansol345mono, 2 stand alone Hotspot ACDC12C Minisplit heat pumps.(4)15 Hanwha Q cell 400 1/2 cell, Classic 200: (5)1X6 HanwhaQcell 400 1 Hotspot minisplit ACDC18C

cpfl

Will,

Actually, I am moving the threshold value up and down, using software to write values to the modbus register 4177. It may be a clunky way of solving the problem, but it does appear to work.

Chris.
Off-Grid in a 320 sqft tiny home (plus 320 sqft attached workshop) in Texas, USA: Midnite Solar Classic 150, Magnum Energy MS4448PAE, 9 x Kyocera KD240 (2160 watts) + 9 x Kyocera KU265 (2385 watts), 16 x GC2 (400AH 48V), Raspberry Pi (ethernet & RS485 monitoring).

paul alting

High Chris,
I am wondering if it were possible get your code you developed for the RPi ?
What I am doing is developing code for the Arduino to handle two loads, via PID and then PWM, and I think I could use what you have done to integrate into the Arduino.

Will has two heating elements in his hot water tank, so I am basing it around this, and this will be managed in a lead / lag control fashion to allow smooth control across both loads.

It seems you have spent some time in figuring out a good solution.
I have thinking on this for the past few days and without really knowing the Classic and how the 'waste not' functionality works, my thinking may be off the mark.
My thinking for the concept of diversion control is based on knowing that the charge controller has completed the 'bulk' and 'absorb' stages and has gone into 'float' mode.
Then, knowing the PV array voltage a controller can divert all available energy from the PV array to a diversion load.
The trick I think is that the charge controller will still want to be in 'float' mode and that is sees enough PV input to maintain this mode without dropping to night time mode.

Is my thinking on the right track ?

I have been reading over the Modbus register tables in an effort out figure out suitable methods by which good stable diversion control can be done.
Once I get the Arduino code complete, I can post it here for others.
____
Paul
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

cpfl

Paul,

My code is heavily based on RossW's newmodbus code. It reads the classic modbus registers and writes them out for later reading, processing and/or displaying by other processes. The part you are interested in, is the adjustment of the classic modbus register that controls the PWM threshold that indirectly affects the battery voltage by increasing or reducing the diversion load.

The code does not need to know the current charge mode (BULK, ABSORB, FLOAT, EQ, etc) because all it is doing is attempting to maintain the battery voltage 0.2 volts below the current target voltage, be that the BULK, ABSORB, FLOAT, EQ voltage.

Chris.
Off-Grid in a 320 sqft tiny home (plus 320 sqft attached workshop) in Texas, USA: Midnite Solar Classic 150, Magnum Energy MS4448PAE, 9 x Kyocera KD240 (2160 watts) + 9 x Kyocera KU265 (2385 watts), 16 x GC2 (400AH 48V), Raspberry Pi (ethernet & RS485 monitoring).

paul alting

Thanks Chris,
After posting I re-realised that the method of diversion control is still based on the Midnight Classic being the actual device doing the diversion control, not the RPi,
I'm looking over the code as a matter of interest.

I put a post in on the Arduino section under diversion control to explain more about what I am doing.
I wonder if it is valid to implement this same functionality in the Arduino, except that the Arduino is the end point of PWM, not the Classic.
If I can read a Classic register that might give data about the amount of diversion that might be available, then I could possibly use that.
____
Paul
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

dgd

Paul,

I don't think such a register exists, at least last time I scanned through the Classic modbus pdf (Dec 2013 vers) there was nothing updated by the Classic that would indicate the power input available above the actual power being used. I also could not figure out how the Classic could measure this, the solar mppt algorithm unloads the output to let the input V rise to its maximum then appears to work on a 'constant voltage ratio' method to (try to) get to the mpp. The perturb and observe method doesn't offer max power available data either as it just slides up the power curve to the mpp then probably oscillates around it.

Maybe (hopefully) my guesswork is wrong and there is something available, but the algorithms used by the Classic have never been revealed.
So as you surmise the way may be to have an external processor just get basic state measurements from the Classic then use that to implement a PWM scheme for power diversion. This looks like an application the Arduino was just designed for  ;)

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

dgd

Paul

Quote
... into home-brew 6 stage MOSFET charge controller

Now there is a project that I would be very interested in  :P
I have had for some time now that niggling thought that I should get into constructing a charge controller. Certainly a small
MPPT type so that I could divide a PV array into smaller chunks (or 2 to 3 series PVs at most) and start relocating PVs to point in different directions to optimise, or flatten out, power curves throughout the day. With PVs so cheap the overpanneling is easy
perhaps using 6Kw PVs to get a steady all day 1.5 to 2Kw input.
Its still a thought experiment

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

cpfl

dgd,

The arduino can read the current battery voltage and the target battery voltage registers, and determine whether there is or is not spare capacity available for diversion.

If the current battery voltage is 0.3 (or more) volts under target, then there is no spare capacity. This may be due to the classic being in BULK, or ABSORB, FLOATM or EQMPPT. All the available power is being used to raise the battery voltage. It is therefore safe to assume that there is no spare capacity to be redirected, and whatever power is currently redirected should be decreased.

If the current battery voltage is 0.1 (or fewer) volts under target, then there is spare capacity. This may be due to the classic being in ABSORB, FLOAT or EQ. The available power has raised the battery voltage close to the target voltage. It is therefore safe to assume that there is spare capacity which can be redirected, and whatever power is currently redirected can be increased.

The threshold register value can be increased or decreased accordingly.

This trial and error process works without ever knowing exactly how many watts are available for redirection. It simply locates the sweet spot for maximum diversion without affecting the charge controller operating mode.

I believe the arduino would be ideal for this application.

Chris.
Off-Grid in a 320 sqft tiny home (plus 320 sqft attached workshop) in Texas, USA: Midnite Solar Classic 150, Magnum Energy MS4448PAE, 9 x Kyocera KD240 (2160 watts) + 9 x Kyocera KU265 (2385 watts), 16 x GC2 (400AH 48V), Raspberry Pi (ethernet & RS485 monitoring).

paul alting

#14
Chris,

Just to clarify what you say:
Quotef the current battery voltage is 0.3 (or fewer) volts under target, then there is no spare capacity
and
QuoteIf the current battery voltage is 0.1 (or fewer) volts under target, then there is spare capacity
Is that correct, or when you say fewer, should it be that one should be higher and the other lower ?

Oh, scrub that, you saw it before I posted  ;D ;D

The 'target' value, can you elaborate more on what this is and which register this is please ?
I am trying to understand and get my head around the concept, which is a bit different to my original idea of working around the Classic's current mode and knowing the PV array volts and battery volts.

I'm wondering if it would be better to continue this discussion over on the Arduino side where we have the thread for it ?
Appreciate your input, Chris and David.

David, the 6 stage MOSFET charge controller is presently on the workbench. But I am thinking of some small design changes to it, possibly adding in individual MPPT, not sure yet.
Once I get some of this programming done, I'll get back to it and would be interested to share thoughts on it.
____
Paul
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