Solar Power Divert with no voltage readings

In discussion with pmcalli on the forum about using a synthetic sine wave for voltage readings combined with a zero crossing detector circuit, for the purpose of solar power divert (aka robins mk2 PV controller) - if this works, then you wouldn't need a relatively expensive transformer - almost anything will do that reflected zero crossing points accurately.

The link below to code:

https://github.com/stuartpittaway/SolarPowerControllerNoVoltage

Purely for experimental purposes!

Feel free to discuss.

calypso_rae's picture

Re: Solar Power Divert with no voltage readings

Interesting.

If you don't have a physical transformer, you won't know what voltage the mains is running at.  Variations of mains voltage will obviously affect the power that is drawn by the dump load.  A 3kW load will only draw 60J per cycle if the mains voltage is precisely 240V AC, which it seldom is.

Having said which, for the specific purpose of diverting surplus PV power using the Mk2 algorithm, this variation may not matter.  The sole aim of the algorithm is to maintain the net flow through the meter at zero.  This is essentially done by balancing packets of current which flow first one way and then the other.  Any errors that are introduced by using the nominal voltage to calculate power rather than the measured voltage may well cancel out as energy is imported and exported.

Has the op amp stage for detecting zero-crossing points been posted anywhere?

 

 

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

Interesting II.

From what I've seen, most transformers (which you will need unless you have a direct mains connection with all the safety implications that accompany that) show a shift of the zero crossing point as the first sign of voltage waveform distortion. So using just the zero crossing might not help very much, if at all - except of course it makes it easy to trigger an interrupt routine.

calypso_rae's picture

Re: Solar Power Divert with no voltage readings

A couple of correspondents have mentioned using an Eco Eye Smart PV monitor.  This has a voltage sensor which is wrapped around any cable that is permanently live. 

Voltage is "adjusted" by changing the nominal value of 240V either up or down.  It may be that this sensor is being used to establish the zero-crossing points, as is being discussed on this thread.

Instruction manual attached.

richmc's picture

Re: Solar Power Divert with no voltage readings

Would it be more likely to be for phase reference so the device knows if you are importing or exporting?

calypso_rae's picture

Re: Solar Power Divert with no voltage readings

Yes, I think you're right.  Maybe this idea would be worth looking at as an alternative form of voltage sensor.  It would be ac-coupled, and would no doubt have some phase-shift, but that could easily be accommodated in the software.

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

It sounds as if it's a capacitive potential transformer - yes, I know that appears to be a contradiction in terms, but that's what they're called. They are common on high voltage systems. It is simply a voltage divider made up of capacitors. The 'top' one is very often a bushing or something like that. I briefly looked at how practical a home-made one would be - a few inches of aluminium foil or an insulated wire wrapped around a meter tail would be the 'top' capacitor, and the bottom one would be an ordinary component. The input impedance of the Arduino is sufficient, but the problem is getting a high enough impedance bias to set the input in the middle of the range. And then the combined bias and input impedance make a nice phase shift as you say, so you're no better off. If you include op-amps, you may be able to get round that problem with a bit of boot-strapping, but I purposely excluded that approach as I was thinking pure emonTx.

stuart's picture

Re: Solar Power Divert with no voltage readings

Although I wrote the software, pmcalli has been testing it out and building a circuit around it.

So far, hes reported that its working very well.  Just waiting for some log files to be sent over.

For the zero crossing detector, I simply used a OpAmp comparator against the voltage readings to trigger near 2.5v, although there are plenty of other methods for doing this on the web - perhaps going back to using live mains and a opto-coupler would be a better move - obviously with care for safety.

 

pmcalli's picture

Re: Solar Power Divert with no voltage readings

interesting idea the capacitive probe. will detect peak voltage not zero cross though and with all these computers flat topping the mains it might have a slow zero cross at peak mains. will get the kitchen foil out and try it.

stuarts code with the synthetic voltage seems to work fine I now have a full tank of hot water.  it needs phase correction adding ( just a delay starting the measurement cycle in this case )  and testing under power factor loads when corrected.

 

plot attached

pmcalli's picture

Re: Solar Power Divert with no voltage readings

try again

pmcalli's picture

Re: Solar Power Divert with no voltage readings

zoomed in trace when no excess loads switching but solar increased by 1kW

calypso_rae's picture

Re: Solar Power Divert with no voltage readings

