Sign in to follow this  
Followers 0
dilnger

Rpm Calculation

5 posts in this topic

Hi All, I need help programming. I am using a s7-222 and a Dart Digital encoder, and I need to calculate rpm of a motor. thanks, dyLAN

Share this post


Link to post
Share on other sites
What kind of signal is the digital encoder giving you? i would simply count the pulses on a high speed input for 2 seconds and multiply by 30. Then divide that by the number of pulses per revolution from the encoder. Might not be the absolute most accurate method, you're only going to get new values after 2 seconds but it's a fairly simple answer to the problem.

Share this post


Link to post
Share on other sites
If it's pulses unless the frequency is very high I just read the time between pulses and figure the RPM from that.   Pulse          P          One Shot ----| |---------| |-----------( )  One Shot ----| |------------(Divide 600 by Timer Value) ------------|-----|--             | TMR |  One Shot   | 0.1S| ----| |-----|Reset|             |_____| This will find the current RPM and reset the timer with the leading edge of the pulse. Accuracy can be adjusted by moving the decimal And/Or creating multiple pulses per revolition and adjusting the math accordingly. Edited by DesertDog

Share this post


Link to post
Share on other sites
The Output is a square wave with 10 pulses per revolution.

Share this post


Link to post
Share on other sites
You could do a timed interupt which is event # 21. This timed interupt happens when T32 (1ms timer) CT=PT. And then when the interupt occurs put the code for your math within that interupt routine by taking your HC### CV and doing whatever math is needed for your rate. Go to the ATCH instruction on the left tree and hit F1 for help and then looking for event priorities.

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  
Followers 0