- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic to the Top
- Bookmark
- Subscribe
- Printer Friendly Page
- « Previous
-
- 1
- 2
- Next »
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-28-2009 12:52 PM
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.
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-28-2009 01:14 PM
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-28-2009 01:18 PM
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).
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-28-2009 02:23 PM
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.
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-28-2009 03:11 PM
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
09-28-2009 03:32 PM
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.
Re: Proximity sensor as a tachometer ?
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Highlight
- Email to a Friend
- Report Inappropriate Content
10-01-2009 01:02 PM
- « Previous
-
- 1
- 2
- Next »
