Community
OpenEnergyMonitor

OpenEnergyMonitor Community

Measuring AC current output from a VFD

Hi all,

I’ve been looking to use a EmonTX-type set-up to monitor AC currents coming out of a VFD. I originally thought I’d be able to use a CT sensor and the same code but a little more research has come up with a number of potential challenges.

  1. The frequency range of a VFD. Our VFD operates at frequencies as low as 30Hz. I understand CT sensors don’t work at low frequencies due to saturation of the iron core. Would this frequency still be ok? And would the EmonLib library still work, or is the method of current calculation dependent on the frequency being 50-60Hz (this is what my research seems to indicate, I just wanted to check). In which case, if I adapted the code, is this approach vaguely feasible?

  2. The VFD outputs a simulated AC signal, from PWM voltage. The current is smoothed by the motor inductance (which the VFD is driving), and I was hoping this would be close enough to a sine wave for us to measure relatively accurately. I know that due to the slightly jagged shape, I need to use True RMS. Does this existing EmonLib code use True RMS, or will I need to write my own code? I’m intending to low pass the CT output with a capacitor, as recommended elsewhere on this site, with a 10uF capacitor to ground. Reckon that’d be enough?

  3. I’ve read that VFD output conductors are unshielded at the point where I’d be measuring them, resulting in extra noise and interference. Some people said meaningful measurements from a CT were impossible to achieve, but one guy said they wrapped the cables with brass foil and soldered a short braid between foil and the cabinet ground rail, which worked. I don’t think my understanding of EMI shielding is good enough that I’d be able to diagnose and fix this in practice. Any tips on how to reduce noise would be amazing. I was just going to have the microcontroller fixed to the wall near the cables, with the CT sensor clamped over the cable.

