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.

***Reverse current problem

My electricity meter shows (+) for the reverse current. On the other hand, the standard meter shows (-)! I would like not to see anything when I have reverse current. (Completely zero!)

I found some commands in the code as follows.

/*! This switch inhibits the accumulation of per phase negative power */
#undef INHIBIT_NEGATIVE_PHASE_POWER_ACCUMULATION

/*! This switch inhibits the accumulation of total negative power */
#undef INHIBIT_NEGATIVE_TOTAL_POWER_ACCUMULATION

/* In limp mode we have no way to determine if the phase is reversed,
so just say it is not. */
phase->status &= ~PHASE_REVERSED;

#if defined(PHASE_REVERSED_DETECTION_SUPPORT)
/* If we find a negative power level we may be genuinely feeding power to the grid,
or we may be seeing a tamper condition. This is application dependant. */
reversed = FALSE;
#endif

But not sure which ones are needed to change! Any experience on reversed current?

p.s. Not to mention that I use the following evaluation module.

http://www.ti.com/lit/an/slaa409a/slaa409a.pdf

  • Hello,

    There is no macro that directly does what you would like to do.  However, this can be implemented by checking the I_REVERSED flag of phase->status.  If this flag is 1, this should correspond to a current reversal condition.  Therefore, once this flag is 1, you can modify the code so that the value of the IRMS current that is calculated by the foreground is set to 0. 

     For the I_REVERSED check to be enabled, the “PHASE_REVERSED_DETECTION_SUPPORT “ macro must be defined.  As a sanity check, you should verify the operation of the I_REVERSED flag to make sure that there are no issues with the user-selected setting.

    Regards,

    Arthi Bhat

  • The compiler ignores the comments. It only tries to translate the source code (excluding the comments) into object code. What did the source code say? (Is it consistent with the comment?) And did the compiler translated that correctly? (Is the compiler bug free?) Did the CPU execute the object code correctly? (Is the hardware bug free?)

  • When measuring AC, you always have reverse current. Half of all current is reverse. While voltage is negative.
    By multiplying current and voltage, the two negative signs usually nullify, so you have positive active power.

    However, as soon as you have not only active but also reactive power, you may have situations where the momentary power is negative. In fact, on plain reactive power, positive and negative power equals out, but its momentary value might be large towards one or the other side.

    If you ignore the negative part, you’ll end up accumulating apparent power and not active power. Something nobody wants to know.

    Of course, if the accumulated active power seems to be negative, you likely have twisted voltage or current. (180 degree phase switch) Happens all the time if the current transformer is mounted the wrong way.

  • Arthi Bhat1 said:

    Hello,

    There is no macro that directly does what you would like to do.  However, this can be implemented by checking the I_REVERSED flag of phase->status.  If this flag is 1, this should correspond to a current reversal condition.  Therefore, once this flag is 1, you can modify the code so that the value of the IRMS current that is calculated by the foreground is set to 0. 

     For the I_REVERSED check to be enabled, the “PHASE_REVERSED_DETECTION_SUPPORT “ macro must be defined.  As a sanity check, you should verify the operation of the I_REVERSED flag to make sure that there are no issues with the user-selected setting.

    Regards,

    Arthi Bhat

    Actually "PHASE_REVERSED_IS_TAMPERING" helped me to do what I wanted to do. And as PHASE_REVERSED_DETECTION_SUPPORT was helpful to tell me the tampering!

  • old_cow_yellow said:

    The compiler ignores the comments. It only tries to translate the source code (excluding the comments) into object code. What did the source code say? (Is it consistent with the comment?) And did the compiler translated that correctly? (Is the compiler bug free?) Did the CPU execute the object code correctly? (Is the hardware bug free?)

    Comments?! Yes, I do know that the lines with "//" won't get compiled! My quesion was how to have the reversed current detected! 

  • Jens-Michael Gross said:

    When measuring AC, you always have reverse current. Half of all current is reverse. While voltage is negative.
    By multiplying current and voltage, the two negative signs usually nullify, so you have positive active power.

    However, as soon as you have not only active but also reactive power, you may have situations where the momentary power is negative. In fact, on plain reactive power, positive and negative power equals out, but its momentary value might be large towards one or the other side.

    If you ignore the negative part, you’ll end up accumulating apparent power and not active power. Something nobody wants to know.

    Of course, if the accumulated active power seems to be negative, you likely have twisted voltage or current. (180 degree phase switch) Happens all the time if the current transformer is mounted the wrong way.

    Thanks Mich for the explanation! :)

  • CaEngineer said:
    Comments?! Yes, I do know that the lines with "//" won't get compiled

    I guess, what OCY wanted to express is that you shouldn’t give too much on comments. They might be misleading or can be misinterpreted.

    If in doubt, only the code counts, as only the code has an influence on the generated program. So check the code instead of trusting what you think a comment might mean.

**Attention** This is a public forum