Jump to content
Sign in to follow this  
stembera

Frequency measurement

Recommended Posts

Hello world,

I have UniStream TP-070 with High Speed  module UID-0808THS. I need to have measurement of speed of electric generator based on pulses from inductive sensor attached to the machine shaft. The frequency is typically 100 Hz for 50 Hz grid. I did not find the convenient way how to measure frequency with precision at least 0.1 Hz with update rate better than 1 sec. In VisiLogic, there is a block HSC->Frequency for High speed inputs (reload). I did not find similar way in UniLogic. Can someone help me?

Thanks, Michal. 

Share this post


Link to post
Share on other sites

Hi Michal,

When configuring a counter in the UID-0808THS the bottom field lets's you choose the frequency measurement interval (from 1 ms up to  10000ms).

Then look at struct created - one the tags created is Frequency. There you will find the measured frequency.

Note that there are other scenarios you can configure. For example if you choose scenario "Measure length" (pulse counter)  you can count pulses from the moment that sensor detects until it stop detecting.

 

Share this post


Link to post
Share on other sites

Thank you Ofir for your response. Yes, I know the structs attached to the UID0808THS module. Unfortunately, it does not solve my problem perfectly. Frequency of pulses from the speedmeter is ~100 Hz. If I choose measurement interval = 1000 ms, I will get frequency 99 Hz, 100 Hz or 101 Hz depending on count of pulses in the last second. For higher precision I need to choose longer time interval but I will lose change of speed in time. This is hardly usable for controlling of synchronous generator – it has to be kept between 49.9 Hz and 50.1 Hz (for 50 Hz grid). During startup and shutdown of generator exact ramp should be kept so I need to get nearly continuous speed measurement. 
There is HSC->Frequency FB in VisiLogic which perfectly meets my requirements; I was looking for something similar (or even better!) in UniLogic but without success. Maybe there is some chance to use hardware hack with PWM output hardwired to high speed input. Then I can count PWM pulses during 100 pulses from speedmeter. With some math I can get reasonable output but I am not sure if this is a way (at least I will need 1 extra input and 1 output). 

If there are no new ideas, I can use speedmeter with analog output. 

Michal.

Share this post


Link to post
Share on other sites

Hi again Michal,

without knowing UniLogic, I think you could possibly backtrack a bit.  Find the max frequency the high speed inputs on the module can achieve, and then go backwards from there with the view to increasing the number of lobes on your shafting that your inductive senses.  The aim would be to have the maximum counts per rev from the shaft that remains within the limits that the module can do, and then you can likely set things up via maths to achieve much closer control.  Also allow a safety margin on over-revving keeping within the counter limits.  You don't want your system being told to go faster when it is in fact already going too fast!!  Only you will know this margin.

cheers,

Aus

Share this post


Link to post
Share on other sites

I see it as a problem of pulses/revolution. If you want more precision without increasing the sampling rate, then you need to put more pulses/rev. You can find now a lot of new magnetic encoders that can improve your precision. The  UID0808THS can count much more than you are using right now. I know the costs are going to rise but it is a better solution. With enough pulses/revolution you can sample each 250 ms or even 100 ms.

Share this post


Link to post
Share on other sites

I'm an RF guy; here's  two external hardware hacks. If 100 Hz is a square wave then filter out a higher harmonic, amplify, and measure. If speedo output is sine wave then feed into an RF mixer and hetrodyne the frequency up. "Two frequencies fed to a non linear mixer will produce: F1, F2,  sum, difference, and some DC component. I know you would prefer a software fix.

I too have found a lot of functions from Visilogic NOT FOUND in Unilogic. Obviously Unilogic was not developed by the same team/composers as Visilogic. Looking at it forensically, it seems impossible. Visilogic packed everything I could dream of and more (like the developer wanted to show off). Unilogic seems to carry theme: "build your own UDFB". I am not a C+ programmer. Just a ladder logic programmer. I find the notion that I should have to construct functions that were prepackaged/just enter my variables in Visilogic somewhat perplexing. 

Edited by hotwires
  • Upvote 1

Share this post


Link to post
Share on other sites

Or construct a zero crossing detector (LM339 comparator) and measure the time between pulses (period) then use math to derive the reciprocal of the period which is the frequency. Just a conceptual idea, not sure if the uniHSC can measure period. If my math is correct 50Hz would 20 ms between zero crossings. If output is square wave then perhaps a PTC/NTC would capture the rise and fall of the first wave which would be 1/2 the wave period. Hope you find a simple cost effective solution.

  • Upvote 1

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×