Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Measuring AC current output from a VFD

And that’s the lower end of expensive! The manufacturers are really proud of the first few in this list:

Thanks both, I’ve ordered some for testing. Fingers crossed I’ll get some meaningful results out!

I’ve been puzzling over this comment for a while…why would 1.024 be more convenient? Do regulators exist at that voltage, or is that the result of a more convenient resistor ratio? Or is just because of the number of ADC levels? I originally thought I’d use a potential divider to provide a reference voltage, but following your accuracy comments I realise that I’d lose accuracy on the resistor tolerances, though it might be enough for our function

RS Components list NO 1.0 V fixed voltage reference ICs, they list one at 0.9 V (a bit low), two at 1.02 V, and eight at 1.024 V.

But note, you’re probably more interested in the long-term stability of the reference than in the initial accuracy of the voltage – provided of course you have a means to calibrate the system.

The SCT-013-000 has an accuracy of ± 3%, the Ideal AC adapter the same, so you’re immediately looking at a power measurement that could be wrong by 6% before you even consider resistor tolerances, reference voltage, etc.

Is power being measured, or just current as indicated by the thread title? If power, you might also need to investigate what the phase errors do down at 30Hz.

Does the motor just have 3 settings, and you’re just trying to distinguish between them, or do you require a reasonably accurate measurement of current (or power)?

When sizing burden Rs Vs ADC inputs etc. also keep in mind the large in-rush currents you’re likely to see when the motor starts. Here’s a pic of my pool pump starting up…

What I was trying to illustrate was the sort of error that might appear, when low-cost parts are used.

Natasha’s organisation is concerned with promoting smart technology in the developing world, so I was guessing that efficiency and power consumption could be a concern. But I only know what’s written here.

My take on that is you can measure the roll-off at any old current, because it happens somewhat independently of saturation. My calibrator can do some big currents, but only in the 45-400 Hz range. But my signal generator can go all the way down to DC, so I fed that through a 2-quadrant amplifier followed by a few loops through the CT and managed 4A RMS of arbitrary waveform and frequency through the CT. My Fluke TrueRMS meter is only good down to 45Hz, so I used the scope to measure the RMS values from 400Hz down to 1Hz.

Basically, a whole series of captures like these:


60Hz


5Hz

Yellow is the voltage across a small shunt on the primary circuit, just to ensure things were stable.
Blue is the output of an SCT013 feeding a 22R burden.
Green is a signal on the amplifier for monitoring it’s performance and can be ignored.

There was a hint of distortion at 2Hz and …


a definite kink at 1Hz (as well as some serious phase shift), but higher than that it looked very clean.

Here’s how the readings look plotted (I truncated the graph at 50Hz to give a better view of the lower frequencies… it was flat line all the way from 50 to 400):

This is a good point which I admit I hadn’t considered. From our experience, it seems VFDs act as a soft starter, reducing the inrush currents slightly (though we may be wrong here, we just found that a milling machine would work when run off a VFD but not directly off a standard solar inverter).

If the current is too high at start-up, would this lead to damage of any components, or just saturate the core, and so give the maximum reading?

Yes we’re trying to understand the typical power usage throughout the day for monitoring purposes. Its a special variable frequency solar inverter (Grundfos RSI) for driving a water pump, which I’ve been told outputs a constant voltage (though I can’t find evidence of this for sure), at variable frequency and current, to enable the water pump to operate when the total power available from the panels is lower. The VFD currently has no remote monitoring capability, and as the pumps are in Africa and we’re in the UK, being able to monitor vaguely what is happening and understand typical use patterns are important. The kit I’m designing hopes to do that.

Wow this is incredible! Thank you! It amazes me how much effort people go to answer questions on this forum! I’m going to try one of the YHDC sensors and a Magnelab one to compare, though from your graph it looks like the YHDC readings might be ok down to 30Hz anyway.