Paul, in your zoomed-in trace, between 1:10 and 1:18, there appears to be around 40W of export taking place.  I think this may be a consequence of using synthesized voltage data. 

Whenever your dump load is on, it will reduce the mains voltage to some extent.  In my house, it's around 1% for a 3kW load.  Unless the instantaneous voltage is actually measured, power contributions at such times will be correspondingly over-estimated.  A tendency to leak power to the grid is the predictable consequence, this effect being undetectable with a digital supply meter because the LED will be on anyway in 'anti-creep' mode.

As conditions change, so will the rate of firing, and also the rate of leakage.  This can't be offset by a single safety-margin factor.  The unknown but finite impedance of the mains can only be accommodated by actually measuring the mains voltage.  That's what the supply meter does, and its the flexibility of the supply meter that we're trying to work with.

Monitoring the meter's pulses has to be a useful thing to do.  My cut-down Mk2 sketch can do this, the sensor being just three components.  The fun bit is how to incorporate knowledge about meter activity into the algorithm.  If a pulse is ever seen while  power is being diverted to the immersion, that means that the measurement system has clearly drifted w.r.t. the meter, and some remedial tweak could usefully be done at that point.

pmcalli's picture

Re: Solar Power Divert with no voltage readings

Robin  firstly the trace was taken with a fluke 345. for some reason it does not like burst fire despite claiming to average in complete cycles. the system was not corrected for phase and I measured this with my analog power meter which shows 20W of export corresponding to the phase error between voltage and current  . the rest of the export shown is due to the misreporting of burst fire by the fluke. In phase control measurements the two agree. the same effect is seen with your mk2 sketch. as proof the anlog power meter is reading correctly I have tweaked the phase of the voltage pick off to cause a small import and the analog power meter records the same import as the meter.

I accept your argument that the power measurement (when the triac is on) is 1% higher due to the voltage drop. The system is trying to balance the power so integrated power is zero therefore I would postulate that the biggest effect is at the lowest power to the immersion ie the biggest difference measured between on and off. if we say 3 seconds is the lowest power able to fool the digital meter ( its longer for a disc meter ) then the biggest ratio is 150:1. this means that the error would be 150/149*error ( 1% of 3kW) which is pretty close to 30W. at half power +1.5kW is measured when the triac is on and -1.5kW when its off so error now 15W and gets smaller as the power rises. I have assumed of course that the voltage has not changed during the 3 seconds other than the triac going on or off. As the effect is to export more if your mains impedance is poor and the numbers are so small I suggest its not worth worrying about.  the errors due to poor current voltage phase alignment are ten times bigger and could produce import at least in a disk meter with no anti creep to exploit. please feel free to throw rocks at my analysis.

 

on the capacitive voltage pick off I built a zero crossing detector fed from a piece of tin foil wrapped around a power line and it produces as expected a transition at the peaks of the voltage 90 out of phase with the zero crossing. this wouldn't be a problem to use as an interrupt to stuarts code as only the table of voltages would need to be changed. however now the bad news my mains is flat topped due to too many computers with rectifiers  in the area or a saturated transformer I suppose and this means it shifts the transition back in time on one half cycle and forward on the second half cycle. for the eco eye I don't suppose that this is a problem as its probably not speced for poor power factors. but for us it would mean the timing would vary in accordance to how flat topped the mains was. Best solution I think is to use a zero detector on the mains with an opto isolator as they only cost pennies and could be incorporated in the triac firing circuit.

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

pmcalli

"the capacitive probe will detect peak voltage" WHAT? ? HOW?  Justify!

"on the capacitive voltage pick off I built a zero crossing detector fed from a piece of tin foil wrapped around a power line and it produces as expected a transition at the peaks of the voltage 90 out of phase with the zero crossing."

It shouldn't do that - it sounds as if you've left out half of the divider chain! A circuit diagram of what you actually have is required.   I've just quickly thrown together a simulation with a bootstrapped op-amp and it follows the input waveform exactly with about ½° phase shift.

pmcalli's picture

Re: Solar Power Divert with no voltage readings

robert

               didn't think about it much so its almost certainly wrong. I just wrapped a piece of foil around a live wire and fed it into a non inverting input of opamp with 100k to deck on biploar supplies so it looks like its really measuring leakage I suppose but that doesn't sound right either. what circuit have you proposed two contact arrangement?

calypso_rae's picture

