Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: crchisholm on July 06, 2019, 02:17:02 PM

Title: touch probe function question
Post by: crchisholm 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
Title: Re: touch probe function question
Post by: JohnHaine 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.
Title: Re: touch probe function question
Post by: crchisholm 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?
Title: Re: touch probe function question
Post by: JohnHaine 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.
Title: Re: touch probe function question
Post by: crchisholm 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.

Title: Re: touch probe function question
Post by: joeaverage 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
Title: Re: touch probe function question
Post by: crchisholm 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
Title: Re: touch probe function question
Post by: joeaverage on July 06, 2019, 07:26:55 PM
Hi,
its in the Mach4Hobby/modules directory called mcTouchOff.lua, all 292k of it. Enjoy!

Craig
Title: Re: touch probe function question
Post by: crchisholm 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.
Title: Re: touch probe function question
Post by: crchisholm 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"?

 
Title: Re: touch probe function question
Post by: joeaverage on July 07, 2019, 11:51:26 AM
Hi,

Quote
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"?

Yes and yes,

Quote
Holy mackral! 140+pages?  I bit more than I expected for my first toe in the LUA water. 

I know...I know....its character building.....but I have got by without any character for years...I don't want to start now!

Craig
Title: Re: touch probe function question
Post by: crchisholm on July 07, 2019, 12:55:59 PM
Well, my wife tells me i'm a "real character"....so maybe that gives me a leg up.
Title: Re: touch probe function question
Post by: crchisholm on July 10, 2019, 02:49:51 PM
Ok, after looking at lua and the module for probing the Z axis, I might have a better idea of how this stuff is setup......but, this is a bit aggravating.  I am a retired developer and quite frankly,  I am in no hurry to get back into programming, especially with a quarter meg code file that is a new language to me.

The video tutorial shows z probing working exactly as I need.  Probe makes contact, stops and retracts, and sets the z at the proper height (as configured).  It appears that is the standard behavior.  Yet with me, it seems to stop cold on touching the plate.  I am convinced that if all the correct values have been provided it would do what I ask for...probe, retract, and set the z height.

Am I nuts?  ... or is there something missing.

Title: Re: touch probe function question
Post by: joeaverage on July 10, 2019, 02:59:17 PM
Hi,
you should try logging a probe session and open a support ticket with NFS.

Have you tried viewing a log file? Much of the nomenclature is a mystery but a reasonable guess can be made as to interpretation.
Logging is a major advance over Mach3 and has always been part of Mach4s DNA. Because its not easy to read we tend to ignore
it but it is an extremely useful feature.

Craig
Title: Re: touch probe function question
Post by: Stuart on July 10, 2019, 03:36:20 PM
Can I ask a question
What do you use between the pc and the mill .
Is it a parrelle port , or WHY

The reason I ask is that the Far East usb controllers do not work for probing they do not update the registers with the required info

The USA made units from Warp9 etc do work as does the printer port

Just a shot in the dark ,I have been there with Mach 3 Far East usb junk  got the smashed 3D probe to prove it

Now I run a ESS with a c25 bob for motion spindle from a 0 10v source and industrial Mach 4 now it works

Stuart
Title: Re: touch probe function question
Post by: crchisholm on July 10, 2019, 07:18:32 PM
I too am running ESS over CAT5.   Gecko for the drivers.  Are you able to probe Z now?  If so, does it retract after touch?

I wonder if there is a problem with the hobby version of M4?  I can’t figure out why it does not work like the video shows in the tut.  I have a question into support, but thus far, no response.

Title: Re: touch probe function question
Post by: joeaverage on July 11, 2019, 02:33:41 PM
Hi,
the first thing Support is going to do is to ask for a logfile so they can track Mach......have you generated and/or viewed a logfile?

Craig
Title: Re: touch probe function question
Post by: crchisholm on July 11, 2019, 03:17:08 PM
Actually, I don't have a clue about log files.  Probably should.  How do generate and view them.  I van look it up later. But if you can give me a nudge in the right direction I would appreciate it.
Title: Re: touch probe function question
Post by: joeaverage on July 12, 2019, 04:12:13 AM
Hi,
under the Diagnostic Tab select Logging from the drop down menu.

