Adding a pin for probing

More
14 Aug 2017 10:56 #97444 by Niko
How can I add an output pin to G38 ?

I have a renishaw mp700 touch probe and I got it to work without the infrared receiver unit, but it'll need an enable pin to supply it .
This probe is not the conventional type with the contact tips. It's either strain gauge or piezo sensors, and the circuit that monitors it needs some supply voltage.
I was hoping to use a probing in progress type of signal but can't find one .
Leaving it powered on all the time is not the most elegant solution .

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

More
15 Aug 2017 17:22 #97526 by andypugh
Replied by andypugh on topic Adding a pin for probing
I think you can do this all in HAL.
motion.motion-type takes the value "5" when you are probing.
linuxcnc.org/docs/2.7/html/man/man9/motion.9.html

That's an S32 signal (which could be more convenient)

You can convert it to a float value:
linuxcnc.org/docs/2.7/html/man/man9/conv_s32_float.9.html

Then use "near" to set a pin high when it has a value of 5.
linuxcnc.org/docs/2.7/html/man/man9/near.9.html

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

More
16 Aug 2017 08:40 #97553 by Niko
Replied by Niko on topic Adding a pin for probing
Thanks for the tip !
I cobbled this together :
component renishaw;
pin in signed motion_type;
pin in bit mp700_return;
pin in bit ts27r_return;
pin out bit probe_enable=0;
pin out bit probe_tripped;

function _;
license "GPL"; // indicates GPL v2 or later
;;

FUNCTION(_) { 

	if(motion_type == 5)
	probe_enable = 1 ;
	else 
	probe_enable = 0 ;
	

	probe_tripped = ( mp700_return && probe_enable ) || ts27r_return ;

 }

Hope this helps someone .

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

Time to create page: 0.069 seconds
Powered by Kunena Forum