Linking two gantry joints with homing switches so it unracks on home

More
07 May 2022 06:15 #242206 by dannym
I never had this working, although I do have 2 homing switches on the 7i92.  It runs them together until one switch on the left is tripped and stops both.  How do I get this to home to its switches?  Is it possible to use the software config to adjust for physical mounting inaccuracy?  e.g. if the actual trip point is 0.2" from the machine's well-calibrated, zero-rackings stops on the X1 side and the switch is 0.4" on the X2 side, can I program it so X2 will find the switch and then physically move X2 back -0.2" before declaring this physical orientation to be  the new machine coordinate X=0? 

HAL:
net switches-x1   hm2_[HOSTMOT2](BOARD).0.gpio.005.in_not => gantry.0.joint.00.home
net switches-x2   hm2_[HOSTMOT2](BOARD).0.gpio.003.in_not => gantry.0.joint.01.home
net home-x         <= gantry.0.home
net home-x          => joint.0.home-sw-in

INI:
[AXIS_X]
MIN_LIMIT = -0.62
MAX_LIMIT = 97.35
MAX_VELOCITY = 15
MAX_ACCELERATION = 50

[JOINT_0]
TYPE =              LINEAR
MAX_VELOCITY =       15
MAX_ACCELERATION =   50
MAX_JERK =   2000
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL =    21
STEPGEN_MAX_ACC =    96
BACKLASH =           0.000
SCALE =            1736.236364
MIN_LIMIT =             -0.62
MAX_LIMIT =             97.35
FERROR =    .0002
MIN_FERROR = .0001
HOME =                  0.000
HOME_OFFSET =           0
HOME_SEARCH_VEL =       -5
HOME_LATCH_VEL =        -1
HOME_FINAL_VEL =  5
HOME_USE_INDEX =        NO
HOME_IS_SHARED = NO
HOME_SEQUENCE = 2
HOME_IGNORE_LIMITS =    YES
# these are in nanoseconds
DIRSETUP   =              6000
DIRHOLD    =              6000
STEPLEN    =              8000
STEPSPACE  =              15000

# PID tuning params
DEADBAND =              0
P =                     1000
I =                     0
D =                     0
FF0 =                   0
FF1 =                   1
FF2 =0.00013
BIAS =                  0
MAX_OUTPUT =0
MAX_ERROR =0.0005

[JOINT_xwas3]
TYPE =              LINEAR
MAX_VELOCITY =       15
MAX_ACCELERATION =   50
MAX_JERK =   2000
# Set Stepgen max 20% higher than the axis
STEPGEN_MAX_VEL =    21
STEPGEN_MAX_ACC =    96
BACKLASH =           0.000
SCALE =            1736.236364
MIN_LIMIT =             -0.62
MAX_LIMIT =             97.35
FERROR =    .0002
MIN_FERROR = .0001
HOME =                  0.000
HOME_OFFSET =           0.0
HOME_SEARCH_VEL =       -5
HOME_LATCH_VEL =        -1
HOME_FINAL_VEL =  5
HOME_USE_INDEX =        NO
HOME_IS_SHARED = NO
HOME_SEQUENCE = 2
HOME_IGNORE_LIMITS =    YES
# these are in nanoseconds
DIRSETUP   =              6000
DIRHOLD    =              6000
STEPLEN    =              8000
STEPSPACE  =              15000

# PID tuning params
DEADBAND =              0
P =                     1000
I =                     0
D =                     0
FF0 =                   0
FF1 =                   1
FF2 =0.00013
BIAS =                  0
MAX_OUTPUT =0
MAX_ERROR =0.0005
 

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

More
07 May 2022 06:59 #242210 by Clive S
You need to have the joints that you want to synchronise HOME_SEQUENCE = 2 needs to be -2

# final home position machine-unit/sec
HOME =  0.000
# use this to square the gantry
HOME_OFFSET =   0 (use this for the amount of racking ie 2mm)

