Microswitch error
- jlviloria
- Offline
- Elite Member
Less
More
- Posts: 311
- Thank you received: 12
13 Mar 2019 02:38 #128479
by jlviloria
Microswitch error was created by jlviloria
Hello,
I'm configuring my turret, I'm using classicladder, it's a lathe cnc cincinnati, turret with 6 positions, very similar to the one published by Rick Lair.
The turret is equipped with 3 microswitches that indicate the position of the tool. with a binary system.
and a microswitch that is strobe position.
in classicladder I have a counter that indicates every time the microswitch strobe position is activated by adding one number at a time.
but if I do the tool change for example from tool1 to tool2. the counter shows value 1.
strobe position is activated 1 time. but the counter shows 4 instead of showing the number 2.
the machine has 5i25, 7i77, 7i64.
remove the microswitch and press it manually and in the counter it jumps of randomly, of 1 or 2 positions.
I thought it was the damaged microswitch, buy 3 new ones. and the same thing happens, the same thing happens to me with the binary system's microswitch.
thanks,
Jorge
I'm configuring my turret, I'm using classicladder, it's a lathe cnc cincinnati, turret with 6 positions, very similar to the one published by Rick Lair.
The turret is equipped with 3 microswitches that indicate the position of the tool. with a binary system.
and a microswitch that is strobe position.
in classicladder I have a counter that indicates every time the microswitch strobe position is activated by adding one number at a time.
but if I do the tool change for example from tool1 to tool2. the counter shows value 1.
strobe position is activated 1 time. but the counter shows 4 instead of showing the number 2.
the machine has 5i25, 7i77, 7i64.
remove the microswitch and press it manually and in the counter it jumps of randomly, of 1 or 2 positions.
I thought it was the damaged microswitch, buy 3 new ones. and the same thing happens, the same thing happens to me with the binary system's microswitch.
thanks,
Jorge
Please Log in or Create an account to join the conversation.
- PCW
- Away
- Moderator
Less
More
- Posts: 18041
- Thank you received: 4860
13 Mar 2019 03:43 #128482
by PCW
Replied by PCW on topic Microswitch error
This is actually expected behavior if you do not debounce the switch signals
The signals from the switch are being sampled at 1000 times a second (assuming the
servo thread period is 1 ms) but when a mechanical switch opens or closes it may
generate many contact closure/open events at this (1 ms) time scale instead of a
single level change.
Typically this is fixed by using LinuxCNCs debounce component, though it could also
be done in Classic Ladder
The signals from the switch are being sampled at 1000 times a second (assuming the
servo thread period is 1 ms) but when a mechanical switch opens or closes it may
generate many contact closure/open events at this (1 ms) time scale instead of a
single level change.
Typically this is fixed by using LinuxCNCs debounce component, though it could also
be done in Classic Ladder
Please Log in or Create an account to join the conversation.
- andypugh
- Offline
- Moderator
Less
More
- Posts: 23182
- Thank you received: 4869
14 Mar 2019 13:55 #128582
by andypugh
Replied by andypugh on topic Microswitch error
Can I suggest using the HAL "carousel" component instead?
But, the switch bounce really shouldn't matter. The strobe should activate after the encoder switches have settled, and it doesn't matter how many times it activates.
But, the switch bounce really shouldn't matter. The strobe should activate after the encoder switches have settled, and it doesn't matter how many times it activates.
Please Log in or Create an account to join the conversation.
Time to create page: 0.074 seconds