Probing Description and Operation - synthetos/TinyG GitHub Wiki
placeholder for documenting G38 command
This section describes edge-0.97 build 449.01.
G38.2 moves toward the programmed X, Y and/or Z point at the current feed rate until the probe input becomes active, then stops and records the position. G38.3, G38.4 and G38.5 are not supported (status 131). Format:
G38.2 Z-10 F100
- Set the mode of exactly one X, Y or Z switch input (min or max) to 4 (probe), e.g.
$zsn=4. -
$prbpsets the probe input polarity independently of$st: 0 = normally open (active low, the default), 1 = normally closed. It can only be changed while no cycle is running and the planner is empty; otherwise it fails with status 117 ("Setting refused: stop the job first") and keeps its value.
- At least one of X, Y or Z must be present (status 134 if not). A, B or C words are not allowed (status 135).
- A feed rate must be in effect; it may have been set on an earlier line (status 142 if not). G93 inverse time mode is not allowed (status 143).
- In G91 the axis words are distances from the current position; in G90 they are work coordinates. Axes that are not programmed do not move.
- The probe travel must be at least 0.254 mm (status 251).
- No probe input configured: status 252. More than one: status 253. A probe input on the A axis: status 254.
- During the probe move the homing jerk (
$xjhetc.) is used for X, Y and Z. Jerk and the G90/G91 distance mode are restored afterwards, and the motion mode is set to G80.
When the probe move ends TinyG sends a report as a top-level object (not inside an r response):
{"prb":{"e":1,"x":10.000,"y":20.000,"z":-3.512,"a":0.000,"b":0.000,"c":0.000}}
-
eis 1 if the probe tripped during the move and 0 if it did not. -
x...care the machine coordinates (G53: not shifted by G54-G59, G92 or the tool length offset) where the machine stopped, in millimetres (degrees for A, B and C) whatever G20 or G21 is active, with 3 decimals, as g2core reports them. A value that is not a finite number is sent asnull. To get the work position, subtract the active offsets, or readposx...poszafter the probe. - The report follows the
$jssetting (relaxed or strict JSON). The same values can be read later with{prb:n}.
- If the probe input is already active before the move starts, the move is not made,
eis 0, and the machine goes to ALARM with status 250 ("Probe already tripped"). - If the move ends without the probe tripping, the machine goes to ALARM with status 250 ("Probe did not trip").
- If the probe move itself is refused (for example by the soft limits), the machine goes to ALARM.
- An alarm that happens before or during the probe ends the probe cycle.
See Alarms for how to clear an alarm.