MONSTER - A learning experience... pyVCP machine
the or2 function does work as you described
it was a suggestion that you may consider adding an appropriate pin to either select the input or
have a situation where you know the correct probe is selected , but as i do not know the probes in question , i left a generic answer
Please Log in or Create an account to join the conversation.
- eFalegname
-
- Offline
- Elite Member
-
- Posts: 253
- Thank you received: 30
I have a "NO" fixed probe on the Router table to measure the length of the tool and a second one "NC" like a Renishaw probe that I mount on the spindle and I wish to connect both to the same parport pin. Is that possible?
Please Log in or Create an account to join the conversation.
It works well... here is the video that i did...
Jerry
Please Log in or Create an account to join the conversation.
- eFalegname
-
- Offline
- Elite Member
-
- Posts: 253
- Thank you received: 30
Please Log in or Create an account to join the conversation.
Is there a way to change the parport pin signal from IN to IN-NOT with a HAL component?
Yes. In fact there are many ways to do it.
You can use a bit-type mux_generic: www.linuxcnc.org/docs/html/man/man9/mux_generic.9.html
You could use lut5: www.linuxcnc.org/docs/html/man/man9/lut5.9.html
Or you could use a combination of AND / OR / XOR discrete logic blocks.
I think I would use LUT5, then have a very heavily de-bounced version of the probe input driving the third input bit, so that the system automatically selected between NO and NC probes.
Please Log in or Create an account to join the conversation.
- eFalegname
-
- Offline
- Elite Member
-
- Posts: 253
- Thank you received: 30
I think I would use LUT5, then have a very heavily de-bounced version of the probe input driving the third input bit, so that the system automatically selected between NO and NC probes.
Hi Andypugh
Could you write this for me please? I don't know where to begin.
First I define my bits:
1-pyvcp.fixed-probe (checkbutton state for fixed probe)
2-pyvcp.movable-probe (checkbutton state for renishaw style probe)
3-debounce (debounce for the probe signal)
Second I define the output condition for my partport pin 11:
1- For the fixed probe: pyvcp.fixed-probe 1; pyvcp.movable-probe 0; debounce 1
2-For the movable probe: pyvcp.fixed-probe 0; pyvcp.movable-probe 1; debounce 1
Third I set the lut5.0.function...?
Fourth how do I swap the parport pin state?
![:sick: :sick:](/media/kunena/emoticons/sick.png)
I need help to understand the logic behind this, a scheme, a diagram,
I'm not a programmer so it would be useful to have some practical examples to get this working.
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
- Posts: 5000
- Thank you received: 1409
I want to check a pyvcp radio button to switch between the "NO" and "NC" probes using the same parport pin swaping the IN entries
I would think an XOR (linuxcnc.org/docs/html/man/man9/xor2.9.html) would be the simplest way to do it. Just connect the parallel port pin to one of the inputs for the XOR and the output from your radio button to the other input of the XOR. (If your signal needs debouncing, that should also be added somewhere in the mix (probably between the PP and the XOR). This if you want the output to switch back and forth between NC and NO.
If you want separate NC and NO signals the parallel port driver already has separate output pins built in on the parallel port inputs (parport.0.pin-10-in and parport.0.pin-10-in-not). The trick then would be to make your radio button enable and disable the appropriate signals.
Please Log in or Create an account to join the conversation.
I would think an XOR (linuxcnc.org/docs/html/man/man9/xor2.9.html) would be the simplest way to do it. Just connect the parallel port pin to one of the inputs for the XOR and the output from your radio button to the other input of the XOR.
I think you are correct, but it would be easy to dispense with the PyVCP button.
If one input to the XOR is the probe signal, and the other is a debounce-filtered version of that signal with a 10 second debounce time, then the output of the XOR will go true whenever the probe input changes from its steady-state value, so NO / NC selection would be automatic.
Please Log in or Create an account to join the conversation.
- eFalegname
-
- Offline
- Elite Member
-
- Posts: 253
- Thank you received: 30
loadrt xor2
loadrt debounce cfg="1"
addf xor2.0 servo-thread
addf debounce.0 servo-thread
setp debounce.0.delay 1000
net probe-in-not partport.0.pin-11-in-not debounce.0.0.in
net probe-movable debounce.0.0.out
net probe-movable pyvcp.probe-movable xor2.0.in0
net probe-in-not pyvcp.probe-fixed xor2.0.in1
net probe-in xor2.0.out
net probe-in partport.0.pin-11-in
At this point I don't know if the checkbuttons are useful
Please Log in or Create an account to join the conversation.
- eFalegname
-
- Offline
- Elite Member
-
- Posts: 253
- Thank you received: 30
loadrt xor2
loadrt debounce cfg="1"
addf xor2.0 servo-thread
addf debounce.0 servo-thread
setp debounce.0.delay 1000
net probe-in-not parport.0.pin-11-in-not debounce.0.0.in
net probe-movable debounce.0.0.out
net probe-movable xor2.0.in0
net probe-in-not xor2.0.in1
net probe-in xor2.0.out
When I plug the Renshaw type probe the parport pin goes to NC state and when I unplug the probe the pin returns to the NO state, don't need to remove my fixed probes they remain connected, works automatically and without any external hardware.
Thank you very much guys, I really appreciate your beautiful work and your altruism.
I have a led that comes on when the probe contacts, now I need some pyvcp indicator to know wich probe is active. Any idea?
Please Log in or Create an account to join the conversation.