From: martind on
>martind wrote:
>> Hi All,
>>
>> I am a newbie to DSP, and near the bottom of the learning curve. I am
>> currently designing a 3-phase IDMT protection relay, which monitors
>> voltage, current, earth leakage etc.
>>
>> The question I have is related to the monitoring of the current. I am
>> sampling 3-phases of current and need to convert each phase to True
RMS,
>> and in it's simplest form, output a signal when the any phases true
RMS
>> current reaches either a predefined trip point, or IDMT output level.
>>
>> I am using 32-bit fixed point hardware, with MAC.
>>
>> My confusion is the True RMS conversion itself. One way is to take 1
cycle
>> of samples, square each sample as received, then divide by total number
of
>> samples then sqrt. But this has a disadvantage as the result if the
>> calculation is given at the end of the cycle. And the response time
would
>> not meet the spec.
>>
>> Another way would be to keep a circular buffer, that way each sample
would
>> be square rooted, and be available on each sample. However, sqrt on
each
>> sample would take up too much CPU.
>>
>> So, reading around it is advised to only square root when needed. So I
am
>> thinking of not square rooting at all, but squaring the result I need
to
>> compare it with, staying in the square domain.
>>
>> Then that (should) just leave me with implementation of an average
>> algorithm for fixed point DSP.
>>
>> I have read that a 1-pole IIR should produce the result I need (or be
>> accurate enough) to represent True RMS (DC equivalent or the heat rise
of a
>> conductor).
>>
>> Does anyone have any thoughts/advice/experience in this area? Any
advice
>> appreciated.
>>
>>
>> Thanks,
>>
>>
>>
>> Martin.
>>
>>
>
>What is *YOUR* definition of "IDMT protection relay"?
>The only thing I found in my Google search referenced protecting
>multi KV distribution systems and/*OR* loads.
>
>My expertise is *NOT* power distribution, but I got to document
>results of 30 kV to ground for a site nominally rated at > 2 MW.
>
>Are you really trying to detect
> (I**2)*t > x
>
>Working for another firm I got caught in meeting a specification
>that *presumed* loads were large motors. We had <200 W of
>microprocessor related electronics.
>

Hi,

My definition of an IDMT relay is one where the following formula is
used:

T = (K / (((I / Is)^a)-1)) x k

K and a vary depends on whether you want Normal Inverse, Long Inverse,
Extremely Inverse etc... k is the plug multiplier.

The system measures a number of things, but most importantly overcurrent
on each phase (it is a 3-phase detector) and earth leakage. I first convert
each phase to RMS using a boxcar average, and feed the RMS output into the
IDMT formula. When the time period exceeds the IDMT (T), it trips.

To measure larger currents, just use higher ratio current transformers.

To measure earth leakage, run L1,L2,L3 through the same CT, and if there
is an inbalance, this will show up through the CT. Or measure inbalance by
vectorial sum of L1,L2,L3 and compare with measured neutral. Difference in
result will be fault current flowing elsewhere...

One of the things that caught me out was that for normal inverse curve, a
= 0.02.

Therefore with fixed point math (I / Is)^0.02, this becomes a little
trickier than when a = 1 for long time inverse, and very inverse. And when
a = 2 for extremely inverse.

Of course times by 1 and squaring a number is easy, but a fractional
exponent of 0.02 causes an issue needing a log lookup etc...

The calculation has to be done very quickly, so ended up generating a RAM
table with all the precalculated IDMT timings using emulated floating point
math, and then just table lookup and compare on interrupt, which works
well.

From: martind on
>martind wrote:
>>> martind wrote:
>>>> Hi All,
>>>>
>>>> I am a newbie to DSP, and near the bottom of the learning curve. I
am
>>>> currently designing a 3-phase IDMT protection relay, which monitors
>>>> voltage, current, earth leakage etc.
>>>>
>>>> The question I have is related to the monitoring of the current. I
am
>>>> sampling 3-phases of current and need to convert each phase to True
>> RMS,
>>>> and in it's simplest form, output a signal when the any phases true
>> RMS
>>>> current reaches either a predefined trip point, or IDMT output
level.
>>>>
>>>> I am using 32-bit fixed point hardware, with MAC.
>>>>
>>>> My confusion is the True RMS conversion itself. One way is to take 1
>> cycle
>>>> of samples, square each sample as received, then divide by total
number
>> of
>>>> samples then sqrt. But this has a disadvantage as the result if the
>>>> calculation is given at the end of the cycle. And the response time
>> would
>>>> not meet the spec.
>
> ...
>
>Why do you need square roots at all? When I > I_trip, it is also true
>that I^2 > (I_trip)^2. Given I_trip as a spec or input, calculate
>(I_trip)^2 once and compare against that. Such simple transformations
>are what make embedded systems practical. (At Siemens, we did what you
>propose with a 68HC11 that also calculated the motor's thermal model and

>would trip on winding excessive temperature.
>
>Jerry
>--
>Engineering is the art of making what you want from things you can get.
>�����������������������������������������������������������������������
>Yes Jerry I agree, and thats how I started out I^2 > (I_trip)^2.
But, the term in the IDMT formula:

(Ic / Is) ^ 0.02.

The trip time takes into account the Ic / Is ^ 0.02. Which is measured
current / trip set point.

Assuming trip point Is = 5.00A, curve is NI3/10, and Ic must be greater
than Is. I am only working in increments of 10mA.

K=0.14, a=0.02, k=1.

Ic Timing / trip times
--- -------------------
5.01A 3503.42s
5.02A 1753.42s
5.03A 1170.09s

Therefore my RAM table contins the timing values pre-calculated and
converted to number of interrupts for simplicity. To index this array:

TripTime = TripTimes[IndexBasedOnIc]

based on Ic, I need to take square root if IndexBasedOnIc^2. Otherwise
square root value will put us well out of bounds of array.

The RAM table is re-generated every time the user changes the Is
setpoint.