Using NC and NO probe on the same input

More
02 Dec 2021 22:07 #228228 by ucancallmebob89
I'm trying to figure out how to connect an NC toolsetter and an NO touch plate to the same input pin on my parallel breakout board. I only have 1 input pin available so I'm really trying to make this work.

Electrically, I'm thinking I can connect both probes in series and have a bypass NC momentary switch that I can manually trigger when I want to use the NO touch plate, like in the attached diagram.

When the momentary switch is untriggered (i.e. normally connected), the toolsetter should work normally. When I want to use the touch plate, I can trigger the momentary switch causing it to be momentarily open, which lets the touch plate to control the circuit.

My issue is I'm not sure how to configure my HAL file to make this work. I'm pretty new to LinuxCNC configuration so I could use some help in this area.
Attachments:

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

More
02 Dec 2021 22:21 #228230 by Aaroncnc
you could also just use a single transistor to invert one of the signals so they are both the same.
www.learningaboutelectronics.com/Article...inverter-circuit.php

Also why are you out of pins? there are other hal tricks to free up more pins

Are you home switches all on 1 pin?
Are your limit switches all on 1 pin?

Did you know you can combine all your home and limit switches to 1 pin?

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

More
03 Dec 2021 00:02 #228241 by ucancallmebob89
I could invert one of them I suppose. And then OR them together somehow.

My BOB has 5 inputs, right now I have them configured like this:
1. Estop in
2. Probe in
3. X and z homing
4. Y0 homing
5. Y1 homing

Y0 and y1 I definitely want separate so I can do gantry squaring. I guess I could assign X, Z, and y0 together and home them sequentially.

I thought I was onto a relatively elegant solution with my momentary switch, I'm just having trouble with the HAL syntax.

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

More
03 Dec 2021 00:07 #228242 by Aaroncnc
the switch would work too.

If you want help on the hal side you can upload your hal file to the post and someone can take a look at it.

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

More
03 Dec 2021 02:05 - 03 Dec 2021 02:07 #228251 by ucancallmebob89
Ok so my understanding is that in the below code, the line that sets net probe-in <= parport.0.pin-11-in makes probe-in an active HIGH signal.

In my use case, it needs to be active HIGH by default but active LOW when using the momentary switch. Is there a way to do this? I can create a new net called probe-in-not <= parport.0.pin-11-in-not, but then I can't seem to also connect it as a secondary motion.probe-input. (Is this even possible?
# Generated by stepconf 1.1 at Tue Mar 9 12:15:54 2021
# 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="0 out"
setp parport.0.reset-time 2500
loadrt stepgen step_type=0,0,0,0

addf parport.0.read base-thread
addf stepgen.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

net probe-in => motion.probe-input

net estop-out => parport.0.pin-01-out
net xstep => parport.0.pin-02-out
net xdir => parport.0.pin-03-out
setp parport.0.pin-02-out-reset 1
net y0step => parport.0.pin-04-out
net y0dir => parport.0.pin-05-out
setp parport.0.pin-04-out-reset 1
net zstep => parport.0.pin-06-out
net zdir => parport.0.pin-07-out
setp parport.0.pin-06-out-reset 1
net y1step => parport.0.pin-08-out
net y1dir => parport.0.pin-09-out
setp parport.0.pin-08-out-reset 1
net estop-ext <= parport.0.pin-10-in-not
net probe-in <= parport.0.pin-11-in
net min-home-xz <= parport.0.pin-12-in
net min-home-y0 <= parport.0.pin-13-in
net min-home-y1 <= parport.0.pin-15-in
Last edit: 03 Dec 2021 02:07 by ucancallmebob89.

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

More
03 Dec 2021 02:44 #228252 by Aaroncnc
On mobile before bed have you looked into this
linuxcnc.org/docs/html/man/man9/or2.9.html

Check the page here for things you can do for and and such
linuxcnc.org/docs/html/hal/components.html

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

Time to create page: 0.080 seconds
Powered by Kunena Forum