This is an old revision of the document!

# Using the touchprobe

NOTE This module is no longer supported, and is not compiled in. If someone fixes this let us know.

left here for historical purposes….

image http://chibidibidiwah.wdfiles.com/local--files/gallery/CBr5vB7ODYKEXWCUnQZ7lXb-VpH8zNHD2Neevo_nsxg.png style="width: 420px" toc Currently the only opperation regarding touchprobes supported by smoothie is G31. G31 works similar to G1 codes but stops if the probe is touched. Please note that coordinated moves are not supported. This means only moves along a single axis will work. Some examples:

This will move to Z-10 and stop when a touch happens during that move:
code G90
G31 Z-10 F150
code

This will probe at a fast speed, retract, probe at a slow speed and report the position:
code G91
G31 Z-10 F300
G0 Z0.2
G31 Z-0.3 F50
M114
code

Additional to the M114 every touch is logged to a file (for more information see: Using log files)

# Configuration

The touchprobe module has the following configuration values (the values here are the default)

code touchprobe_enable false # enables/disables the module the other config values are ignored if this is false
touchprobe_log_enable false # should the touches be logged
touchprobe_logfile_name /sd/probe_log.csv # location of the log file
touchprobe_log_rotate_mcode 0 # adds a spacer to the logfile if M[xxx] is issued
touchprobe_pin nc # selects the pin where the probe is connected
touchprobe_debounce_count 100 # reports a touch if the probe is active for this number of ticks (prevents false positives)
code

# Using log files

The log file is an easy way to create point clouds of the probed objects. Due to bugs in mbed the log file isn't created automaticaly so you have to create it first and restart smoothie in order to update the file-handle propertly. You should also propertly unmount (safetly remove) the sd-card before logging. This is because the file-system is dual mounted: by your operating system and by smoothie. As a consequence desynchronization is possible. If you forget this try to remount the sd-card afterwards, most of the time no data loss will happen.

It's very easy to convert the logfile to an PLY file, which is supported by most point cloud applications. Note this only works if there are no spacers in the file, that are generated by the “log-rotation” M-code.
1. Find out how many points has been logged ( *nix users can use 'wc -l' for that)
code ply
format ascii 1.0
comment smoothie cloud
element vertex xxxxxxxx
property float x
property float y
property float z
element face 0
property list uchar int vertex_indices
@@ @@$P3=(P1.x, P1.y + \frac{(P2.y-P1.y)}{2})$ 3. Probe along the X axis for P4 and P5, make sure the Y axis is at P3.y
@@ @@$M=(P4.x+\frac{(P5.x-P4.x)}{2},P3.y)$ 5. M is the center