- Configuring LinuxCNC
- Basic Configuration
- Combined homes/limits on one input: Blocking other homes/limits during homing
Combined homes/limits on one input: Blocking other homes/limits during homing
09 Feb 2019 17:50 #126064
by MartyJ
Trying to home Y and Z with one input. I thought HOME_IS_SHARED = 1 would do it, until I found this little line in the docs:
"To use only one input for all homing and limits you will have to block the limit signals of the joints not homing in HAL and home one joint at a time."
My question is, how do I block the signals during homing? Is this a tristate bit thing? I can't find any reference to blocking signals in other places.
Background:
I have an XYZX gantry router.
I have one home/limit switch per axis, on three physical inputs, so one physical input functioning as home and limit for my Y and Z axes. They're normally closed and in series.
My HAL config looks like this:
My INI for the Y and Z axes looks like this:
"To use only one input for all homing and limits you will have to block the limit signals of the joints not homing in HAL and home one joint at a time."
My question is, how do I block the signals during homing? Is this a tristate bit thing? I can't find any reference to blocking signals in other places.
Background:
I have an XYZX gantry router.
I have one home/limit switch per axis, on three physical inputs, so one physical input functioning as home and limit for my Y and Z axes. They're normally closed and in series.
My HAL config looks like this:
net limit-home-y-z <= parport.0.pin-11-in
net limit-home-y-z => joint.2.home-sw-in
net limit-home-y-z => joint.2.pos-lim-sw-in
net limit-home-y-z => joint.1.home-sw-in
net limit-home-y-z => joint.1.neg-lim-sw-in
My INI for the Y and Z axes looks like this:
[AXIS_Y]
MAX_VELOCITY = 8.0
MAX_ACCELERATION = 20.0
MIN_LIMIT = -27.5
MAX_LIMIT = 0.01
[JOINT_1]
TYPE = LINEAR
HOME = -0.02
MIN_LIMIT = -27.5
MAX_LIMIT = 0.01
MAX_VELOCITY = 8.0
MAX_ACCELERATION = 20.0
STEPGEN_MAXACCEL = 25.0
SCALE = 2539.0
FERROR = 0.05
MIN_FERROR = 0.01
HOME_OFFSET = 0.04
HOME_SEARCH_VEL = 1.0000
HOME_LATCH_VEL = 0.050000
HOME_IGNORE_LIMITS = YES
HOME_IS_SHARED = 0
HOME_SEQUENCE = 2
[AXIS_Z]
MAX_VELOCITY = 3.0
MAX_ACCELERATION = 30.0
MIN_LIMIT = -9.0
MAX_LIMIT = 0.01
[JOINT_2]
TYPE = LINEAR
HOME = -0.02
MIN_LIMIT = -9.0
MAX_LIMIT = 0.01
MAX_VELOCITY = 3.0
MAX_ACCELERATION = 30.0
STEPGEN_MAXACCEL = 37.5
SCALE = 10150.0
FERROR = 0.05
MIN_FERROR = 0.01
HOME_OFFSET = 0.04
HOME_SEARCH_VEL = 1.0000
HOME_LATCH_VEL = 0.050000
HOME_IGNORE_LIMITS = YES
HOME_IS_SHARED = 1
HOME_SEQUENCE = 0
VOLATILE_HOME = 1
Please Log in or Create an account to join the conversation.
09 Feb 2019 19:55 #126077
by MartyJ
Replied by MartyJ on topic Combined homes/limits on one input: Blocking other homes/limits during homing
I am now trying to us Xor to block one axis while the other homes. Right now this is the best I've got (based on this thread: forum.linuxcnc.org/38-general-linuxcnc-q...it-switches?start=20)
#SET PIN 11 NC FOR Y AND Z LIM-HOME
net limit-home-y-z <= parport.0.pin-11-in
#TRYING TO BLOCK y while Z HOMING
net homing-z xor2.0.in0 <= joint.2.homing
net limit-home-y-z xor2.0.in1
net limit-y xor2.0.out => joint.1.home-sw-in joint.1.neg-lim-sw-in
net limit-home-y-z => joint.2.home-sw-in
#TRYING TO BLOCK z while y HOMING
net homing-y xor2.1.in0 <= joint.1.homing
net limit-home-y-z xor2.1.in1
net limit-z xor2.1.out => joint.2.home-sw-in joint.2.neg-lim-sw-in
net limit-home-y-z => joint.1.home-sw-in
Obviously the last lines containing "limit-home-y-z => joint.n.home" etc conflict with one another, I'm just not sure how to fix it.
#SET PIN 11 NC FOR Y AND Z LIM-HOME
net limit-home-y-z <= parport.0.pin-11-in
#TRYING TO BLOCK y while Z HOMING
net homing-z xor2.0.in0 <= joint.2.homing
net limit-home-y-z xor2.0.in1
net limit-y xor2.0.out => joint.1.home-sw-in joint.1.neg-lim-sw-in
net limit-home-y-z => joint.2.home-sw-in
#TRYING TO BLOCK z while y HOMING
net homing-y xor2.1.in0 <= joint.1.homing
net limit-home-y-z xor2.1.in1
net limit-z xor2.1.out => joint.2.home-sw-in joint.2.neg-lim-sw-in
net limit-home-y-z => joint.1.home-sw-in
Obviously the last lines containing "limit-home-y-z => joint.n.home" etc conflict with one another, I'm just not sure how to fix it.
Please Log in or Create an account to join the conversation.
09 Feb 2019 20:07 #126080
by rodw
Replied by rodw on topic Combined homes/limits on one input: Blocking other homes/limits during homing
There is an ini setting which should solve this.
HOME_IS_SHARED = 1
linuxcnc.org/docs/devel/html/config/ini-...html#_home_is_shared
You have it on one axis but not the other . From your description, it needs to be used for all of axes. Also make sure you move the axis off the switch during homing.
HOME_IS_SHARED = 1
linuxcnc.org/docs/devel/html/config/ini-...html#_home_is_shared
You have it on one axis but not the other . From your description, it needs to be used for all of axes. Also make sure you move the axis off the switch during homing.
Please Log in or Create an account to join the conversation.
09 Feb 2019 20:09 #126081
by MartyJ
Replied by MartyJ on topic Combined homes/limits on one input: Blocking other homes/limits during homing
My current HAL file has HOME_IS SHARED=1 on all axes...
docs say "To use only one input for all homing and limits you will have to block the limit signals of the joints not homing in HAL and home one joint at a time."
docs say "To use only one input for all homing and limits you will have to block the limit signals of the joints not homing in HAL and home one joint at a time."
Please Log in or Create an account to join the conversation.
09 Feb 2019 20:15 #126084
by rodw
Replied by rodw on topic Combined homes/limits on one input: Blocking other homes/limits during homing
Yes, sorry, I was too quick. I personally think for a gantry machine (particularly if it has any size to it), its better to use something like a Mesa 7i76e that has enough inputs to cover all of the limits and home signals seperately. I have one shared home/limit switch on the Z axis due to space considerations and it causes me no end of grief!
You might be able to use a mux2 to swap between true and false outputs for the other joints is not homing. (one input would be set with setp)
You might be able to use a mux2 to swap between true and false outputs for the other joints is not homing. (one input would be set with setp)
Please Log in or Create an account to join the conversation.
09 Feb 2019 21:25 #126096
by MartyJ
Replied by MartyJ on topic Combined homes/limits on one input: Blocking other homes/limits during homing
You're fine, thanks for the responses. Getting a Mesa board is almost certainly the "right answer", having the switches but not having an input is a wasted economy for sure. It's just a little frustrating because the xor command seems like it would work, I've just been unable to find a documented "known good" implementation of the xor so I can see how it's intended to be written. My programming knowledge isn't deep enough to make much sense of the man page on it.
Please Log in or Create an account to join the conversation.
09 Feb 2019 21:37 #126099
by rodw
XOR is an exclusive OR in bitwise logic operations. XOR means one or the other but not both eg:
10 => TRUE
01 => TRUE
00 => FALSE
11 => FALSE
with an OR, the last one would evaluate to True
So the component has 2 inputs being the two bits I showed above and the output is the TRUE/FALSE result where TRUE =1 and FALSE = 0
Replied by rodw on topic Combined homes/limits on one input: Blocking other homes/limits during homing
You're fine, thanks for the responses. Getting a Mesa board is almost certainly the "right answer", having the switches but not having an input is a wasted economy for sure. It's just a little frustrating because the xor command seems like it would work, I've just been unable to find a documented "known good" implementation of the xor so I can see how it's intended to be written. My programming knowledge isn't deep enough to make much sense of the man page on it.
XOR is an exclusive OR in bitwise logic operations. XOR means one or the other but not both eg:
10 => TRUE
01 => TRUE
00 => FALSE
11 => FALSE
with an OR, the last one would evaluate to True
So the component has 2 inputs being the two bits I showed above and the output is the TRUE/FALSE result where TRUE =1 and FALSE = 0
Please Log in or Create an account to join the conversation.
09 Feb 2019 21:39 #126100
by MartyJ
Replied by MartyJ on topic Combined homes/limits on one input: Blocking other homes/limits during homing
For future reference, I ended up using this:
net limit-home-y-z <= parport.0.pin-11-in
net limit-home-y-z => joint.2.home-sw-in
net limit-home-x-z => joint.2.pos-lim-sw-in
net limit-home-y-z => joint.1.home-sw-in
#net limit-home-y-z => joint.1.neg-lim-sw-in
My short-term solution is to roll with soft limits on joint 1 (Y axis) until I get a Mesa board. At least this gets me up and running so I can start writing my auto tool probe routines.
If anyone has a better solution down the road, I'd love to hear it.
net limit-home-y-z <= parport.0.pin-11-in
net limit-home-y-z => joint.2.home-sw-in
net limit-home-x-z => joint.2.pos-lim-sw-in
net limit-home-y-z => joint.1.home-sw-in
#net limit-home-y-z => joint.1.neg-lim-sw-in
My short-term solution is to roll with soft limits on joint 1 (Y axis) until I get a Mesa board. At least this gets me up and running so I can start writing my auto tool probe routines.
If anyone has a better solution down the road, I'd love to hear it.
Please Log in or Create an account to join the conversation.
09 Feb 2019 21:52 - 09 Feb 2019 21:53 #126101
by rodw
Replied by rodw on topic Combined homes/limits on one input: Blocking other homes/limits during homing
This is a bit long winded vs XOR2 but it might work
linuxcnc.org/docs/devel/html/man/man9/mux2.9.html
loadrt mux2 count=2
addf mux2.0 servo-thread
addf mux2.1 servo-thread
#SET PIN 11 NC FOR Y AND Z LIM-HOME
net limit-home-y-z <= parport.0.pin-11-in
# Z axis Homing
net limit-home-y-z => mux2.0.in0
setp mux2.0.in1 0
net homing-z <= joint.2.homing
net homing-z => mux2.0.sel
mux2.0.out => joint.2.home-sw-in
#Y axis homing
net limit-home-y-z => mux2.1.in0
setp mux2.1.in1 0
net homing-y <= joint.1.homing
net homing-y => mux2.1.sel
mux2.1.out => joint.1.home-sw-in
linuxcnc.org/docs/devel/html/man/man9/mux2.9.html
Last edit: 09 Feb 2019 21:53 by rodw.
Please Log in or Create an account to join the conversation.
09 Feb 2019 21:59 - 09 Feb 2019 22:00 #126103
by rodw
Replied by rodw on topic Combined homes/limits on one input: Blocking other homes/limits during homing
Actually, I think I have the order of the inputs wrong. More like this. Also halshow is your friend here as you can go through each pin one by one to check behaviour
loadrt mux2 count=2
addf mux2.0 servo-thread
addf mux2.1 servo-thread
#SET PIN 11 NC FOR Y AND Z LIM-HOME
net limit-home-y-z <= parport.0.pin-11-in
# Z axis Homing
net limit-home-y-z => mux2.0.in1
setp mux2.0.in0 0
net homing-z <= joint.2.homing
net homing-z => mux2.0.sel
mux2.0.out => joint.2.home-sw-in
#Y axis homing
net limit-home-y-z => mux2.1.in1
setp mux2.1.in0 0
net homing-y <= joint.1.homing
net homing-y => mux2.1.sel
mux2.1.out => joint.1.home-sw-in
Last edit: 09 Feb 2019 22:00 by rodw.
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Basic Configuration
- Combined homes/limits on one input: Blocking other homes/limits during homing
Time to create page: 0.098 seconds