MONSTER - A learning experience... pyVCP machine

More
05 Oct 2015 06:50 - 05 Oct 2015 06:54 #63437 by cncbasher
then by all means add the -not and change pin numbers accordingly , to suit your requirement

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
Last edit: 05 Oct 2015 06:54 by cncbasher.

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

More
07 Oct 2015 04:07 #63518 by eFalegname
Cncbasher Hi, thanks for your advice, I did not answer you before because I was trying to understand how mux_generic works, I ask you again please to clarify me another doubt. Will be possible by implementing a function mux generic put a couple of pyvcp radio buttons to choose the probe I want to use and change the status of parport pin from "IN" to "IN-NOT" and so in order to use the two probes with the same pin.
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.

More
07 Oct 2015 07:25 #63526 by Askjerry
I just made a switch so that I could select between normally open and normally closed.
It works well... here is the video that i did...



Jerry

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

More
07 Oct 2015 13:48 #63528 by eFalegname
Thank you Jerry, I saw your video. I have this signal inverter NPN PNP , but my question is: Is there a way to change the parport pin signal from IN to IN-NOT with a HAL component? 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

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

More
07 Oct 2015 16:27 #63530 by andypugh

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.
The following user(s) said Thank You: eFalegname

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

More
07 Oct 2015 19:35 - 07 Oct 2015 19:37 #63538 by eFalegname

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:
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.
Last edit: 07 Oct 2015 19:37 by eFalegname.

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

More
07 Oct 2015 20:25 - 07 Oct 2015 20:33 #63541 by Todd Zuercher

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.
Last edit: 07 Oct 2015 20:33 by Todd Zuercher.
The following user(s) said Thank You: eFalegname

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

More
07 Oct 2015 20:37 #63542 by andypugh

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.
The following user(s) said Thank You: eFalegname

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

More
07 Oct 2015 21:21 - 07 Oct 2015 21:31 #63544 by eFalegname
Hi guys, tell me if I understood something, I'm not sure at all:

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
Last edit: 07 Oct 2015 21:31 by eFalegname.

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

More
07 Oct 2015 22:41 - 07 Oct 2015 22:51 #63547 by eFalegname
Now is working this way:

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?
Last edit: 07 Oct 2015 22:51 by eFalegname.

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

Time to create page: 0.118 seconds
Powered by Kunena Forum