Host Engineering Forum
General Category => CTRIO and CTRIO2 => Topic started by: ArmstrongPLC on April 24, 2012, 06:49:50 PM
-
Hi all,
i have my CTRIO connected using quadrature counting mode. i have a limit switch that runs along the top of a board and the ctrio operates a router in and out to process the edge of the board. when the the limit switch hits the board i count 500 pulses then operate the CTRIO output for 10000 pulses, then release. the problem i am having is that when the limit switch reaches the end of the board and deactivates, the CTRIO sometimes receives a false input on release of the limit switch. if i manual connect direct to the input on the CTRIO i get the same thing unless i press and release the wire within a second, then everything works fine.
is there a solution?
-
This sounds like you need to debounce your limit switch with an RC circuit.
-
would you have a suggestion as to the size of capacitor/resistor to use in this RC circuit?
i was thinking 1 cer cap across 2c 2m and 1k resistor between 2c and limit switch.
-
The connections you mention will form a low pass filter. The 1k resistor could drop as much as 12V at the CTRIO maximum input current of 12mA, so be sure your power supply is at least 21VDC. The value of the cap will set the time constant, so 1uF would set a 1ms time constant. That seems like a good place to start. If you still have the issue, try increasing the cap size.
-
Just wondering. Obvious you have a plc since you have the ctrio. Ever thought of running the limit switch to the plc input and doing rungs to cancel out the bounce problem? You can use a plc output to trigger your ctrio. I always run switches to my plc, use a one-shot or timer or something to condition the signal. Not sure this would cause a time delay so that is why you are directly running the switch to the ctrio.
-
If I understand this correctly, the problem is the limit switch is appearing to open early? Is this a NO switch?
-
You may want to consider an optical switch to detect the edge of the board - that would eliminate having to deal with contact bounce.
-
PLCGuy; I get a varying delay when i run the limit switch through the PLC.
ATU; The switch is NO. When it closes it produces the required signal, but when it opens, it produces a second unwanted signal.
rgbarr; i am considering a capacitive proximity switch instead of an optical switch because of the sawdust contamination of the lens. not sure how accurate these things are at consistently sensing the edge of a board.
Tim; i have installed a 1uf cap across 2c,2m. this seems to have corrected the problem during testing. The machine will run all day today, hopefully no more problems.
Thanks for all your help. greatly appreciated.
-
Its odd that the double bounce is happening when the switch opens. Could be noise that is present all the time. When the switch is closed, the signal is above the threshold that would cause a problem and when the input is off, its a floating antenna. Did you use shielded cable out to the switch? Wires near your saw motor?
-
am using shielded cable to switch. although entire plc bank is located aprox 12" from ac power transformer. this was an existing system that i have upgraded. There is not much room in the control panel to relocate.
-
If the filter cap doesn't solve the problem, you could try something that worked for us. We use the CTRIO module inside servo based molding equipment. Never had a problem until we kept getting false home signals on one particular press. Everything was shielded and we had done this on at least 20 other installations without a problem. We even rewired the entire harness, but the problem persisted. We found out that the module requires 5ma for the input to come on or 9V across the input to ground. Thus the internal resistance is about 1800 ohms. We added a 2.2k resistor on the input of the module for the home sensor circuit. This raised the threshold voltage to the module to about 20V. Any voltages induced by noise were not high enough to trigger the input. After that the glitches on the input stopped and the system worked as it should without any added filter delays.
-
still occasional false signal on input. i am going to try out a 2.2k resistor across the input.
-
ATU, did you mean in parallel or series with the input? I read you to mean in series, but sounds like the other poster thought you meant parallel, to increase the load.
-
i am thinking across the input, parallel. is that what you meant ATU?
-
Put the resistor in series, directly on the input.
-
i connected a 2.1k resistor between 2c and 2m input. this has reduced the problem from 1 in 5 cycles to 1 in 30 cycles.
ATU; when you say directly on the input, i could be wrong, but to me this is parallel between 2c and 2m. Series would be between 2c and the limit switch.
are you saying between the limit switch and 2c?
-
Yes, put the resistance in series. You want to increase the resistance in that circuit. I was using a Photo eye with an NPN output which dropped another 2-3 Volts. Since you have a contact in the circuit, you may be able to have more resistance. For me, I took a 5k pot connected the wiper to the sensor and one of the ends to the input and adjusted it until the sensor just turned on the input reliably. Then measured the pot resistance to get an idea for a fixed resistor.
-
Guys, the only thing I would caution you on, is be careful about increasing the resistor value because of the voltage drop. Tim (the engineer of the CTRIO module) said, "The connections you mention will form a low pass filter. The 1k resistor could drop as much as 12V at the CTRIO maximum input current of 12mA, so be sure your power supply is at least 21VDC. The value of the cap will set the time constant, so 1uF would set a 1ms time constant. That seems like a good place to start. If you still have the issue, try increasing the cap size."
Increasing cap size has the same effect on time constant as increasing the resistor value with the added advantage of not increasing the voltage drop.
-
I'm just relating what worked for me. I sweated for 3 days over an injection molding press with handfuls of capacitors and a digital scope trying to clean up that signal.
After the conventional approach, I was trying everything. Sometime you get noise and you just can't isolate where its coming from.
-
resistor and cap still didn't work (but there was a small improvement) so i grounded out the switch by placing a copper wire against the switch lever so it rubs on the lever, constant contact. The switch case was already grounded. This corrected the problem. i suspect it is a static discharge when the roller lever leaves the edge of the melamine board. i think this is a good application for a non contact capacitive proximity sensor.
-
I don't know if you'd be able to tolerate the extra delay, but I once had a servo with an input that was turning on from noise, and I placed a mechanical relay right next to the servo with very short wires and energized it from the signal that was supposed to turn on that input. Voila, problem solved! I had tried all the resistors and caps (though not ATU's series resistor idea) with little to no improvement, and the relay did it. Your application sounds like it might be harmed more than helped if there were any bounce in the relay, though, so it might not work for you.
-
Good to hear that you solved your problem. Perhaps you may want to look at the source of the static build up. Static discharges in a dusty environment may not be a good situation. I would look at how your material handling is grounded and it might even be as simple as changing the material on your roller to something more conductive.