Gui message while homing with shared home/limit swiches

More
2 months 3 weeks ago #348616 by rubes
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

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #348617 by tuxcnc

# =====================================================================
# 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
 
I don't understand why and what for ...

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.

More
2 months 3 weeks ago - 2 months 3 weeks ago #348619 by rubes
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
Last edit: 2 months 3 weeks ago by rubes. Reason: added one line

Please Log in or Create an account to join the conversation.

More
2 months 3 weeks ago #348645 by rodw

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.
 
Personally, I like writing statements on separate lines. I find its easier to understand and maintain

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #348662 by tuxcnc
I can't help you.
I gave you working example.
You only have to remove from your config unnecessary stuff and replace parport pin by mesa pin.
But you see only that is one line not many...

Please Log in or Create an account to join the conversation.

More
2 months 2 weeks ago #348669 by rubes
thanx, but I already had a working solution to my "problem" so didnt actually need your help by that time. I guess i am obviously an idiot because i didn't fall all over myself thanking you, and using your solution rather than the one i worked hard at figuring out while not knowing anything about HAL or Linuxcnc.

Please Log in or Create an account to join the conversation.

Moderators: cmorley
Time to create page: 0.102 seconds
Powered by Kunena Forum