Forums

Reply
Scion of (FT)Security
NorwichUK
Posts: 161
Registered: 03-28-2009
0

Re: Proximity sensor as a tachometer?

Smoke,

 

try this AOI in place of the timer. This AOI is a Rockwell AOI, and its quite good in that it eliminates the minor error you would get if this routine got called either side of when the RTC value rolled over).

 

It will accurately give you to 10 microseconds the time since you last called it.

 

What you can do is use this every time you see an edge of your sensor.

 

Even better - create a small fast task with the code in. Make sure you I/P is fast (configured COS and a local I/P, not networked).

 

You'll be amazed at the increase in accuracy this gives you.

Lieutenant (RS)Linx
Smoke
Posts: 91
Registered: 12-20-2008
0

Re: Proximity sensor as a tachometer?

The program had no code?
Scion of (FT)Security
NorwichUK
Posts: 161
Registered: 03-28-2009
0

Re: Proximity sensor as a tachometer?

No code - thats right - don't want to spoil peoples fun.

 

What it has is an AOI called DeltaT.

 

Have a play and see what it does - its a good way of getting precisely a time interval (better than a timer).

Scion of (FT)Security
NorwichUK
Posts: 161
Registered: 03-28-2009
0

Re: Proximity sensor as a tachometer?

Here's some code for those who haven't seen what an AOI is before.

 

Its 'as is' (not tested) and will need correcting for when there are long intervals with no activity, and also the 1st pulse after a power up (which can return duff values).

 

If the filtering that's applied isn't for you (its a bit ghetto), then replace it with some filtering thats more to your liking if you want the value filtered in addition to the instantaneous value.

 

Captain CompactLogix
fordtt
Posts: 331
Registered: 06-23-2008
0

Re: Proximity sensor as a tachometer?

Do you know what your max RPM will be?  The switching frequency of the prox should be higher than the number of pulses the equipment is capable of producing.  If you're using a 1 pulse per rev prox switch, then calculate the time between pulses (DT) and divide into 60.  60/DT=RPM.  The more pulses per rev you have, the more accurate your measurement, of course.
Scion of (FT)Security
NorwichUK
Posts: 161
Registered: 03-28-2009
0

Re: Proximity sensor as a tachometer?

forgot to mention to stuff this code into a fast periodic task for better results.

 

If you have a fast sensor, and a fast task (~2ms), then it will be good for a few thousand RPM.

 

Code all assumes that there is one pulse per rev - redo the maths if its not the case.

DF1 Devotee
cobra4202
Posts: 5
Registered: 09-16-2009
0

Re: Proximity sensor as a tachometer?

Thanks for all the feedback. I think I have some great Info to use now!:smileyhappy: