Measuring AC current output from a VFD

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