Announcement

REXYGEN forum has been moved. This one is closed.
Head over to the new REXYGEN Community Forum at https://forum.rexygen.com.

Looking forward to meeting you there!
 

#1 2017-01-10 07:42:00

michmir
Member
Registered: 2017-01-10
Posts: 4

Generator block - frequency too low

Hi guys.

I began to experiment with rex and unipi and decided measure time of powered digital input signal, which indicate material flow and later calculate amount of material used during the day. So i put square generator enabled by input in project and connect counter to it. So i expected to see when generator is 10Hz and is on 10s, there will be 100 pulses counted for calculations, but it is more like 89 pulses in 10s window when i examine situation in rexview, so if time scale of those graphs is ok, pulses seems stretchched. Is this something in timing of project settings which create delays?

Thanks.

Offline

#2 2017-01-10 12:20:14

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Generator block - frequency too low

Hi michmir,

thank you for your question.

According to your description, it seems that there is an issue in timing of your project. Please, can you upload all your project files so we can have a look at it and help you to solve the issue? If you mind sharing it with community send it via email to support(at)rexcontrols.com.

Regards, Tomas

Offline

#3 2017-01-11 14:04:00

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Generator block - frequency too low

Hi again,

the problem you are touching in your project is a feature of discrete systems.
Your task period is set to 20 ms. Therefore it is not possible to produce a square signal with period 100 ms (10 Hz). It's not possible to produce 50 ms pulses using 20 ms task period. Because there are 5 ticks for whole square signal period. In case of square signal there have to be even number of ticks.

The fastest frequency using 20 ms task period you can achieve is 25 Hz (40 ms = 20 ms HIGH + 20 ms LOW).

Note that the task period should be finest among all other time constants.

If you require any further information, feel free to contact me.

Regards, Tomas

Offline

#4 2017-01-11 14:48:33

michmir
Member
Registered: 2017-01-10
Posts: 4

Re: Generator block - frequency too low

Hi Tomas,

Thanks for quick help and clarification of discrete behavior of generator, i was thinking not so discrete of him before smile.

michmir

Offline

#5 2017-04-09 14:37:10

michmir
Member
Registered: 2017-01-10
Posts: 4

Re: Generator block - frequency too low

So here is the file, for anyone interested in logging digital input long time (include impulse counter in ON state. 10 impulses in 1s) for easy work with data in excel.

https://www.rexygen.com/oldforum/img/m … ogging.zip

Offline

#6 2017-04-11 08:50:48

tomáš čechura
Administrator
Registered: 2016-02-22
Posts: 371

Re: Generator block - frequency too low

Hi michmir,

thank you for sharing your example on logging digital input - nice work!
If I may I would suggest to use RTOI (Real to Integer) function block instead of TSE function block. Do you use it to convert Real signal output from Signal Generator to Integer input of counter, am I right?

Another suggestion is about project timing. Be careful with too fast tasks periods - your main task is running with 1 ms period. Is it really necessary? For only one Digital Input it can be enough however for more complex tasks I would definitely extend the period.

You are logging every single event as separate item, right? May I ask what is the post-processing of your data in Excel?

Recently we have created example on measuring running hours - I thought it can be interesting for you:
Hour_Meter_example.zip

Good luck with your project!

Regards, Tomas

Offline

Board footer

Powered by FluxBB