Hello Guest it is April 16, 2024, 08:20:55 AM

Author Topic: touch probe function question  (Read 4723 times)

0 Members and 1 Guest are viewing this topic.

touch probe function question
« on: July 06, 2019, 02:17:02 PM »
I have been using the old paper method to set the Z height and decided to try and use the touch probe function in Mach 4.  It works up to a point.  I set the retract height to 5 (mm)  and the touch plate height to 4.76mm (I use a piece of 3/16"aluminum as the plate).  When i attach the alligator clips to the bit and the plate and click Z height button it does exactly what I would expect until it touches the plate.  At that point it just stops without retracting or setting the Z. 

Am I misunderstanding what I should do or what should happen?

Charlie
Re: touch probe function question
« Reply #1 on: July 06, 2019, 03:52:15 PM »
Well it depends on what it's programmed to do!  It sounds like it's programmed to just stop when it touches the plate.  Assuming that the plate is on top of the workpiece and you want the top of the work to be zero, then you need (assuming that M4 behaves like M3) to clock in the Z DRO, type in 4.76 mm, and press return.  The Z DRO should display 4.76 because that's how far above the material you are.
Re: touch probe function question
« Reply #2 on: July 06, 2019, 04:08:21 PM »
... Assuming that the plate is on top of the workpiece and you want the top of the work to be zero, then you need (assuming that M4 behaves like M3) to clock in the Z DRO, type in 4.76 mm, and press return.  The Z DRO should display 4.76 because that's how far above the material you are.

I spend most of my time in the 3D printing world and there, I can configure the software to always back off a set amount and set z to the same offset amount each time I probe.  If I understand you correctly, there is no mechanism to do the same in Mach 4 without modifying the code.  Is that correct?
Re: touch probe function question
« Reply #3 on: July 06, 2019, 04:16:00 PM »
Actually I haven't a clue!  I use Mach 3, and there are a lot of M3 macros to do probing, including what you describe.  M3 macros are in a different language to M4 so they can't be used directly.  What you want is very standard so I'm sure someone has written a macro for it.  Or it would be a good way to learn Lua programming.
Re: touch probe function question
« Reply #4 on: July 06, 2019, 05:04:42 PM »
Well, I'll give it a day or two and see if anyone else chimes in.  I can do it manually, as you described above, but it would be handy if I can find s script or some other method to do this is a more automated fashion.  I don't really want to learn Lua cold.  I do better if I have a starting point that I can tweak and modify.

Re: touch probe function question
« Reply #5 on: July 06, 2019, 05:38:18 PM »
Hi,

Quote
If I understand you correctly, there is no mechanism to do the same in Mach 4 without modifying the code.  Is that correct?

In the strictest sense that is correct. The probing 'move' is g31. It does not back off. It behaves the same in Mach4 as in Mach3.
In order to probe materials requires a short sequence of moves, a g31 to move to and probe the surface and then another
move to back off.

You can if you wish code these yourself but you don't have to, there are many 'scripts' where the code is already written.

The Touch module in Mach4 is a great example, and much improved over any of the Mach3 probing routines.

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: touch probe function question
« Reply #6 on: July 06, 2019, 07:05:11 PM »
Actually, that is exactly what I am looking for.  I tried to look at the code behind the “touch” button, but so far I don’t know enough to find it.  I will continue to look.  Also, I assume that the values in the retract and offset fields are stored in variables somewhere in code, so I need to find them as well.  Any hint you might offer to find this stuff might help me get off the starting blocks.

Thanks
Charlie
Re: touch probe function question
« Reply #7 on: July 06, 2019, 07:26:55 PM »
Hi,
its in the Mach4Hobby/modules directory called mcTouchOff.lua, all 292k of it. Enjoy!

Craig
'I enjoy sex at 73.....I live at 71 so its not too far to walk.'
Re: touch probe function question
« Reply #8 on: July 07, 2019, 10:33:08 AM »
its in the Mach4Hobby/modules directory called mcTouchOff.lua, all 292k of it. Enjoy!

I do not seem to have any *.lua files on my mach4 computer at all.  There are several *.mcs files.  Could it be that these are the same as the *.lua files?

Also, I found that i do not have ANY files named "mcTouchOff"  regardless of the extension.

I watched the tutorial video again and they show the touch module behaving exactly as I need, but that does not happen on my instance.  everything stops when the touch plate is touched.  Also, sometimes (not consistently), the "disable" button is triggered.

Everything else, a far as I can tell, works exactly as I would expect.
« Last Edit: July 07, 2019, 10:36:30 AM by crchisholm »
Re: touch probe function question
« Reply #9 on: July 07, 2019, 10:59:42 AM »
Opps...never mind.  I found it.  Not sure why win7 search didn't find it.

Ok, now I think the "Enjoy" was tong-in-cheek.   Holy mackral! 140+pages?  I bit more than I expected for my first toe in the LUA water.   

Is this code actually what is running when I click the "touch" button?  So, if I modify this code, it should effect what happens when I click the "touch"?

 
« Last Edit: July 07, 2019, 11:08:43 AM by crchisholm »