Setting Up emonTx Shield for Mk2 PV Diverter

Hi all,
Have completed assembly of my emonTx Shield & it is now attached to Arduino.
Have run minMaxAndRangeChecker_2 just to see everything is working as expected - it is.
Having recently received various power supplies & current transducers from OEM shop I have spent this afternoon playing about with the range checker.
Shield & Arduino powered from separate 9V power supply (from shop), using standard current transducer, USB cable from Arduino to laptop for serial port connection. I also have separate Eco Eye display measuring consumption & PV generation.
Attached is a text file showing my results.
Below & some comments, questions & observations regarding this data:-

1) With no inputs or connections (apart from power) both voltage & current seem to be centred fairly near the 512 were aiming for. Both are stable & don’t drift from this value (current especially stable). After playing about & returning to this configuration both inputs returned to these values.
I assume it does not matter that neither is centred exactly on 512 or the fact that they are both centred on slightly different figures (& hence DC bias). From what I seen of the main diverter sketches the DC bias is calculated separately (for voltage & current) & subtracted from these values   -  we are only concerned with the waveform alternating about these centre values.
2) With both inputs connected but no signals applied the voltage line seems to pick up a slight bit of noise – the current input is stable.
3) Voltage input & no current input – current input stable & no noise pickup.
4) Voltage & current inputs – various loads.

Voltage Measurement
My 240v voltage signal seems to give a measurement range of about 600 ADC steps out of the available 1024 – surely it would be better to increase this range for better resolution & accuracy. By increasing the resistor in the voltage divider I could increase the measurement range up to about 800 (for instance). I understand that the voltage is allowed to vary a bit & the effect of component tolerances but the voltage basically does not vary by much from its 240V.

Current Measurement
I was frankly quite disappointed with my current measurements. At a 4kW load my measurement range was only 152 units! I know the value of the burden resistor has been worked out using a max current of 100A but in my house I will never use that amount of current. On my setup I am only interested in the amount of power generated being sent to the grid. (I have separate monitoring system) I want to accurately measure only the first 4kW being sent to the grid. I am not worried about the times when I consuming 12kW. For me the first 4kW needs to be accurately measured to determine whether it is being consumed or produced, anything above this figure must be consumption ( I can only produce 3.7kW max theoretically).
Obviously I could increase the burden resistor value from 33R, this could increase the measurement range for the first 4kW up to 800 units but there would come a point at really high currents when the Arduino input would go above 5V pk 2 pk (1024units).
What is max ADC input voltage the Arduino will tolerate without burning out?
Could I do anything with zener diodes to limit the maximum output voltage of current sensor?
The current sensor supplied already has x2 zeners attached to limit output voltage to 22V, if I add another couple to limit the max output voltage to just over 5V I could choose a value of burden resistor to allow accurate measurement of first 4kW anything above this is just consumption.
Has anyone any thoughts on this or even tried it.
The above musings are probably for future development & experiment; I intend to set up this shield in the normal configuration & manner. What do I do next in the set up? How do I calculate PHASECAL, POWERCAL & VOLTAGECAL

Robert Wall's picture

Re: Setting Up emonTx Shield for Mk2 PV Diverter

The place to look for detailed information about protecting the processor input is of course the manufacturer's data sheet.
The absolute maximum voltages are -0.5 V and VCC + 0.5 V. Outside that, the built-in protection diodes are limited to 40 mA. Therefore, you need to hard clip at -0.5 V and VCC + 0.5 V, or you need to current limit the input. The latter is the most practical solution and by including a low-ish value series resistor in the input circuit, you will achieve that. In practice, the bias resistors and decoupling capacitor seem to provide enough impedance.

If you increase the burden resistor, you need to stay within the VA rating of the c.t, else you will start to hit saturation that will lead to inaccuracies.

(Note: your input range will be slightly less than 1024 units due to resistor tolerances shifting the midpoint voltage, and the maximum UK voltage is 253 V.)

If you look at Building Blocks, you'll see how the calibration constants are derived, but due to the difficulty in establishing exact values for every significant component (including the internal voltage reference), the accepted method is to calibrate the voltage against your multimeter, then phase to obtain unity power factor on a resistive load, then finally current by comparing power against your tariff meter.

calypso_rae's picture

Re: Setting Up emonTx Shield for Mk2 PV Diverter

Delighted to hear that you've made use of my standard checker program and that you're getting good values from your rig.  From the various CAL values you've mentioned, it sounds like you're intending to build a Mk2 PV Router. 

For this application, if you use a burden resistor of 150R, your system should then be nicely scaled for around 4 kW maximum.  If you want a bit more safety margin, you could drop this value to 120R.

Technically, these higher values are using the CT outside its recommended operating limits, so it will not be working quite as well.  What you gain, however, is that you'll be using a much greater portion of the ADC's input range.  At low levels of power, your signal will then span more ADC levels, hence the quantisation distortion will be much less. 

For more critical applications, where phase-shift is more relevant, it may be wise to keep the CT's output signal small by using the 18R burden.  But for a PV Router, I would recommend using a higher valued one.

Although the emonTx Shield has no protection diodes, I don't think you'll have any problem with over-current.  We regularly use an 8kW electric shower, and the system always springs back into life when surplus power returns.  I can only presume that the Atmega's inputs are adequately protected against overvoltage.

In my various Mk2 sketches, VOLTAGECAL is only used for determining when it's OK to arm the trigger.  A much easier way to do this is to only enter the relevant code block when samplesDuringThisCycle == 3 (or any other suitable number).  Then VOLTAGECAL need not be used.  This simpler arrangement works fine, but I can't now recall in which sketch(es) it appears. 

calypso_rae's picture

Re: Setting Up emonTx Shield for Mk2 PV Diverter

Yesterday, I mentioned that there's a simpler way to determine when it's OK to arm the trigger.  This just requires an existing counter to be checked rather than a floating-point calculation being performed every time around the loop.  I thought I'd already posted some code which includes this mod, but maybe I haven't.

The technique certainly works.  Here's an extract from a sketch that I've used at home:

      // still processing POSITIVE Vsamples ...
      if (triggerNeedsToBeArmed == true)
      {
        // check to see whether the trigger device can now be reliably armed
        if(samplesDuringThisMainsCycle == 3) // should always exceed 20V (the min for trigger)
        {
 

By the time that the third set of samples is being taken within each new mains cycle, it can be guaranteed that we're far enough into the cycle so that the trigger can be safely armed.  Hence there's no need to consider the state of the AC voltage.  For this application, which only involves the measurement & control of "real power", calibration can conveniently be done on the basis of power alone, rather than voltage and current separately.

 

Comment viewing options

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