A quick sanity check: the YHDC sensor cable doesn’t have any screening, right? I read on the open energy monitor website about how when extending a cable, we should use a screened cable. Is that just especially important when the cable is longer, and so there is a higher risk of EMI interference? Or is it good practice to cut back the cable supplied and replace it with screened cable anyway, even if the distances are under 1m? (it’ll be in a room with other inverters and mains frequency cabling).

Maybe. There’s still a chance your much higher currents will saturate the transformer… I can’t manage 30A at 30Hz (yet… there’s possibly an open source calibrator project in the wings).

But is there any chance of 30 At? I’ve done 250 At (from a 6.5 V transformer at 50 Hz, admittedly).

But yes, the graph of the YHDC is something I’ve longed to measure for some time, but I don’t have the facilities. So many thanks for that.

@Natashaxh
The YHDC c.t. cable is screened, but the screen is not connected at the c.t. end, it used to be cut short when the plugs were soldered, I’ve no idea what happens to it with the moulded plug, but there’s no connection on the one I’ve just pulled apart to measure. The screen does nothing. So that a plug can be detected in the socket, we use the plug tip as the ‘earthy’ side and the plug sleeve as the input signal to the ADC – that’s why you must never use a made-up extension cable that has the screen connected to the plug sleeve.

As you’ll be a couple of thousand miles away, it’s probably worth earthing the screen - but that in itself has problems - it’s easy with an emonTx to slip a wire under a screw head, so I suggest a wire from the cable screen outside the plug via a screw head on the case and take it to the GND on the screw terminals. The emonPi is not so easy because the anodising on the aluminium case effectively isolates each part of the case.

Hello Natashaxh,
Have you considered using the ADE9153A SHIELDZ from Analog Devices?
I don’t know it but I read that it performs self calibration…

Presumably, that will require a defined set of conditions, such as the use of a known value of load, or precisely known calibration for the input transducers, so it cannot be completely automatic.

I think it does actually do away with the need for a reference load or a reference meter, or precise knowledge about the value of the “sensors”. It only needs V connected to calibrate, no load is required.

The IC has 3 measurement channels: V, I-A and I-B. I-A is designed for shunts and I-B is designed for CTs. It also has 3 reference signal generators that inject on the far side of the “sensors”, measures what comes back and the result can then be used to tune the gain on each channel.

The V reference signal attaches to the bottom of the R divider and can be used to calibrate out any variation in the divider Rs. The I-A reference signal attaches to the load side of the shunt and can be used to calibrate out any variation in shunt R. The I-B reference signal can be used to feed a current loop which you pass through the CT, alongside the signal you’re trying to measure, and can be used to calibrate out any variation in CT/burden.

The I-B channel can only be used to measure Irms (not power). If you want to measure power/energy you need to use a divider on V and a shunt on I-A. That pretty much does away with the need to calibrate out any phase errors, although the metrology engine does allow for phase adjustment, the auto-calibrate only helps with gain. And that all means lethal voltages everywhere… in fact the GND of the IC is typically tied to Active so it’s not suitable for anyone who doesn’t understand the risks of working with mains voltages.

That shield has all the appropriate isolation between the IC and Arduino, but the scarey end of that shield is live and easily lethal. It looks like they’ve nobbled the I-B channel on the shield so you’re stuck with the V divider and the shunt and can’t easily test how well the CT calibration works. There are a few places where they kinda’ infer it’s designed for 50 and 60 Hz operation only so it may not be a good fit for the OP’s project.

On top of everything mentioned so far, they’re fairly proud of it. 110 USD.

Just been testing this design using a YHDC 30A/1V sensor, or a 100A YHDC sensor, or 50A Magnelab to calibrate it before using on a VFD. (there’s the option to include or remove a jumper cable depending on the need for a burden resistor). The sensor is plugged in via the 3.5mm breakout, the output goes into an MCP3008 before HSPI connection to an ESP32 with wifi enabled.

Though I don’t seem to be getting a linear response for any of them which I don’t understand. The MCP3008 should be giving a linear output and the sensors should be linear for a solar inverter output? I’m using a forked EmonLib library with callback method, enabling use of external adc (GitHub - PaulWieland/EmonLib at 4a965d87061c19ad8b0a35bb173caada014ecbd9)

