Page 1 of 1

PWM FREQUENCY CALCULATOR

Posted: Thu Oct 17, 2013 3:18 pm
by pars11
I HAVE TRIED TO CALCULATE FREQUENCY OF FLOW SENSOR PWM OUTPUT BUT RESULTS DOESNT MATCH WITH REAL VALUE. I HAVE USED DIGITAL INPUT OF PHIDGETS 8/8/8 INTERFACE KIT. FLOW SENSOR FREQUENCY CHANGES 15 TO 225 HZ, I THOUGHT I COULD GET AT LEAST UPTO 180HZ BUT MAXIMUM I CAN READ IS 43 SAMPLE PER SECOND. COULD YOU HELP ME ABOUT THIS.

THANKS

Re: PWM FREQUENCY CALCULATOR

Posted: Thu Oct 17, 2013 3:27 pm
by pars11
THIS IS THE SCHEMATIC

Re: PWM FREQUENCY CALCULATOR

Posted: Thu Oct 17, 2013 5:22 pm
by tester
Post fsm schematic (part that addreses the error) instead of blurry picture of it.

Few things to pay attention to are:

- connection order = trigger order (these small markers at the beginnings and ends count the order) = order of operations (triggers work in hierarchy).
- amount of triggers in crucial points (use trigger counter). While values don't have to change, triggers may reintroduce them again to prims and modules.

Re: PWM FREQUENCY CALCULATOR

Posted: Thu Oct 17, 2013 9:03 pm
by trogluddite
Hi Pars, welcome to the forum.

Unfortunately, this one may be tricky to fix.
The 'events' that transfer data from one 'green' primitive to the next are rather limited in speed. 43 sample/sec is getting pretty close to the upper limit (43 samples = 86 events on/off) - the events probably won't get missed out, but when they are too fast you get an effect a bit like YouTube "buffering", where the events get slowed down - and this will make the counting get less and less accurate as your PWM gets faster.
Faster event can be handled by the Ruby parts of FS, but, as the Phidgets interfaces ONLY send their output from "green" connectors it may not be possible to read the data as quickly as you need to - I've never used any of the hardware interfaces, so I couldn't say for sure.

PS) CAPS-LOCK is over at the left hand side of your keyboard just above the SHIFT key! ;)