Re: Solar Power Divert with no voltage readings

pmcalli: the errors due to poor current voltage phase alignment are ten times bigger and could produce import at least in a disk meter with no anti creep to exploit. please feel free to throw rocks at my analysis.

The purpose of the PHASECAL calculation is to correct for any misalignment of voltage and current.  Once setup correctly, there should be minimal error from this source.

pmcalli's picture

Re: Solar Power Divert with no voltage readings

The purpose of the PHASECAL calculation is to correct for any misalignment of voltage and current.  Once setup correctly, there should be minimal error from this source

there you have it " once set up " I agree you can remove the time error between current sample and voltage sample  and characterize the advance from the CT but the voltage samples coming from the transformer will move with everything you can think of unless you buy a specialized transformer ( expensive) . If you are operating in a power factor of 1 environment you wont have a problem but its becoming common place to fit things like heat pumps combined with solar and my experience ( very limited ) so far is they have very bad power factors hopefully this will change as the market matures or domestic installations are more regulated.

ericw's picture

Re: Solar Power Divert with no voltage readings

Using a capacitive pickup gives a voltage about 90 degrees out of phase with the mains. It also exaggerates any high frequency spikes on the mains waveform.

However if you are just using it for phase/zero crossing detection with suitable delay it doesn't need a mid rail bias circuit but can be taken through a small current limiting resistor to an input. A pair of diodes to the supply rails to limit the voltage swing is advisable rather than relying on the internal ESD protection diodes.

 

pmcalli's picture

Re: Solar Power Divert with no voltage readings

robert ericw

 

now I have had a chance to think about Roberts comment and read his earlier post more carefully. I think I see that what I should have done was capacitively divide ie foil wrapped around conductor with a small cap connected to it and ground and then feed into high impedance op amp. the cap will have to be small and the op amp i/p impedance very high but it will be in phase. can you confirm robert and do you have any suggestions for parts.

you also stated that arduino inputs are high impedance don't be fooled by the spec of 100M ohms its misleading because of the adc sample and hold so source impedance of no more than 10k is recommended

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

pmcalli

What you had was the classic RC first order filter. OF COURSE it will show a 90° phase shift. Think of a standard resistive potential divider and replace the resistors with capacitors, bearing mind capacitive impedance is proportional to 1/C, so the biggest value is at the bottom.

You end up with something like this (attached).
NOTE: this was quickly thrown together. It needs properly checking. It's set up for 1 V p-p swing into a 1 V input. The op-amp is bootstrapped and should happily drive the input. Bootstrapping of course means that the choice of op-amp is less critical.

stuart's picture

Re: Solar Power Divert with no voltage readings

Just for my benefit + understanding.

The "capacitive potential transformer" is using the copper in mains cable as one "plate" of the capacitor, the insulation on the cable as the insulator and then the alu foil the other plate.  Which is then connected to a "real" (low value) capacitor and ground/earth.

This then generates a voltage which is proportional to the AC wave voltage?

stuart's picture

Re: Solar Power Divert with no voltage readings

Robert, I've copied your circuit into CircuitLab, link below if anyone wants to try it out online...

https://www.circuitlab.com/circuit/9g7fj8/capacitive-p_t-bootstrapped/

Just press F5 to re-run the simulation when you are in the editor.

calypso_rae's picture

Re: Solar Power Divert with no voltage readings

Sorry, Robert, could you remind me what "bootstrapping" means in this context please?

pmcalli's picture

Re: Solar Power Divert with no voltage readings

stuart

                its the other way up on a capacitive divider the highest voltage is developed across the lowest capacitance. so to divide the voltage of 240 V to a few volts cap in the bottom needs to be many times the cap of the foil which is only a few pf. should have known this stuff from designing high voltage power supplies where if you get an air bubble in the potting compound it looks like a small cap develops all the voltage across it and sets up a plasma which burns its way through the potting. its worth a bit more experimentation thanks for the circuit robert

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

stuart

