View Full Version : koyo (automation direct) help

December 2nd, 2002, 02:30 PM
Here is the problem that I have
The program relies on x4 toggling back and forth from on/off to create the timing and thus the location of the machine.
Basically each on is one index or vial movement of the machine and so is the off.

What is happening is the source for the x4 input sucks. Sometimes it
makes a double on because of electric noise. The Koyo goes well that's weird and throws **** away.

Could someone help me write something that would make it so the on impulse would have some sort of millisecond timer that would be able to discount any further impulses until it should see the off impulse.

The catch is you can not hold the on impulse on because it will not toggle the bit correctly.

Any help that any one could give me will be appreceated

Eric Nelson
December 2nd, 2002, 03:21 PM
Try this:
| X4 T1 C1
|---] [---+---]/[---+---(PD)
| | |
| C0 | | C0
|---] [---+ +---(OUT)
| |
| | +-----+
| +---| TMR |
| | T1 |
| | K5 |
| +-----+

Use C1 in place of X4 as your "impulse"
When X4 turns ON, C1 turns ON for one scan
C0 simply latches until the timer expires, so input X4 is "ignored" for the time dictated by T1



Steve Bailey
December 2nd, 2002, 08:37 PM
Eric's logic is sometimes called a "pulse stretcher". It will work fine if you can be sure that every time the contact bounces, it is associated with a bona fide transition from Off to On.

However, it doesn't address the potential for contact bounce on the On-to-Off transition. Nor does it filter out a miscellaneous spike such as might be generated if the switch was tripped for just a few milliseconds.

It will work correctly if the switch signal looks like this:

/\ /\ / \
___/ \/ \/ \_____

But not if it looks like this:

/\ / \
___/ \_______________/ \_______
| |
| This time is |
|longer than T1 |


Here's a more generic solution:

X4 _____
--| |------| |
| TMR |
| T1 |

X4 _____
--|/|------| |
| TMR |
| T2 |

Next On
T1 Is On Pulse
---| |----| |------(PD)-

Next Off
T2 Is On Pulse
---| |----|/|------(PD)-

Off Next
Pulse Is On
---| |--------------(L)-

On Next
Pulse Is On
---| |--------------(U)-