diy solar

diy solar

Monitoring DC-coupled PV production with shunt?

fafrd

Solar Wizard
Joined
Aug 11, 2020
Messages
4,188
I’m looking for easy ways to monitor / measure DC-coupled production and realized that placing a shunt on the output path of an SCC (or multiple SCCs) should provide an easy solution.

Interested in anyone who is already doing this?

In particular, I’m considering building a PLC-based or Rasberry-Pi-based ‘brain’ that will monitor DC-coupled power generation as well as grid import/export to control a Modbus-based hybrid inverter such as the Schneider Conext XW Pro.

I have no experience with either platform, so any suggestions as to which would be easier to interface to a shunt to achieve my goal of DC-coupled power generation monitoring / measuring appreciated.
 
You can buy meters and shuts that pretty much do what you want. Is there something special you are looking to deliver?
 
You can buy meters and shuts that pretty much do what you want. Is there something special you are looking to deliver?
The hybrid inverter I’m considering (Schneider Conext XW Pro) allows export power to be controlled through Modbus commands.

I was thinking about adding additional AC-coupled power because that makes it very easy to ramp-up export ‘naturally’ with early-morning sunshine.

But now I realize that if my ‘brain’ is able to measure the amount of incoming early-morning DC-coupled power using a shunt, I can achieve exactly the same thing by instructing the XW Pro to export an amount of AC-power matching the level of incoming DC-coupled power.

So I’m looking for an easy way to measure DC-power generation out of 1 or 2 SCCs that can be read by either a PLC-based or Rasberry Pi-based controller / brain.

Just unsure how uncommon of an approach this might be.

Of course, as soon as you enter the world of programming your own energy monitors / controllers, I understand you are getting waaay off the beaten-path…
 
Seems like a ModBus-RS485 PLC could interface directly with the XW Pro Gateway. As far as accuracy it would depend on the amp rating of the shunt and the resolution of the analog input on the PLC. One of the problems I have is not being able to monitor small standby currents (150mA or less) with a 100A, 75mV shunt connected to a ZEVA BMS. The ADC, probably 8 or 10 bits only, does not have a small enough least significant bit to capture those small mV readings.
In your case DC only flows one way from the SCC to the battery, so you don't have to worry about reserving half the ADC range for negative values. Also depends on how small of a current the SCC can deliver before it shuts off either with a full battery or low sun light.

The RPi alternative is questionable, can it even be used to capture mV readings from the shunt and communicate via ModBus RS485 to the Gateway at the same time. Especially if you need to add a high resolution ADC hat and an RS485 hat.
 
Seems like a ModBus-RS485 PLC could interface directly with the XW Pro Gateway.
Please excuse my ignorance but I am stil coming up to speed with all this Modbus and PLC technology.

Are you just saying that a PLC-based ‘brain’ / controller will have an easier time interfacing with the XW Pro gateway than an RPi-based brain / controller?

Or are you saying there are some smart shunts supporting Modbys-RS485 communication that could directly interface with the XW Pro Gateway?

I’m still trying to understand whether a PLC can directly communicate with an XW Pro or (Victron) MPII or a gateway is required…
As far as accuracy it would depend on the amp rating of the shunt and the resolution of the analog input on the PLC.
This I understand - PLC will have a resolution limit on analog input and shunt will have an analog noise level that needs to be accounted for in that context. But that makes it sound as though it’s a workable idea (as long as accuracy is sufficient).
One of the problems I have is not being able to monitor small standby currents (150mA or less) with a 100A, 75mV shunt connected to a ZEVA BMS.
What shunt are yo using and is it connected directly to the BMS or through a PLC? (In which case I’d also appreciate understanding which PLC you are using).
The ADC, probably 8 or 10 bits only, does not have a small enough least significant bit to capture those small mV readings.
In your case DC only flows one way from the SCC to the battery, so you don't have to worry about reserving half the ADC range for negative values.
Out of the SCC, yes, but I am hoping to absorb the majority of that current in an inverter before it gets to used to charge the battery).

I’m looking at max charge current of 100A so an 8-bit ADC should provide accuracy of ~0.4A / 10W if I can find a shunt that expounds the full analog range from 0-100A.

I’d be happy with any accuracy below 50W, so this should not be a problem…
Also depends on how small of a current the SCC can deliver before it shuts off either with a full battery or low sun light.
This is actually not a problem. The whole goal of this approach is to exploit the simple and natural throttling / curtailing capability DC-coupling through an SCC has to offer. The inverter will invert all of the incoming DC-power whenever it can, so the battery will not be charging and the SCC will remain in CC / Boost mode.

Only in the circumstance that the inverter cannot export all incoming DC power (because my export cap of 3.5kW has been reached) AND the battery is full enough to cause the SCCs t enter CV mode will DC power be getting curtailed (in which case I had no choice but to dump / waste it and n which case the incoming DC power measured by the SCC remains accurate).
The RPi alternative is questionable, can it even be used to capture mV readings from the shunt and communicate via ModBus RS485 to the Gateway at the same time.
I don’t know (which is why I asked).