You can Pin-to-Top the logging window and start logging. You can save it should you need to communicate with NFS say about
what Mach is doing.

With a bit of interpretation and some judicious questions on the forum its possible to deduce much of whats going on,
all very instructive.

Craig
Title: Re: touch probe function question
Post by: crchisholm on July 12, 2019, 07:28:53 AM
Thank you!
Title: Re: touch probe function question
Post by: crchisholm on July 12, 2019, 12:49:28 PM
Got it.  Mach support never got back to me on my ticket request.  I will try again and this time attach the log file from my most recent attempt to probe Z
Title: Re: touch probe function question
Post by: Chaoticone on July 12, 2019, 04:35:11 PM
Sorry, just seeing this.

Finding Z should work exactly as you expect. But one thing that will break the functionality is a noisy or bouncy probe input. Ensure that is not a problem. Lots of info here to help with that.

All moves but one are actually probe moves so if something triggers the probe, motion stops. However that safety comes with one caveat. The retract move can't be a probe move because you can't start a probe move if the probe is active. So, if after retract the input is still active you see what you are seeing. Why would the retract move need to be bigger? Because when you do a probe move the exact position the probe triggered is stored and that is what sets the coordinates. However, after the input goes active the axis has to stop respecting the accel/decel in motor tuning so the tool tip will be beyond the position it touched. How much will vary depending on touch rate, motor tuning backlash, etc.. So, make your retract distance bigger and retest, lower touch rate, etc. It may take a bit of tuning to get it all dialed in for your machine.   
Title: Re: touch probe function question
Post by: Chaoticone on July 12, 2019, 04:39:30 PM
Meant to say too............

The TouchOff module isn't that bad. A lot of it is the embedded button images. But most functions are just running other functions in a particular order. In a nutshell it all boils down to just a few moves (prep move, touch move, retract move) that has some variables. 
Title: Re: touch probe function question
Post by: crchisholm on July 12, 2019, 06:52:24 PM
As far as bounce is concerned, I am just using a simple plate and an aligator clip on the bit.  Not sure how I could do anything directly with bounce in that arrangement. 

As far as retract distance, I am trying to retract 5mm.  Is that not enough?

I figured out that two thirds of the file was image data.  I was not completely sure what is the main function that pulls it all together.  i will give it another look, but from what you're telling me, it sounds line a timing issue more than anything.  Am I wrong?   Without knowing the code very well, is it possible that there could be a place in the functions that I might add a 100 ms delay to let any bounce settle down?  (not even sure if lua has a delay function) If so, which function should I be looking at to place a delay into.
Title: Re: touch probe function question
Post by: joeaverage on July 12, 2019, 07:18:30 PM
Hi,
the 'bounce' chaoticone is referring to is electrical double operation and/or noise on the probe circuit.

Try increasing the debounce or input filtering on your probe signal line. A substantial capacitor (0.1uf -1 uF)
on the input is another worth while experiment.

Craig
Title: Re: touch probe function question
Post by: crchisholm on July 13, 2019, 11:35:05 AM
I know what bounce is.  The problem I have is that i am using a simple aluminum plate and alligator clips (ground and v+) so there is no adjustment.  I know this is not a unusual arangement (per several youtube videos).  Are you saying that this sort of simple probe won't work for what I am trying to do?   I am not trying to be obtuse.  I just don't understand.
Title: Re: touch probe function question
Post by: crchisholm on July 13, 2019, 02:02:49 PM
Ok, being the dummy that I am, it took me a while to understand about the filtering. When I looked at it, there was no filtering at all (0), I bumped the filtering up to 1000 and tried again.  Same result.  Bumped it to 2000.  Same result.  I am not sure how high I should go. The log file for these two attempts is below if that tells anyone anything usefull.