To give some context, the amount of non-linearity is like this:
For the YHDC 30A sensor with calibration constant 30A, I measure 10.78A when it should be 8.1A, and 14.93A when it should be 21.1A. (ie. I’m measuring both above and below the true reading at different points in the range, which doesn’t allow for a linear calibration constant). The zero reading is 0.06A
For the 100A, I measure 9.55A when it should be 7.3A, and 12.8A when it should be 15.5A. The zero reading is 0.26A
The Magnelab sensor is slightly closer to linear from the values I could test. At least it doesn’t go from over to underestimating in the range I tested. (5.4A measured when it should be 6.8A, and 11.3A when it should be 21.7A).

Was this level of non-linearity to be expected? Or can you see something wrong with my wiring or that code which could have caused this to happen? I wonder whether noise could also be causing the non-linear readings? None of my sensors are shielded at the moment.

I can’t see anything obviously wrong with the library you’re using (but then I have not studied it line by line and in great detail) and unless there’s an overflow or something like that not apparent at a first glance, it’s hard to see where a non-linearity could creep into the software.

What I’d do is plot the actual and measured current in reasonable detail over the range you’re interested in, to see what the shape of the curve is. That should give you some clues.

We always expect a c.t. to be non-linear to some extent - it’s inherent in the way the magnetics work (CT Theory 3.pdf (54.8 KB)
or you can turn to any decent text book, no doubt on-line too) but even without roughly plotting your numbers, it should be nowhere near that bad. Using a true rms multimeter on the current range, the non-linearity of most c.t’s is better than I can measure with any confidence.

Just realised I also made some mistakes with what I was measuring off the inverters so its likely much better than that. Will test again tomorrow.

As for measuring off a VFD at another site, I couldn’t get the digital clamp meter anywhere near the wires without it measuring currents up to 12A in thin air (i.e not clamped over a wire, and with the load switched off!) so evidently the noise from the VFDs is much worse than anticipated and it doesn’t look like my solution will work. Will do some more testing and see if I can shield my cables any better, but not feeling very optimistic.

My first thought is to suggest a balanced input ADC, or a proper “instrumentation” balanced input to a single-ended ADC, which will assure equal impedances on both legs. With very careful circuit design and equally if not more importantly, board layout, that should give a significant improvement.

You might want to rewire the SCT-013 c.t’s: As far as I’m aware, the screen is unused, the twin (I assume twisted) cores connect to tip and sleeve. Much better would be to use the sleeve as a ground for the screen, and use tip and ring for the balanced input.

If you’re thinking about filtering and measuring real power, bear in mind the phase shift that a filter will introduce, and you need to introduce exactly the same into the voltage.

I think some reading up of application notes is required. :wink:

You might want to consider something like this:

Documentation: WattsOn_Manual.pdf (757.4 KB)

Often available at very resonable cost (this one is 40 USD) accurate and uses widely available
333 mV CTs.

I thought I should post an update in case other people face a similar situation in future.

I’m happy to announce that the CT sensors actually worked really well measuring currents from the VFD. I tried both the YHDC sensors and Magnelab sensors, and they don’t seem to be affected by the VFD noise. The theoretical calibration constants gave an accurate reading when compared to a calibrated analogue meter, performing much better than the digital multimeter which was giving completely spurious readings.

We’ve installed it on one phase going to a milling machine at one of our solar sites. The data is being sent to ThingSpeak here, which allows us to remotely monitor rough power consumption, and when the machine is being used: https://thingspeak.com/channels/1552034

I tried shielding one of the Magnelab sensors but unfortunately the 3.5mm breakout board broke off so I didn’t get to test it. It doesn’t seem like shielding was that necessary in our application though (Surprisingly as it is definitely a noisy VFD environment judging by the digital multimeter).

Thank you everyone for your help so far! Still lots more learning and reading up to do for further improvements! Code is here for anyone that wants it, and the circuit diagram is shown above. https://github.com/nasherxh/ESP32CurrentSensor