Machsupport Forum

Mach Discussion => Mach4 General Discussion => Topic started by: it*guy on March 07, 2015, 05:35:15 AM

Title: Mach 4 Tool Auto Zero
Post by: it*guy on March 07, 2015, 05:35:15 AM
I was trying to figure out a few things regarding tool auto-zero in Mach 4.

1. When the M6 code comes up when running a program it passes by the code as if it is a comment, NO it does not show up as (M6) in code. no brackets.
2. I see the button for tool auto-zero on the main "run Program" page, but alas, nothing comes of it when pressed.

I am new to Mach 4 so I am %99.99 SURE I missed something somewhere!

P.S. also what is the best recommended wiring for the touch-off plate, I plan on having one for tool change permenantly installed on the table.

Any and all help given is more than greatly appreciated.

V/R
Mike (it*guy)
Title: Re: Mach 4 Tool Auto Zero
Post by: ger21 on March 07, 2015, 07:44:14 AM
1) Do you have an M6 macro in your Mach4Hobby\Profiles\macros\ folder?
The default macro stops and waits for you to press Cycle Start. The Tool Change LED should be blinking.

2) Like in Mach3, it's up to the user to implement the Auto Zero. I'm not aware of anyone doing it with Mach4 yet.
Title: Re: Mach 4 Tool Auto Zero
Post by: Bodini on March 07, 2015, 07:42:35 PM
2) Like in Mach3, it's up to the user to implement the Auto Zero. I'm not aware of anyone doing it with Mach4 yet.

Auto touch-off was the first thing I looked at in M4.  I tried converting over the script from the VB version in M3 to Lua in M4 but "IsMoving" does not work properly. I submitted the bug in the forum about 9 months ago I think, but it still didn't work when I checked a few days ago.  :-\

-Nick
Title: Re: Mach 4 Tool Auto Zero
Post by: dude1 on March 07, 2015, 09:31:44 PM
I think whats below is what you wont if wrong ever development team will say the squire or round one


mcCntlGCodeExecuteWait(inst, "G53 Y0 Z0")--Move back to the YOffset line
      if rc ~= mc.MERROR_NOERROR then return "Could not complete GCode motion", false end
   else
      mcCntlGCodeExecuteWait(inst, "G53 Y0 Z0")--Move to the YOffset line
      if rc ~= mc.MERROR_NOERROR then return "Could not complete GCode motion", false end
Title: Re: Mach 4 Tool Auto Zero
Post by: poppabear on March 08, 2015, 12:30:51 PM
--Take a poke at this and see if it works for your
--machine state, for probing. I don't have  a working probe,
--I am unable to test it. as an alternative, you could "NOT" the
--Run and Feedhold enums.

function test()
    local inst = 0; local state = 0; local rc = 0;
    --*****   Mach4 Enum machine states   *****
    local states = {["0"]   = "MC_STATE_IDLE",          --nothing going on, ok to probe
                    ["102"] = "MC_STATE_FRUN_PROBE",    --unknown if this is applicable
                    ["103"] = "MC_STATE_FRUN_PROBE_FH", --unknown if this is applicable
                    ["202"] = "MC_STATE_MRUN_PROBE",    --unknown if this is applicable
                    ["203"] = "MC_STATE_MRUN_PROBE_FH" }--unknown if this is applicable   
   
    state, rc = mc.mcCntlGetState(inst);

    if state == 0 or state == 102 or state == 103 or state == 202 or state == 203 then   
        state, rc = mc.mcCntlGetState(inst);
        if state == 0 then
            --states of instance that is running, i.e. RUN, STOP etc.                 
            wx.wxMessageBox("Number State = " .. tostring(state),
                            "String State " .. states[tostring(state)],
                            wx.wxOK);
            --If you got here, then it is OK to do probing, your code here......
        end
    end
end

if (mc.mcInEditor() == 1) then
    test();
end
Title: Re: Mach 4 Tool Auto Zero
Post by: it*guy on March 11, 2015, 10:26:12 PM
poppabear,
how do I test your code?
Title: Re: Mach 4 Tool Auto Zero
Post by: poppabear on March 12, 2015, 09:03:03 AM
1). Get a working probe.
2). Map probe to an input.
3). with probe tip held "ON", step the above code with a break point at "your probe code".
4). with mach in idle state, If you stop in that part of the code then that represents you getting the signal.
5). Write/test your probing code in real world, test, re-test under various conditions.
6). Modify, fix, rinse, repeat.
7). Probe stuff

Scott
Title: Re: Mach 4 Tool Auto Zero
Post by: dude1 on March 12, 2015, 02:06:59 PM
the other way you can do it is with G code

something like this
G49 (Cancel TLO)

G58 (Switch to work offset G58)

G0 X10 Y20 (move the tool over the toolsetter)

G31 Z-10 F15 (probe tool down till it touches the toolsetter)

G10 L1 P1 Z#2002 (set the tool length offset value to the G58 Z position where the probe tripped)

G0 Z3 (move up to safe distance)

G54 (reapply old work offset coordinate system)

G43 H1 (apply new TLO for tool 1)
%