HOME_SEARCH_VEL = -5 (This is the speed to search to the switch the sign signifies the direction)
HOME_LATCH_VEL = -1 (speed to search, the sign signifies the direction usually opposite the above)
HOME_FINAL_VEL =  5 ( speed to final home)
HOME_USE_INDEX = NO
HOME_IS_SHARED = NO ( I would replace this with HOME_IGNORE_LIMITS = YES
HOME_SEQUENCE = 2 (This needs to be a -ve same number for both joints)

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

More
07 May 2022 20:44 #242249 by dannym
OK thanks will try!
>HOME_IS_SHARED = NO ( I would replace this with HOME_IGNORE_LIMITS = YES

I'm unclear on what IGNORE_LIMITS does. I have a non-shared homing switch on each axis but don't have separate limit switches. My homing switch is like 10mm from the endstop and after it finds it, then we use soft limits that is like 8mm past the switch location so it will come to a stop 2mm before crashing into the endstop. I didn't use IGNORE_LIMITS and it homed like I intended on all axes.

But there isn't a limit switch to ignore, just a homing switch.

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

More
07 May 2022 22:03 - 07 May 2022 22:07 #242275 by Clive S
This might help
linuxcnc.org/docs/devel/html/config/ini-homing.html

Re: HOME_IGNORE_LIMITS = YES This means that when homing and the switch is triggered it will ignore the switch as a limit until the machine is homed.

When it is homed the switch will act as a limit switch.

The soft limits will then be obeyed.

You can use the switch as a combined home and limit.

Edit: I think you are misunderstanding as you can use just one input for several switches BUT in your case you are using an input for each switch which is good.
Last edit: 07 May 2022 22:07 by Clive S.

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

More
08 May 2022 00:05 - 08 May 2022 00:07 #242278 by dannym
>I think you are misunderstanding as you can use just one input for several switches BUT in your case you are using an input for each switch which is good.

I understood how some machines can complicate things by combining switches from different axes, and I'm not doing that. I have no question on how that works.

I don't have anything specified as a limit switch, just homing. It never stops on the homing switch in jog, interpreter, or homing, even though it definitely reaches them at the extremes in normal operation.  But I never told it to HOME_IGNORE_LIMITS=YES to not use a homing switch as limit.

Now that IS a question I'm confused on. Is there a different pin inside the HAL for the axis +/- limit switches and by never connecting it in the HAL they just stay false and never stop the axes? But other config options would be to have a limit switch past the homing switch that you should never reach in normal operation, or that the homing switch can be tied to both the HAL's homing and limit input but after homing we restrict the max travel so it won't trip that switch in jog/interpreter mode unless there's a fault and it's about to crash on a stop or run off the rails?
Last edit: 08 May 2022 00:07 by dannym.

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

More
08 May 2022 07:19 #242293 by Clive S


Now that IS a question I'm confused on. Is there a different pin inside the HAL for the axis +/- limit switches and by never connecting it in the HAL they just stay false and never stop the axes? But other config options would be to have a limit switch past the homing switch that you should never reach in normal operation, or that the homing switch can be tied to both the HAL's homing and limit input but after homing we restrict the max travel so it won't trip that switch in jog/interpreter mode unless there's a fault and it's about to crash on a stop or run off the rails?


# ---setup home / limit switch signals---

net x-home-sw => joint.0.home-sw-in
net x-neg-limit => joint.0.neg-lim-sw-in
net x-pos-limit => joint.0.pos-lim-sw-in


Does the gantry now run in sync ?(it only runs in sync when it has homed )

In the axis gui before homing you should see 4 joints
then when the machine is homed it should change to 3 axis ie just X,Y Z

This MIGHT depend on what version of linuxcnc and what gui you have loaded

Posting the full hal and ini files helps

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

More
09 May 2022 00:36 #242338 by andypugh

Is it possible to use the software config to adjust for physical mounting inaccuracy?  
 

As this bit hasn't been answered: 
Yes, you can tweak the HOME_OFFSET in the INI to adjust for the actual positions of the switch operating points. 
 

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

More
09 May 2022 07:24 #242360 by dannym
Files enclosed

I went with HOME_SEQUENCE = -2 and get:
1.  The gantry ignores both switches entirely and hits the endstops.  These switches definitely work, I went back to the 2.7 box and it works fine, although that only uses one switch.  I did note that with HOME_SEQUENCE = -2 neither joint stops on its switch, both drove to the endstops.
2.  It's telling me I can't jog the gantry until it's homed and out of Joint mode.  We do need to be able to jog the axis while unhomed in case it's in a problem condition.  Case in point, I saw an immediate prob in that debugging this is awkward because I can't physically jog the X off the endstops so I can try something else to make the homing-unracking work, although I did simply revert to HOME_SEQUENCE = 2 so I can jog off the stops then make some .ini changes and try again.

I also tested the rotary axis, it is now configured so it just skips the sequence and instant-homes since it doesn't have any homing switch.  It won't let me MDI to move it while unhomed, even though there is no actual homing step.  Tried Touch-Off, which, granted, isn't Machine Coords, but it says I can't do Touch-Off either because it's not homed.

I would expect that if we power up the machine and it says A=42 deg , I could type G0 A52 if I needed to reposition it 10 deg.  Is there a way to allow that?
Attachments:

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

More
09 May 2022 13:33 - 09 May 2022 16:47 #242375 by Clive S
I have not come across these pins: gantry.0.joint.00.home

net switches-x1 hm2_[HOSTMOT2](BOARD).0.gpio.005.in_not => gantry.0.joint.00.home
net switches-x2 hm2_[HOSTMOT2](BOARD).0.gpio.003.in_not => gantry.0.joint.01.home

What version of linuxcnc are you using ?

Can you see the switches toggle with HALSHOW

linuxcnc.org/docs/devel/html/hal/tools.html#_halshow
Last edit: 09 May 2022 16:47 by Clive S. Reason: Editor messed up

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

More
09 May 2022 14:22 #242379 by dannym
LinuxCNC 2.8.2. I'm upgrading from a 2.7 machine, which was set up with 2 homing switches on the X (gpio 005 and 003) but LinuxCNC has only been configured to home on one of them, so it wouldn't unrack itself.

The switches did toggle last I checked. But right now, neither half of the X stops when it gets to a switch, they both drive into the stop

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

Time to create page: 0.100 seconds
Powered by Kunena Forum