Calculate RPM from pulse

briana banks

Member
Join Date
Jul 2005
Posts
242
Hi All


Using rslogix 5k.
I wish to calculate the rpm from the pulse
this way:


DI-----------------------------------move TOF.ACC to TOF_ACC
|-----------TOF

TOF.DN-----------------------------compute[60000/TOF_ACC]

but it is not accurate for above 200 rpm
and on the other hand on very low rpm the calculated value remains a long
time before updating.


Is there a better way to calculate that?

Thanx
 
No one method is going to work through the entire range of RPMs. At very low RPMs you're going to have to find a way to increase the number of pulses per revolution above 1. A sprocket on a shaft with a sensor giving a number of pulses is one way. But as the RPMs increase this rapidly becomes uncountable to a standard input. At that point switch over to deriving from a pulse which occurs once per revolution. When that becomes unreliable swith to code which counts this single RPM pulse over a unit time. If this is way too unwieldly use the sprocket sensor with a high speed counter card. Let it do the work.
 
Again depending on you situation, one thing that might improve the calculation is to add a one shot into the logic, so you are not loosing part of the revolution by waiting for the sensor or what ever to clear.

DI-------ONS-------MOVE TOF.ACC TO TOF_ACC
DI-------ONS-------TOF
TOF_ACC------------CPT[60000/TOF_ACC]
 
There could also be scan time issues, what is the duration of the pulse that you are receiving, is it greater than the scan time?

If you need it to be accurate, use a pulse input, or encoder with a HSC card, don't know about AB, but when implementing this setup in Omron, there is a method that does it for you.

For the AB guys, why not use a DIV instruction, I have read that the compute has a longer processing time?

Maybe. Depending....

Which of course means there is.
 
Hi All

i simulate the input signal with a TON.
with TON set to 1000 it shows accurately, steady 60 RPM
the same with 500ms i.e. 120 RPM

the problem start somewhere around 200ms then the RPM
goes up and down ±3 RPM and can't reach my actual 300 RPM High limit (my rotating shaft speed ranges 0-300 rpm).

surprisingly,around 150 ms the rpm returns to be steady...


 
Hi Briana,

I have a similar setup. I send the pulses to a counter. When a 1 minute Ton was done, it moved the counts to an integer file, reset the counter and started over.
 
The simulation of a pulse using a timer may, in itself, be introducing many of the variances you are seeing. The timeout of the timer is only recognised on a scan so the actual time could be as little as the timer setting and as much as the timer setting plus 1 scan time.
 
Briana,

Have you tried running a little dc motor, and use a dc prox to experiment with?

There are wheel type tachs, or strobe tachs to verify the rpm.
 
Brianna,



Have you ever used an STI? Regular timers for AB tend to get a little loopy with medium to high speed pulses. This can be due to several things, scan time being high on the list.



A STI (Selectable Timed Interrupt) is not an instruction, but rather a routine that runs at a given rate. You select this rate within reason. The range can very between 10ms and 2550ms for the SLC500 controllers. The timing is set up in the Processor Status Folder. It will call your routine (LAD3) or whatever at a given rate.



Knowing this, you can use a scan counter to create a better timer in the STI routine. If for instance, you set your STI to scan every 50ms, each scan would be equal to 50ms. Thus 20 counts would equal 1 sec. It is better because the scan time error is practically eliminated.



Add a XIC/XIC and a OSR to ADD one to an integer (or counter whichever you like) during this 20 counts. 300rpm would be 5 counts per second. Then do the math needed to get RPM. In this case, our integer * 60.



The above is purely an example. Most likely you would want to count for 5 seconds or so.



If this is something you would be interested in let me know, and I'll write an example lad, and STI settings to match. Keep in mind that this does interrupt the processor, and may have adverse affects on the other parts of your program. (Lengthened Scan time.) If you are already fighting scan time issues, this may cause more trouble than it would be worth. However, it works, and works well. I have used it in the real world with great success.
 
There's no such thing as an STI in Logix5000. Periodic tasks replaced them.

So are the TOF and CPT instructions in a periodic task or the continuous one? What's the task's scan time?
 

Similar Topics

Hi everyone, This is my first time posting, so please forgive any omissions or mistakes. I am attempting to control the velocity of a stepper...
Replies
18
Views
986
Hello, I'm trying to understand a servo motion system. I want to know the motor speed in RPM at a given speed setpoint entered in a MAJ...
Replies
4
Views
2,236
Hello Forum, I am being told to implement position feedback mechanism for a Winch which does not have encoder mounted on it. I am running the...
Replies
27
Views
6,974
Hi. I have a AB PowerFlex VFD. I need to calculate in the PLC(SLC 500)the speed the wheel in RPM's. All I know in the PLC is the Frequency of my...
Replies
20
Views
16,553
Hello.. I need to read some pulses from an inductive sensor on an engines and then calculate the rpm and then show rpm in a E1071 panel.. how...
Replies
6
Views
5,433
Back
Top Bottom