cancel
Showing results forย 
Search instead forย 
Did you mean:ย 

MorningStar TriStar-45 PWM and Raspberry Pi 3 data project

full_mosey
Explorer
Explorer
I am working my way through the MS MODBUS Specification specs to capture data onto the RPi3.

The plan is to avoid fixed control panels, and instead, run a web server on the RPi3 and then view info via smartphone, tablet, laptop, etc clients. A mifi will provide LAN connections.

As of last Friday, I have been capturing the 'RAM' data fields for each minute. The fields are listed on page 4.

I have no plans to use spreadsheets. I store the data in an sqlite3 database.

Here is a sample output from an sql query run from the sqlite3 CLI:

day cs cstate avg_bvolts min_btemp max_btemp minutes
---------- -- ------ ---------- ---------- ---------- ----------
2017-04-23 3 Night 12.93 9 25 620
2017-04-23 5 Bulk 13.35 9 26 178
2017-04-23 6 PWM 14.86 10 22 328
2017-04-23 7 Float 13.36 22 27 314

The query displays a summary of the minutes for each control state for the previous day.

The bank is 270ah AGM which should explain the high Night battery Volts. I do run two 12V compressor fridges 24/7.

Looking for Comments, Suggestions, Questions.

HTH;
John

To correct broken MODBUS link. And, yes, I still refer back to this topic.
32 REPLIES 32

full_mosey
Explorer
Explorer
Bar graph!

Here is a graph covering 10 days of summarized data. The bars represent hours of duration for the MS MPPT 15L controller states; Night, Bulk, Abs, Float, and Equalize. The graph data is extracted from the controller by a Raspberry Pi 3 B by using the MODBUS protocol.



July 5: You see some of the 28 day equalization. I don't know why it was only 31 min.

July 6: You see the tall Bulk bar. I ran the 5000W A/C for 4.5 hours between 1PM and 5:30PM which caused the controller to stay in Bulk all day. The bank was under 12V overnight(not shown).

July 7: You don't see any tall charge bars. That is because I ran the 50A inverter/charger for 3.5 hours to expedite the Bulk charging. That is what I would normally do if running the genny due to a low morning Volts(not shown). The controller doesn't record the 50A. Also there is no Float bar because the controller is set to skip float when Volts have been low.

July 12: You see a tall Night bar. I covered the panels with a blanket for 3 hours between 8 and 11:30AM. Extended Night hours is what would happen during a storm. The controller handled this well.

July 13: All seems to be back to normal.

HTH;
John

full_mosey
Explorer
Explorer
I performed a driveway test of the solar system in the van. I drew 2KWH ,per Kill-A-Watt, by running a 5K BTU window-shaker A/C for 4.5hours.
I ran the coolest setting so the A/C would run continuously so the average was 444W.

A majority of the power came from the 270Ah AGM bank, with the assist from the 280W solar with the MS SS MPPT 15l controller. The controller was maxed out at 15A for about 3 hours. I had to use a USB fan on the controller. It got very hot where the decal said 'Don't touch!'.

The test began at 12:52, a few minutes after the controller switched to float and ran until 17:22. The lowest Voltage was 11.77 at 17:22 and 10 minutes later at 17:32 the Volts were 12.17. All the while, 2 Dometic CF-35 12V compressor fridges are running 24/7. End result is the system did well.

Now it is the next morning, July 7th, and we need a good charge. Beforehand, I set the 15L to skip float if the battery Volts stay below 12.5 for 2 hours. The bank needs a long Abs stage. I plugged in the Magnum 1012 inverter/charger at 6AM. Now the 1012 is providing 50A of charge and the solar nearly nothing. All I want is for the 1012 to bring Volts up to the Abs target. This took 3.5hours at which point I unplugged the 1012 and let the controller finish Abs. As I had hoped, the controller held Abs all day and never went to float. It worked!

I believe that the 1012 if left on would have dropped to float anyway. In either case, the 15L controller would have held Abs all day.

I believe the bank is charged.

