RPM using 1 inductive sensor

alecsandes

Member
Join Date
Sep 2018
Location
Romania
Posts
6
Hi Guys,

As I am beginner in programming, but however advanced in reading PLC programs. I face an dumb moment which I cannot pass :DDD

In order to troubleshoot an issue, I have mounted a sensor on a motor output key to have it activated at each revolution.
Aprox RPM of the gearmotor is ~100-150 RPM

I need an estimate RPM value to trend when the issue is occuring.
The system is GE FANUC 90-30 with proficy.

I started with ONDTR with ALWON power and reset timer by POS edge of sensor. than I divide 600 to this value.
The problem is that the timer increases and with sweep time I get increasing values than it divides to zero when the timer resets.
I cannot think a way to hold last value until sensor gets activated again.

I stumbled upon this and cannot see through to make it work.

Can you please help me?

Thank you guys!
 
With a simple timer and rising trigger, you could calculate the RPM with something like:


Code:
speed_r_trig(CLK := DI_Speed);
speedTON(IN := TRUE, PT:=T#1m);

IF (speed_r_trig.Q) THEN
    IF (speedTON.ET > T#60ms) THEN
        rRPM := 60000.0 / TIME_TO_DINT(speedTON.ET);
    END_IF
    speedTON(IN := FALSE);
ELSIF speedTON.Q  OR rRPM < 1.0 THEN (* No index sensor seen before time-out. Zerospeed *)
    rRPM := 0.0;
ELSIF (speedTON.ET > REAL_TO_TIME(60000.0 / rRPM)) THEN
    rRPM := 60000.0 / TIME_TO_DINT(speedTON.ET);
END_IF


You basically just start and stop the timer all the time when you see the index sensor. Poor resolution though, but that's what you'll get this way.
 
Hi Jesper and Commissioning Man,

Thank you for your replies.

Regarding the example of the Commissioning Man, It would be better for me to write it like this, but I have to make it in ladder which for me it is harder.
 
I get yelled at if I have anything looking like ladder on my monitor.


But it should be doable to translate the above to ladder, but it won't be pretty. Also depends on how your system handles IEC-timers.
 
alecsandes, you should use this as a programming excercise. Sometimes you can get a ready finished program, but most of the times not.

CommisioningMan said:
You basically just start and stop the timer all the time when you see the index sensor. Poor resolution though, but that's what you'll get this way.
Using only the time between one pulse-pair, the accuracy will go down when the RPM goes up. Also, the value is updated at varying times, rather than at a fixed time interval.
If the above is an issue, try to use the method I suggested. Basically use the time from 1st to last impulse within a fixed update period, and count the number of pulses within that period. That will give greater precision.
It will be slightly more complex to program, but not by much.
That could be programming excercise step 2 !
 
Hi,

Thank you for involvement. Every new thing I encounter I treat as an exercise and by asking you questions I am developing myself. I did not want a ready copy of the program I need but a small example because my main concern is that for every timer I use, I need to reset it to zero, the divide to zero and than the sweep time of program faster than the revoultion is what is killing me. Another issue is i do not understand if i need to use POSCOIL or use the direct contact from sensor, as the speed of its activation is less than the cycle time.

In Proficy Machine Edition, for 90-30 I have only TMR, OFDT and ONDT, OFDTR and ONDTR and I am lost in how to manipulate them in order to achive something.

Because I have put the sensor on the gerarbox, I use the key channel of the gearbox.
So I have Sensor activated most of the time, until gear channel is passing through.

I have made it like this previously

|alwon| - ONDT => Registry 1
|/Sensor1| - Reset

DIV IN1=6000 IN2=R1

Jesper, I do not understand your method. Maybe if you have a small printscreen of your ladder logic, I would adapt it to my needs.

Thank you!
 
Jesper, I do not understand your method. Maybe if you have a small printscreen of your ladder logic, I would adapt it to my needs.
It does not fit in a small screenshot. I guess I could poast several screenshots, but ...
If you dont get the principle from my description, the ladder logic will not make sense to you.
If you grasp the principle, based on the description, you should be able to make the logic.
Also ... I cannot be bothered
In Proficy Machine Edition, for 90-30 I have only TMR, OFDT and ONDT, OFDTR and ONDTR and I am lost in how to manipulate them in order to achive something
Then start with learning how to get the elapsed time from these timers.
Without knowing this you wont get anywhere.
 
Hi Widelto,

Thank you.
I don't have OS relay, is it POS Coil?
Timer.ACC is a timer of what?
I see it is RW LD which has greater options.
 
Basically use the time from 1st to last impulse within a fixed update period, and count the number of pulses within that period. !

I must add that I am a mechanical engineer :D

By fixed update period you mean the program sweeptime?
if so, I don't know how to use it. i see it in a status bar and si not fixed in my case, varying from 15ms to 18ms

I don't understand how to determine which is first and last.
Correction: I have TMR, ONDTR, OFDT only as options.

I managed to count how many activations (In my case, deactivations) I have per a period of time.
UPCTR requires a reset, so I again will face the issue with dividing or multiplying to 0.

I have attached some screens

rung1.png rung2.png
 
By fixed update period you mean the program sweeptime?
No. You must decide at which rate the RPM value must update. Every 2 seconds, every 5 seconds, every 10 seconds, or something.
You then program a timer with that setpoint, which then resets and restarts itself.

I managed to count how many activations (In my case, deactivations) I have per a period of time.
So you are not far from solving the task.
OK, here is a more detailed description in words:

At the edge of the 1st impulse, you start another timer ("T_elapsed" for example).
At the edge of the subsequent impulses, you increment the counter and store the elapsed time in a variable ("T_elapsed_actual" for example).
When the update timer is done, you do the following:
Calculate the flow based on no of impulses and the elapsed time.
Reset the impulse count and actual elapsed impulse timer.
Reset and restart the update timer.
 
Hi Jesper,

Thank you for guiding me into this issue I face.

I've realized that your method would be better in terms of accurate reading for my specific case it would not be suitable (due to measuring cycle of even 2 sec, maybe If would have more impulses per rev it would be better)

The issue I face is random and quick and I need to know the "exact speed" of a driven roller (controlled by a FreqConv) at the moment the issue is occuring.

The inductive sensor is placed on the motorgearbox and it is on all the time until the channel of they key passes in front.

I started in accumulating time in a registry and reset-ing it at trasition on-off. then diveie this time a minute and get the RPM value for that specific moment.
As the speed of the roller is not fixed, it always fluctuates during operation and I want to catch if there is a abnormal "delay" between the pulses of sensor (dropping speed at specific moment).

I was thinking to use positive transition coil to start a timer, negative transition coil to execute the calculation and then to reset the timer on the next positive transition.
This would get me the RPM value for each revolution, I guess, and this is suitable for my purpose.
But this will lead me to a redundancy as the start of the timer is also the reset of the timer.

Can you please suggest me an idea?
 
With an update time of 2 seconds, and only 1 impulse per rotation, you would start to get accurate readings from approx 70 RPM and up. That is a bit close to the 100-150 RPM you are expecting. There is no smart programming way to get a reading for lower RPMs with these conditions.

The solution is to not measure on the shaft itself, instead add a trigger disk to the shaft, and then have a number of notches in the disk to suit the speed of the shaft. Make the notches so that you get even on/off periods.

If you ask how many notches can you have ?
You can find that by investigating the propogation delay of the prox signal. If the sensor has a delay of f.ex. 5 ms and you want to measure up to f.ex. 200 RPM, then 5 ms on + 5 ms off plus some safety, makes for approx 20 notches (60000 ms / 200)/(5 ms + 5 ms) = 30 --> round down to 20 for safety.
With 20 notches, and update every 2 seconds, you can measure from 4 RPM to 200 RPM.
 
Another solution can be to mount a sensor on the motor end, instead of the output shaft of the gear. The motor probably runs at a much higher RPM than the output shaft from the gear.
There is probably a shaft on the motor end with a ventilation fan for cooling the motor.

Either way, add sensor disk with many notches on the slow shaft, or move the sensor to the fast shaft, the solution is mechanical which should suit you since you are mechanical engineer.
 

Similar Topics

Studio 5000 & PF 525, Ethernet Comms, Encoder FB, Using Motor RPM as speed reference I'm trying to figure out how to send a speed reference in...
Replies
6
Views
890
Good Morning , I am going to be re-working 2 portable machines. I am going to have one main panel with a CompactLogix and 3 PowerFlex...
Replies
2
Views
1,480
I am looking to detect the RPM/speed of a conveyor belt using a Micro820 processor and a magnetic sensor. The magnetic sensor would pickup the...
Replies
4
Views
3,369
Hello I am new to programming Analog inputs and am wondering how to use the analog output from my inverter drive to an analog input on the...
Replies
1
Views
7,262
Back
Top Bottom