Code: [Select]
2019-07-13 13:50:10.480 - Loggging Enabled.
2019-07-13 13:50:22.216 - API: mcCntlEnable(true) called.
2019-07-13 13:50:22.217 - Signal id 1019, (Enable #1), changed from LOW to HIGH.
2019-07-13 13:50:22.217 - Signal id 1021, (Enable #3), changed from LOW to HIGH.
2019-07-13 13:50:22.217 - Signal id 1020, (Enable #2), changed from LOW to HIGH.
2019-07-13 13:50:22.218 - Signal id 1120, (Machine Enabled), changed from LOW to HIGH.
2019-07-13 13:50:30.719 - API: mcCntlGcodeExecute() called. (G91 G31 Z -5.25F5)
2019-07-13 13:50:30.919 - Attempt transition from "Idle" on event "MDI Start" Controller.cpp:1811
2019-07-13 13:50:30.919 - S_IDLE_on_exit
2019-07-13 13:50:30.919 - ACTION_start_mdi
2019-07-13 13:50:30.919 - S_MDI_RUNNING_on_entry
2019-07-13 13:50:30.919 - S_MDI_RUNNING2_on_entry
2019-07-13 13:50:30.920 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:50:30.936 - Attempt transition from "MDI Running" on event "Probe" RunCanon.cpp:497
2019-07-13 13:50:30.936 - S_MDI_RUNNING2_on_exit
2019-07-13 13:50:30.936 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2019-07-13 13:50:30.936 - ACTION_start_probe
2019-07-13 13:50:30.937 - >>>>> ESS Probe 0, Starting.

2019-07-13 13:50:30.938 - S_MDI_PROBING_on_entry
2019-07-13 13:50:30.938 - Probing: Waiting on exit event... RunCanon.cpp:236
2019-07-13 13:50:30.938 - Controller::RunCanonBuffer called AddStopReportRequest() RunCanon.cpp:76
2019-07-13 13:50:30.938 - Requesting a stopped report for axis 0 motors.
2019-07-13 13:50:30.938 - Requesting a stopped report for motor 0.
2019-07-13 13:50:30.938 - Requesting a stopped report for axis 1 motors.
2019-07-13 13:50:30.938 - Requesting a stopped report for motor 1.
2019-07-13 13:50:30.938 - Requesting a stopped report for motor 3.
2019-07-13 13:50:30.938 - Requesting a stopped report for axis 2 motors.
2019-07-13 13:50:30.938 - Requesting a stopped report for motor 2.
2019-07-13 13:50:30.939 - Waiting on SetStill...
2019-07-13 13:50:30.960 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 0
2019-07-13 13:50:30.960 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 1
2019-07-13 13:50:30.960 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 2
2019-07-13 13:50:30.960 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 3
2019-07-13 13:50:30.960 - >>>>ESS: Switching from NORMAL to PROBE state for Probe 0
2019-07-13 13:50:31.510 - -----ESS: Checking for Probe0 Strike, none yet...
2019-07-13 13:50:32.060 - -----ESS: Checking for Probe0 Strike, none yet...
2019-07-13 13:50:32.360 - Signal id 161, (PROBE), changed from LOW to HIGH.
2019-07-13 13:50:32.360 - -----ESS: Mach ACKs Probe0 input signal ON!
2019-07-13 13:50:32.361 - API: mcMotionSetProbePos() called. motor 0 position 0.0000
2019-07-13 13:50:32.361 - API: mcMotionSetProbePos() called. motor 1 position 0.0000
2019-07-13 13:50:32.361 - API: mcMotionSetProbePos() called. motor 2 position -54.0000
2019-07-13 13:50:32.361 - API: mcMotionSetProbePos() called. motor 3 position 0.0000
2019-07-13 13:50:32.361 - API: mcMotionSetProbePos() called. motor 4 position 0.0000
2019-07-13 13:50:32.361 - API: mcMotionSetProbePos() called. motor 5 position 0.0000
2019-07-13 13:50:32.361 - ^^^^^^ ESS: Success! Probe0 Strike. Switching from PROBING to PROBING_CLEANUP state.
2019-07-13 13:50:32.410 - ^^^^^^ ESS Probe0 Finished: The device is still and the buffer is empty.
2019-07-13 13:50:32.410 - API: mcMotionClearPlanner() called.
2019-07-13 13:50:32.410 - API: mcMotionSetProbeComplete() called.
2019-07-13 13:50:32.410 - Recording latched probe positions.
2019-07-13 13:50:32.411 - Attempt transition from "Probing" on event "Probe Complete" MachAPI.cpp:1348
2019-07-13 13:50:32.411 - S_MDI_PROBING_on_exit
2019-07-13 13:50:32.411 - ACTION_stop_probe
2019-07-13 13:50:32.411 - >>>>> ESS Probe 0, Done

2019-07-13 13:50:32.413 - S_MDI_RUNNING2_on_entry
2019-07-13 13:50:32.413 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:50:32.415 - SyncPosition()! Clearing planner.
2019-07-13 13:50:32.415 - .^^^^^ESS: Switching from PROBING_CLEANUP to NORMAL state.
2019-07-13 13:50:32.415 -
2019-07-13 13:50:32.415 - Waiting on SetStill is Done!
2019-07-13 13:50:32.415 - Probing: Exiting hold because of probe strike. GcodeExec.cpp:1272
2019-07-13 13:50:32.535 - Attempt transition from "MDI Running" on event "Stop" GcodeExec.cpp:1099
2019-07-13 13:50:32.535 - S_MDI_RUNNING2_on_exit
2019-07-13 13:50:32.535 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2019-07-13 13:50:32.535 - S_MDI_RUNNING_on_exit
2019-07-13 13:50:32.535 - ACTION_stop
2019-07-13 13:50:32.560 - Signal id 161, (PROBE), changed from HIGH to LOW.
2019-07-13 13:50:32.562 - S_IDLE_on_entry
2019-07-13 13:50:32.562 - -----ESS: Mach ACKs Probe0 input signal OFF.
2019-07-13 13:50:32.623 - API: mcCntlGcodeExecute() called. (G 91
F 5)
2019-07-13 13:50:32.823 - Attempt transition from "Idle" on event "MDI Start" Controller.cpp:1811
2019-07-13 13:50:32.823 - S_IDLE_on_exit
2019-07-13 13:50:32.823 - ACTION_start_mdi
2019-07-13 13:50:32.823 - S_MDI_RUNNING_on_entry
2019-07-13 13:50:32.823 - S_MDI_RUNNING2_on_entry
2019-07-13 13:50:32.824 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:50:32.846 - API: mcCntlEStop() called.
2019-07-13 13:50:32.846 - API: mcCntlEnable(false) called.
2019-07-13 13:50:32.846 - API: mcCntlCycleStop() called.
2019-07-13 13:50:32.847 - Signal id 1019, (Enable #1), changed from HIGH to LOW.
2019-07-13 13:50:32.847 - Signal id 1021, (Enable #3), changed from HIGH to LOW.
2019-07-13 13:50:32.847 - Attempt transition from "MDI Running" on event "Stop" MachAPI.cpp:2678
2019-07-13 13:50:32.847 - S_MDI_RUNNING2_on_exit
2019-07-13 13:50:32.847 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2019-07-13 13:50:32.847 - Signal id 1020, (Enable #2), changed from HIGH to LOW.
2019-07-13 13:50:32.848 - Attempt transition from "MDI Running" on event "Stop" Controller.cpp:4535
2019-07-13 13:50:32.848 - S_MDI_RUNNING_on_exit
2019-07-13 13:50:32.848 - Signal id 1120, (Machine Enabled), changed from HIGH to LOW.
2019-07-13 13:50:32.848 - ACTION_stop
2019-07-13 13:50:32.848 - 
2019-07-13 13:50:32.848 -    $$$ ESS: Mach4 was Disabled - Force Output Stop Sates Now
2019-07-13 13:50:32.848 -    !!! ESS: Stop Event IGNORING command to turn OFF DISABLED output Port1-Pin14 - Spindle ON Relay
2019-07-13 13:50:32.848 -    $$$ ESS: Finished processing the Stop Event
2019-07-13 13:50:32.848 - 
2019-07-13 13:50:32.872 - S_IDLE_on_entry
2019-07-13 13:50:32.937 - Attempt transition from "Idle" on event "Stop" GcodeExec.cpp:1099
2019-07-13 13:50:32.937 - Can't transition from "Idle" on event "Stop"
2019-07-13 13:54:07.881 - -----ESS: Switching from NORMAL to CONFIG state
2019-07-13 13:54:40.889 - ESS Called its Reconfigure() function
2019-07-13 13:54:40.911 - ESS: Switching from CONFIG to NORMAL state
2019-07-13 13:54:46.193 - API: mcCntlEnable(true) called.
2019-07-13 13:54:46.193 - Signal id 1019, (Enable #1), changed from LOW to HIGH.
2019-07-13 13:54:46.194 - Signal id 1021, (Enable #3), changed from LOW to HIGH.
2019-07-13 13:54:46.194 - Signal id 1020, (Enable #2), changed from LOW to HIGH.
2019-07-13 13:54:46.194 - Signal id 1120, (Machine Enabled), changed from LOW to HIGH.
2019-07-13 13:54:57.194 - API: mcJogVelocityStart() called. Axis 2, dir = 1
2019-07-13 13:54:57.194 - Attempt transition from "Idle" on event "Jog" Axis.cpp:632
2019-07-13 13:54:57.194 - S_IDLE_on_exit
2019-07-13 13:54:57.194 - ACTION_start_jogging
2019-07-13 13:54:57.194 - S_JOGGING_on_entry
2019-07-13 13:54:58.362 - API: mcJogVelocityStop() called. Axis 2
2019-07-13 13:54:58.915 - Requesting a stopped report for axis 2 motors. Axis.cpp:806
2019-07-13 13:54:58.915 - Requesting a stopped report for motor 2.
2019-07-13 13:54:58.915 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 2
2019-07-13 13:54:59.114 - All motors marked as still.
2019-07-13 13:54:59.114 - Main planner updated from last mcMotionSetPos().
2019-07-13 13:54:59.114 - Attempt transition from "Jogging" on event "Stop Jog" Controller.cpp:1076
2019-07-13 13:54:59.115 - S_JOGGING_on_exit
2019-07-13 13:54:59.115 - S_FILE_RUNNING_stop_jogging
2019-07-13 13:54:59.115 - S_IDLE_on_entry
2019-07-13 13:54:59.115 - Signal id 1127, (Jog Enabled), changed from LOW to HIGH.
2019-07-13 13:54:59.115 - -----ESS: Motor 2 Still
2019-07-13 13:55:07.277 - API: mcCntlGcodeExecute() called. (G91 G31 Z -5.25F5)
2019-07-13 13:55:07.477 - Attempt transition from "Idle" on event "MDI Start" Controller.cpp:1811
2019-07-13 13:55:07.477 - Signal id 1127, (Jog Enabled), changed from HIGH to LOW.
2019-07-13 13:55:07.477 - S_IDLE_on_exit
2019-07-13 13:55:07.477 - ACTION_start_mdi
2019-07-13 13:55:07.477 - S_MDI_RUNNING_on_entry
2019-07-13 13:55:07.477 - S_MDI_RUNNING2_on_entry
2019-07-13 13:55:07.478 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:55:07.493 - Attempt transition from "MDI Running" on event "Probe" RunCanon.cpp:497
2019-07-13 13:55:07.494 - S_MDI_RUNNING2_on_exit
2019-07-13 13:55:07.494 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2019-07-13 13:55:07.494 - ACTION_start_probe
2019-07-13 13:55:07.494 - >>>>> ESS Probe 0, Starting.

2019-07-13 13:55:07.496 - S_MDI_PROBING_on_entry
2019-07-13 13:55:07.496 - Probing: Waiting on exit event... RunCanon.cpp:236
2019-07-13 13:55:07.496 - Controller::RunCanonBuffer called AddStopReportRequest() RunCanon.cpp:76
2019-07-13 13:55:07.496 - Requesting a stopped report for axis 0 motors.
2019-07-13 13:55:07.496 - Requesting a stopped report for motor 0.
2019-07-13 13:55:07.496 - Requesting a stopped report for axis 1 motors.
2019-07-13 13:55:07.496 - Requesting a stopped report for motor 1.
2019-07-13 13:55:07.497 - Requesting a stopped report for motor 3.
2019-07-13 13:55:07.497 - Requesting a stopped report for axis 2 motors.
2019-07-13 13:55:07.497 - Requesting a stopped report for motor 2.
2019-07-13 13:55:07.497 - Waiting on SetStill...
2019-07-13 13:55:07.516 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 0
2019-07-13 13:55:07.516 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 1
2019-07-13 13:55:07.516 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 2
2019-07-13 13:55:07.516 - -----ESS: Mach requested MSG_REPORT_MOTOR_STOP Motor 3
2019-07-13 13:55:07.516 - >>>>ESS: Switching from NORMAL to PROBE state for Probe 0
2019-07-13 13:55:08.065 - -----ESS: Checking for Probe0 Strike, none yet...
2019-07-13 13:55:08.615 - -----ESS: Checking for Probe0 Strike, none yet...
2019-07-13 13:55:08.668 - Signal id 161, (PROBE), changed from LOW to HIGH.
2019-07-13 13:55:08.668 - API: mcMotionSetProbePos() called. motor 0 position 0.0000
2019-07-13 13:55:08.669 - API: mcMotionSetProbePos() called. motor 1 position 0.0000
2019-07-13 13:55:08.669 - API: mcMotionSetProbePos() called. motor 2 position 3199.0000
2019-07-13 13:55:08.669 - API: mcMotionSetProbePos() called. motor 3 position 0.0000
2019-07-13 13:55:08.669 - API: mcMotionSetProbePos() called. motor 4 position 0.0000
2019-07-13 13:55:08.669 - API: mcMotionSetProbePos() called. motor 5 position 0.0000
2019-07-13 13:55:08.669 - ^^^^^^ ESS: Success! Probe0 Strike. Switching from PROBING to PROBING_CLEANUP state.
2019-07-13 13:55:08.669 - -----ESS: Mach ACKs Probe0 input signal ON!
2019-07-13 13:55:08.718 - ^^^^^^ ESS Probe0 Finished: The device is still and the buffer is empty.
2019-07-13 13:55:08.718 - API: mcMotionClearPlanner() called.
2019-07-13 13:55:08.718 - API: mcMotionSetProbeComplete() called.
2019-07-13 13:55:08.718 - Recording latched probe positions.
2019-07-13 13:55:08.718 - Attempt transition from "Probing" on event "Probe Complete" MachAPI.cpp:1348
2019-07-13 13:55:08.718 - S_MDI_PROBING_on_exit
2019-07-13 13:55:08.719 - ACTION_stop_probe
2019-07-13 13:55:08.719 - >>>>> ESS Probe 0, Done

2019-07-13 13:55:08.721 - S_MDI_RUNNING2_on_entry
2019-07-13 13:55:08.721 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:55:08.723 - SyncPosition()! Clearing planner.
2019-07-13 13:55:08.723 - .^^^^^ESS: Switching from PROBING_CLEANUP to NORMAL state.
2019-07-13 13:55:08.723 -
2019-07-13 13:55:08.723 - Waiting on SetStill is Done!
2019-07-13 13:55:08.723 - Probing: Exiting hold because of probe strike. GcodeExec.cpp:1272
2019-07-13 13:55:08.793 - Signal id 161, (PROBE), changed from HIGH to LOW.
2019-07-13 13:55:08.794 - -----ESS: Mach ACKs Probe0 input signal OFF.
2019-07-13 13:55:08.843 - Attempt transition from "MDI Running" on event "Stop" GcodeExec.cpp:1099
2019-07-13 13:55:08.843 - S_MDI_RUNNING2_on_exit
2019-07-13 13:55:08.843 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2019-07-13 13:55:08.843 - S_MDI_RUNNING_on_exit
2019-07-13 13:55:08.843 - ACTION_stop
2019-07-13 13:55:08.869 - S_IDLE_on_entry
2019-07-13 13:55:08.870 - API: mcCntlGcodeExecute() called. (G 91
F 5)
2019-07-13 13:55:09.070 - Attempt transition from "Idle" on event "MDI Start" Controller.cpp:1811
2019-07-13 13:55:09.070 - S_IDLE_on_exit
2019-07-13 13:55:09.070 - ACTION_start_mdi
2019-07-13 13:55:09.070 - S_MDI_RUNNING_on_entry
2019-07-13 13:55:09.070 - S_MDI_RUNNING2_on_entry
2019-07-13 13:55:09.071 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:55:09.093 - API: mcCntlEStop() called.
2019-07-13 13:55:09.093 - API: mcCntlEnable(false) called.
2019-07-13 13:55:09.093 - API: mcCntlCycleStop() called.
2019-07-13 13:55:09.093 - Signal id 1019, (Enable #1), changed from HIGH to LOW.
2019-07-13 13:55:09.094 - Signal id 1021, (Enable #3), changed from HIGH to LOW.
2019-07-13 13:55:09.094 - Signal id 1020, (Enable #2), changed from HIGH to LOW.
2019-07-13 13:55:09.094 - Attempt transition from "MDI Running" on event "Stop" Controller.cpp:4535
2019-07-13 13:55:09.094 - S_MDI_RUNNING2_on_exit
2019-07-13 13:55:09.094 - Signal id 1114, (Gcode Running), changed from HIGH to LOW.
2019-07-13 13:55:09.094 - S_MDI_RUNNING_on_exit
2019-07-13 13:55:09.094 - ACTION_stop
2019-07-13 13:55:09.095 - 
2019-07-13 13:55:09.095 -    $$$ ESS: Mach4 had a Cycle Stop - Force Output Stop Sates Now
2019-07-13 13:55:09.095 - Attempt transition from "MDI Running" on event "Stop" MachAPI.cpp:2678
2019-07-13 13:55:09.095 -    !!! ESS: Stop Event IGNORING command to turn OFF DISABLED output Port1-Pin14 - Spindle ON Relay
2019-07-13 13:55:09.095 -    $$$ ESS: Finished processing the Stop Event
2019-07-13 13:55:09.096 - 
2019-07-13 13:55:09.120 - S_IDLE_on_entry
2019-07-13 13:55:09.120 - Signal id 1120, (Machine Enabled), changed from HIGH to LOW.
Title: Re: touch probe function question
Post by: joeaverage on July 13, 2019, 02:26:37 PM
Hi,
so what actually happened? I presume from reading the log that you MDI'ed a g31 z-5.25 f5?

It appeared in the log file that the probe move occurred, a probe event was detected, the motors were set to still,
the position was latched, the remainder of the move was cleared......all looks normal.

What did the machine do?

Craig
Title: Re: touch probe function question
Post by: crchisholm on July 13, 2019, 07:24:39 PM
I set the "Retract Distance" to 5mm
I set the "Touch Plate Height to 4.76mm

What I wanted to happen:  Probe to the top of the touch plate, stop, retract 5mm and set the z axis to 9.76mm (5+4.76)
What actually happened:  Proved to the top of the touch plate and stopped.   Did not retract and did not set the Z height.

When I looked at the tutorial video on touch probing, it shows the exact behavior I am trying to get.   If this is not a standard behavior, then why show it in the tut and why collect the retract distance and the touch plate height.

Charlie
Title: Re: touch probe function question
Post by: joeaverage on July 14, 2019, 12:49:08 AM
Hi,
the log file you posted never got as far as a retract move.

Code: [Select]
2019-07-13 13:50:32.848 - Signal id 1120, (Machine Enabled), changed from HIGH to LOW.
2019-07-13 13:50:32.848 - ACTION_stop
2019-07-13 13:50:32.848 - 
2019-07-13 13:50:32.848 -    $$$ ESS: Mach4 was Disabled - Force Output Stop Sates Now
2019-07-13 13:50:32.848 -    !!! ESS: Stop Event IGNORING command to turn OFF DISABLED output Port1-Pin14 - Spindle ON Relay
2019-07-13 13:50:32.848 -    $$$ ESS: Finished processing the Stop Event
2019-07-13 13:50:32.848 - 

This occurred at the end of what appeared to be a successful g31 probe move. The g31 executed, the probe event was detected
and yet at 13:50:32.848 Mach4 was disabled, and apparently by the ESS if I read the log file correctly. Its not easy to
interpret a log file but I'm sure smurph or Chaoticone or Daz or......will assist.
The reason the machine never retracts is because Mach is disabled BEFORE the retract is enacted.

Solve the problem of the 'probe clean-up phase' so Mach is not disabled and the bet is everything will work OK thereafter.

Craig
Title: Re: touch probe function question
Post by: joeaverage on July 14, 2019, 01:05:27 AM
Hi,
I'm out of my depth, please ignore my previous post. As I have said there is no documentation AFIK to help you
interpret the log file.

Code: [Select]
2019-07-13 13:50:32.623 - API: mcCntlGcodeExecute() called. (G 91
F 5)
2019-07-13 13:50:32.823 - Attempt transition from "Idle" on event "MDI Start" Controller.cpp:1811
2019-07-13 13:50:32.823 - S_IDLE_on_exit
2019-07-13 13:50:32.823 - ACTION_start_mdi
2019-07-13 13:50:32.823 - S_MDI_RUNNING_on_entry
2019-07-13 13:50:32.823 - S_MDI_RUNNING2_on_entry
2019-07-13 13:50:32.824 - Signal id 1114, (Gcode Running), changed from LOW to HIGH.
2019-07-13 13:50:32.846 - API: mcCntlEStop() called.
2019-07-13 13:50:32.846 - API: mcCntlEnable(false) called.
2019-07-13 13:50:32.846 - API: mcCntlCycleStop() called.

Look at the first line:   mcCntlGcodeExecute() called. (G 91 F 5)

Look at the retract move: G91 F5.....so where is the axis command?. G91 sets relative mode, the G31 previously executed
sets the motion mode of G1. Thus your G91 F5 says linear interpolated move at feedrate of 5......but what axis? If I'm not
mistaken....'It is an error if no axis word is  commanded'.

Craig
Title: Re: touch probe function question
Post by: crchisholm on July 14, 2019, 10:18:12 AM
Thank you for looking at this.  What is truely frustrating is that I am convinced that the solution is going to be simple even if illusive.  At this point I can only hope that someone with some knowledge about this process can chime in and help me figure this out.

thanks again for your effort.
Charlie
Title: Re: touch probe function question
Post by: crchisholm on July 14, 2019, 11:02:01 AM
Here are the parameters that I'm using in case someone sees something that be causing this issue.
Title: Re: touch probe function question
Post by: joeaverage on July 14, 2019, 01:35:40 PM
Hi,
I think your prep distance is too much. It only needs to be clear of the surface, say 0.25 inch.
I Think also your retract distance is wrong. If I'm not mistaken the retract height is relative to the nominal
surface, again 0.25 inch should be enough.

Craig
Title: Re: touch probe function question
Post by: jbuehn on July 14, 2019, 05:25:13 PM
Hi Charlie,

Looking at the last error history (click the "history" button) is a good way to see what is happening when using mcTouchOff. The guys at Mach have been very helpful by sending messages there when things are happening in that script, such as a probing move, setting offsets, retract moves, etc.

The command that Craig mentioned, G91 F5 followed by mcCntlEstop, looks like it is from the CheckProbe() function in the script. Look for the "CheckProbe failed" comment. It's also sending a message to the error log so it will be telling you something in that last error history.
Title: Re: touch probe function question
Post by: crchisholm on July 15, 2019, 10:46:25 AM
Hi,
I think your prep distance is too much. It only needs to be clear of the surface, say 0.25 inch.
I Think also your retract distance is wrong. If I'm not mistaken the retract height is relative to the nominal
surface, again 0.25 inch should be enough.

Craig

I’m not sure I follow.  Your suggesting 0.25 inch which is greater than 5 mm.  Of course that is assuming that mach4 would assume the units I am working.  I tried to add “mm” to the number but it wouldn’t allow anything but numbers.
Title: Re: touch probe function question
Post by: crchisholm on July 15, 2019, 10:50:51 AM
Hi Charlie,

Looking at the last error history (click the "history" button) is a good way to see what is happening when using mcTouchOff. The guys at Mach have been very helpful by sending messages there when things are happening in that script, such as a probing move, setting offsets, retract moves, etc.

The command that Craig mentioned, G91 F5 followed by mcCntlEstop, looks like it is from the CheckProbe() function in the script. Look for the "CheckProbe failed" comment. It's also sending a message to the error log so it will be telling you something in that last error history.

I will look at this as soon as I Finnish my current task (which is sitting in the a/c recouping from working in the un-airconditioed shop on a very hot day in Florida)