Today July 8, the charge stages are back to normal.

I have graphs if anyone is interested.

I say automatic is getting smarter. What do you say?

HTH;
John

full_mosey
Explorer
Explorer
We got the charge_state 3 = nightime behavior nailed down.

Now, here is a 7 day, 24/7 graph of load Amps. The plots are the hourly average of Amps.

Any ideas on why the load Amps are higher during daylight( charge states 5,6,7,8 = bulk, abs, float, equ)?

Except for last night's test, the load was always and only the RPi 3B.



HTH;
John

full_mosey
Explorer
Explorer
mike-s;

I forgot to do my math in Watts. ๐Ÿ˜ฎ Thanks for catching that.

Yes the DROK is an in-line USB meter. It was really handy when matching USB power sources and cables so that I could meet the V and A requirements of the RPi. I am running the 0.33A at 5.2V on USB, or about 1.7W.

HTH;
John

mike-s
Explorer
Explorer
So, from what I can tell, your controller is producing pretty accurate measurements, much better than spec, and you've just been misinterpreting what they should show.

First, you said USB, which is 5 V. But the load terminals are ~13 V. So I assume you have a 12V-USB converter in there. A perfectly efficient converter would produce 5 V @ .55 A from 13 V @ .21 A. Your chart shows an increase of about that, so the relative change looks reasonable.

Something similar would apply to the Raspi. They don't run on 13 V, either. You said you measured about .330 A. If that's the 5V draw, then the 13 V draw would be about .13 A (= 5V*.33A / 13V), which is pretty close to what your chart shows before you added the new load.