Several members have told me on other threads that RPis have the advantage of being faster the PLCs, in case that provides an answer.

But as far as the code / library to translate desired Modbus commands into the correct output string, my sense is that PLCs make that more turnkey / foolproof than figuring out how to do so on an RPi…
Especially if you need to add a high resolution ADC hat and an RS485 hat.
Not sure whet a ‘hat’ is - it that an add-on board for an RPi?

Assuming it is, I suppose I should start looking into what RPi ‘hats’ are typically being used for Energy Monitors…

Appreciate your inputs and would love to understand in more detail what you are found with your shunt…
 
For the record, I'm just a novice with regard to electronics, software, RS485 & CAN bus and programming so I can only relate to issues that I have direct experience with.
1) A PLC with a built in ModBus RS485 port theoretically is the easiest way to interface with the Schneider Gateway. I'm using the older ComBox which has an RS485 connection but I am not using it at present. GXMnow has posted on the Forum regarding his experience setting up and using a PLC. For clarification, my understanding is that ModBus is the communication standard (how the bits are packaged) and RS485 is only the electrical standard for the wiring and communication bus.
2) I'm not aware of any so called Smart Shunt that would interface with the Schneider.
3) The shunt I'm using is just a generic 100A, 75mV model sourced from AliExpress. It is connected directly to the ZEVA BMS but the resolution is disappointing probably because it is relying on an 8 or 10 bit ADC pin on the processor. I have been testing and evaluating a TI INA229 IC that has 20bit resolution so its quite capable of registering very small mV readings. Its rated for up to 85V common mode operation yet it seems to keep failing even though I have never used more than 60VDC (18 LFP cells in series) So this is a work in progress.
4) There is nothing wrong with an RPI. In fact, I'm using one with a Pi CAN Duo hat which is an expansion board that fits on the GPIO. It receives and transmits CAN bus communications. I'm intercepting the ZEVA BMS raw CAN info and then the RPi sends it out over the network as a WebSocket to be viewed on a webpage. I hired someone to do all the programming. Although I did learn enough HTML, CSS, and Java Script to reformat the webpage to my liking.
In your situation I don't think processing speed is a factor as long as the PLC can update once or twice per second that's good enough. A compatible PLC should almost be plug and play vs. a RPi that would need a separate ModBus RS485 expansion board requiring some programming and most likely some difficulty getting reliable communication. You would also need some programming to read the analog mV signal from the shunt and convert it to a proper value then push it out through the RS485 expansion board to the Gateway.
 
For the record, I'm just a novice with regard to electronics, software, RS485 & CAN bus and programming so I can only relate to issues that I have direct experience with.
1) A PLC with a built in ModBus RS485 port theoretically is the easiest way to interface with the Schneider Gateway.
That’s kind of what I thought.

So you also have a Conext XW Pro?

I’m still a bit fuzzy on whether a Schneider Gateway is required to communicate Modbus commands from a PLC to a Conext XW Pro…
I'm using the older ComBox which has an RS485 connection but I am not using it at present. GXMnow has posted on the Forum regarding his experience setting up and using a PLC. For clarification, my understanding is that ModBus is the communication standard (how the bits are packaged) and RS485 is only the electrical standard for the wiring and communication bus.
I think that is correct - RS485 is the physical transport layer while Modbus is a specific communication protocol.
2) I'm not aware of any so called Smart Shunt that would interface with the Schneider.
Yeah, that seems to be more Victron’s sort of thing than Schneiders…
3) The shunt I'm using is just a generic 100A, 75mV model sourced from AliExpress. It is connected directly to the ZEVA BMS
Meaning your BMS has an analog input intended to be connected to a shunt?
but the resolution is disappointing probably because it is relying on an 8 or 10 bit ADC pin on the processor. I have been testing and evaluating a TI INA229 IC that has 20bit resolution so its quite capable of registering very small mV readings. Its rated for up to 85V common mode operation yet it seems to keep failing even though I have never used more than 60VDC (18 LFP cells in series) So this is a work in progress.
What is your goal?
4) There is nothing wrong with an RPI. In fact, I'm using one with a Pi CAN Duo hat which is an expansion board that fits on the GPIO. It receives and transmits CAN bus communications. I'm intercepting the ZEVA BMS raw CAN info and then the RPi sends it out over the network as a WebSocket to be viewed on a webpage.

I hired someone to do all the programming.
How much did that cost you?
Although I did learn enough HTML, CSS, and Java Script to reformat the webpage to my liking.
In your situation I don't think processing speed is a factor as long as the PLC can update once or twice per second that's good enough. A compatible PLC should almost be plug and play vs. a RPi that would need a separate ModBus RS485 expansion board requiring some programming and most likely some difficulty getting reliable communication. You would also need some programming to read the analog mV signal from the shunt and convert it to a proper value then push it out through the RS485 expansion board to the Gateway.
Thanks.
 
