It might be useful for someone with a bigger Victron system. The inputs to the node should be self explanatory. The output on msg5 (was my 5th output) sets the ESS maximum feed in. This limits the export preventing the high 'push back' voltage.
Code: Select all
var feedIn = context.get("feedIn")
var vDiff = 250-voltageIn
var gridDiff=feedIn+grid
var correction =0
if (vDiff<0) {
// Greater than the voltage we want. make a big correction
feedIn=feedIn+vDiff*800
} else if (vDiff>.55 && gridDiff<500 ) //.55 stops continued hunting due to viltron discrete steps of 100watts on feed in.
{
// Creep up on the export figure from below. Can go faster at the start.
correction=(30 *Math.pow(vDiff,2))
feedIn=feedIn+correction
}
//node.warn(feedIn+":"+vDiff+":"+gridDiff+"c:"+correction)
feedIn = clampValue(feedIn, 0, 13000)
context.set("feedIn",feedIn)
msg5.payload=feedIn
In node OnStart you will need to set your initial export figure.
Code: Select all
context.set("feedIn",5000) // Initial allowed export of 5000