(looking back, you did mention DROK USB way back on page 1. When you've been referring to "DROK," I've been assuming you're using one of their voltage/current monitors directly on the load line)

full_mosey
Explorer
Explorer
This graph will confirm that the 15L does indeed measure battery draw at the load terminals. I believe the measurements are within the 2% of 15A spec.

Per the 3A rated DROK USB meter, I added a draw of 0.55A to the USB adapter. You can see that increase at ~21:30.



My best guess is that I was drawing ~0.88A, but the graph never exceeded 0.45A.

HTH;
John

full_mosey
Explorer
Explorer
mike-s wrote:
full_mosey wrote:
The known RPi Amp draw of 0.33A per the DROK is nowhere to be seen.
What makes you say that? As I pointed out, the accuracy of current measurement based on the Morningstar manual seems to be 0.3+ A. It may even be around 0.6 A, which is 2% of the -15 to +15 A range. And, do you know and trust the accuracy of the meter you're comparing against?

You might want to review the difference between accuracy, precision, and resolution. You seem to be assuming that because your data seems precise with high resolution, that it's also accurate.



I see. With the 2% based on 15A, it is now obvious to me. I thank you for providing the reason.

HTH;
John

mike-s
Explorer
Explorer
full_mosey wrote:
The known RPi Amp draw of 0.33A per the DROK is nowhere to be seen.
What makes you say that? As I pointed out, the accuracy of current measurement based on the Morningstar manual seems to be 0.3+ A. It may even be around 0.6 A, which is 2% of the -15 to +15 A range. And, do you know and trust the accuracy of the meter you're comparing against?

You might want to review the difference between accuracy, precision, and resolution. You seem to be assuming that because your data seems precise with high resolution, that it's also accurate.

full_mosey
Explorer
Explorer
mike-s

Here is a graph of load and charge Amps since Midnight for charge state 3.



The known RPi Amp draw of 0.33A per the DROK is nowhere to be seen.

For grins, I have added another draw to bring the total draw up to ~.70A. I will leave this overnight and let you know of the outcome tomorrow.

HTH;
John

full_mosey
Explorer
Explorer
WackAway wrote:
@full_mosey

Could you post or somehow send your code?

I've been wanting to dig into getting the data out to other then the status webpage. I have my trailer hooked up with SmartThings which can control lights/switches/tv etc. With SmartThings, I can also create logic rules that can then turn things on/off/down. It would be nice to have those rules be tied to battery voltage and or charging amp levels.


Sure.

The program that reads from the 15L is what you will need. It is 85 lines long. It contains links that you will need.

Is it OK to post it here in a QUOTE?

Are you fluent in PHP?

HTH;
John

mike-s
Explorer
Explorer
full_mosey wrote:

sqlite> select max(adc_ic_f), max(adc_il_f) from rhr where charge_state = 3 and dt>'2017-06-26 12';
0.007247314453125 0.12320434570312
sqlite>

The RPi is powered from a USB adapter connected to the load terminals.

A DROK USB tester shows the RPi drawing ~.330 mA, which is greater than the .12mA above. That is how I concluded that the 15L is not measuring battery draw overnight.
I assume you mean ~.330 A, not mA above - that's the units the controller reports.

I would not expect any great accuracy at those low levels. They claim current accuracy of "2%", but that certainly means 2% of full scale (so, ~0.3 A or more), not 2% of the reading.

And, If it's in "night" mode, I wouldn't expect _any_ solar current. There will be "charge" current, which is just battery current, although I'm not sure of the sign (+ for charge, - for drain, or the opposite). One sure way to tell - disconnect the solar, put a more significant load on it, and see what it reports for battery and load current.

WackAway
Explorer
Explorer
@full_mosey

Could you post or somehow send your code?

I've been wanting to dig into getting the data out to other then the status webpage. I have my trailer hooked up with SmartThings which can control lights/switches/tv etc. With SmartThings, I can also create logic rules that can then turn things on/off/down. It would be nice to have those rules be tied to battery voltage and or charging amp levels.
Todd & Victri
"Looking for the perfect spot and points in-between"
2017 Ford F350 Lariat Super Duty 4x4
2017 KZ Durango Gold G380FLF 40ft
800W Solar | Morningstar TS-MPPT-60 | Aims 3000W Inverter Charger

full_mosey
Explorer
Explorer
mike-s wrote:
According to their modbus doc:
Adc_ic_f
(12)(0x000B) (A). battery charge current, filtered.
Charging current to the battery as measured by on-board shunt.
I think you have to calculate solar current = load current + battery current (maybe flip the sign on battery current?)


Take a look at this for me.

The graph is all charge_state 3 = night. There cannot be any charge current.

sqlite> select max(adc_ic_f), max(adc_il_f) from rhr where charge_state = 3 and dt>'2017-06-26 12';
0.007247314453125 0.12320434570312
sqlite>

The RPi is powered from a USB adapter connected to the load terminals.

A DROK USB tester shows the RPi drawing ~.330 mA, which is greater than the .12mA above. That is how I concluded that the 15L is not measuring battery draw overnight.

It also appears that the daytime measuring is off as well. Here is a read of current values averaged over the most recent 10 minutes:

SS MPPT 15L Meter(10 min avg):
Serial = ********
Time = 2017-06-27 14:25:03
Charge State = 7.0 <--- float
INPUT:
Array Voltage = 38.04
OUTPUT:
Battery:
Target-Volts = 13.23
Volts = 13.21
Amp-Hours = 28.1
Current = 0.69 <---- adc_ic_f
kW = 0.0091
kWhs = 17.3
Load:
Volts = 13.2
Amp-Hours = 0.8
Current = 0.13 <---- adc_il_f
Temperature:
RTS = 34.0
Heatsink = 47.0
Ambient = 46.0

Maybe you can make sense of this. The .13 is less than the RPi's actual draw.

HTH;
John

full_mosey
Explorer
Explorer
MrWizard wrote:
Battery voltage did not drop below 12.62v
You did very well
What is the amp hr capacity of your battery bank ?

Was that 10pm to 6am ?


Eaton Powerware 135Ah 500W UPS used. I have two for 270Ah. I got them at 5yrs old in the Summer of '15. I benchmarked them at the time and they rested at 12.88V at 85F.

Yes, 21:09 to 06:02!

HTH;
John