Host Engineering Forum

General Category => Do-more CPUs and Do-more Designer Software => Topic started by: AustinT on February 15, 2020, 12:22:25 AM

Title: Measuring line frequency and phase angle
Post by: AustinT on February 15, 2020, 12:22:25 AM
I have a question regarding the High speed inputs for measuring line frequency.  Please confirm If I understand this correctly.  If I choose timer and interval scaling , I will get a new frequency reading every cycle.  If I want to average a few cycles then I need to use the counter and scaling function.  This will result in a rolling average frequency .  What would be the best way to do phase angle, just measure the rising edge between two inputs?

Thanks
Title: Re: Measuring line frequency and phase angle
Post by: BobO on February 15, 2020, 10:36:57 AM
I would think about the timer vs counter differently. If the frequency is low, use timer. If the frequency is high, use counter. That gives you the best trade off between stable vs responsive data. Then use smoothing to stabilize the data further, if desired. For something like a 60hz line, I?d probably use time. For something like a 10khz pulse train, I?d definitely use counter.

As for phase, yes, measure time between edges with a dual edge timer.
Title: Re: Measuring line frequency and phase angle
Post by: AustinT on February 15, 2020, 12:54:02 PM
Thank you for the reply.   So if I understand correctly, using the time method for the slow 60 hz signal , every power line cycle it will have an updated frequency.  So if that cycle took 16.67 ms it would say 60 hz , If the next cycle took 2*16.67 , for example, it would say 30 hz after that cycle
Thanks
Title: Re: Measuring line frequency and phase angle
Post by: BobO on February 15, 2020, 01:17:15 PM
Thank you for the reply.   So if I understand correctly, using the time method for the slow 60 hz signal , every power line cycle it will have an updated frequency.  So if that cycle took 16.67 ms it would say 60 hz , If the next cycle took 2*16.67 , for example, it would say 30 hz after that cycle
Thanks

Correct. When in free-run mode with interval scaling, it spits out a new frequency every interval. With a counter and rate scale, it sums the counts and converts to frequency at the specified sample time. For low frequency the timer is always best.
Title: Re: Measuring line frequency and phase angle
Post by: Ingeniero on February 24, 2020, 09:54:40 PM
Try a power monitor.  The PLC reads the power monitor output, analog, modbus or others. For cheap you dont have to reinvent the wheel.

If you are using a PLC to synch breakers, I have done it but auto synch and synch checks relays are available for most budgets.