Hello Guest it is March 29, 2024, 08:33:37 AM

Author Topic: Opto switches behaving badly  (Read 11993 times)

0 Members and 1 Guest are viewing this topic.

Opto switches behaving badly
« on: January 18, 2010, 09:54:04 PM »
Dear Friends (can you tell I need help?)

I wanted to add homing switches to my mini mill.  After looking around I decided on purchasing these Opto Endstops switches; http://reprap.org/bin/view/Main/OptoEndstop_2_1 from searching the forums this switch seemed like a reasonable choice, a standard 5v source and easy to assemble.

So I assembled the switch and mounted it as shown on the Z axis.  Of course I did a bench test and every thing seemed ok.  Here is a photo of the Z opto endstop;

http://www.dfurlano.com/optoz.jpg

I created a small cover and taped it over the switch (in white) used a cat5 cable and I then connected the switch to a 5v power connector from inside my PC.  I checked the voltage and I was getting 5v in and 4.2v out of the switch.  When I move the Z up the LED lights and the voltage goes to zero and I thought I was ready to go.

After some consideration I thought I would buy a second parallel port for my PC after searching the forum I found that people had successfully used the SIIG Cyberpro board so I purchased a new one from Newegg and installed it in my PC.  I set the address for the SIIG and it again seemed to function properly.  

I then mounted all four homing switches and bench tested them. All seemed to work.  Then my luck ran out.  When I began testing I found first that some LED's were remaining lit after homing.  I read that the procedure is to hit the switch and then back off so it does not stay triggered.  Well I was getting all confused about what was going on so I started over with just the Z being connected.  But it is clear something is wrong not only does the LED remain lit but most times the homing stops short of actually triggering the switch.  I checked the voltage and clearly when I am off the switch I read 4.2v and when I am on I read zero.  Not sure if 4.2v is not good enough and that is why it is randomly stopping (seems odd that it would work then not work) or do I have another problem?

I somehow need to trouble shoot what is going on.  I tried to find a printer port monitor but the only one I can find have preset addresses to monitor the ports and my second port is not one of the presets.  

I am lost on what I should try and do and I was hoping that someone could give me a suggestion or offer any advice on how to figure this out.

As always thanks in advance for your help.

Dan

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Opto switches behaving badly
« Reply #1 on: January 19, 2010, 01:27:38 AM »
Dan, I'm thinking it may be noise. Do you have any debounce set in General config.? I'm a little confused about your post. If it does a homeing routine does the leds stay on after they should have moved off? If you jog away from the switches do the LEDs go out once you clear them? If your BOB is opticaly isolated and the switches that can cause a problem. Dual optical isolation isn't a good thing.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Opto switches behaving badly
« Reply #2 on: January 19, 2010, 02:44:57 AM »
See if there is voltage present at the BOB inputs.

I have all opto and two PP. On one of my BOBs, the input pins have about 1.2v on them all the time. No idea why the voltatge is there,  but it causes unreliable operation. I put resistors fropm the pins to ground to pull them down to zero volts and the problems went away.

The other BOB is a different brand and does not have the same behavior.
Re: Opto switches behaving badly
« Reply #3 on: January 19, 2010, 08:20:11 AM »
Guys thanks for the replys.  One very important point I forgot to tell you.  I have a Gecko G540 and after I searched the forum I decided to go directly into the printer port with the output signal from the Opto switches.  I am using 10,11,12,13 on the second parallel port. 

The LED staying on after homing is not consistent.  If the LED is on I get a message that a limit switch is active.  If I jog off the switch the LED does go off.

I will also check the debounce (I did not set it)  but for some reason I thought that was only for mechanical switches.  I will try this tonight when I get home.

Thanks

Dan
Re: Opto switches behaving badly
« Reply #4 on: January 19, 2010, 09:38:42 AM »
Most all opto switches do have debounce in their circuit already - a schmidt trigger. But it will not hurt a thing to add a bit more delay in Mach3.
Re: Opto switches behaving badly
« Reply #5 on: January 19, 2010, 05:01:48 PM »
I put a value of 100 in for both inputs and after some short testing the Z seems to work very well.  I will do more later but it looks to have solved the problem.

Thanks to everyone who responded, very much appreciated.

Dan

Offline Chaoticone

*
  • *
  •  5,624 5,624
  • Precision Chaos
    • View Profile
Re: Opto switches behaving badly
« Reply #6 on: January 19, 2010, 06:19:43 PM »
Good Dan, hopefuly your all set. Simpsons solution may be the most robust though. If setting debouce helps your problem it will tell us it is most likely noise. I should have explained it a little better. Debouce increases the time a signal state change has to be seen to be considered changed. For troubleshootiing you can set the debounce pretty high but if you have to set it very high to make the switches stable I would prefer resistors like simpson said. Other things to consider are wire routing and shielding.

Brett
;D If you could see the things I have in my head, you would be laughing too. ;D

My guard dog is not what you need to worry about!

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Opto switches behaving badly
« Reply #7 on: January 20, 2010, 06:01:55 AM »
In extreme cases in very noisy environments, you can also opt to run the signal side of the opto at 12V for more noise immunity. You then need to knock the 12V down to 5V be for connecting to the BOB.

I am making a little circuit board for signal boosting and running remote LEDs. It can also be used for the above mentioned task of knocking a high voltage signal down to 5V.

This is a video showing my previous mill routing the little boards. You will see the finished board at the end of the vid. Routing PCBs is new to me and it is really fun.

http://www.youtube.com/watch?v=r9Zf_5yHB1I
Re: Opto switches behaving badly
« Reply #8 on: January 20, 2010, 09:39:44 AM »
Currently I have the debounce at 30 for the Z axis.   It seems to work at 25 but I thought I would just be sure with 30.  I will find out if it changes once I hook up the other three switches and then I can decide what if anything else I should do to reduce the debounce. 

It sounds like there are 3 options to reducing the debounce;

1) Add a BOB of some type.
2) Somehow better isolating to reduce noise (grounding, shielding)
3) Increasing the opto to 12v for better noise immunity

Any other suggestions?

Dan

Offline simpson36

*
  •  1,369 1,369
    • View Profile
Re: Opto switches behaving badly
« Reply #9 on: January 20, 2010, 10:49:48 AM »
Be aware that debounce delays the recognition of a 'hit', so you may need to slow your homing so that the axis does not slam into the end of travel while the computer is figuring out if the signal is real or not.  :'(