Electronics > Projects, Designs, and Technical Stuff

Is there an easy DSP route to measure power?

(1/1)

741:
I'm asking on behalf of someone else: we've inherited some hardware with ARM etc (coding is his bit). There are some LPF filters and my guess is that the ARM computes RMS power from V & I samples.

I've been told that (for example) it's pretty straightforward to make an equaliser with ARM because ST dev kits supply free software; "all you do" is specify the response and it spits out some coefficients (I gather). Quite what extra bits the developer supplies like ISRs and ADC setup I do not know.

But, given that, I like to imagine that finding RMS power given LPF V & I signals should be fairly painless.

I would be interested if anyone out there has done this, and in any "not too generic" links. At this point (regrettably) we are not going to be able to learn about DSP in any serious depth, so I'm after more practically orientated information for now.

Marco:
I'm going to make a wild guess that whoever was talking about audio DSP was talking about ST Audioweaver, a limited closed source framework for ST Arm devices. But it's far from a generic visual DSP programming platform, so it wouldn't help you.

What's wrong with your existing code?

T3sl4co1l:
Well, RMS you take the samples, square them (mind the increased number of bits -- probably truncate the fractional end), add them up over whatever period you're averaging over, then divide by the number of samples and sqrt it.  (Presumably the number of samples will be a power of 2, so shifting can be used instead of division.  The sqrt will have to be written out somehow or another, but the compiler or library will have a solution for that.)

For power, instead of multiplying one signal by itself, multiply V times I, i.e. instantaneous power.  Average that, and don't take sqrt.  That's the time domain definition of average power.

Mind offsets -- any DC offset will contribute to the output, just as it's supposed to.  If your signals are biased or unsigned, keep this in mind and adjust the math accordingly.

You can also find the apparent power |S|, which is rms(V) * rms(I).  This is greater than the real power.

You can, finally, find reactive power Q by doing the vector subtraction, since |S| = |P + jQ| = sqrt(P^2 + Q^2).  Of course, as you're taking the difference of two noisy signals, don't expect great accuracy this way.

Tim

Benta:
Depends on what you want to measure.
If it's 50/60 Hz power consumption it's dead simple, I've done it with a 68HC11 8-bit MCU.
Two ADCs synchronously sampling, one for voltage and one for current sampling at 10 ksps (or what you find fitting). Just multiply the samples, depending on polarity of the multiplication it's either RMS power or reactive power.

If you want to measure higher frequencies it gets hairy.

Navigation

[0] Message Index

There was an error while thanking
Thanking...
Go to full version
Powered by SMFPacks Advanced Attachments Uploader Mod