This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

MSP430F6736A: Reactive Energy readings

Part Number: MSP430F6736A
Other Parts Discussed in Thread: EVM430-F6736, MSP-EM-DESIGN-CENTER

Hi there

I am using the TI energy library (slac488) for our implementation of an energy meter.

The voltage, current, active power, frequency results (after appropriate calibration) are all spot on when compared to my test instruments (Keithley, oscilloscope, power meter).

However, the reactive power calculation is proving rather bothersome.

For reactive power measurement i'm using a load which is a motor that can draw a variable current from 0.5A up to 6.5A at 240V.

My reactive power measurement device is a Mastech MS2205 power clamp meter....its readings are stable at the various current draws.
However, my reactive power calcs are not so stable - they wander up and down....
eg:
meter indicates 995VAR and i'm calculating 900VAR, but after a few secs my value starts to creep up about 100VAR stay there for 5-10secs then drop back for another 30secs before repeating the wander.
and when the load is at 400VAR (as per clamp meter) i'm calculating 300VAR but after 30secs or so at this level the results rapidly go up to 2000VAR, stay there for a few secs before drifting down again and repeating the cycle.
There is no other load on the circuit...ie current, voltage all remain stable & clamp meter reading of VAR remains stable.

Can anyone give me some pointers as to where/how to start addressing this?
Whilst i'm not concerned about being 100VAR off (as i can cater for that), its the wanderings that really puzzle me.

The current measurement to my implementation uses a current transformer not a shunt. 

thanks in advance
moshe

  • Hello Moshe,

    Thanks for your detailed post.

    On the hardware side, I suspect that you're using a custom board and not the EVM430-F6736? Please confirm. If you have the EVM430-F6736, it would be helpful for you to see if the issue is observed on the EVM or not. Perhaps it's something as simple as increasing the gain.

    On the software side, have you made any changes to the original SLAC488 source code? If so, you may want to revert to the original code and see if you can still replicate the issue. If you've changed anything, it could have impacted something like the reactive power due to fixed (hard-coded) filters, etc. I've seen issues around the reactive power readings if the frequency wandered. Perhaps it's some type of harmonic or noise affecting the frequency affecting the reactive power. Assuming you're using a custom board, did you follow our analog front end circuitry design for the voltage and current channels? Also, did you calibrate the phase angle compensation? This could affect reactive power/energy performance too.

    Also, I've had several instances where users compare our EVMs with another meter. Recently, a user expressed concern about inaccuracies when comparing the results to another meter/monitor. When I tried to replicate the issue using our highly accurate test source, I could not replicate the inaccuracies. Without one, it's really hard to know if the F6736-based design is inaccurate or the comparison meter/monitor. See the threads below for more details.

    CCS/MSP-EM-DESIGN-CENTER: Inaccuracy current, power, PF in lower PF (ex: PF = -0.7 [CF=2.5], PF = 0.5 [CF=3.5]) in EMDC and EVM430-i2040S

    CCS/MSP430I2040: The EVM430-i2040S with the EMDC test questions

    For your reference, the legacy Energy Library is not recommended for new designs. Have you had a chance to check out the new Energy Measurement Design Center (MSP-EM-DESIGN-CENTER and MSP430-ENERGY-MEASUREMENT)? You can read more about it in the following thread. If you're early in your development, I would suggest switching to EMDC.

    [FAQ] MSP-EM-DESIGN-CENTER: Announcing the new Energy Measurement Design Center (EMDC) and Software Library for MSP430 MCUs!

    Regards,

    James

  • Hi James

    Thanks for all your information. i did peruse all the links you supplied.

    On the hardware side we are using our own custom board.
    Initially i did have a TI EVM430 but its current location is unknown...but i'll now look for it.
    My implementation is too far gone to switch over to the new Energy library.

    I dont have a problem with the TI code par se nor its accuracy as that is what calibration is all about.

    The frequency result is really very constant at 49.95-50.05Hz so thats not an issue.

    Re changes to the original software...yes, this has been done as the original gave completely wacky results so i replaced the inline macros calls with their source so as to begug what was going on.

    What it appears is that there is overflow &/or 16-32-64 bit conversions issues in the calculation of V_quad_corrected "at certain times" (it appears when the fir_beta is in a certain negative range) which results in  large dot_prod.P_reactive values..i wanted to look deeper into this and.....i was hoping for some pointers as to where to look up the theory for the V_quad_corrected calculation as implemented in the emeter-background.c source.

    The formula given in the TIDU816.pdf & SLAA517E.pdf indicates using the voltage at instant 'n' shifted by 90 degs but it would be instructive to know (or be given pointers to where i can deduce) how TI got from that formula to the actual code in the source file to determine the phase shifted voltage....and also what theory/logic TI used to calculate the correction value in set_phase_correction()....

    Regarding the phase angle compensation..this i havent calibrated yet as i expected the phase effect of the current transformer would be a constant over all loads.

    thanks

    moshe

  • Hi James

    Further to the above, i revisited all the reactive calculations with attention to variable size and signs.

    I adjusted some of the variables down to 16bits from 32bits & from 64bits to 32bits which stabilised the results.

    So the issue of instability has been resolved!

    However, i am still curious as to:
    1. Where to look up the theory for the V_quad_corrected calculation as implemented in the emeter-background.c source.  
    2. How TI got from the formula of the reactive power to the actual code in the source file to determine the phase shifted voltage.
    3. Pointers as to how to establish the phase shift due to a current transformer & translate that back to the preload....i set up the scope to see the phase shift (i vs v) at the inputs to the SD24s but saw that its 45degrees (no load) and 180degrees (inductive load)! Clearly i'm not doing something correctly. 

    thanks
    moshe

  • For the phase shift measurement, you really need an accurate test source or a load that is purely resistive to see if you're code is measuring 0 degrees. Normally, we introduce a +60 degrees phase angle between the voltage and current, and then perform the phase correction. Keep in mind that the phase adjustment can be composed of: (1) whole sample delays done with pointers and buffers (2) fractional sample delays using the preload delay in the SD24 ADCs. Keep in mind that the resolution for both of these delays depend on the sampling frequency and also the oversampling rate (OSR). When you apply +60 degrees, you can compare what you're measuring (let's say +48 degrees) and adjust the whole and fractional sample delays to reach +60 degrees. One challenge with the legacy Energy library is that the author hard-coded most of the functions, filters, and calculations that don't scale if you change the sampling frequency or OSR. This was addressed with EMDC.

    Regards,

    James
  • this is still ongoing...other issues prevent me returning to it.
  • If you have other unrelated issues, please post them in a new thread. For this thread, I can close it, and you can re-open it when you resolve the other issues. Thanks.

    Regards,

    James
  • thanks James....that i'll do.

**Attention** This is a public forum