I'm using the older model XW+ 6848 with the ComBox, the Pro model is basically the same but with some hardware and firmware modifications related to UL 1741 SA (Rule 21 in CA) Also the network communication device ComBox, was replaced by the Gateway. I opened the PDF Operating Guide and Installation Guide for the Pro here is the description of the Gateway.
"The Conext Gateway is a multi-function communication device that provides an overall
view of system performance for residential power monitoring systems. It also provides a
communications gateway between a network of Xanbus™-enabled devices and Modbus
devices."

That description would indicate the ModBus connections are located on the Gateway device (same as the older ComBox) which also means the translator for ModBus to Xanbus is also located inside the gateway on the PCB. The individual Schneider devices, inverters, charge controllers, batt monitor, gen start, SCP, which is now discontinued, all have only the RJ45 port for Xanbus communications. Its the Gateway that provides the user interface to the Schneider system. I would have to say with high confidence, you do need the Gateway.

Yes, my BMS has an analog input for a shunt.

My goal regarding the high precision, 20bit ADC is to be able to capture the very low stand-by current so the SoC is accurate. Anything less than about 150mA shows as 0 on the BMS. I only use the batteries for infrequent power outages or peak load shaving during flex alerts or rolling black outs so mostly they sit with a small parasitic load that is not accounted for. I have no direct DC charging, its all AC coupled. Secondarily, I have attempted to develop a home brew BMS with the help of contracted engineering support. While I actually do have a functional BMS prototype its full of problems both hardware and software related so its been kind of disappointing.

Cost wise: The RPi programming and WebSocket/HTML CAN bus interface for the ZEVA BMS was about $1,500 as I recall.

The hobby BMS I'm working on including hardware design, PCB layout, PCB fabrication, electronic components and assembly plus firmware development for the PIC18 microcontroller and Nextion touch display, I've spent about $4,000. I suppose compared to many other things its not that expensive of a hobby.
 
I'm not sure Schneider has implemented Modbus over RS 485. I'm using modbus over TCP/IP (from memory that's the correct term), basically I plugged both into my internet switch.
 
I'm not sure Schneider has implemented Modbus over RS 485. I'm using modbus over TCP/IP (from memory that's the correct term), basically I plugged both into my internet switch.
That is a good point. The older ComBox is definitely labeled as a RS485 interface. They probably have in fact upgraded to the more modern TCP/IP protocol.
The key point being that the ModBus connection is on the Gateway not the inverter.
 
I'm not sure Schneider has implemented Modbus over RS 485. I'm using modbus over TCP/IP (from memory that's the correct term), basically I plugged both into my internet switch.
Are you saying that the Conext XW Pro has an Ethernet port over which you can communicate Modbus-on-TCP/IP, or is the Ethernet port on a Schneider Gateway that then communicates with the Conext XW Pro?
 
In terms of my original question about monitoring DC-coupled solar production using a shunt, GXMNow has pointed the existence of these out to me: https://www.amazon.com/PZEM-017-Communication-Interface-Voltage-Consumption/dp/B08TTTXNM7

The PLC I am looking at has 2 analog inputs with 12-bit ADCs over a 0-5VDC range. So if I used a 100A over 100mV shunt, I could in principle read DC current to a precision of 1.23A / 32W.

This would mean having a noise level of under +/-0.25mV on the long analog sense wire I’d need between the shunt and the PLC which is not impossible but not easy.

So a sensor that converts to modbus right at the shunt itself makes much more sense (at least at this pricepoint).
 
I’m using Epever SCCs and apparently they support Modbus readout of current or power output:

So there is probably a way I can avoid even needing a shunt and can just directly get DC power output from the SCCs…

It’s a pretty simple control loop I am interested in since the idea is to invert all incoming DC-coupled power to AC until total power export (including a seperate and ‘lagging’ AC-coupled array) reaches an export limit of 3.5kW (at which point excess DC-coupled power goes to charging the battery until it eventually gets throttled if/when the battery gets fully-charged).

SoI just need a separate 120VAC meter on both L1 and L2 coming in from grid and either a shunt on total SCC output or a way to read output power directly from the SCCs…
 
Are you saying that the Conext XW Pro has an Ethernet port over which you can communicate Modbus-on-TCP/IP, or is the Ethernet port on a Schneider Gateway that then communicates with the Conext XW Pro?
No, that's not what I'm saying.
Please check the manuals.
The only comm ports on the XW are Xanbus. All communication must go through a gateway/insight.

That is a good point. The older ComBox is definitely labeled as a RS485 interface. They probably have in fact upgraded to the more modern TCP/IP protocol.
The key point being that the ModBus connection is on the Gateway not the inverter.
I'm pretty sure there are RS485 pins in the insight, just that Schneider isn't using them yet.
 
No, that's not what I'm saying.
Please check the manuals.
The only comm ports on the XW are Xanbus. All communication must go through a gateway/insight.
I’d actually done that in the meantime and saw that the gateway is needed to communicate with the XW.

Victron is the same (though their gateway costs less than half of Schneider’s) so I suppose it’s the common way to manage open-standards / Modbus communication…
I'm pretty sure there are RS485 pins in the insight, just that Schneider isn't using them yet.
 
Back
Top