GeePaw Posted December 23, 2021 Share Posted December 23, 2021 Folks... Here are three rising edge-detector circuits. The first two came from the archives, and were fairly old. They're meant to detect a rising edge: when the switch goes from red to green, the output goes to green. All three circuits do this. The top one sends a single short pulse of 1 tick. The middle and bottom let you set the duration of the pulse using the filter's timing. But. The top and the middle have a problem: they also detect a *falling* edge, sending a tiny blip pulse when the switch goes green to red. This is not a problem if you're using the output to control most hardware, a sweeper or an aquatuner, let's say. But if you're using it to control the reset port on a memory toggle or the conveyor meter, you'll get a reset both on the rising and the falling edge, which likely isn't what you wanted. It took me an embarrassingly long time to figure out the issue: the gates before the XOR take time to react, and on a falling edge, for one tick, the upper XOR input is green and the lower one is red, so the XOR fires green. The fix, synchronize them by inserting that ribbon-reader, which takes the same amount of time as the filter does to pass its signal along. On the one hand, maybe this will help someone else. On the other hand, I absolutely suck at hardware logic: If someone uses a simpler and more compact perfect single-edge detector, please show it off. Seeya -- @GeePaw Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/ Share on other sites More sharing options...
Saturnus Posted December 23, 2021 Share Posted December 23, 2021 I think the below from an old post of mine are the ones most people use I reckon. For a positive edge detector you can also use a counter set to 1 with output and reset connected which obviously also makes a negative edge detector by having a NOT in front of the counter. Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/#findComment-1527650 Share on other sites More sharing options...
gabberworld Posted December 23, 2021 Share Posted December 23, 2021 2 hours ago, GeePaw said: On the one hand, maybe this will help someone else. On the other hand, I absolutely suck at hardware logic: If someone uses a simpler and more compact perfect single-edge detector, please show it off. one thing you are wrong at here. that is a software logic what we deal in here, you may not experience like that in hardware or it may act little differently Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/#findComment-1527655 Share on other sites More sharing options...
Tuode Posted December 24, 2021 Share Posted December 24, 2021 7 hours ago, Saturnus said: Aren't these builds also affected by the issue mentioned above? Sorry if this is a stupid question, for I don't play around with automation very often Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/#findComment-1527768 Share on other sites More sharing options...
nakomaru Posted December 24, 2021 Share Posted December 24, 2021 1 hour ago, Tuode said: Aren't these builds also affected by the issue mentioned above? Sorry if this is a stupid question, for I don't play around with automation very often On the contrary - they specifically exploit the fact that gates take 0.1 seconds to update. That's part of the role of the NOT gate on the left - to allow a double green or double red signal to the center gate for only a moment. Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/#findComment-1527794 Share on other sites More sharing options...
Sasza22 Posted December 24, 2021 Share Posted December 24, 2021 Personally i use a buffer gate with a XoR for one edge and a filter with XoR for the other, then both a filter ande a buffer for both edges. Additionally a 0.2s filter at the edge to avoid false positives. There are probably better setups than that but this one seems the easiest for me to understand. Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/#findComment-1527935 Share on other sites More sharing options...
Occam Blazer Posted December 29, 2021 Share Posted December 29, 2021 Top to bottom: Rising edge detector; falling edge detector; toggle detector. (two versions each) The signal counters' outputs are connected to their reset port. Switch them to advanced mode and set to 1%. Link to comment https://forums.kleientertainment.com/forums/topic/136451-edge-detection-circuits/#findComment-1529050 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.
Please be aware that the content of this thread may be outdated and no longer applicable.