We developed an application Probe Screen for more convenient work with the touch probe and the toolsetter in LinuxCNC. Description and source codes are presented in this article for version Probe Screen V2. Description of the previous version V1 is here.
The Probe Screen application is not necessary for working with our sensors and is not supplied with sensors; you can use this and any available and suitable software with our sensors. On the other hand, the Probe Screen can be used with third-party sensors. This application is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Attention! Measuring operations are very intolerant of incorrect settings. It is strongly recommended to do preliminary tests on loose object that will not damage the probe when unexpected movements. It is recommended to carefully check each setting before measuring the workpiece.
Installation
...more
1. Add to your .ini ...-postgui.hal settings from my-mill.ini and my-mill-postgui.hal, substitute your own constants.
2. The following folders from the archive are placed in configuration folder:
/python
/macros
/probe_icons
3. File .axisrc is placed in home ~/ folder. If you are already using .axisrc, then only add to your file contents of this .axisrc (use CTRL + H in explorer to see hidden system files).
4. Delete (or comment out) from all .hal files lines of the form:
#loadusr -W hal_manualtoolchange
#net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
#net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
#net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
If something went wrong and you need debugging, here is a list of variables that are used in the settings, you can find them in the files macros/*.ngc and python/probe_screen.py
↑ roll up
Measurement
Set the probe in the spindle.
Move manually probe for Z about 2-10 mm above the workpiece surface,
and for XY about the position indicated by the colored dot on the appropriate button Probe Screen.
Fill parameters (names pop up when you mouse). If you change the parameters are automatically saved in .pref .
If you change the values of the parameters using the keyboard (and not with the mouse on the arrows), you must press Enter to commit the new values.
Search speed: “fast” feed rate at which the probe searches for the target workpiece in machine units per minute. As soon as touched, it retreats to the distance indicated in the fourth field, and then again searches at a slower Latch speed (indicated in the second field). This is done to eliminate inaccuracies caused by the inertia of the machine, just as LinuxCNC handles home switches. The search speed should be slow enough to give you an acceptable initial accuracy, but fast enough to not waste time waiting for movement. Recommendation: 200-500 mm / min.
Latch speed: The "slow" speed that the machine uses for accurate measurement. This speed depends on how quickly your machine stops when the probe is triggered. The value of this field should be small enough for the machine to instantly stop when moving at such a speed. You must experiment with it to find the greatest value that does not sacrifice accuracy with your center finder. Recommendation: 5-50 mm / min.
Search distance: this is the maximum limit on how far the probe will search for a target. If the search distance is too short, you will receive a message like "G38 finished without probe trip". For safety reasons, it is recommended to set this parameter no more than free running of the stylus of the probe: 3-4mm.
Latch distance: this is indented to perform a re-search. This is a short distance (short because it will need to be passed at a "slow" Latch speed), but large enough for the probe to stop touching the part and bring it to the search ready state. If you make the Latch distance too large, you will end up spending a lot of time waiting for the search to complete. Recommendation: 0.5-1mm
The diameter of stylus tip: Used for mathematical calculations of the coordinates of the search results. Theoretically, the probe tripped as soon as the ball touches the part, preventing further movement of the axis. Therefore, if you use a stylus tip with a diameter of 2 mm, you need to fix the coordinates of the machine 1 mm from the place where the sensor worked, and thus take into account the diameter of the tip. Half of the value that you enter in this field is subtracted or added to the place of drawdown of the probe (during the Latch search), depending on the direction of movement. If this number = 0, the resulting coordinates will be incorrectly shifted. It is worth using a micrometer to measure the tip of the stylus in order to add a size to this field, if the manufacturer has not told you.
XY clearance: this is the spare distance from the measured face (the same for X and Y, see diagrams below). It is necessary to compensate for the inaccurate manual positioning of the probe above the workpiece before starting the measurements. If this value is too small, you run the risk of ran into a part. XY clearance should be slightly larger than the radius of the stylus bulb. If it is too large, you lose time or run into another side of the part. Recommendation: stylus tip radius + 0.5 ... 1.5mm.
Edge length: This is the distance that some buttons use to determine how far to move at the quick speed (RAPID_SPEED) to the position before starting the search to speed up the work. For example, to find the center inside the hole, you manually set the probe within a short distance Z from the top of the hole (you can go directly into the hole, then Z clearance = 0) and approximately (by eye) in the center. The probe will go down by the value of Z clearance, then the X will move at a quick speed at (Edge length minus XY clearance). It then switches to the “search speed” indicated in the first field and starts the search sequence. In the case of this particular button (search for the center of the hole), Edge length must be set before the start of the search approximately equal to the radius of the hole. If the hole, for example, is about 8 mm, place the probe tip approximately centrally above it and about +1 mm Z. Edge length set = 4 mm, XY clearance = 2mm. Press the button, the probe goes down to the value of Z clearance (which in our case let it be = 3, so the probe tip enters 2 mm into the hole) and moves 2 mm X- (Edge length 4 mm minus XY clearance 2 mm = 2 mm). Since we started approximately in the middle of the hole in X and Y, the action should position us within about 2 mm from the hole wall. The probe begins to move with a Search speed to -X. Once triggered, the probe will retreat (+ X) at the Latch distance, slow down and then touch again. This will determine the location of the -X hole wall. After clarification, the probe will be installed on the opposite side of the hole again about 2 mm from the wall. The process is repeated here, as well as for Y + Y-.
If the Edge length is too large, the probe will abut the edge of the hole before it even starts searching. If this happens, the search will stop and give an error message. You will have to readjust your values, manually move the probe back to its original location and try again.
If the Edge length is too small, the probe may arrive at the desired starting position, but will not reach the hole wall when searching. If this happens, get another error. Correct the values, manually move the probe back to its original location and try again.
Recommendations:
-for the center (hole-cylinder) buttons the Edge length set approximately equal to the estimated radius (not to be confused with the diameter),
- for the corner buttons the Edge length is equal to the indent along the edge from the corner point,
-for the length buttons, set the Edge length approximately equal to half the length we are looking for (approximately equal to the radius of the inscribed circle),
-Edge length is not used at all in buttons for simple searches along one axis (X +, X-, Y +, Y-, Z-).
Z clearance (depth of search): this is the depth where the search will be conducted relative to the current position on Z. Z clearance is required for measurements Outside (left group of buttons). Example. If you set the Z clearance to 3 mm and position the probe >3 mm above the workpiece, then the search will not occur, because the stylus cannot touch the walls.
On the other hand, if you make this distance too large, the program will not check and will simply go into operation and may crash into the bottom of the hole.
The pictures below show how xy clearance differs from edge lenght.
Hit only! the button that corresponds to the position of the probe above the workpiece. For the other buttons - another position above the workpiece.
The trajectory of the probe by the example of measurement outside corner X+Y+
Two separate searches are combined: X+ and Y+.
Central, the most complex button, starts a row 4 searches X+ X- Y+ Y-, edge length should be approximately equal to the radius of the cylinder, xy clearance indented outwardly from the cylinder wall (it is necessary to compensate for the error of the approximate initial manual exposure of the center and add the radius of the stylus tip)
Trajectory of motion of the probe using the example of measurement of an internal angle X+Y+
The search for the hole center is constructed as follows X- X+ Y- Y+, edge length should also be approximately equal to the radius of the hole being measured, xy clearance offset from walls of the hole to the center (it is necessary to compensate for the error of the approximate initial manual exposure of the center and add the radius of the stylus tip).
Any of the searches is completed by moving XY to the desired point (either the edge, or the angle, or the center), Z remains in the original position. The found point can be automatically made by zero or a specific number.
Settings for the tool diameter measurement button:
The button launches a macro measuring the tool diameter on the toolsetter. Moves the spindle to the measuring point at a safe height of Z: [AXIS_2] MAX_LIMIT, makes a measurement of the height of the toolsetter's pad, then starts the spindle at reverse(it is recommended to set no more than 1500 rpm) and measures the diameter by analogy with the center of the cylinder.
Constant parameters for the button are set by the user individually in the .ini file:
[TOOLSENSOR]
# Absolute coordinates of the toolsetter pad
X = 10
Y = 10
# Absolute Z start search coordinates
Z = 10
# Maximum search distance and direction (sign)
MAXPROBE = -60
# Speed of movements during working in Probe Screen
RAPID_SPEED = 600
# Diameter of toolsetter pad
TS_DIAMETER = 10
# The speed of the reverse rotation of the spindle when measuring the tool diameter
REV_ROTATION_SPEED = 300
The button also uses all the "Settings" fields (except Edge length and Search distance, instead they are taken as 0.5 * TS_DIAMETER and MAXPROBE from .ini, respectively). Note: the approximate diameter of the measured milling cutter is entered in the "Diameter stilys tip" field.
Quick manual tool change (Remap M6):
Probe Screen allows you to speed up manual tool changes thanks to automatic measurement of tool height during g-code execution. The user will only have to remove the old and install a new tool.
Requirement: presence of two sensors - touch probe and toolsetter.
Preparatory steps:
1.Toolsetter should be installed permanently on the edge of the desktop.
2. Set the workpiece on the table.
3. Insert the probe into the spindle.
4.Enter the Settings. The maximum search distance for the buttons is used from the fields shown in Fig. below
5.Measuring with a probe on the z surface of the toolsetter measuring pad: press the "TS Height" button, the probe will automatically perform actions and the result will appear in the field next to the button. The actions are as follows: the probe moves at the RAPID_SPEED speed to the search point above the toolsetter at the coordinates specified in [TOOLSENSOR] XY, at height [AXIS_2] MAX_LIMIT (Z axis), the search starts down from the height of [TOOLSENSOR] Z, at a maximum distance of no more than MAXPROBE. Search-Latch rates and Latch distance will be taken from "Settings".
6.Measuring with a probe on the surface of the workpiece: the probe must be manually brought to the measurement site above the workpiece, press the "Workpiece Height" button, the probe will perform a simple search down from the current position, the result will appear in the field under the button. Search and Latch rates and Search and Latch distances will be taken from the “Settings” (the top four parameters).
7.The [CHANGE_POSITION] specifies the XYZ (machine) coordinates of an arbitrary point at which it is convenient to carry out a tool change.
After this preparation, you can run the program g-code. As soon as the tool change command M6 Tn is met, the spindle stops, moves to [CHANGE_POSITION], then a new tool is placed, "OK" is pressed to continue, the new tool is automatically measured on the toolsetter, and g-code continues.
How to use Rotation:
Set the probe above the desired edge 2-4 mm (the approximate position shows the colored dot on the button). Fill in the parameters. Press only! corresponding to this position button.
Then there will be two measurements, as indicated by the arrows on the button.
The parameters are set so
edge length = distance between measured points
xy clearance = offset from the edge
z clearance = embedment
Auto Rott:
-if Yes, then after measuring the coordinate system will automatically rotates by the measured angle,
-if No, then the angle is simply measured and written out.
The angle is calculated relative to the X axis for the front and back faces, relative to the Y axis for the right and left faces.
After the coordinate system has been rotated, all other measurement groups will start working in a new coordinate system.
You can also rotate the coordinate system at an arbitrary angle manually - type an angle in the New angle field and click the button to approve.