shared home/limit swiches
- rubes
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 2
05 Aug 2026 19:32 #348471
by rubes
shared home/limit swiches was created by rubes
i have a RPI-4 running linuxcnc 2.9.10. using a 7i96s, the qtdragon GUI, and inductive proximity switches. i have one switch acting as both home and limit.
everything is working perfectly except for a minor annoyance on the status bar. when i home, and the axis move toward the home switch, initially trips the switch, it properly reverses off the switch (search velocity is positive, and latch velocity is negative so the axis is of the switch), then continues on to the final home position. but when it initially hits the switch, the status bar shows "hard limit tripped". the machine doesn't stop, so it is properly ignoring limits while homing. the fault clears itself after several seconds. just curious why this is happening. i thought i read somewhere that it re-enabled limits after the cycle was done, apparently not the case? I assume if it bothers me enough i could learn/write some HAL code to block it in the GUI?? or better yet just use the switch as home, and just rely on the soft limits
everything is working perfectly except for a minor annoyance on the status bar. when i home, and the axis move toward the home switch, initially trips the switch, it properly reverses off the switch (search velocity is positive, and latch velocity is negative so the axis is of the switch), then continues on to the final home position. but when it initially hits the switch, the status bar shows "hard limit tripped". the machine doesn't stop, so it is properly ignoring limits while homing. the fault clears itself after several seconds. just curious why this is happening. i thought i read somewhere that it re-enabled limits after the cycle was done, apparently not the case? I assume if it bothers me enough i could learn/write some HAL code to block it in the GUI?? or better yet just use the switch as home, and just rely on the soft limits
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 12067
- Thank you received: 4116
09 Aug 2026 10:49 #348587
by rodw
Replied by rodw on topic shared home/limit swiches
If you have shared home/limit switch, you should add a HOME_OFFSET to move off the switch before homing finishes to avoid this.
Please Log in or Create an account to join the conversation.
- rubes
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 2
09 Aug 2026 13:52 #348595
by rubes
Replied by rubes on topic shared home/limit swiches
that was what I understood to be the case...but it isnt!!! ive done .1" to 1" offsets in both positive and negative. it dont matter. all that does is change the final parking position of home.
The hard stop tripped status shows up instantly when the axis hits the switch initially.
this is just a visual annoyance at this time so ill deal with it the way it is.
The hard stop tripped status shows up instantly when the axis hits the switch initially.
this is just a visual annoyance at this time so ill deal with it the way it is.
Please Log in or Create an account to join the conversation.
- PCW
-
- Offline
- Moderator
-
Less
More
- Posts: 18008
- Thank you received: 5289
09 Aug 2026 14:07 #348596
by PCW
Replied by PCW on topic shared home/limit swiches
Shared home/limit switches are pretty common so I would expect more
complaints about this if this always happened.
I wonder if this is possibly caused by contact bounce.
Have you set the switch input inm pins to "slow" ?
complaints about this if this always happened.
I wonder if this is possibly caused by contact bounce.
Have you set the switch input inm pins to "slow" ?
Please Log in or Create an account to join the conversation.
- rubes
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 2
09 Aug 2026 14:20 #348599
by rubes
Replied by rubes on topic shared home/limit swiches
I was thinking the same thing about if it was "normal" I would have been able to find those posts. So i just assumed maybe I just didnt set something up right yet (like the slow parameter you mentioned, Ill give that a try). thanx
Please Log in or Create an account to join the conversation.
- rubes
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 2
09 Aug 2026 14:22 #348600
by rubes
Replied by rubes on topic shared home/limit swiches
oh, by the way, im using inductive switches.
Please Log in or Create an account to join the conversation.
- rubes
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 2
09 Aug 2026 20:30 #348616
by rubes
Replied by rubes on topic shared home/limit swiches
i tried
setp hm2_7i96s.0.inm.00.input-00-slow true
but saw no diffference. maybe there are other things that need to go along with that but im no HAL programmer.
as such i made friends with google AI and had him write me some code to block the hard limit status in the status bar. it took several passes, and even i got to call him out when i knew something was wrong. eventually here is what he came up with, so i put it in my custom.hal and it works. figured i would post it in case anyone else runs into this and finds this thread;
# =====================================================================
# OVERRIDE X, Y, Z LIMIT FLASHING DURING HOMING (Safe from pncconf)
# =====================================================================
# 1. Load 3 instances of each logic gate (one per axis/joint)
loadrt and2 count=3
loadrt not count=3
# 2. Add them all to the real-time processing thread
addf and2.0 servo-thread
addf and2.1 servo-thread
addf and2.2 servo-thread
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
# =====================================================================
# JOINT 0: X-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the X limit pins
unlinkp joint.0.neg-lim-sw-in
unlinkp joint.0.pos-lim-sw-in
# Invert X homing status (Output goes FALSE when homing)
net x-is-homing <= joint.0.homing
net x-is-homing => not.0.in
# Mask the X signal during homing
net min-home-x => and2.0.in0
net x-mask-control <= not.0.out
net x-mask-control => and2.0.in1
# Route masked signal back to X limits
net min-home-x-gated <= and2.0.out
net min-home-x-gated => joint.0.neg-lim-sw-in
net min-home-x-gated => joint.0.pos-lim-sw-in
# =====================================================================
# JOINT 1: Y-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the Y limit pins
unlinkp joint.1.neg-lim-sw-in
unlinkp joint.1.pos-lim-sw-in
# Invert Y homing status (Output goes FALSE when homing)
net y-is-homing <= joint.1.homing
net y-is-homing => not.1.in
# Mask the Y signal during homing
net min-home-y => and2.1.in0
net y-mask-control <= not.1.out
net y-mask-control => and2.1.in1
# Route masked signal back to Y limits
net min-home-y-gated <= and2.1.out
net min-home-y-gated => joint.1.neg-lim-sw-in
net min-home-y-gated => joint.1.pos-lim-sw-in
# =====================================================================
# JOINT 2: Z-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the Z limit pins
unlinkp joint.2.neg-lim-sw-in
unlinkp joint.2.pos-lim-sw-in
# Invert Z homing status (Output goes FALSE when homing)
net z-is-homing <= joint.2.homing
net z-is-homing => not.2.in
# Mask the Z signal during homing (Change 'min-home-z' if pncconf used 'max-home-z')
net min-home-z => and2.2.in0
net z-mask-control <= not.2.out
net z-mask-control => and2.2.in1
# Route masked signal back to Z limits
net min-home-z-gated <= and2.2.out
net min-home-z-gated => joint.2.neg-lim-sw-in
net min-home-z-gated => joint.2.pos-lim-sw-in
setp hm2_7i96s.0.inm.00.input-00-slow true
but saw no diffference. maybe there are other things that need to go along with that but im no HAL programmer.
as such i made friends with google AI and had him write me some code to block the hard limit status in the status bar. it took several passes, and even i got to call him out when i knew something was wrong. eventually here is what he came up with, so i put it in my custom.hal and it works. figured i would post it in case anyone else runs into this and finds this thread;
# =====================================================================
# OVERRIDE X, Y, Z LIMIT FLASHING DURING HOMING (Safe from pncconf)
# =====================================================================
# 1. Load 3 instances of each logic gate (one per axis/joint)
loadrt and2 count=3
loadrt not count=3
# 2. Add them all to the real-time processing thread
addf and2.0 servo-thread
addf and2.1 servo-thread
addf and2.2 servo-thread
addf not.0 servo-thread
addf not.1 servo-thread
addf not.2 servo-thread
# =====================================================================
# JOINT 0: X-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the X limit pins
unlinkp joint.0.neg-lim-sw-in
unlinkp joint.0.pos-lim-sw-in
# Invert X homing status (Output goes FALSE when homing)
net x-is-homing <= joint.0.homing
net x-is-homing => not.0.in
# Mask the X signal during homing
net min-home-x => and2.0.in0
net x-mask-control <= not.0.out
net x-mask-control => and2.0.in1
# Route masked signal back to X limits
net min-home-x-gated <= and2.0.out
net min-home-x-gated => joint.0.neg-lim-sw-in
net min-home-x-gated => joint.0.pos-lim-sw-in
# =====================================================================
# JOINT 1: Y-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the Y limit pins
unlinkp joint.1.neg-lim-sw-in
unlinkp joint.1.pos-lim-sw-in
# Invert Y homing status (Output goes FALSE when homing)
net y-is-homing <= joint.1.homing
net y-is-homing => not.1.in
# Mask the Y signal during homing
net min-home-y => and2.1.in0
net y-mask-control <= not.1.out
net y-mask-control => and2.1.in1
# Route masked signal back to Y limits
net min-home-y-gated <= and2.1.out
net min-home-y-gated => joint.1.neg-lim-sw-in
net min-home-y-gated => joint.1.pos-lim-sw-in
# =====================================================================
# JOINT 2: Z-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the Z limit pins
unlinkp joint.2.neg-lim-sw-in
unlinkp joint.2.pos-lim-sw-in
# Invert Z homing status (Output goes FALSE when homing)
net z-is-homing <= joint.2.homing
net z-is-homing => not.2.in
# Mask the Z signal during homing (Change 'min-home-z' if pncconf used 'max-home-z')
net min-home-z => and2.2.in0
net z-mask-control <= not.2.out
net z-mask-control => and2.2.in1
# Route masked signal back to Z limits
net min-home-z-gated <= and2.2.out
net min-home-z-gated => joint.2.neg-lim-sw-in
net min-home-z-gated => joint.2.pos-lim-sw-in
Please Log in or Create an account to join the conversation.
- tuxcnc
- Offline
- Elite Member
-
Less
More
- Posts: 204
- Thank you received: 33
09 Aug 2026 21:03 #348617
by tuxcnc
In hal file :
net min-home-x <= parport.0.pin-12-in-not => joint.0.home-sw-in => joint.0.neg-lim-sw-in
In ini file :
[JOINT_0]
HOME_IGNORE_LIMITS = YES
Replied by tuxcnc on topic shared home/limit swiches
I don't understand why and what for ...# =====================================================================
# JOINT 0: X-AXIS CONFIGURATION
# =====================================================================
# Disconnect pncconf's direct mapping to the X limit pins
unlinkp joint.0.neg-lim-sw-in
unlinkp joint.0.pos-lim-sw-in
# Invert X homing status (Output goes FALSE when homing)
net x-is-homing <= joint.0.homing
net x-is-homing => not.0.in
# Mask the X signal during homing
net min-home-x => and2.0.in0
net x-mask-control <= not.0.out
net x-mask-control => and2.0.in1
# Route masked signal back to X limits
net min-home-x-gated <= and2.0.out
net min-home-x-gated => joint.0.neg-lim-sw-in
net min-home-x-gated => joint.0.pos-lim-sw-in
In hal file :
net min-home-x <= parport.0.pin-12-in-not => joint.0.home-sw-in => joint.0.neg-lim-sw-in
In ini file :
[JOINT_0]
HOME_IGNORE_LIMITS = YES
Please Log in or Create an account to join the conversation.
- rubes
- Offline
- Senior Member
-
Less
More
- Posts: 42
- Thank you received: 2
09 Aug 2026 21:26 - 09 Aug 2026 21:27 #348619
by rubes
Replied by rubes on topic shared home/limit swiches
that is what everyone gas been telling me (the part about home_ignore_limits). that other line i dont understand because i am not a HAL programmer. but there is probly several ways to accomplish this. if your one line per axis accomplishes the same thing, it is certainly more elegant and efficient.
the problem, which is really just an annoyance, is that even though ignor_limits is set to yes, when the axis is homing and touches the switch, it flashes the hard limits tripped error on the status bar for several seconds (At least on my machine it does, apparently im the only one). it doesnt actually stop the machine though, so the logic is properly ignoring the limit switch. I just wanted to cleanup the screen a bit, try and learn some HAL, and yeah even try out this AI thing since ive never been a big fan. its actually kind of cool.
oh, one more thing, i'm using QtDragon
the problem, which is really just an annoyance, is that even though ignor_limits is set to yes, when the axis is homing and touches the switch, it flashes the hard limits tripped error on the status bar for several seconds (At least on my machine it does, apparently im the only one). it doesnt actually stop the machine though, so the logic is properly ignoring the limit switch. I just wanted to cleanup the screen a bit, try and learn some HAL, and yeah even try out this AI thing since ive never been a big fan. its actually kind of cool.
oh, one more thing, i'm using QtDragon
Last edit: 09 Aug 2026 21:27 by rubes. Reason: added one line
Please Log in or Create an account to join the conversation.
- rodw
-
- Offline
- Platinum Member
-
Less
More
- Posts: 12067
- Thank you received: 4116
11 Aug 2026 12:35 #348645
by rodw
Replied by rodw on topic shared home/limit swiches
Personally, I like writing statements on separate lines. I find its easier to understand and maintainthat is what everyone gas been telling me (the part about home_ignore_limits). that other line i dont understand because i am not a HAL programmer. but there is probly several ways to accomplish this. if your one line per axis accomplishes the same thing, it is certainly more elegant and efficient.
Please Log in or Create an account to join the conversation.
Time to create page: 0.122 seconds