X and Z homeswitches shared, Ya and Yb using own switches, is this possible?

More
12 Feb 2018 13:58 - 12 Feb 2018 14:25 #105788 by ikkuh
hi,

having loads of fun trying to get LinuxCNC to do what I want. I now have a gantry style machine that homes all axis by itself.
Since I have to use separate switches for Ya and Yb I had to sacrifice my probe input to use as a homeswitch for Yb.
Would like to have the probe back :)

Question:
Is it possible to put the homeswitches for X and Z together, in stepconf you can say 'all home'. But all homes in one input will not work because of the separate homing switches needed to get the gantry to square itself.

anybody know a solution? (I ordered a second parallel port, but that will not be here for a few weeks).

(LinuxCNC is great software btw! I like how it works, especially with Gmoccapy)
Last edit: 12 Feb 2018 14:25 by ikkuh.

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

More
14 Feb 2018 11:30 #105912 by ikkuh

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

More
14 Feb 2018 13:13 #105915 by rodw
You need to forget about stepconf at this point and learn how to edit hal and ini files.

I would expect home switches sharing one input would work if you follow Todd's post on the thread you linked to. But I've never tried it.

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

More
14 Feb 2018 13:28 #105916 by ikkuh

You need to forget about stepconf at this point and learn how to edit hal and ini files.


Was not using stepconf.

I would expect home switches sharing one input would work if you follow Todd's post on the thread you linked to. But I've never tried it.

Ok, will give it a go then. Thanks for your reaction.

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

More
14 Feb 2018 13:59 #105919 by Todd Zuercher
I believe that it should be possible for the Yb home switch to share it's input with your Probe. (Since probing and homing never occur at the same time.)
But first you need to figure out the homing and get it configured. Adding the probe should be fairly simple afterward.

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

More
14 Feb 2018 14:01 - 14 Feb 2018 14:11 #105920 by ikkuh

I believe that it should be possible for the Yb home switch to share it's input with your Probe. (Since probing and homing never occur at the same time.)

Ok, will try that, sounds logical. Thanks.

But first you need to figure out the homing and get it configured. Adding the probe should be fairly simple afterward.

Homing works already. The gantry is squared and all axis are homed.

Does not work, I get a message saying that probe was tripped during homing.
Last edit: 14 Feb 2018 14:11 by ikkuh.

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

More
14 Feb 2018 14:12 #105921 by Todd Zuercher
I need to add 1 caveat, If the Yb home switch is also used as a Limit switch, then it can not share it's input with the Probe, (it can share with other limits though such as X or Z) However if Ya has limit switches, having limits on Yb seems like it may be an unnecessary redundancy.

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

More
14 Feb 2018 14:22 - 14 Feb 2018 14:24 #105922 by ikkuh

I need to add 1 caveat, If the Yb home switch is also used as a Limit switch, then it can not share it's input with the Probe, (it can share with other limits though such as X or Z) However if Ya has limit switches, having limits on Yb seems like it may be an unnecessary redundancy.



No limit switches, just home switches.
I tried almost all combinations now, it looks like it is not possible to 'reuse' a homing switch as a probe input. I get the error that the probe was triggered during homing.
# Generated by stepconf 1.1 at Thu Feb  8 12:13:55 2018
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0x378 out"
setp parport.0.reset-time 5000
####https://forum.linuxcnc.org/49-basic-configuration/33867-how-to-connect-home-switches-for-dual-motor-on-3-axis-machine-2-8-pre-master#104933
loadrt stepgen step_type=0,0,0,0
loadrt pwmgen output_type=1

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf pwmgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread

net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= motion.spindle-on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm
setp pwmgen.0.pwm-freq 16000.0
setp pwmgen.0.scale 1075.0
setp pwmgen.0.offset 0.0857142857143
setp pwmgen.0.dither-pwm true
net spindle-cmd-rpm     <= motion.spindle-speed-out
net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cmd-rps     <= motion.spindle-speed-out-rps
net spindle-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-at-speed    => motion.spindle-at-speed

##net probe-in => motion.probe-input

net spindle-pwm     => parport.0.pin-01-out

net xstep           => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
setp parport.0.pin-03-out-invert 1
net xdir            => parport.0.pin-03-out

net yRstep           => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
net yRdir            => parport.0.pin-05-out

net zstep           => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net zdir            => parport.0.pin-07-out

