diff --git a/docs/src/gui/qtdragon.adoc b/docs/src/gui/qtdragon.adoc index ef8d54e90cf..35c2ee6bfa3 100644 --- a/docs/src/gui/qtdragon.adoc +++ b/docs/src/gui/qtdragon.adoc @@ -1,5 +1,6 @@ :lang: en :toc: +:toclevels: 3 [[cha:qtdragon-gui]] = QtDragon GUI(((QtDragon))) @@ -843,6 +844,7 @@ Sequence after pressing the probe button: + . rapid back to starting corner (now calculated using the probed walls), . if auto zero button is enabled, set X and Y of the current user system to zero. +[[sub:touch-plate]] == Touch plate .QtDragon - Touch Plate @@ -866,23 +868,41 @@ The machine will probe down twice and the current user offset (G5X) will be zero == Auto Tool Measurement -QtDragon can be setup to do integrated auto tool measurement using the Versa Probe widget and remap code. -To use this feature, you will need to do some additional settings and you may want to use the offered HAL pin to get values in your own ngc remap procedure. +=== Overview -[IMPORTANT] -Before starting the first test, do not forget to enter the probe height and probe velocities on the versa probe settings page. +QtDragon can be setup to do integrated auto tool measurement using the Versa Probe widget and remap code. -Tool Measurement in QtDragon is done with the following steps: +This feature assumes the use of two probes in concert: -* Touch off your workpiece in X and Y. -* Measure the height of your block from the base, where your tool switch is located, to the upper face of the block (including chuck etc.). -* In the Versa probe tab, enter the measured value for block height. -* Make sure the use tool measurement button in the Vesa probe tab is enabled. -* Go to auto mode and start your program. + . A tool switch sensor, fixed somewhere on the machine (sometimes called a tool-setter), and + . A spindle probe that is installed temporarily at the beginning of the job (sometimes called an xyz probe or a Renishaw probe). -[NOTE] -When fist setting up auto tool measurement, please use caution until you confirm tool change and probe locations - it is easy to break a tool/probe. -Abort will be honoured while the probe is in motion. +These techniques are useful for machines that do not have repeatable tool holders and do not have automatic tool changing devices. (For machines with repeatable tool holders, see the section on <>. For machines with automatic tool changing devices, consult work done under the linuxcnc repository at configs/sim/axis/remap/rack-toolchange) + +To use this feature, you will need to do some additional settings and you may want to use the offered HAL pins to get values in your own ngc remap procedure. Those settings are covered later in the section. + +First, this document covers how to use this technique. Second, this document covers how to set up for this technique at the beginning of a production run. + +=== Workflow Overview + +A detailed workflow walkthrough follows this overview. + +[IMPORTANT] +Setup steps include: + + + +Entering the probe velocities on the versa probe settings page. + +Enabling "Use Tool Measurement" on the Versa Probe tab. + +Enabling "Use Tool Sensor" under Settings. + + + +When fist setting up auto tool measurement, please use caution until you confirm tool change and probe locations - it is easy to break a tool/probe. Abort will be honoured while the probe is in motion. + +Tool Measurement in QtDragon is organized into the following steps which will be explained in more detail in the following section: + +. Zero the probe tool by measuring the tool setter with the spindle probe installed +. Touch off your workpiece in X and Y. +. Measure the height of your block from the base, where your tool switch is located, to the upper face of the block (including chuck etc.). +. In the Versa probe tab, enter the measured value for block height. +. Go to auto mode and start your program. .Auto tool measurement image::images/sketch_auto_tool_measurement.png[align="left"] @@ -890,24 +910,63 @@ image::images/sketch_auto_tool_measurement.png[align="left"] With the first given tool change the tool will be measured and the offset will be set automatically to fit the block height. The advantage of this way is, that you do not need a reference tool. +[NOTE] +Your program must contain a tool change at the beginning. The tool will be measured, even it has been used before, so there is no danger if the block height has changed. There are several videos on you tube that demonstrate the technique using GMOCCAPY. The GMOCCAPY screen pioneered the technique. + +The sequence of events (using the default files in the default setting): + +. Rapid move in Z to position defined in the INI's [TOOL_CHANGE] Z +. Rapid move in X and Y to number defined in INI's [TOOL_CHANGE] X and Y +. Perform normal M6 tool change: ie, stop spindle, send message to user to change the tool +. Rapid move in X and Y to position defined in the INI's [VERSA_TOOLSETTER] X and Y +. Rapid move down in Z to position defined in the INI's [VERSA_TOOLSETTER] Z +. Probe down in Z to maximum defined in the INI's [VERSA_TOOLSETTER] MAXPROBE +. Changes the offset of the current work coordinate system to match the difference between the previous tool and the currently measured tool +. Rapid move up in Z to position defined in the INI's [VERSA_TOOLSETTER] Z_MAX_CLEAR +. Rapid move to the X Y position when the tool change was called +. Rapid move down to the Z position when the tool change was called [NOTE] -Your program must contain a tool change at the beginning. -The tool will be measured, even it has been used before, so there is no danger if the block height has changed. -There are several videos on you tube that demonstrate the technique using GMOCCAPY. -The GMOCCAPY screen pioneered the technique. +The [TOOL_CHANGE] Z position should be high enough so the tool will not hit the tool probe when moving to the [VERSA_TOOLSETTER] X and Y position. + + + +MAXPROBE distance needs to be high enough for the tool to touch the probe. + +=== Detailed Workflow Example -The sequence of events (using the default files): +==== One Time Setup -* Rapid move in Z to position defined in the INI's [TOOL_CHANGE] Z -* Rapid move in X and Y to number defined in INI's [TOOL_CHANGE] X and Y -* Request tool change -* Rapid move in X and Y to position defined in the INI's [VERSA_TOOLSETTER] X and Y -* Rapid move down in Z to position defined in the INI's [VERSA_TOOLSETTER] Z -* Probe down in Z to maximum defined in the INI's [VERSA_TOOLSETTER] MAXPROBE -* Return Z to position defined in the INI's [TOOL_CHANGE] Z +The following setups need only be done once as long as they remain in effect: + +. Under Probe Tool Screens: Insure reasonable values for "Rapid" and "Search," these are the speeds at which the probing will be performed and are in machine units per minute. + +. Under Probe Tool Screens: insure that "Tool Measure" is enabled (this is a button that must be highlighted) +. Under Settings: insure that "Use Tool Sensor" is enabled (this is a tick-box that must be checked) +. In the Tool Table: setup a tool for the spindle probe and insure that its Z offset is set to zero. [NOTE] +It is possible to use a non-zero tool length for the tool probe, but this requires extra steps and is easy to make mistakes. The following procedure assumes a zero tool probe length. + +==== Procedure before starting a program + +The following setup is done before beginning a program that has M6 tool change commands inside it. + +. Physically load the spindle probe into the spindle. +. Logically load the spindle probe into the spindle with the M61 Qx command where x is the number in the tool table for the spindle probe (there is a button inside the tool table tab that can also be used) +. Position to the Toolsetter: Use the button under the Probe Screens for "Go To Toolsetter" to position the spindle above the Toolsetter. +. Toolsetter Measure: Use the button under the Probe Screens for "Probe Tool Setter Z Height." Note that this will set and display on the Probe Settings screen the "Probe HT" value in ABS coordinates +. Jog to your workpiece. +. Workpiece Measure: Use the button under the Probe Screens for "Probe Z Height of Material:" this will set and display on the Probe Settings screen the "Block Ht" value in ABS coordinates. (Typically, this will now also be the zero Z for your Work Coordinate System) +. Set Work Coordinate System (ie, G54, or other): Use the Probe Tool and whatever probe screen or other method is appropriate to set the X, Y, and Z coordinate system needed for your job. +. If your program begins with a TnM6 command before spinning the spindle, you may leave the spindle probe installed. You may also issue a TnM6 command to change out the spindle probe, and if the program issues the same one, it will skip the tool change. + +[CAUTION] +Take care not to leave the spindle probe in the spindle if a program may start the spindle. + +Once those steps are complete, a program with multiple TnM6 toolchanges can be started and will operate with automatic pauses for manual tool change followed by automated tool measurement. + +[NOTE] +After probing the new tool length using the tool-setter, this remap code uses a G43 which applies the offset to the Work Coordinate system which was in effect when the M6 command was issued. Because remapping has adjusted the Work Coordinate system by the offset between the previous and the current tool, the tool tip will end up at the same point in space as the tip of the previous tool was when the tool change was called. + +=== Work Piece Height Probing in QtDragon_hd The [TOOL_CHANGE] Z position should be high enough so the tool will not hit the tool probe when moving to the [VERSA_TOOLSETTER] X and Y position. MAXPROBE distance needs to be high enough for the tool to touch the probe. @@ -1019,27 +1078,29 @@ REMAP=M6 modalgroup=6 prolog=change_prolog ngc=qt_auto_probe_tool epilog=change ==== The Tool Sensor Section The position of the tool sensor and the start position of the probing movement. + -All values are absolute (G53) coordinates, except MAXPROBE, which is expressed in relative movement. + +All values are absolute (G53) coordinates, except MAXPROBE, which is expressed as an absolute length of movement. + All values are in machine native units. + -X,Y,Z set the tool setter probe location. + -auto probe action sequence (this could be changed with a modified ngc remap file): + - -* go to TOOLCHANGE Z position -* go to TOOLCHANGE XY position. -* wait for manual tool change acknowledgement -* go to VERSA_TOOLSETTER XY position -* go to VERSA_TOOLSETTER Z position -* fast probe -* slow probe -* go to TOOLCHANGE Z position +X, Y, & Z set the tool setter probe location. + + +Auto probe action sequence in the default qt_auto_probe_tool example remap defined above (this behavior can be changed by modifying either the remap statement in the RS274NGC section, or by modifying the qt_auto_probe_tool.ngc code.): + + +. rapid move to the INI's [CHANGE_POSITION] Z position (this is a relative move, it adds this Z value to the current Z coordinate) +. rapid move to the INI's [CHANGE_POSITION] X & Y position. +. wait for manual tool change acknowledgement +. rapid move to the INI's [VERSA_TOOLSETTER] X & Y position +. rapid move to the INI's [VERSA_TOOLSETTER] Z_MAX_CLEAR Z position +. fast probe +. slow probe +. rapid move to the INI's [VERSA_TOOLSETTER] Z_MAX_CLEAR Z position Z_MAX_CLEAR is the Z position to go to before moving to the tool setter when using the 'Travel to Toolsetter button'. + 'Travel to Toolsetter' Action sequence: + -* go to VERSA_TOOLSETTER Z_MAX_CLEAR Z position -* go to VERSA_TOOLSETTER XY position -* go to VERSA_TOOLSETTER Z position. +. rapid move to [VERSA_TOOLSETTER] Z_MAX_CLEAR Z position +. rapid move to [VERSA_TOOLSETTER] XY position +. rapid move to [VERSA_TOOLSETTER] Z position. +Example settings: [source,{ini}] ---- [VERSA_TOOLSETTER] @@ -1053,7 +1114,7 @@ MAXPROBE = -20 ==== The Change Position Section This is not named TOOL_CHANGE_POSITION on purpose - *canon uses that name and will interfere otherwise*. -The position to move the machine before giving the change tool command. +The position to which to move the machine before giving the change tool command. All values are in absolute coordinates. All values are in machine native units. diff --git a/nc_files/remap-subroutines/qt_auto_probe_tool.ngc b/nc_files/remap-subroutines/qt_auto_probe_tool.ngc index fabfecfdb1d..0f8e24d388d 100644 --- a/nc_files/remap-subroutines/qt_auto_probe_tool.ngc +++ b/nc_files/remap-subroutines/qt_auto_probe_tool.ngc @@ -1,99 +1,237 @@ o sub + +; IMPORTANT: this remap enables using a gcode/ngc program on machines without +; automatic tool changers, and without repeatable tool holders, but which +; do have a tool setter (and ideally, an xyz probe). +; With this remap, a program or user can issue TxM6 commands at any +; point and the machine will automatically do the following: +; 1. Move to a tool change position defined in .ini parameters, Z first, then XY +; 2. Perform the normal M6 tool change (IE stop spindle, prompt for tool) +; 3. Move to the location of the toolsetter, Z first, then XY, probe the new tool's offset +; 4. Change the offset of the current coordinate system to match the new tool +; 5. Return the tip of the new tool to the same spot as the tip of the old tool +; based on newly measured z-offset +; 6. Return control back to whatever state it was in prior, continuing the program +; if one had been running. +; The following settings should be enabled in the QtDragon interface: +; A - Under Probe Tool screens: insure that "Tool Measure" is enabled +; B - Under Settings: insure that "Use Tool Sensor" is enabled +; The following workflow assumes using both a XYZ probe and a Z Toolsetter: +; 1 - Initial Setup: Before beginning the program, setup the Probe Tool as +; having a zero z-offset in the tool table. (Non-zero tool lengths +; for the probe tool can be made to work, but have multiple extra +; steps required, and it is easy to have the tool offset interfere with +; the remap coding and cause incorrect adjustments to your offsets. +; This procedure assumes a zero length.) +; 2 - Initial Tool: Load the probe tool with M61 Qx, where x is the Probe tool's number +; in the tool table. (Do not use TxM6) +; 3 - Toolsetter measure: Use button under the Probe Screens for "Probe Tool Setter +; Z Height:" this will set and display on the Probe Settings screen the +; "Probe HT" = #<_hal[qtversaprobe.probeheight> value in ABS coordinates. +; 4 - Workpiece Measure: Use the button under the Probe Screens for "Probe Z height +; of material:" this will set and display on the Probe Settings screen the +; "Block Ht" = #<_hal[qtversaprobe.blockheight]> value in ABS coordinates. +; 5 - Set Coord System (G54): Use the Probe Tool and whichever probe screen is +; appropriate to set the coordiate system XYZ offsets needed for your job. +; NOTE: Return_Option 3 uses the current local coordinate system, not just ABS coord. +; 6 - Prepare to Run: You may then issue a manual TnM6 command to change the tool +; before starting the job, or if the job begins with a TnM6 command before +; spinning the spindle, you may leave the Probe Tool installed. +; !! Take care not to leave the XYZ tool probe in the spindle when a program may start +; the spindle. !! ;(debug, in change tool_in_spindle=# current_pocket=#) ;(debug, selected_tool=# selected_pocket=#) -; calculate Z offset value based on current work offset (#5220) and -; G92/G52 offset if enabled (#5210) -# = [#[5203 + #5220 * 20] + #5213 * #5210] - +; ------------------------------------- +; --- Begin Initial data gathering ---- +; ------------------------------------- # = # # = # +# = #<_x> +# = #<_y> +# = #<_z> + +; ------------------------------------- +; --- End Initial Data Gathering ---- +; ------------------------------------- + +; ------------------------------------- +; --- Begin Initial Safety Checks ---- +; ------------------------------------- + ; we must execute this only in the milltask interpreter ; or preview will break, so test for '#<_task>' which is 1 for ; the milltask interpreter and 0 in the UI's -O100 if [#<_task> EQ 0] +o100 if [#<_task> EQ 0] (debug, Task is Null) -O100 return [999] -O100 endif +o100 return [999] +o100 endif ; check we are in right mode -O110 if [#<_metric_machine>] - O115 if [#<_imperial>] +o110 if [#<_metric_machine>] + o115 if [#<_imperial>] (MSG, Auto Tool probe error: not in G21 mode ) - O115 return [-3] ; indicate probe contact failure to epilog - O115 endif -O110 else - O115 if [#<_imperial> EQ 0] + o115 return [-3] ; indicate probe contact failure to epilog + o115 endif +o110 else + o115 if [#<_imperial> EQ 0] (MSG, Auto Tool probe error: not in G20 mode ) - O115 return [-3] ; indicate probe contact failure to epilog - O115 endif -O110 endif + o115 return [-3] ; indicate probe contact failure to epilog + o115 endif +o110 endif + +;check we have a usable search velocity configured, otherwise error +o150 if [#<_hal[qtversaprobe.searchvel]> LE 0] + (MSG, No usable search velocity in hal.qtversaprobe.searchvel) + o150 return [-1] ; indicate searchvel <= 0 +o150 endif + +;check we do not have an invalid Return Option +o175 if [EXISTS[#<_ini[VERSA_TOOLSETTER]RETURN_OPTION>]] + # = #<_ini[VERSA_TOOLSETTER]RETURN_OPTION> + o176 if [[# EQ 1] OR [# EQ 2] OR [# EQ 3]] + ;Continue: Return_Option is both defined and valid + o176 else + (MSG, Invalid RETURN_OPTION in .ini file under VERSA_TOOLSETTER) + o176 return [-1] ; signal error to post processing + o176 endif +o175 else + ;Continue: it is valid to not define Return_Option, defaults to 1 +o175 endif + +; ------------------------------------- +; --- End Initial Safety Checks ---- +; ------------------------------------- + +; ------------------------------------- +; --- Begin Physical Tool Change ---- +; ------------------------------------- ;first go up F #<_hal[qtversaprobe.searchvel]> G53 G0 Z[#<_ini[CHANGE_POSITION]Z>] -O125 if [#<_current_tool> NE #] +o200 if [#<_current_tool> NE #] ; then move to change position G53 G0 X[#<_ini[CHANGE_POSITION]X>] Y[#<_ini[CHANGE_POSITION]Y>] -O125 endif +o200 endif -; cancel tool offset +;cancel tool offset mode G49 ; using the code being remapped here means 'use builtin behaviour' +; ie, this is not a recursive call to this program, but calls the +; un-remapped M6 processing +; That processing includes actually sending the window to the user +; to press OK when they have completed the tool change. M6 -O200 if [#<_hal[qtversaprobe.enable]> EQ 0] - (MSG, Auto Tool probe disabled ) - G43 -O200 return [3] ; indicate no tool measurement -O200 endif +; ------------------------------------- +; ------ End Physical Tool Change ---- +; ------------------------------------- + +; ------------------------------------- +; ------ Begin Safety Checks for Tool Offset Measurement ---- +; ------------------------------------- +o300 if [#<_hal[qtversaprobe.enable]> EQ 0] + (MSG, Auto Tool probe disabled ) + G43 ;turn back on tool offset mode before returning +o300 return [3] ; indicate no tool measurement +o300 endif + +;check we have a usable probe velocity configured, otherwise error +o400 if [#<_hal[qtversaprobe.probevel]> LE 0] +o400 return [-2] ; indicate probevel <= 0 +o400 endif + +; ------------------------------------- +; ------ End Safety Checks for Tool Offset Measurement ---- +; ------------------------------------- + +; ------------------------------------- +; ------ Begin Tool Offset Measurement ---- +; ------------------------------------- + +;rapid-move to safe height +G53 G0 Z[#<_ini[VERSA_TOOLSETTER]Z_MAX_CLEAR>] +;Then rapid-move to probe XY location G53 G0 X[#<_ini[VERSA_TOOLSETTER]X>] Y[#<_ini[VERSA_TOOLSETTER]Y>] +;then feed down to the probe start location F #<_hal[qtversaprobe.searchvel]> G53 G1 Z[#<_ini[VERSA_TOOLSETTER]Z>] +;switch to relative distance mode for probe moves +G91 -O300 if [#<_hal[qtversaprobe.searchvel]> LE 0] -O300 return [-1] ; indicate searchvel <= 0 -O300 endif - -O400 if [#<_hal[qtversaprobe.probevel]> LE 0] -O400 return [-2] ; indicate probevel <= 0 -O400 endif - +;begin initial probe move F #<_hal[qtversaprobe.searchvel]> -G91 -G38.3 Z- #<_ini[VERSA_TOOLSETTER]MAXPROBE> +G38.2 Z- #<_ini[VERSA_TOOLSETTER]MAXPROBE> G0 Z #<_hal[qtversaprobe.backoffdist]> -O500 if [#5070 EQ 0] +o510 if [#5070 EQ 0] G90 -O500 return [-3] ; indicate probe contact failure to epilog -O500 endif +o510 return [-3] ; indicate probe contact failure to epilog +o510 endif -;reprobe at probe speed +;reprobe at probe speed: G38.2 means probe toward workpiece, stop on contact +; when G38.n axis completes, it puts the Z value detected (in the coordinates system +; in which this program started) into parameter #5063 (because we're probing Z) +; F #<_hal[qtversaprobe.probevel]> -G38.3 Z- [#<_hal[qtversaprobe.backoffdist]> *1.2] +G38.2 Z- [#<_hal[qtversaprobe.backoffdist]> *1.2] -O600 if [#5070 EQ 0] +o510 if [#5070 EQ 0] G90 -O600 return [-3] ; indicate probe contact failure to epilog -O600 endif +o510 return [-3] ; indicate probe contact failure to epilog +o510 endif +;switch back to absolute distance mode once probing is done G90 -G53 G0 Z[#<_ini[CHANGE_POSITION]Z>] -# = [#5063 + #] +;set the current offset +# = #5063 + +; +; G10 L1 is the Set Tool Table Offset: it changes the tool table offset, +; it DOES NOT change the offsets in the current coordinate system. (that would be G10 L2) + +# = [# - #<_hal[qtversaprobe.probeheight]> + #<_hal[qtversaprobe.blockheight]>] + +G10 L1 P# Z[#] + +;G43 enables tool length offset: this affects all subsequent moves by applying +; the offset just calculated to the coordinate system currently in +; effect. ie. it has subtracted Calculated Offset from the Z offset + +G43 + (DEBUG, %fProbe Height: #<_hal[qtversaprobe.probeheight]>) (DEBUG, %fBlock Height: #<_hal[qtversaprobe.blockheight]>) (DEBUG, %fProbe Result: #) - -G10 L1 P# Z[# - #<_hal[qtversaprobe.probeheight]> + #<_hal[qtversaprobe.blockheight]>] -G43 +(DEBUG, %fCalculated Offset: #) + +; ------------------------------------- +; ------ End Tool Offset Measurement ---- +; ------------------------------------- + +; ------------------------------------- +; ------ Begin Return Movement ---- +; ------------------------------------- + +; return to original tool-tip position, but using new z-offset +;(DEBUG, Return to original tool-tip position using new z-offset: # , # , #) +G53 G0 Z[#<_ini[VERSA_TOOLSETTER]Z_MAX_CLEAR>] +; now use original (modal)coord system to go over to xy +G0 X[#] Y[#] +; and finally down to the (already offset) z coord +G0 Z[#] + +; ------------------------------------- +; ------ End Return Movement ---- +; ------------------------------------- ; signal success be returning a value > 0: o endsub [1]