I have not tested it use at your own risk
Title: Re: Mach 4 Tool Auto Zero
Post by: poppabear on March 15, 2015, 08:21:56 AM
it*guy,

   So.......... did you get it to work yet?

Scott
Title: Re: Mach 4 Tool Auto Zero
Post by: it*guy on March 26, 2015, 05:47:09 PM
not yet. I have been on a vacation away from the machine. I will be attempting to test it over the next few days. if anybody has any input for this since the last post please chime in!
Thanks,
V/R
Mike
Title: Re: Mach 4 Tool Auto Zero
Post by: it*guy on March 26, 2015, 05:48:19 PM
I was spending some much needed time with Joe Crumley in Norman, OK! learning how to properly use my machine!
Title: Re: Mach 4 Tool Auto Zero
Post by: it*guy on March 27, 2015, 03:30:15 AM
the G-Code Function works but when it gets to the G31 Command Mach 4 says that "probing is not yet supported by the motion Controller"
This is because the probing function may not be set up right on my end, or the firmware actually does not support the probing function.

I am using the PMDX-422 SmartBOB for your information.

Thanks for any and all replies.

V/R
Mike
Title: Re: Mach 4 Tool Auto Zero
Post by: it*guy on March 27, 2015, 03:31:32 AM
I went to the plugins section for the 422 and found only 2 options for probing.
1. wildhorse low pull up
2. wildhourse high pullup (strong pull up)
Title: Re: Mach 4 Tool Auto Zero
Post by: Steve Stallings on March 27, 2015, 04:58:04 AM
As of 27 March 2015, the plugin and firmware for the PMDX SmartBOB-USB boards
does not support probing yet. This applies to both tool length probing and digitizing
of coordinates. Our software for probing support is mostly developed and we expect
to release it next week. New plugins and firmware can be downloaded from our
web site. When this release occurs, it will be announced here:

http://www.pmdx.com/PMDX-Forums/index.php?board=2.0

You can request automatic notification of announcements by following the instructions
here:

http://www.pmdx.com/PMDX-Forums/index.php?topic=55.0

The options that you see in the PMDX-SmartBOB-USB plugin configuration dialogs
are for controlling the electrical characteristics of the signal input used for pin 15 on
the SmartBOB-USB. This one pin has special properties for accommodating the behavior
of Wildhorse brand of digitizing probes and similar ones which contain an LED connected
across the electrical contacts inside the probe.
Title: Re: Mach 4 Tool Auto Zero
Post by: it*guy on March 28, 2015, 02:30:17 AM
So I decided just to manually touch off the plate to the tool, and on the Machine Diagnostics Tab the probe light turns on when the circuit is completed. I believe that it is just the motion controller awaiting the aforementioned update to allow the configuration of the auto-zero.

Thanks again Steve!
V/R
Mike
Title: Re: Mach 4 Tool Auto Zero
Post by: Pedio on July 28, 2015, 05:08:49 PM
Did you guys get this to work? I believe that the smartBob now has probing working. I can get the LEDs to change when my touch plate is touched to the bit.

Also, not sure how to use G-code in the Lua interface. Do I just enter it where the script goes? Will this reset my Z=0 for the machine or only set a difference for the one run of the current file? Anyone have a script that works. This would make my life compete (until I hit the next challenge).   ;D
Title: Re: Mach 4 Tool Auto Zero
Post by: dude1 on July 28, 2015, 06:32:10 PM
just go here and get the probing screen set http://machremote.dyndns.org:8080/
Title: Re: Mach 4 Tool Auto Zero
Post by: Pedio on July 28, 2015, 09:17:50 PM
Ok - downloaded it. How do I make it work?
Title: Re: Mach 4 Tool Auto Zero
Post by: ger21 on July 28, 2015, 09:31:02 PM
There were instructions there.
http://machremote.dyndns.org:8080/index.php?/Knowledgebase/Article/View/3/1/how-to-install-the-mach4-hobby-screen-set-with-probing
Title: Re: Mach 4 Tool Auto Zero
Post by: Pedio on July 29, 2015, 01:49:57 PM
I saw the instructions and was able to install the screenset successfully; however, I am not sure how to activate an Auto tool Zero session using this screenset. The Screen set I was using supported G31 via SmartBob. I am able to type a G31 command into the MDI and have the Z axis move / stop moving when I touch the plate to the bit. What I expected and did not see in the Probe screen set was a script behind the "Auto Tool Zero" button.

Thoughts?
Title: Re: Mach 4 Tool Auto Zero
Post by: dude1 on July 29, 2015, 03:07:14 PM
its all stored in a module there`s instruction in the screen
Title: Re: Mach 4 Tool Auto Zero
Post by: Pedio on July 30, 2015, 06:12:12 AM
its all stored in a module there`s instruction in the screen

Perhaps I am being dense today. I looked under the button, in wizards, on all screens, and can not find it. Where is the code to do probing? I am running simulation mode if that makes a difference.
Title: Re: Mach 4 Tool Auto Zero
Post by: dude1 on July 30, 2015, 06:25:03 AM
in your profile C/ Mach4/profile/profile name/modules
Title: Re: Mach 4 Tool Auto Zero
Post by: Pedio on July 30, 2015, 09:18:53 PM
I can run the profile. How do I get it to auto zero...