Reusing probe pin (I did run out of pin on papor)

More
19 Sep 2023 15:32 #281167 by Stanislavz
Hello!

So did come here to conclusion : forum.linuxcnc.org/12-milling/50094-rigi...-with-simple-encoder

That for rigid tapping one need A B Z on spindle encoder. Did order three hall sensors. But ! I have 3 parport pins already in use (E stop, home and probe). I did find of possibility to use missing tooth encoder style for both index and phase.  After reading on missing tooth implementation - it will not take B signal so quadrature would be lost. Which is ok lathe threading, but not for rigid tapping. I do even download source code of encoder - no easy way to implement both (missing tooth and X4) of them. Unless other have seen different option, question is simple.

How can one reuse Probe pin as Phase B pin ?  Acidently - you do not want spindle to rotate  while probing :)

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

More
19 Sep 2023 17:27 #281177 by tommylight
How many outputs are used? Outputs, not inputs.
If it is a built in parallel port, almost all can be set to different modes and that changes the number of outputs and inputs:
-Mode "out" 12 outputs and 5 inputs
-Mode "in" 4 outputs and 13 inputs
-Mode "X" 8 outputs and 9 inputs
The following user(s) said Thank You: Stanislavz

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

More
19 Sep 2023 18:17 - 19 Sep 2023 18:34 #281181 by Stanislavz
Only one left output for now. But - it will be used later.

My crap code using spindle-on:

net probe-and-B        <= parport.0.pin-15-in 

loadrt and2 count=2
addf and2.0 servo-thread
addf and2.1 servo-thread

loadrt not count=1
addf not.0 servo-thread

net spindle-phase-a encoder.0.phase-A
net spindle-phase-b encoder.0.phase-B
net spindle-index encoder.0.phase-Z

net my_sigin1 and2.0.in0 <= probe-and-B
net my-sigin2 and2.0.in1 <= spindle-on
net both-on spindle-phase-b <= and2.0.out

net my-signot not.0.in <= spindle-on
net my-sigout probe-on <= not.0.out

net my-sigin12 and2.1.in0 <= probe-and-B
net my-sigin22 and2.1.in1 <= probe-on
net both-on2 probe-in <= and2.1.out

net probe-in => motion.probe-input


And chat gpt created :

# Load the MUX component
loadrt mux names=mux.0 count=2

# Configure the MUX to select between encoder phase B and probe based on spindle state
setp mux.0.sel 0             # Use encoder phase B signal by default

# Invert the spindle-on signal to control the MUX selection
net spindle_on_not spindle.0.on => mux.0.sel-invert

# Connect encoder phase B and probe signal to the MUX
net encoder_phase_B encoder.0.phase-B => mux.0.0.in
net probe_signal probe.0.probe-in => mux.0.1.in

# Connect the output of the MUX to the input pin (parport12)
net mux_output mux.0.out => parport.0.pin-12-out 

Or it will go to error while stopping, due to loosing one of encoder phase. I think i can add an delay of 1 second to avoid this ? And - any way to get all axis homed bit ?

Looks like here it is called get_allhomed

github.com/LinuxCNC/linuxcnc/blob/master...onents/homecomp.comp

Than i would share home all pin.
Last edit: 19 Sep 2023 18:34 by Stanislavz.

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

Time to create page: 0.116 seconds
Powered by Kunena Forum