net yLstep           => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
net yLdir            => parport.0.pin-09-out

net xenable         => parport.0.pin-14-out
net spindle-on      => parport.0.pin-17-out
net estop-ext       <= parport.0.pin-10-in
#net probe-in        <= parport.0.pin-11-in-not
net home-x          <= parport.0.pin-12-in-not
net home-yR          <= parport.0.pin-11-in-not
net home-yL          <= parport.0.pin-13-in-not
net home-z          <= parport.0.pin-15-in-not

setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable joint.0.amp-enable-out => stepgen.0.enable
net home-x => joint.0.home-sw-in

setp stepgen.1.position-scale [JOINT_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net yRpos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
net yRpos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
net yRstep <= stepgen.1.step
net yRdir <= stepgen.1.dir
net yRenable joint.1.amp-enable-out => stepgen.1.enable
net home-yR => joint.1.home-sw-in
##copy
setp stepgen.2.position-scale [JOINT_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
net yLpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
net yLpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
net yLstep <= stepgen.2.step
net yLdir <= stepgen.2.dir
net yLenable joint.2.amp-enable-out => stepgen.2.enable
net home-yL => joint.2.home-sw-in

setp stepgen.3.position-scale [JOINT_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 35000
setp stepgen.3.dirsetup 35000
setp stepgen.3.maxaccel [JOINT_3]STEPGEN_MAXACCEL
net zpos-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
net zpos-fb stepgen.3.position-fb => joint.3.motor-pos-fb
net zstep <= stepgen.3.step
net zdir <= stepgen.3.dir
net zenable joint.3.amp-enable-out => stepgen.3.enable
net home-z => joint.3.home-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

net probe  motion.probe-input <= parport.0.pin-12-in
Last edit: 14 Feb 2018 14:24 by ikkuh.

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

More
14 Feb 2018 16:27 #105928 by Todd Zuercher
You need to set it up so the probe is disabled during homing. Like this, use a tristate bit component to disable the probe while the axis is homing. You also need to be certain that the axis sharing the home switch won't trip the home switch while you are probing.
# Generated by stepconf 1.1 at Thu Feb  8 12:13:55 2018
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0x378 out"
setp parport.0.reset-time 5000
####https://forum.linuxcnc.org/49-basic-configuration/33867-how-to-connect-home-switches-for-dual-motor-on-3-axis-machine-2-8-pre-master#104933
loadrt stepgen step_type=0,0,0,0
loadrt pwmgen output_type=1
loadrt tristate_bit count=1

addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf pwmgen.make-pulses base-thread
addf tristate-bit.0 base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread

addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf pwmgen.update servo-thread

net spindle-cmd-rpm => pwmgen.0.value
net spindle-on <= motion.spindle-on => pwmgen.0.enable
net spindle-pwm <= pwmgen.0.pwm
setp pwmgen.0.pwm-freq 16000.0
setp pwmgen.0.scale 1075.0
setp pwmgen.0.offset 0.0857142857143
setp pwmgen.0.dither-pwm true
net spindle-cmd-rpm     <= motion.spindle-speed-out
net spindle-cmd-rpm-abs <= motion.spindle-speed-out-abs
net spindle-cmd-rps     <= motion.spindle-speed-out-rps
net spindle-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
net spindle-at-speed    => motion.spindle-at-speed

##net probe-in => motion.probe-input

net spindle-pwm     => parport.0.pin-01-out

net xstep           => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
setp parport.0.pin-03-out-invert 1
net xdir            => parport.0.pin-03-out

net yRstep           => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
net yRdir            => parport.0.pin-05-out

net zstep           => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
net zdir            => parport.0.pin-07-out

net yLstep           => parport.0.pin-08-out
setp parport.0.pin-08-out-reset 1
net yLdir            => parport.0.pin-09-out

net xenable         => parport.0.pin-14-out
net spindle-on      => parport.0.pin-17-out
net estop-ext       <= parport.0.pin-10-in
#net probe-in        <= parport.0.pin-11-in-not
net home-x          <= parport.0.pin-12-in-not
net home-yR          <= parport.0.pin-11-in-not
net home-yL          <= parport.0.pin-13-in-not
net home-z          <= parport.0.pin-15-in-not

setp stepgen.0.position-scale [JOINT_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 35000
setp stepgen.0.dirsetup 35000
setp stepgen.0.maxaccel [JOINT_0]STEPGEN_MAXACCEL
net xpos-cmd joint.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => joint.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable joint.0.amp-enable-out => stepgen.0.enable
net home-x => joint.0.home-sw-in

setp stepgen.1.position-scale [JOINT_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 35000
setp stepgen.1.dirsetup 35000
setp stepgen.1.maxaccel [JOINT_1]STEPGEN_MAXACCEL
net yRpos-cmd joint.1.motor-pos-cmd => stepgen.1.position-cmd
net yRpos-fb stepgen.1.position-fb => joint.1.motor-pos-fb
net yRstep <= stepgen.1.step
net yRdir <= stepgen.1.dir
net yRenable joint.1.amp-enable-out => stepgen.1.enable
net home-yR => joint.1.home-sw-in
##copy
setp stepgen.2.position-scale [JOINT_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 35000
setp stepgen.2.dirsetup 35000
setp stepgen.2.maxaccel [JOINT_2]STEPGEN_MAXACCEL
net yLpos-cmd joint.2.motor-pos-cmd => stepgen.2.position-cmd
net yLpos-fb stepgen.2.position-fb => joint.2.motor-pos-fb
net yLstep <= stepgen.2.step
net yLdir <= stepgen.2.dir
net yLenable joint.2.amp-enable-out => stepgen.2.enable
net home-yL => joint.2.home-sw-in

setp stepgen.3.position-scale [JOINT_3]SCALE
setp stepgen.3.steplen 1
setp stepgen.3.stepspace 0
setp stepgen.3.dirhold 35000
setp stepgen.3.dirsetup 35000
setp stepgen.3.maxaccel [JOINT_3]STEPGEN_MAXACCEL
net zpos-cmd joint.3.motor-pos-cmd => stepgen.3.position-cmd
net zpos-fb stepgen.3.position-fb => joint.3.motor-pos-fb
net zstep <= stepgen.3.step
net zdir <= stepgen.3.dir
net zenable joint.3.amp-enable-out => stepgen.3.enable
net home-z => joint.3.home-sw-in

net estop-out <= iocontrol.0.user-enable-out
net estop-ext => iocontrol.0.emc-enable-in

loadusr -W hal_manualtoolchange
net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared

net probe-enable <= joint.0.homed => tristate-bit.0.enable
net probe-in <= parport.0.pin-12-in => tristate-bit.0.in
net probe-out <= tristate-bit.0.out =>  motion.probe-input
The following user(s) said Thank You: ikkuh

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

More
15 Feb 2018 14:12 - 15 Feb 2018 15:46 #105975 by ikkuh

You need to set it up so the probe is disabled during homing. Like this, use a tristate bit component to disable the probe while the axis is homing. You also need to be certain that the axis sharing the home switch won't trip the home switch while you are probing.


I used your modifications and it kinda works. The problem is that the probe signal is inverted.
net xenable         => parport.0.pin-14-out
net spindle-on      => parport.0.pin-17-out
net estop-ext       <= parport.0.pin-10-in
#net probe-in        <= parport.0.pin-11-in-not
net home-x          <= parport.0.pin-12-in-not
net home-yR          <= parport.0.pin-11-in-not
net home-yL          <= parport.0.pin-13-in-not
net home-z          <= parport.0.pin-15-in-not
snip ...
net probe-enable <= joint.0.homed => tristate-bit.0.enable
net  probe-in <=  parport.0.pin-12-in => tristate-bit.0.in
net probe-out <= tristate-bit.0.out =>   motion.probe-input
I get an error message stating that:
./nieuwste.hal:134: Pin 'parport.0.pin-12-in-not' was already linked to signal 'home-x'
When I invert the port signal, with either invert or not then nothing works anymore.
So I tried NOT and INVERT . NOT just does not work when I do:
net  probe-in <=  parport.0.not.pin-12-in-not => tristate-bit.0.in
I get an error;
./nieuwste.hal:134: Pin 'parport.0.not.pin-12-in-not' does not exist


And invert works only on floating numbers, so that will never work for what want.

What am I doing wrong, was real happy when Todd came up with the solution, it looked like it might work.
Last edit: 15 Feb 2018 15:46 by ikkuh.

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

Time to create page: 0.086 seconds
Powered by Kunena Forum