Exactly. The 15 pF capacitor is the one that uses the cable as one plate, the insulation & sheath as the dielectric and the foil as the second plate (add or remove foil to trim the value, but don't cut into the cable!). But the "real" (bottom) capacitor isn't low value, it is high value (low impedance). If it was a resistive divider, the ratio would be 100 k (top) and 1.2 k (bottom) (say), using capacitors it's 15 pF (top - high impedance, about 212 MOhms) and  12 nF (bottom - low impedance, about 265 kOhms).

N.B. there's no way you will get a dangerous current through a 15 pF capacitor. I got that value as being roughly a few cm of cylindrical capacitor with the same dimensions as a meter tail. If you get more capacitance than that with your foil, increase the 12 nF to reduce the output voltage and compensate. If you use screened cable, reduce the 12 nF to compensate. All values will need tweaking to get useful results!

If you need to generate an interrupt, you feed the op-amp into a normal level detector or whatever. If you want to use it as the voltage reference, then it's usable as-is.

calypso_rae

It is raising the effective impedance of the 330 kOhm resistor artificially by feeding the opposite end from the signal with the signal voltage (nearly) taken from after the amplifier (via the 10 uF), so that with the same signal at both ends, no current flows and the impedance is close to infinite. So the signal, rather than being pulled down by that resistance, is pulling itself up by its own bootlaces through the action of the amplifier. Note it is crucial that the amplifier has a gain of less than unity, which is the case with the follower configuration (and no, the gain isn't exactly 1, though a lot of texts say that - it is fractionally less, and that allows the configuration to work and not be unstable).

ericw

Sorry, but you're barking up the wrong tree.

pmcalli's picture

Re: Solar Power Divert with no voltage readings

progress update

Stuart and I have updated the sketch to extend the voltage table to correct for phase difference between voltage and current this is now simply done by offsetting the index of the table by up to +/- 1 cycle with a resolution of 100uS (1.8 degrees ) you can have any resolution you like by extending the table. one of the digital outputs is now set at start and stop of measurement so that you can see what's going on with a scope which has revealed an anomaly between the measurement interrupt and the zero cross which in debug mode shows as extra noise in the power reading. adding a small delay at zero cross removes the noise but i am confident Stuart will find the real reason shortly. noise with the delay is under 1W and readings can be taken at 200 samples per cycle even in debug. any amount of code can be added outside the interrupt handlers without affecting measurements very nice well done Stuart.

I have been delving in the past for a suitable simple zero cross trigger. it doesn't have to be exactly at zero just before is good as long as its constant. I found a sync circuit we used in 1976 for syncing the mains via an interrupt to a 4040 ( no jokes or abusive remarks please ). I also found a similar circuit on dextrel but for all zero crossing rather than just positive or negative. bit of a mash between the two and he presto here  is a super zero synch which can be used on mains ( 110 or 240) or transformer ( value change ). it produces an opto isolated pulse with an edge about 1ms in advance of zero cross. it is almost immune to temp and voltage value. it needs a few hundred ms on start up to synch but there after its rock solid. I think I will be using this circuit as the cost is very small low voltage components for all but the input resistors and opto plus completely safe once built. circuit attached.

ericw's picture

Re: Solar Power Divert with no voltage readings

Robert

What happens during the negative half cycles in your circuit.?

Presumably as the output of the op-amp cannot go below the negative rail, it comes out of bootstrap mode and C2 will be slowly charged through R5 until the opamp input no longer goes negative. This however will give you an output which will be dependent on the magnitude of the mains voltage with it's negative peak 'clamped' to ground rather than having the zero crossings at a fixed voltage.

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

What happens during the negative half cycles in your circuit.?"What happens during the negative half cycles in your circuit.?"

Much the same as during the positive half cycles, but 10 ms later and the other way up! ! ! ! ! ! !

If the op-amp output gets too close to either rail, feedback action fails and that's another story. The general idea is to not overdrive the input. Are you forgetting that the values are intended for use with a 1.1 V reference and therefore the input peak-peak swing should not exceed this?

ericw's picture

Re: Solar Power Divert with no voltage readings

In the absence of leakage in the capacitors would you not expect the voltage at the tap to be swinging symetrically about ground. ? This would be regardless of the magnitude of the signal. Until some DC bias has been generated on C2 the opamp will not be able to track negative half cycles.

Robert Wall's picture

Re: Solar Power Divert with no voltage readings

"In the absence of leakage in the capacitors would you not expect the voltage at the tap to be swinging symetrically about ground?"

Yes I would, in the absence of a connection to the 0.55 V bias supply via R3.

"Until some DC bias has been generated on C2 the opamp will not be able to track negative half cycles."

And how long do you think that takes from switch-on? (To within 0.7% of the final settled value is good enough).

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.