(For context, the VFD we’re using is a Grundfos RSI. We could measure at the inputs to the VFD instead, as this may be more accurate and less noisy, taking DC voltage and DC current measurements, but I’ve had a whole host of other challenges there, which I’d love to discuss if anyone is knowledgeable. My technique for measuring DC voltage was to use a potential divider, which I’m concerned is not electrically isolated and the voltages could be up to 1000V. I’ve also been having struggles working out how to safely and effectively connect to the ACS hall effect current sensor. See ACS770 Hall Effect Sensors - #16 by Natashaxh )

1 . I don’t have the facilities to test a c.t. down to 30 Hz. I think it’s reasonable to assume that the YHDC devices that we normally use would exhibit a roll-off at that sort of frequency, I cannot speak for other manufacturers/types, but I suspect some will be better than others (especially those containing more iron!). I think a trawl through manufacturers’ data sheets will be in order - maybe some emails as well. In the past Magnelab (US, and quite expensive) have been very helpful.

2 .

Yes it does

I don’t think that comes from an official source (link please if you can) and I certainly wouldn’t recommend it, it will introduce a significant phase shift if nothing else.

3 .

I think that will very much depend of the bandwidth of the c.t.

I agree with your concerns. It is possible to obtain an isolated d.c. measurement, but tends to be cost-prohibitive for most people. As for measuring the current, that should be relatively straightforward. I’ve read your note to Dan (I’ve been advising him too) and I suspect the way to address those concerns is to have a mounting plate made from thick Paxolin or equivalent, with a couple of holes drilled, through which you have a couple of brass bolts with nuts & washers. You then need some copper braid (as used for car battery earth straps) and the requisite number of crimp or solder lugs, so that you can terminate the fixed cables to a bolt, then use the braid from there to the ACS sensor.

There’s no difference, when you think what the rms value means! :wink:
The CSA you need will depend on the installation conditions and the protection it has (like every other cable). Protected by a m.c.b. or a current-limited source and in conduit, it might be 10 mm², also in a thermally insulating wall it could be 16 mm².

Thank you so much! I wish I’d reached out to you earlier when I was first struggling with the solar monitoring project I’m working on. (Your resources and other forum responses have been a lifesaver so far, thank you)

I’ll do more research based on your recommendations. I was tempted to try the cheap CT sensors I’ve got with the EmonLib code, as its pretty straightforward, and I think for our purposes we don’t necessarily need accuracy, just a way of monitoring when the motor is operating at high vs low power, or when it is off. Although googling frequency responses, as you recommended, made me come across this report (written by you it seems?!), and the appendix seems to indicate the YHDC CT sensors fare really badly with an imperfect sine wave, which I expect the VFD current will be :frowning: It also raises the point that I won’t actually be able to accurately calibrate the CT sensor reading even if it is reliable, as I only have a budget clamp ammeter to compare with, which is unlikely to give accurate readings for an imperfect sine wave. Looks like my sensing will be very vague indeed, but hopefully still be able to show relative power increases/decreases…

I’m sure I read somewhere (perhaps the GitHub description) that EmonLib was written for 50 or 60Hz, but your comments seem to indicate this isn’t the case. Is 50-60Hz optimum measurement frequency due to the time period over which samples are averaged, but lower frequencies would still work?

The low pass filter capacitor I was referring to was C1 on this page ( though I might have misinterpreted it. I thought capacitors from a measurement point to ground tended to filter out high frequency noise. Learn | OpenEnergyMonitor

Thank you for the recommendations for mounting an Allegro bi-directional current sensor. To confirm, do you mean you’d connect both the solar cables, and the copper braid to the brass bolts mounted in Paxolin, but have ACS sensor, microcontroller and other components on a separate PCB? (And then both mounted in a housing box of some form). The forces from the copper braid on the sensor legs would be much lower because of its higher flexibility than traditional cables. But surely the copper braid would still need to be relatively thick to carry the high currents? I might just being overcautious in wire sizing as it’d be a short distance, but for a copper braid rated for 63A, this site seems to indicate I’d end up with a 10mm wide braid, which is significantly wider than the legs of the ACS sensors. How’d that connection work?

Thank you! (And feel free to stop replying if these questions are too much. I’m amazed people give up their time to help strangers online in this way).

You have indeed misinterpreted it. That capacitor is anchoring the “earthy” end of the c.t. to an a.c. ground that sits at half-supply voltage d.c-wise. The output to the ADC is the other end of the c.t., and that’s definitely not filtered.

It was - because few people ever use anything other than 50 or 60 Hz. And it will work at different frequencies (not the 3-phase PLL sketch though). The main limitation is the number of samples per cycle. emonLibCM (if you don’t use the stock sketch) does one sample every 104 µs, so if you have just one voltage and one current, it does a sample pair in 208 µs. If you want to measure (say 4 samples - in theory, you only need two) per cycle at the highest harmonic you’re interested in, that makes one cycle 832 µs long, or the harmonic frequency is 2.26 kHz – you haven’t said what the max. frequency out of the drive is, so I can’t tell you which harmonic it represents.

You will need to put the sensor on a PCB, using thick copper, and I would solder the braid direct to the copper pads. If you could take the braid right up to the pins, that would be better. Then fix that PCB to the insulation carrying the studs. As you rightly surmise, the point of having the braid is flexibility, and the bolts are the strain relief providing a solid anchoring point for the fixed wiring. The whole lot needs to be enclosed, obviously.

The limiting factor is temperature rise. If there’s no insulation on the braid, it can run much hotter than if it is insulated - in exactly the same way that busbars can run a lot hotter than any cable can.

On point: The ACS714 is rated at 50 A d.c or peak a.c. (so if it’s a pure sine wave, 35.35 A rms).

There’s nothing to stop you (and you probably should) calibrating the c.t. on a nice clean mains current, then transfer it to the drive.

Thinking a little more about the ACS714 - it’s surface mounting, so if your fabrication facilities are up to it, you could fix two copper bars to an insulating sheet, leaving a gap obviously, and bolt the lugs on the main cables directly to the bars. The ACS714 would need a PCB for the low-voltage side that would need fixing at the same height as the surface of the bars, so that you could fix it in place and then solder the high-current legs to the copper and the low-voltage side to the PCB.

A little more fact-checking and I can quote a Magnelab c.t. data sheet:
“Split-Core AC Current Sensor SCT-0750

Features:
• Rated input up to 200 Amp • Operates from 30 Hz to 1,000 Hz”

[My emphasis]
One of those should give a reasonably accurate representation of your stepped sine wave.

And yet another edit. Some time ago, I did some tests for Robin Emley as he was concerned that his Mk2PVRouter wasn’t accurately recording the first cycle when the dump load was switched on. Here’s the waveform I got with a SCT-013-000 and two widely spaced half cycles. The lack of l.f. response results in the offset after each pulse, which slowly decays away. Were the c.t’s response to extend down to 0 Hz, that wouldn’t happen and the “zero” line would be straight, along the time axis.

Ah yes I see it now. Thanks for correcting me.

Just checked, and the VFD won’t operate above the operating frequency of the pump, which is 50Hz, so well within the software and hardware capabilities. I’m actually using a forked version of the EmonLib code (I’m using an ESP32 for WiFi functionality, but the inbuilt ADC isn’t linear, so I’m using an external MCP3008 which requires a callback added to the original library).

Ah, I didn’t spot that. Luckily that’s still within our operating range this time. Will make sure be mindful of peak vs RMS whenever looking at ratings in future. Thank you!

Excellent, though its unfortunate the Magnelab ones seem to be about 4x the price. My googling seems to suggest YHDC ones won’t work well below 50Hz, as you suggested. Although from your tests, when operating at much lower frequencies, it looks as if the l.f. response would result in an overestimate of True RMS, but I think that non-linearity is something we could cope with, so long as it is consistent.

I don’t think so. To a first approximation, the c.t. is a first-order high pass filter, and that will result in the secondary current (which is what the ADC is measuring) falling as the frequency falls. Here’s a description of what happens inside the transformer (both current and voltage are explained): Why do current transformers have a minimum frequency rating? - Electrical Engineering Stack Exchange

The problem is, without knowing all the parameters or being able to source a decent current down to a very low frequency, I can’t measure the roll-off.

I did warn you that Magnelab were expensive.

Thank you! I’ll do some more reading up about CT sensors, and give the cheap ones a go to see how badly they perform.

In fact, think I’ll get a Magnelab to test too, just to compare performance.
The series is rated up to 200A, but I can buy ones rated up to lower currents with an internal burden resistor. The output is only 0.333V at the rated current, so I’m concerned about resolution when using a 3.3V ref voltage and 10bit adc (though general accuracy might mean the resolution doesn’t make much difference). Would you recommend getting the no burden resistor version so I can tune the output voltage range to be closer to the full analog 3.3V range at my expected maximum currents of 30A RMS (like how is done with the CT sensor in the open energy monitor)?

Not really fair, but here’s a phase shift comparison between a YHDC CT like the one sold in the OEM Shop and a 50 Amp CT from Continental Control Systems. I expect a similar Magnelab CT would yield results much the same as shown below, as they spec their product to be linear from 10 to 120% of the CT’s rated value.
(the CCS linearity spec is from 1 to 120% of device rating)

Here’s the complete table of cal data:

The advantage of the 0.333 V output is it is factory calibrated and the accuracy is guaranteed.

You could consider giving your MCP3008 a voltage reference of 1 V (or maybe 1.024 is more convenient?), it will then work very happily with a 0.333 V c.t.

If uncalibrated accuracy is not a major worry, then by all means select your burden resistor to give 1.1 V output at max. current.

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).