Hello Guest it is September 15, 2019, 09:21:29 PM

Author Topic: setting up a reflective object sensor for dummy's  (Read 27041 times)

0 Members and 1 Guest are viewing this topic.

Re: setting up a reflective object sensor for dummy's
« Reply #60 on: February 04, 2008, 08:22:27 PM »
hmmmm went back down after dinner and it seems that most of my gains have evaporated without me doing anything. now its back all over the place. I just feel like Im getting noise somewhere but I just dont know why. even when I have the spindle at a dead stop Im still getting wacky tach readings so its gotta be picking up something right. Or is that just what it does for everybody when the spindle is off?
Chris
Re: setting up a reflective object sensor for dummy's
« Reply #61 on: February 04, 2008, 08:58:13 PM »
tried switching to a different input and Im back to where I was two posts ago. its almost readable but it still jumps around and it doesnt seem like its giving an entirely accurate reading but it is close. Im done for today though so hopefully Ill think of something while I sleep.

Offline Chip

*
  • *
  •  2,056 2,056
  • Gainesville Florida USA
    • View Profile
Re: setting up a reflective object sensor for dummy's
« Reply #62 on: February 04, 2008, 09:48:19 PM »
Hi, Chris

Not sure what your Index De-bounce is set to, At this point it's time to Review/Get a fresh start,

In Config, General Configuration Page, Set the De-bounce interval and Index De-bounce to 1000 - 2000.

The 220 ohm resistor for the opto led may be to low (typically 220-330 ohm used for 5 volt setup) 500 ohm for 12 volt setup as Hood stated, Don't want to

burn out the light emitting diode

What opto device did you finally use hear, Jot a link to it ?

Have you shielded the opto from external light sources ?

Got a Big Hammer ?, Chip

Offline jimpinder

*
  •  1,233 1,233
  • Wakefield, West Yorks, UK
    • View Profile
Re: setting up a reflective object sensor for dummy's
« Reply #63 on: February 05, 2008, 03:54:09 AM »
As far as debounce is concerned - if the spindle is rotating at 3000 rpm (which is above the speeds you mention) then the slot only comes round every 2/100 ths of a second - so to get rid of any spurious count - set the debounce at that - the switch only needs to be live as the slot is coming round again.

As far as noise is concerned - make sure your lead from the optics is shielded to stop it picking up noise from your driver boards and spindle driver if you have one.

You have chosen to go with a 12 volt system. This seems to me unescessarily complex, in that you are introducing additional chips and a voltage change for no reason, but all of which can contribute to delay. You could drive this lot from one of the 5 volt supplies, and feed the input signal direct to the computer, therefore cutting out a lot of ****

Paint your disc MATT black with a good quality paint, not with sticky tape - mine with the Fairchild sensor - is painted matt black - with a reflective piece of self adhesive mirror on - and works well.

You do not need a 1 inch gap in your disc. Your problem is not GETTING a reading, your problem is your are getting too many. A 1/8 or 1/16 slot will be enough - if you look at the rise time of your optical sensor. - work out at 3000 rpm how long the gap will be above the sensor. If it exceeds the rise time then you are OK.

In a simple system like this you will always get spurious readings. Mine occur near the bottom of the readings - say 100 rpm. Between that and full speed it seems to be fine.

Since I do not know what system you are then employing to drive the spindle, I cannot comment on the calibration - however if it is the PWM system put out by Mach3, calibration is relatively simple and fully automatic - but save the calibration then restart your computer. It seems to work better when it has digested the information.


Not me driving the engine - I'm better looking.
Re: setting up a reflective object sensor for dummy's
« Reply #64 on: February 05, 2008, 07:39:53 AM »
Ok well glad to see everyone was thinking about this while I was sleeping.  first off this is the sensor I went with.
http://www.optekinc.com/pdf/OPB917.pdf
now as for the breakout board im using its the Bob Campbells combo board so it has the Digital to analog converter built in to the board to drive the spindle motor. Im using a 3hp DC motor with a KB Motor controler.
I put a 500 Ohlm resister onthe emitter yesterday as well when I was messing with it so that has already been changed. I will play with the debounce a little more today. I did happen to pick up a dual trace O scope off ebay for $60 last night and it will hopefully arrive by weeks end. then maybe we can get somewhere once I figure out how to use it.
anyhow I understand that I will always get a small amount of spurious readings, but right now im getting more of them than the real reading so  I continue on.
I did shield the sensor from outside light and the cables are fully shielded too. I will try painting the slotted disk.
Is the inch wide slot now too big? do i need to make a new one? man that would suck.
Chris
Oh yeah what would I set the debounce to in order to make it 2/100ths of a second?

Offline jimpinder

*
  •  1,233 1,233
  • Wakefield, West Yorks, UK
    • View Profile
Re: setting up a reflective object sensor for dummy's
« Reply #65 on: February 05, 2008, 07:57:27 AM »
If my maths is right, each debounce is 40 usec, so 500 would give you 2/100 of a sec. Anybody confirm that, I only did it on the back of an envelope.

Seeing you are trying a load of things, I would leave the slot as it is for the time being. The debounce will nullify it anyway.

Next thing for you to try - I am just fitting a laser with some sensors on my table to get more accurate positioning - I don't know how well that will work. Always something to keep you busy!!!

Jim
Not me driving the engine - I'm better looking.
Re: setting up a reflective object sensor for dummy's
« Reply #66 on: February 05, 2008, 08:23:04 AM »
Hi Chris,
Reflection should not be a problem now that you are using a "through beam" sensor.
What is the "actual " part # on yours ?
It sounds to me like the signal is floating and requires a 10k ohm pull up resistor.
That would explain it reading a goofy rpm while the spindle is stationary.
I'm guessing, I've seen this before with microcontrollers.
Good luck
RC
Re: setting up a reflective object sensor for dummy's
« Reply #67 on: February 05, 2008, 01:25:26 PM »
Im using the OPB917B

this is the correct PDF
http://www.farnell.com/datasheets/81057.pdf

It does seem to call for a 10k pull up resistor. If i understand it right I would put the resistor between the white and blue wires coming off the switch?

Offline Chip

*
  • *
  •  2,056 2,056
  • Gainesville Florida USA
    • View Profile
Re: setting up a reflective object sensor for dummy's
« Reply #68 on: February 05, 2008, 01:43:43 PM »
Hi, Chris

Yes the actual Part # is needed, As far as the pull-up resistor I was off on that value a bit, With the data sheet a !0K ohm's if it's a OPB917BZ or

OPB9167OCZ.

While the switch only needs a short/narrow window to change state/on-off, Mach needs more time to see the state of change, Your slot width is fine.

The Index Deb-ounce is there mostly for mechanical switches, Thy tend to bounce a little and gives Mach time to see a steady/Relible state on the Input pin

Hi or Low.

Yes, White & Blue

Thanks, Chip
« Last Edit: February 05, 2008, 01:45:50 PM by Chip »
Re: setting up a reflective object sensor for dummy's
« Reply #69 on: February 05, 2008, 02:11:47 PM »
There may be some confusion here.
The first resistors mentioned by Chip and Hood are for "current limiting" and are most likely the proper value.
A "pull-up/dn" resistor serves a totally different purpose and is used to positively pull the signal high or low to eliminate any "floating" voltage.
You may need both.
RC