optimet plugin for mach 4 user guide - non contact ... ©2016 flexware innovation, inc. 1 overview...

52
Optimet Plugin for Mach 4 User’s Guide 5/4/2016 ©2016 Flexware Innovation, Inc.

Upload: nguyentuyen

Post on 23-Jun-2018

218 views

Category:

Documents


0 download

TRANSCRIPT

Optimet Plugin for

Mach 4

User’s Guide

5/4/2016 ©2016 Flexware Innovation, Inc.

2

©2016 Flexware Innovation, Inc.

Contents

1 Overview .............................................................................................................................................. 5

1.1 Audience ....................................................................................................................................... 5

1.2 Hardware Requirements ............................................................................................................. 6

1.2.1 Optimet Probe...................................................................................................................... 6

1.2.2 Host PC ................................................................................................................................. 6

1.3 Software Requirements .............................................................................................................. 6

1.3.1 Mach 4 .................................................................................................................................. 6

1.3.2 Host PC ................................................................................................................................. 6

2 Hardware Setup ................................................................................................................................... 7

3 Software Architecture ......................................................................................................................... 8

3.1 Deployment Diagram ................................................................................................................... 8

3.2 Plugin Architecture ...................................................................................................................... 9

3.2.1 Component Diagram ............................................................................................................ 9

3.3 Essential Concepts ...................................................................................................................... 11

3.3.1 Measurement Buffer .......................................................................................................... 11

3.3.2 Scan Configuration .............................................................................................................. 12

3.3.3 Zero Reference Configuration ............................................................................................ 13

3.3.4 Visualization Configuration ................................................................................................ 13

3.3.5 Register Interface .............................................................................................................. 14

3.3.6 Command Processor .......................................................................................................... 14

4 Plugin Installation and Setup.............................................................................................................. 15

4.1 Installing the plugin .................................................................................................................... 15

4.2 Enabling the plugin in Mach 4 ................................................................................................... 16

4.2.1 Set up a new profile ........................................................................................................... 16

4.2.2 Enable the plugin ............................................................................................................... 18

4.3 Copying the sample macro files into the Mach 4 profile ......................................................... 18

4.4 Adding the Optimet GUI to a Mach 4 screen set ..................................................................... 19

5 Optimet Plugin GUI ............................................................................................................................ 25

5.1 Probe Connection ...................................................................................................................... 25

5.2 Probe Configuration .................................................................................................................. 27

5.2.1 Lens Configuration ............................................................................................................. 28

5.2.2 Measurement Acquisition Settings ................................................................................... 29

3

©2016 Flexware Innovation, Inc.

5.3 View Probe Properties ................................................................................................................ 31

5.4 Scan Configuration...................................................................................................................... 31

5.5 About Dialog .............................................................................................................................. 33

5.6 Measuring Actions ..................................................................................................................... 34

5.6.1 Take single measurement .................................................................................................. 34

5.6.2 Start/stop measurement stream ....................................................................................... 34

5.7 Measurement Buffer ................................................................................................................. 35

5.7.1 Save buffer to file ............................................................................................................... 35

5.7.2 View buffer ......................................................................................................................... 37

5.8 Zero Reference ........................................................................................................................... 38

5.9 Visualization ............................................................................................................................... 39

5.9.1 Visualization Configuration ............................................................................................... 41

5.9.2 Visualization Window Controls ......................................................................................... 44

6 Macros and G Code Integration ........................................................................................................ 45

6.1 Provided Macros ........................................................................................................................ 45

6.2 Example Integration .................................................................................................................. 46

7 Licenses ............................................................................................................................................... 51

7.1 Mobile Robot Programming Toolkit (MRPT) ............................................................................ 51

7.2 Open Source Computer Vision (OpenCV) ................................................................................. 52

4

©2016 Flexware Innovation, Inc.

Figures

Figure 1 – Suggested Hardware Setup ........................................................................................................ 7

Figure 2 – Optimet Plugin Deployment Diagram........................................................................................ 8

Figure 3 – Software Component Diagram .................................................................................................. 9

Figure 4 –Mach 4 – Copy Profile Dialog .................................................................................................... 16

Figure 5 – Mach 4 – Select Profile Dialog ................................................................................................... 17

Figure 6 – Enable Optimet Plugin .............................................................................................................. 18

Figure 7 – Main Panel ................................................................................................................................. 19

Figure 8 – Main Panel – Probe Properties ................................................................................................. 31

Figure 9 – Probe Properties Dialog ............................................................................................................ 31

Figure 10 – Main Panel – Help Section ...................................................................................................... 33

Figure 11 – About Dialog ............................................................................................................................ 33

Figure 12 – Main Panel – Measurement Actions ....................................................................................... 34

Figure 13 – Save Buffer To File Dialog ....................................................................................................... 36

Figure 14 – View Measurement Buffer Dialog .......................................................................................... 38

Figure 15 – Main Panel – Zero Reference .................................................................................................. 39

Figure 16 – Main Panel – Visualization Controls ....................................................................................... 40

Figure 17 – Visualization Window .............................................................................................................. 41

Figure 18 – Visualization Configuration Dialog ......................................................................................... 42

5

©2016 Flexware Innovation, Inc.

1 Overview The Optimet plugin for Mach 4 brings the measurement capabilities of Optimet devices to the Mach

4 platform. Mach 4 provides the toolset for controlling CNC machines, allowing users to create

accurate and repeatable patterns for scanning items. Optimet measurement probes provide the

ability to collect precise measurements at high speed. Using the Optimet plugin within the Mach 4

framework, detailed point clouds of scanned items can be created quickly and efficiently for use in

visualization and metrology applications.

The Optimet plugin includes a graphical user interface (GUI) that can be fully integrated with new or

existing Mach 4 screen sets. The GUI allows an operator to perform several common interactions

with the probe. These include:

Establishing a network connection between the host PC and the probe

Configuring the probe’s measurement settings (e.g. active lens, laser power, and frequency)

Sending commands to the probe to take measurements

The GUI also provides access to several of the plugin’s features. Some of these features include:

Inspecting measurement values (distance, SNR, etc.) on-demand to help with calibration and

testing

Visualizing a scanning session as a 3D point cloud in real-time

Saving a scanning session to a file as a series of point cloud values (spatial (x,y,z)

coordinates), allowing the scan to be analyzed by metrology tools at a later time.

In addition to the GUI, the plugin provides access to most of its features using the Mach 4 register

interface. This allows an operator to access almost all of the plugin’s functions via custom macros

(scripts). These macros can be run standalone or can be embedded into G Code in order to trigger

actions while the CNC machine is running.

1.1 Audience This user guide is intended for users who are already familiar with the basic operation of the Mach 4

application and Optimet measurement devices. This guide assumes that the user has read the Mach

4 operation manual and is able to calibrate, configure, and drive a CNC machine using the Mach 4

application. This guide will focus on extending the Mach 4 application with the Optimet plugin for

measuring and scanning tasks.

The Optimet plugin includes a programming interface that can be accessed using the Mach 4 register

interface. The Optimet plugin ships with several macros (scripts) which take advantage of the

programming interface to perform basic tasks. This guide will explain how to integrate these existing

scripts into the Mach 4 application in order to accomplish most scanning tasks. A more detailed

explanation of the programming interface is provided in a separate manual, the Optimet Plugin

Programming Guide.

6

©2016 Flexware Innovation, Inc.

1.2 Hardware Requirements

1.2.1 Optimet Probe The Optimet plugin for Mach 4 is designed to work with several types of Optimet measurement

devices. However, the probe must meet the following requirements in order to be compatible with

the plugin:

The probe must support Ethernet-based communication.

The plugin does not support communication using a serial port interface.

The probe must support receiving encoder inputs from the CNC controller.

The plugin requires these encoder values to transform measurements into a 3D point cloud.

1.2.2 Host PC The Optimet probe must be connected to a Windows-based PC capable of running the Mach 4

application. The Host PC has the following hardware requirements:

The PC must have an Ethernet adapter with an IPv4 address.

It is highly recommended that the host PC has a dedicated Ethernet adapter to communicate

with the Optimet probe. Connecting the probe to a larger LAN will significantly increase traffic

on the LAN during streaming and may reduce the reliability of the connection.

Software requirements for the host PC are described in section 1.3.

1.3 Software Requirements

1.3.1 Mach 4 The Optimet plugin for Mach 4 is designed to work with Mach 4 version 2872 or later. The plugin will

not load in older versions of Mach 4 because older versions do not fully support the API used by the

plugin.

1.3.2 Host PC The plugin is designed to work with the following operating systems:

Windows 7, Windows 8.1, Windows 10

The plugin is compiled as a 32-bit library. It will run on either a 32-bit or 64-bit version of Windows.

7

©2016 Flexware Innovation, Inc.

2 Hardware Setup Figure 1 below describes the expected hardware setup when using the Optimet plugin for Mach 4.

Host PC

CNC MachineMotor Controller

Ethernet (dedicated adapter)

Encoder X

Encoder Y

Encoder X

Encoder Y

Motor Controller Interface

Probe Controller

Optimet Probe Interface

Figure 1 – Suggested Hardware Setup

In this setup, the Host PC is running the Mach 4 application. The Mach 4 application will have at least

two plugins installed: (1) the Optimet plugin and (2) a plugin provided by the motion controller

manufacturer.

The host PC is connected to the motion controller, and the Mach 4 application drives the motion

controller using the motion device’s plugin. The physical interface is commonly USB or serial, but it

will vary depending on the manufacturer.

The host PC is also connected to the Optimet probe’s controller box via Ethernet. The Optimet

plugin uses this interface to send commands to and receive data from the Optimet probe.

The encoder outputs from the motion controller are connected to both the CNC machine and the

Optimet probe interface box. This requires splitting the output signals from the motion controller.

Connecting the encoder outputs to the Optimet probe allows the probe to include position

information with every measurement that is sent to the Host PC and eliminates the need for more

complex synchronization between the CNC machine and the Host PC. With this position information,

the plugin can construct 3D point clouds from the measurement stream.

Finally, the probe controller interface box is connected to the probe. The probe controller interface

box and the interface cable are provided by Optimet as part of the probe measurement kit.

8

©2016 Flexware Innovation, Inc.

3 Software Architecture This section of the user guide provides an overview of the Optimet Plugin software architecture. The

goal of this section is to introduce the concepts that will be described in detail later in this guide.

3.1 Deployment Diagram The Optimet plugin is a set of libraries that work together with the Mach 4 framework to provide

configuration, measuring, and visualization capability.

Figure 2 shows a deployment diagram for the Optimet plugin.

OptimetPlugin.m4pw OptimetPlugin.sig

Smart32.dll opencv_world300.dll

NewProbeDialog.dll NTGraph.ocx

Core Plugin

Optimet SDK Libraries

3rd Party Libraries

Figure 2 – Optimet Plugin Deployment Diagram

OptimetPlugin.m4pw is the core library for the Optimet plugin. The extension indicates that it is a

Mach 4 Plugin for Windows. This library contains the executable code for interfacing with Mach 4,

interfacing with the Ethernet probe via the Smart32 library, generating a user interface, and creating

the visualization window.

OptimetPlugin.sig is the signature file that corresponds to OptimetPlugin.m4pw. This file does not

contain any executable code, but it must be installed with the m4pw file. The Mach 4 platform

requires that all plugins are signed. Plugins that are not accompanied by a valid signature file will not

be loaded by Mach 4.

Smart32.dll is a library provided by the Optimet SDK. This library contains the API used to

communicate with the Optimet probe via Ethernet. OptimetPlugin.m4pw depends on this library for

proper communication with the probe.

NewProbeDialog.dll and NTGraph.ocx are both part of the Optimet SDK. These libraries contain

common code used to configure the Optimet probe’s scanning parameters and to view the signal

characteristics on a graph in real time.

9

©2016 Flexware Innovation, Inc.

opencv_world300.dll is version 3.0.0 of the Open Source Computer Vision library. The Optimet

plugin uses the Mobile Robot Programming Toolkit (MRPT) for point cloud visualization. (MRPT is a

cross-platform, OpenGL-based library that includes 3D rendering as one of its many features.) MRPT

uses OpenCV to provide efficient, high performance rendering of 3D images.

3.2 Plugin Architecture

3.2.1 Component Diagram Figure 3 provides a high-level overview of the Optimet plugin’s functional blocks and the interface to

important external functional blocks. Functional blocks within the gray rectangle are implemented

within the m4pw library. Functional blocks outside the gray rectangle are external libraries and

applications. An arrow drawn between two functional blocks indicates a data path (or command

path) between the components. Data flows in the direction of the arrow; in many cases, the path is

bi-directional. It is not important to understand this diagram in detail. It is provided for reference for

the next several sections.

Macros / Scripts Register Interface

Mach 4 Application

Measurement Buffer

Optimet Probe API

Visualization

File Writer

Zero Reference Configuration

Scan Configuration

Optimet Probe Interface

Graphical User Interface (Plugin Panel)

Visualization Configuration

Command Processor

Figure 3 – Software Component Diagram

10

©2016 Flexware Innovation, Inc.

3.2.1.1 Mach 4 Application

This block represents the Mach 4 executable program (Mach4GUI.exe).

3.2.1.2 Macros/Scripts

This block represents custom M Scripts that can be embedded in G Code. M scripts may use the

Mach 4 API to execute Mach 4 commands and manipulate registers. This includes commands and

registers that the Optimet plugin has exposed through its register interface.

3.2.1.3 Register Interface

This functional block represents a set of data registers and a command register that the plugin has

exposed to Mach 4. (A register is essentially a piece of memory shared between the Mach 4

application and the plugin.) A list of all valid registers and commands exposed by the plugin is

available in the Optimet Plugin Programming Guide.

3.2.1.4 Graphical User Interface

The Optimet plugin provides a graphical user interface that can be integrated with a Mach 4 screen

set. This user guide will explain how to integrate the GUI with Mach 4 and how to use the GUI for

configuration and testing.

3.2.1.5 Command Processor

This functional block represents a set of functions that execute commands within the plugin. The

command processor handles commands arriving from scripts and commands initiated by the GUI.

3.2.1.6 Optimet Probe Interface

This functional block represents a set of functions that the command processor executes to send

commands and retrieve data from the Optimet probe. This functional block also has access to the

measurement buffer in order to write measurements to the buffer when the probe is streaming

data.

3.2.1.7 Optimet Probe API

This functional block represents the API provided in the Smart32.dll library from Optimet. This library

handles the low-level details of Ethernet communication with the smart probe.

3.2.1.8 Visualization

This functional block is responsible for managing the visualization window provided by the Mobile

Robot Programming Toolkit (MRPT). The visualization window uses the visualization configuration,

scan configuration, and zero reference configuration to render a 3D point cloud based on the

measurements stored in the measurement buffer.

3.2.1.9 File Writer

This functional block is responsible for transforming the measurement buffer into a 3D point cloud

and writing the point cloud to a file in the designated format. It relies on the scan configuration and

zero reference configuration in order to perform the point cloud transformation.

3.2.1.10 Measurement Buffer

The measurement buffer is the central repository for measurements accumulated from the Optimet

probe. The Optimet probe can be instructed to take a single measurement or to stream

measurements at a high speed. In both cases, the received measurement(s) are written to the

11

©2016 Flexware Innovation, Inc.

measurement buffer. Measurements can be displayed in the visualization window as a 3D point

cloud or stored to a file as (x,y,z) point cloud data.

The measurement buffer accumulates measurements until it is explicitly cleared (from a script or

from the GUI). This allows an operator to scan multiple (potentially discontiguous) regions using the

CNC machine and to view or store the results as one data set.

3.2.1.11 Visualization Configuration

The visualization configuration controls how the visualization is displayed. For example, an SNR

threshold can be set to filter out measurements below a certain SNR value. Also, the color gradient

applied to the point cloud can be adjusted to accommodate a wide range of scans.

3.2.1.12 Scan Configuration

The scan configuration defines the scanning mode (i.e. planar or rotary) and describes how the

measurement buffer’s encoder values are translated into a point cloud.

3.2.1.13 Zero Reference Configuration

The zero reference configuration allows the operator to store a distance as the offset for all other

measurements in the measurement buffer. All of the measurements in the measurement buffer will

be interpreted relative to this offset when the buffer is translated into a point cloud.

3.3 Essential Concepts

3.3.1 Measurement Buffer The measurement buffer is the central repository for all data collected from the Optimet probe.

Measurements can be added to the buffer either one at a time (in single measurement mode) or at a

high speed using the probe’s streaming function.

The measurement buffer is cleared only when explicitly commanded to do so. This command can be

initiated manually by the user from the user interface or automatically by a macro (script) when

running G code.

IMPORTANT: When creating a G code script for a scanning session, if the file represents a standalone session, you must remember to include the appropriate macro at the start of the G code script to clear the memory buffer before starting the measurement stream.

The measurement buffer stores all data collected from the probe in its original state, including the

distance, encoder values, signal-to-noise ratio, and total energy associated with each measurement.

This allows users to change the SNR filter, total energy filter, encoder setup, and other values after a

scan and quickly see the effect on the point cloud. This means that users can improve parameters

for the point cloud visualization and/or fix errors in the scan configuration without having to start

over and execute the scan again.

There is no soft limit on the number of measurements that can be stored in the measurement buffer.

Hardware memory constraints and per-process memory constraints will both effect how many

measurements can be stored and effectively visualized before either running out of memory or

12

©2016 Flexware Innovation, Inc.

experiencing poor performance. It is estimated that 20-25 million measurements can be stored

before running into the memory limitations of a 32-bit application.

The measurement buffer is transient. It is stored in memory, and it is lost when the Mach 4

application is closed. The user must save the buffer to a file before quitting the application in order

for it to be persisted.

3.3.2 Scan Configuration The scan configuration contains information that allows the Optimet plugin to transform the probe’s

measurement data and raw encoder values into 3D point cloud information. For example, the plugin

must know how the part or probe was moved during the scan (e.g. in a grid pattern over a 2D

surface) and how to map encoder values to distances. Please refer to section 5.4 to see how the

scan configuration is set up in the user interface. The different pieces of the scan configuration are

described below.

3.3.2.1 Scanning Mode

The scan configuration defines the type of scan being performed. The following modes are

supported:

Plane, normal: The probe is scanning an object by moving in the xy plane, and the probe is

measuring distance values along the z axis. It is assumed that the probe is mounted

orthogonally with respect to the item being scanned in the xy plane. When transforming

measurements into a point cloud, the X encoder is mapped to the x-axis, the Y encoder is

mapped to the y-axis, and the measurement distance is mapped to the z-axis.

Plane, swap axes: This is the same as plane, normal, except that the X encoder is mapped to

the y-axis and the Y encoder is mapped to the x-axis. Use this to change the orientation of

the point cloud when it is not convenient to physically rewire the encoder inputs.

Additional modes to accommodate rotary scanning are planned in future software updates.

3.3.2.2 Measurement Units

The scan configuration defines the units of measurement that are used when displaying and storing

data. Specifically, the measurement units are applied in the following places:

In the scan configuration dialog, it controls how the scaling values are entered.

On the main plugin panel, it controls how all measured values are displayed.

In the visualization configuration, it controls how visualization parameters are entered.

When saving to a file, it controls how the spatial coordinates (x,y,z values) are calculated.

The units can be set to millimeters or inches.

Note that some values, such as the lens description, are always displayed in millimeters and are not

affected by this setting.

NOTE: For programmers who are creating macros (scripts), it is important to remember that all distance values are stored in the register interface in millimeters. If a script needs to work with values in inches, the programmer must convert values before using them.

13

©2016 Flexware Innovation, Inc.

3.3.2.3 Scaling

The scan configuration defines how encoder values are interpreted in order to calculate point cloud

data. For example, when doing a planar scan, the plugin needs to be able to convert X and Y encoder

values into millimeters or inches.

3.3.2.4 Data Persistence

The scan configuration is persistently stored with the current Mach 4 profile. There are two main

benefits to this:

1. Because the configuration data is stored, the end user does not have to re-enter the

parameters each time the Mach 4 application is restarted.

2. Because the configuration data is stored separately for each profile, if the user is scanning

more than one type of item regularly, they can create a profile for each type of item.

Switching between each type of item is then as easy as restarting Mach 4 with the

appropriate profile.

3.3.2.5 Data Pipeline

The visualizer and file writer components of the plugin both use the scan configuration to transform

the probe’s measurements into a point cloud when visualizing and saving data. It is perfectly valid to

change the scan configuration after a scan is completed. The new values will be applied to the

current measurement buffer. This feature is useful to correct errors or to change the units of

measurement after the fact.

3.3.3 Zero Reference Configuration The zero-reference configuration is used when the user wants to view or store measurement

information relative to another distance. For example, if a part is mounted on a fixture on the CNC

machine, the absolute vertical distance between the probe sensor and the part may vary slightly

from scan to scan. The user can use the zero reference feature to move the probe to a known

location on the part or fixture that represents the zero height and then store that as the zero

reference.

The zero reference configuration is not stored persistently; it is lost when the Mach 4 application is

exited.

The visualizer and file writer will both take the zero reference value into account when displaying

and saving point cloud data.

3.3.4 Visualization Configuration The visualization configuration contains additional information that is used when displaying the point

cloud that results from a scan. Examples of visualization parameters include the signal-to-noise ratio

(SNR) threshold, grid size and spacing, and color coding of points in the point cloud.

The visualization configuration is stored persistently with the current Mach 4 profile. The benefits to

storing these parameters with the Mach 4 profile are described in section 3.3.2.

14

©2016 Flexware Innovation, Inc.

The visualization configuration applies only to the visualization window in the user interface. For

more information about how these parameters change the look of the visualizer, see section 5.9.1.

3.3.5 Register Interface The Optimet plugin uses the register interface to share some configuration and status values with

the Mach 4 application. End users generally do not have to worry about the details of the register

interface unless they are going to create their own macros (scripts) to interact with the plugin.

However, some of the macros included with the Optimet plugin software require setting

configuration registers prior to executing the command. These macros are described in more detail

in section 6.1.

For a complete discussion of the Optimet plugin register interface, please refer to the Optimet Plugin

Programming Guide, which is provided with the Optimet plugin software package as a separate

document.

3.3.6 Command Processor The Optimet plugin uses a common module for processing commands. This means that the same

code is executed whether a command is initiated from the user interface or from a script. If a user is

trying to understand the behavior of a scripted command, they can try running it from the GUI

before integrating the script into their G code.

15

©2016 Flexware Innovation, Inc.

4 Plugin Installation and Setup The following sections walk through how to install the plugin, how to enable the plugin within Mach

4, how to take advantage of the included macro files, and how to integrate the Optimet plugin GUI

into a Mach 4 screen.

4.1 Installing the plugin

The Optimet plugin is distributed as a self-extracting installer. Double click on the Optimet Plugin

Setup.exe file to begin a new installation or upgrade an existing installation.

IMPORTANT: Shut down Mach 4 and close all Optimet plugin documentation before running the installer. The installer cannot replace files that are in use.

The installer for the plugin includes the following components:

Visual C++ 2008 and Visual C++ 2013 redistributables

These are a prerequisite dependency for the plugin; they will be installed on the host PC if

needed.

Plugin library and dependencies

These files will be placed into the Mach 4 installation Plugins directory.

Product documentation

The User’s Guide (this document) and the Programming Guide will be copied to the location

selected during installation; shortcuts will be made available on the Windows Start Menu.

Basic macros

A set of starter macros to get up and running are also provided; a shortcut to the directory

containing these macros is made available on the Windows Start Menu. Note that macros

are associated with individual Mach 4 profiles. To use these macros with a particular Mach 4

profile, you will need to copy the macros into the appropriate Mach 4 Profiles subdirectory.

Before beginning, the installer will attempt to find the existing Mach 4 installation on the PC. If it is

not able to find the installation, you will be prompted to set it during the installation process. Be

sure to select the top level Mach 4 directory (e.g. C:\Mach4Hobby), not the Plugins subdirectory.

16

©2016 Flexware Innovation, Inc.

4.2 Enabling the plugin in Mach 4

4.2.1 Set up a new profile Consider creating a new profile (or copying an existing profile) to begin working with the Optimet

plugin.

After completing section 4.1, start the Mach 4 GUI application. When you are prompted to select a

profile, choose to copy an existing profile. If you are just starting out, it is suggested to copy the

Mach4Mill profile to a new profile named Optimet.

The Copy profile dialog is shown below in Figure 4. Enter Optimet for the Profile Name. If you do

not yet have a screen set specific to your CNC machine, consider copying the default wxMach.set

screen set file to wxMachOptimet.set.

Detailed Steps:

1. Click the … button to browse

2. Find the wxMach.set file in the Mach4 installation under Screens

3. Right-click wxMach.set and choose Copy

4. Right-click an empty space in the directory and Paste

5. Rename wxMach – Copy.set to wxMachOptimet.set.

Figure 4 –Mach 4 – Copy Profile Dialog

17

©2016 Flexware Innovation, Inc.

After creating the Optimet profile, the Select Profile dialog should appear similar to Figure 5 below.

Click the Optimet profile to select it, then click OK.

Figure 5 – Mach 4 – Select Profile Dialog

IMPORTANT: If Mach 4 displays an error message about the Optimet plugin during initialization, shut down Mach 4 and recheck the plugin installation before continuing.

18

©2016 Flexware Innovation, Inc.

4.2.2 Enable the plugin Mach 4 plugins can be enabled and disabled in the Mach 4 configuration. By default, after

installation, plugins are disabled. Follow the steps below to enable the Optimet plugin.

1. This step varies depending on the version.

a. On Mach 4 versions prior to 2.2888, go to the Configure menu and select Plugins…

When the Configure Plugins dialog appears, find the plugin with the description

Optimet Sensors – DangerLabs.

b. On Mach 4 versions 2.2888 or later, go to the Configure menu and select Mach…

When the Mach Configuration dialog appears, switch to the Plugins tab. Find the

Optimet Sensors – DangerLabs plugin in the list.

2. An icon with a red X should be visible in the Enabled column. This indicates the plugin is

disabled. Click this icon to enable the plugin. The icon should change to a green checkmark,

as shown below in Figure 6.

3. Restart Mach 4 for the change to take effect.

Figure 6 – Enable Optimet Plugin

4.3 Copying the sample macro files into the Mach 4 profile The Optimet plugin is distributed with several macro files. These macro files (m100, m101, etc.) are

scripts that send commands to the Optimet plugin to execute actions such as “start streaming

measurements” or “clear memory buffer.”

Macros can be executed as part of a G code script simply by adding the macro name (e.g. m100) as a

command in the G code file. An example of this will be provided later (see section 6).

Macros are associated with Mach 4 profiles. To use the provided macros, you must copy them into

the Macros directory of the profile you created in section 0. As an example, if you created a profile

called Optimet, copy the macro files to Mach4Home\Profiles\Optimet\Macros.

A description of the macro files provided with the plugin is provided in section 6.1.

19

©2016 Flexware Innovation, Inc.

4.4 Adding the Optimet GUI to a Mach 4 screen set The Optimet plugin provides a graphical user interface (GUI) that allows an operator to easily access

most features of the plugin. The GUI can be integrated into a Mach 4 screen set simply by adding a

plugin panel control to a screen and associating the control with the proper register. This process is

described below.

An example of the Mach 4 GUI is shown below in Figure 7.

Figure 7 – Main Panel

20

©2016 Flexware Innovation, Inc.

Follow these steps to add the Mach 4 GUI to your screen set:

Open the Mach 4 GUI and put it in Edit Screen mode.

From the Operator menu, select Edit Screen.

Create a location to insert the Optimet plugin GUI. In this example, we will add a tab called Optimet to the wxMachOptimet.set screen set created in section 4.2.1. If you are modifying an existing screen set, modify these steps to suit your needs.

Click on MainTabs in the Screen Tree Manager to select it.

Select Add a page from the controls along the top.

21

©2016 Flexware Innovation, Inc.

In the Screen Tree Manager, select the new tab

In the Properties section, change the Name to tabOptimet

In the Properties section, change the Label to Optimet

22

©2016 Flexware Innovation, Inc.

Add a plugin panel to the screen set.

NOTE: Make sure tabOptimet is selected in the Screen Tree Manager before starting.

Click the Plugin Panel icon in the list of controls. A green rectangle will appear.

Select the new plugin panel in the Screen Tree Manager.

In the Properties section, change the Name to ppOptimet.

In the Properties section, change the Register to OptimetProbe0/PanelMain.

Click and drag the corner of the panel to adjust its size, or use the Top, Left, Height, and Width properties in the Properties section.

23

©2016 Flexware Innovation, Inc.

Exit Edit Screen mode and save the changes.

In the Operator menu, select Edit Screen to exit the screen editor. When prompted, choose Yes to save your changes.

24

©2016 Flexware Innovation, Inc.

After exiting the screen editor, the Optimet plugin GUI should appear within the plugin panel. NOTE: In some versions of Mach 4, you may need to shut down and restart Mach 4 for the GUI to appear properly. You can adjust the height, width, and position of the panel by restarting the screen editor and dragging the panel’s edges.

When finished with the screen editor, it is recommended to shut down and restart Mach 4 to ensure all of the screen elements load and operate correctly.

25

©2016 Flexware Innovation, Inc.

5 Optimet Plugin GUI

This section provides an overview of the features offered by the Optimet plugin GUI.

5.1 Probe Connection The host PC must establish a network connection to the Ethernet-based Optimet probe before any

measurement features are available. The connection status is shown in the plugin GUI in the Probe

Properties area to the left. When the Connected state is No, measurement-related functions are

disabled.

NOTE: the network adapter on the host PC must be configured correctly in order to establish a connection with the probe. Generally speaking, the network adapter on the host PC must have an IPv4 address on the same 255.255.255.0 subnet as the probe. If you have not yet configured the host PC’s network adapter, please refer to section 3 of the Optimet Point Sensors Manual and ensure the host PC is correctly configured before proceeding.

Follow these steps to connect the probe to the host PC:

Click the Configure probe… button on the UI

26

©2016 Flexware Innovation, Inc.

Select the Host IP Address that corresponds to the network adapter connected to the probe. For your convenience, the plugin will attempt to populate the drop down with available IPv4 addresses on the host PC. If the adapter does not appear in the drop down list, you may enter a value not in the list.

Select Auto-Discover to instruct the plugin to automatically find the probe on the LAN. If you would like to enter the probe’s IPv4 address instead, deselect Auto-Discover and enter the probe’s IP address in the associated text field. Note: Auto-Discover is not supported if more than one probe is connected to the host PC. You will need to manually enter the IP address of the probe to use if more than one probe is connected.

Click Connect to establish a connection to the probe.

27

©2016 Flexware Innovation, Inc.

If the connection is successful, the Lenses and Settings sections of the configuration will populate with data, and the controls will become active. If the connection is not successful, ensure that the probe is properly connected to the PC and that the network adapter is correctly configured. If cabling and configuration appear to be correct, power cycle the probe and try again.

5.2 Probe Configuration After the host PC is connected to the probe, the active lens and the measurement acquisition

parameters can be modified from the probe configuration dialog.

28

©2016 Flexware Innovation, Inc.

5.2.1 Lens Configuration For proper operation, the Active Lens must correspond to the lens that is attached to the probe.

Follow these steps to update the probe’s active lens.

Select the lens to make active from the drop down list. The lens characteristics (focal length and min/max distance) will update to match the selected lens.

Click Apply to make the selected lens the active lens. The selected lens is not set as the active lens until you click Apply.

29

©2016 Flexware Innovation, Inc.

5.2.2 Measurement Acquisition Settings The frequency and laser power used by the probe for measurement may be adjusted using Optimet’s

configuration tool. Follow these steps to change the frequency and power settings of the probe.

Click the Configure button in the Settings area of the configuration dialog.

30

©2016 Flexware Innovation, Inc.

Adjust the location of the probe until the arrows are in the green area – this represents the region that the lens is designed to measure accurately. NOTE: if the power and frequency settings are too far from optimal, the distance measurements may not be accurate, and you may need to skip this step and come back to it.

Adjust the laser power, frequency, and auto-exposure settings until the graph indicates a good signal is present. Please consult the Optimet Point Sensors Manual for more information on how to determine if the signal is good. NOTE: the auto-exposure checkbox will not be present if the connected probe does not support the auto-exposure feature.

When you are satisfied with the new settings, click OK to update the probe’s configuration. WARNING: At the time of publication, the version of NewProbeDialog.dll that ships with the Optimet plugin does not work correctly if this dialog is closed by any means other than clicking OK.

Clicking Cancel or closing the dialog with the window frame’s close (X) button will reset the laser power to a very low setting.

Pressing ENTER to close the dialog instead of clicking OK will program the probe correctly but may cause information to be misreported in the Mach 4 user interface.

Please ensure that you only exit this dialog with the OK button.

31

©2016 Flexware Innovation, Inc.

5.3 View Probe Properties When the host PC has successfully connected to the probe, additional details about the probe may

be viewed from the plugin’s main UI. These details may be useful for configuration or debugging.

Click the View details… button to trigger the probe properties dialog, shown in Figure 9.

Figure 8 – Main Panel – Probe Properties

Figure 9 – Probe Properties Dialog

5.4 Scan Configuration Use the Configure Scan… button to set up the scan mode (e.g. planar scan) and to correlate X and Y

hardware encoder values with measurement values. Refer to section 2 for more information about

hardware configuration related to the X and Y encoders. Refer to section 3.3.2 for a complete

description of supported scanning modes.

32

©2016 Flexware Innovation, Inc.

To set up a scan, follow these steps:

Click the Configure Scan… button in the Configuration section of the UI.

Select the scanning mode. This describes the type of scan to perform and also

allows X and Y encoder values to be mapped to different axes in software.

Select the scaling units to use when displaying measurements in the UI and when saving point cloud data to a file.

Enter values in the Scaling section to correlate encoder values with distances. These values will be used when constructing point cloud data. Negative values may be used in these fields to reorient the point cloud if desired.

Click OK to save the changes.

33

©2016 Flexware Innovation, Inc.

Remember that the scan configuration is stored separately from the measurement buffer, and the

measurement buffer contains the original stream of data provided by the probe. This means that

you can change the scan configuration after completing a scan, and the new parameters will be

applied to the current measurement buffer. You can use this to correct an error or to change the

units of measurement after the fact.

5.5 About Dialog The About… button displays a dialog with additional information about the plugin. Refer to

Figure 10 below.

Figure 10 – Main Panel – Help Section

This information may be used to verify that the correct version is installed. Version information is

also useful when contacting support. An example of the dialog is shown below in Figure 11.

Figure 11 – About Dialog

34

©2016 Flexware Innovation, Inc.

5.6 Measuring Actions The Optimet plugin GUI allows the user to manually trigger the probe’s measurement functions. This

can be useful during initial setup when configuring the hardware to scan a new part. Note that

under normal scanning conditions, a G code script will be responsible for controlling the motion of

the CNC machine and for programmatically triggering measurement actions. (See section 6.)

Figure 12 – Main Panel – Measurement Actions

5.6.1 Take single measurement

Click the Take measurement button to immediately take one measurement at the probe’s current

location. This will increment the measurement count by 1, indicated in the Measurements field.

The Last Measurement section will also update to show relevant information such as encoder

values, distance, and signal information about the measurement.

5.6.2 Start/stop measurement stream

Click the Start stream button to immediately start streaming measurements from the probe. The

Optimet plugin will begin recording measurements as they are received. While streaming, the

number of Measurements will increment and the Last Measurement data will update to

provide feedback about the streaming operation. The data will update approximately 4 times per

second (every 250ms).

While streaming is active, several controls on the GUI will be disabled. Changing configuration values

and working with the measurement buffer are not allowed while streaming is active.

35

©2016 Flexware Innovation, Inc.

When streaming is activated, the Start stream button will change to Stop stream. Click Stop

stream to stop the measurement stream. It may take one update cycle for the values on the GUI to

stabilize after stopping the stream.

5.7 Measurement Buffer Information about the measurement buffer can be accessed from the Optimet plugin GUI. Please

use Figure 12 as a reference for this section.

The number of measurements currently in the buffer is shown in the Measurements field. When

the number of measurements is 0, measurement buffer actions that do not make sense (clear, save,

and view) are disabled.

Click the Clear buffer button to remove all measurements from the buffer. The Measurements

field will update to confirm that the buffer has been cleared.

Click the Save… button to save the measurement buffer to a file. The plugin will prompt to select

a file format (e.g. csv or tab delimited), enter an output location, and define filter values before

saving. This is described in section 5.7.1 below.

Click the View… button to bring up a data table showing the measurements currently in the

buffer. See section 5.7.2 for details.

5.7.1 Save buffer to file The Optimet plugin allows the user to save the measurement buffer to a file. This allows the

measurements and/or point cloud data to be viewed later or imported into metrology tools for

further analysis. To begin the process of saving a file, click the Save… button as described above.

The Save Buffer To File dialog will appear (see Figure 13).

36

©2016 Flexware Innovation, Inc.

Figure 13 – Save Buffer To File Dialog

Follow these steps to save a file:

Select the output format for the file. Two types of files are available: Spatial coordinates and Full report.

Select Spatial coordinates to output only point cloud coordinates. Only spatial (x,y,z) coordinates corresponding to each measurement will be written to the file. Each line of the output file will contain one set of coordinates. There is no header row at the start of the file. It the units of measure are important, consider including “in” or “mm” in the file name.

Select Full report to output most of the available measurement data in addition to point cloud values. This can be useful if other values, such as SNR and total energy, will be used in post-processing. Each line of the output file will correspond with one measurement in the buffer. The first line of this file is a header row describing each column.

For each type of file, the output may be comma delimited (csv) or tab delimited (txt). Choose the appropriate format based on how the data will be parsed or viewed later. For spatial coordinates, the output may also be saved in TrueMap format. This is just a comma delimited file with an xyz extension.

Enter values to define the filter that will be applied to the measurement buffer. If a measurement contains a value that falls outside of the specified filter limits, the measurement will be excluded from the output file. Use this feature to ignore measurements with poor SNR or total energy values that should not be included in future analysis. Filter parameters include:

37

©2016 Flexware Innovation, Inc.

Min. SNR(%): Enter the minimum SNR threshold, interpreted as a percentage. Measurements with an SNR below this value will be excluded.

Min. Total Energy: Enter the minimum required total value here. Measurements with a total energy less than the minimum will be excluded.

Max Total Energy: Enter the maximum allowed total value here. Measurements with a total energy greater than the maximum will be excluded.

Measurements must pass all of the filter criteria to be included in the output file. To effectively disable a filter, enter its minimum or maximum allowed value. For example, set the SNR to 0, the minimum total energy to 0, or the maximum total energy to 50000.

Set the location of the output file. This should be the full path to the output file, including a drive letter. Use the … button to browse to a location.

Click OK to save the file. This operation may take several seconds; a progress dialog will appear to indicate progress while the plugin is saving the file.

5.7.2 View buffer The Optimet plugin offers a simple view into the measurement buffer through the GUI. This can be

used during configuration and testing to see all of the measurements that have been taken. Click the

View… button to show the View Measurement Buffer dialog, shown in Figure 14.

The measurement buffer is broken up into pages every 1,000,000 measurements. When there is

more than one page, use the first, previous, next, and last buttons in the pagination section at the

bottom of the dialog to navigate through pages. Input a page number directly into the current page

text box and press ENTER to jump directly to a specific page.

38

©2016 Flexware Innovation, Inc.

Figure 14 – View Measurement Buffer Dialog

5.8 Zero Reference The Zero Reference feature allows the user to take measurements relative to a specified set point.

The zero reference influences how point cloud (x,y,z) coordinates are calculated as well as how the

visualization window displays the measurement buffer.

39

©2016 Flexware Innovation, Inc.

Figure 15 – Main Panel – Zero Reference

Click the Take sample button in the Zero Reference section to take a sample measurement.

Immediately after taking a sample, data about the measurement will be displayed under the Take

sample button.

The zero reference sample measurement is maintained separately from the measurement buffer;

this measurement is not added to the measurement buffer. Only one zero reference sample is

stored at a time. When a new sample is taken, the previous one is overwritten.

When the zero reference sample is acceptable, click the Set button to make its distance the Set

point. When the zero reference is set, all point cloud measurements will be displayed and stored

relative to the set point. Any measurements displayed in the UI, including the visualization window,

will be immediately updated to reflect this change.

To clear the zero reference, click the Clear button. Point cloud measurements will no longer be

relative to the set point. Any measurements displayed in the UI, including the visualization window,

will be immediately updated to reflect this change.

5.9 Visualization The visualization tool included with the Optimet plugin allows the user to view the results of a scan in

real time. The visualization window includes the ability to pan, rotate, and zoom in order to change

the perspective for better viewing. The window also includes a few helper objects that can be

turned on and off dynamically to help orient the user while changing the perspective.

The visualization tool has its own configuration which allows the user to control what points are

displayed and how the color gradient is applied. The configuration also allows some of the helper

objects to be scaled at runtime. These configuration options are designed to accommodate a wide

range of scanned objects in terms of size and shape. Figure 16 highlights the Optimet plugin’s

Visualization section of the main panel. Figure 17 shows an example of the visualization window.

Note that the visualization settings are stored persistently with the current Mach 4 profile. This is a

convenience so that the user does not have to enter values each time the Mach 4 application is

40

©2016 Flexware Innovation, Inc.

restarted. Also, because the settings are stored per-profile, the user can create multiple profiles and

simply switch between profiles in Mach 4 when scanning different types of objects with different

sizes and shapes.

Figure 16 – Main Panel – Visualization Controls

Click the Show Visualizer checkbox in the Visualization section to toggle showing and hiding the

visualization.

The following additional configuration items are available on the main panel:

Select Always on top to force the visualization window to remain on top of all other

windows on the desktop. When a measurement stream is active, this may make it easier to

watch while working in other windows.

Select Show grid to show a flat grid in the xy plane. This is useful for maintaining orientation

while moving inside the visualization window. Additional settings for the grid, including its

size, scale, and z (height) can be modified in the visualizer’s configuration dialog. (See

section 5.9.1).

Select Show origin marker to show a symbol at the origin (x,y,z) = (0,0,0). The marker’s x,

y, and z lines extend in the positive direction along each axis for a short distance. This may

be useful for maintaining orientation while moving inside the visualization window.

The filter settings for the visualizer are also shown on the main panel to remind the user of the

current values. (These values are directly above marker in Figure 16.) To modify these filter

values, open the visualizer’s configuration dialog by clicking Configure visualizer…

41

©2016 Flexware Innovation, Inc.

Figure 17 – Visualization Window

5.9.1 Visualization Configuration Use the visualization configuration dialog to change the measurement filter, grid scaling, and point

cloud color gradient used by the visualizer. An example of the visualization configuration dialog is

shown below in Figure 18.

42

©2016 Flexware Innovation, Inc.

Figure 18 – Visualization Configuration Dialog

5.9.1.1 Visualization Filtering

Configure the filters used by the visualizer in the Filtering section. In order for a point to be

displayed in the visualization window, it must meet the criteria for all filters.

Min. SNR(%): Enter the minimum SNR value (as a percent) that a measurement must have to

be displayed. To effectively disable this filter, set the value to 0.

Min. Total Energy: Enter the minimum total energy that a measurement must have to be

displayed. To effectively disable this filter, set the value to 0.

Max. Total Energy: Enter the maximum allowed total energy that a measurement may have

to be displayed. To effectively disable this filter, set the value to its maximum (50000).

43

©2016 Flexware Innovation, Inc.

Changes do not take effect in the visualization window until they are applied with OK.

5.9.1.2 XY Grid Plane Settings

Configure the appearance of the xy plane in the XY Grid Plane section.

The X Min, X Max, Y Min, and Y Max values control the extent of the plane in the visualization

window. Decrease the minimum values and increase the maximum values to cover a greater extent.

The Z Height value controls the height at which the plane is drawn. Adjust this value to change

where the plane intersects the point cloud.

The Spacing value controls the interval of the line spacing on the grid. (This value controls spacing in

both the x and y direction.) A smaller value increases the total number of grid lines; a larger value

decreases the total number of grid lines. Adjust this value based on the size of the scanned object

and the amount of context required to understand the scale of the point cloud.

All of these values are entered in the same units of measure as specified in the scan configuration

(see sections 3.3.2 and 5.4).

Changes do not take effect in the visualization window until they are applied with OK.

5.9.1.3 Coloring

Points displayed in the visualization window are color coded by height (z axis value). Users may

control how the color gradient applied to the point cloud in the Coloring section. For correct

operation, it is important that values are specified from highest (maximum value) to lowest

(minimum value). Negative values are permitted.

The actual color used to render each point is based on where the point lies between its two nearest

inflection points. For example, consider the segment between 7.5 mm and 9 mm defined in Figure

18. Points with a height of 7.5 mm are rendered 100% red. Points with a height of 9 mm are rendered

100% white. Points in between are a shade of pink, going from darker to lighter as the height

increases from 7.5mm to 9mm.

Points with a height below the lowest value are rendered 100% purple. Points with a height above

the highest value are rendered 100% white.

The inflection point values are entered in the same units of measure as specified in the scan

configuration (see sections 3.3.2 and 5.4).

Changes do not take effect in the visualization window until they are applied with OK.

44

©2016 Flexware Innovation, Inc.

5.9.2 Visualization Window Controls The visualization window supports the following movements to change the camera location and

perspective:

Rotate: In the visualizer window, hold the left mouse button down and drag the mouse in the

desired direction to rotate the camera.

Pan: In the visualizer window, hold the right mouse button down and drag the mouse in the

desired direction to pan the camera.

Zoom: In the visualizer window, use the mouse’s scroll wheel to zoom in and zoom out of the

image.

45

©2016 Flexware Innovation, Inc.

6 Macros and G Code Integration The Optimet plugin is distributed with several macros (scripts) which provide the ability to trigger

probe actions within G code. The scripts can be integrated into G code in a number of ways. The

most basic scan patterns are:

1. Point measurements:

a. Clear the measurement buffer [m code (macro/script)]

b. Move to a specific location [G code commands]

c. Take a measurement [m code (macro/script)]

d. Repeat a & b until all points are acquired

2. Line scan:

a. Clear the measurement buffer [m code (macro/script)]

b. Move to a start location [G code commands]

c. Begin streaming measurements [m code (macro/script)]

d. Trace a path to an end location [G code commands]

e. Stop streaming measurements [m code (macro/script)]

3. Plane scan:

a. Clear the measurement buffer [m code (macro/script)]

b. Move to a start location [G code commands]

c. Begin streaming measurements [m code (macro/script)]

d. Scan a 2D grid pattern by tracing parallel lines along the x or y axis [G code

commands]

e. Stop streaming measurements [m code (macro/script)]

Keep in mind that the measurement buffer is only cleared when instructed by the user or by a script.

By repeating the basic scans above multiple times, multiple (potentially discontiguous) regions can

be scanned together as one session.

6.1 Provided Macros The following table describes the macros that are distributed with the Optimet plugin.

Macro (script) Description m100 The plugin starts the measurement stream m101 The plugin stops the measurement stream m102 The plugin takes a single measurement at the current location m110 The plugin clears the measurement buffer m120 The plugin takes a zero reference sample measurement m121 The plugin sets the zero reference from the zero reference sample m122 The plugin sets the zero reference from a user-defined value* m125 The plugin clears the zero reference

Except for m122, none of these macros have input parameters. This means they can be run as

distributed without any modifications.

46

©2016 Flexware Innovation, Inc.

Macro m122 provides an example of setting a configuration parameter before invoking a command.

Before integrating this with G code, the user should open the macro file and change the

measurement written to the configuration register to the appropriate value.

IMPORTANT: Remember that macros are stored with each profile (see section 4.3). When creating a new profile, be sure to copy over any macros that are going to be used with the new profile!

The plugin provides the ability execute additional commands that are not mentioned here. For

example, it is possible to connect to the probe, set probe parameters (e.g. laser power), and even

save results to a file using commands executed from a macro. For information about all of the

available commands and status registers, please see the Optimet Plugin Programming Guide.

6.2 Example Integration This section provides a brief example of how to modify an existing G code script to work with the

provided macros. Unfortunately, G code programming, macro creation, Lua script, and other

concepts are beyond the scope of this guide. Please refer to the Mach 4 Operation Manual and the

Mach 4 Scripting Manual for more information about G code, macros, and Lua. Please refer to the

Optimet Plugin Programming Guide for a complete discussion of the Optimet plugin’s register

interface, including a list of all available commands and configurable values.

Follow the steps below to modify an existing G code file to include the “start measuring” and “stop

measuring” commands for a line scan.

Open the G code file in Mach 4.

In the Mach 4 GUI, click File > Open Gcode File.

47

©2016 Flexware Innovation, Inc.

Select the G code file to modify. In this example, we have created a copy of the ArcTest file provided by Mach 4 and named it ArcTestOptimet.tap. We will modify this file.

Select the file to modify/execute.

Click Open.

48

©2016 Flexware Innovation, Inc.

Notice that the G code is loaded under G Code. (You may need to switch from the Optimet tab to the Program Run tab.) We will now use the gcEdit tool provided by Mach 4 to edit the loaded G code file.

Click Edit G Code on the File Ops tab to edit the loaded G code file. NOTE: If gcEdit fails to open, the path to the editor may be incorrect inside of the Mach 4 configuration. Detailed Steps:

1. Open the Mach 4 Configure menu and select Mach… to open the Mach Configuration dialog.

2. On the General tab, look for G code file editor in the bottom right corner.

3. Make sure the path points to gcedit.exe in the Mach 4 program directory.

49

©2016 Flexware Innovation, Inc.

Use gcEdit to add the appropriate M codes to the G code file. (gcEdit is essentially a text editor with syntax highlighting – insert text as you would with any other application.)

Insert the M codes m100 and m101 into the desired locations; an example is shown in the image.

Save the file (File > Save), then exit the editor.

50

©2016 Flexware Innovation, Inc.

Notice that Mach 4 has updated and reloaded the G code file. (The M codes are indicated with red circles in the G code box.) When the G code is executed, the Optimet plugin will start a stream of measurements when the line m100 is executed and will stop the stream of measurements when the line m101 is executed. (In this example, measuring will occur while the machine is traversing two of the fins along the example object. The Tool Path window on the right shows the scanning pattern defined by the G code.)

At this point, the G code could be executed to complete the scan. At any time, switch to the Optimet tab to enable the visualizer and watch the scan as it runs. When the scan is complete, switch to the Optimet tab to save the measurements to a file for further processing.

51

©2016 Flexware Innovation, Inc.

7 Licenses Certain third party libraries used by the Optimet plugin require their license agreement to be

redistributed with the plugin. This section contains all such license agreements. A link to the original

license agreement is also provided in each section.

7.1 Mobile Robot Programming Toolkit (MRPT) http://www.mrpt.org/License/

Copyright (c) 2005-2014, Individual contributors, see AUTHORS file Copyright (c) 2005-2014, MAPIR group, University of Malaga Copyright (c) 2012-2014, University of Almeria All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 'AS IS' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDERS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

52

©2016 Flexware Innovation, Inc.

7.2 Open Source Computer Vision (OpenCV) http://opencv.org/license.html

License Agreement For Open Source Computer Vision Library

(3-clause BSD License)

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.

Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

Neither the names of the copyright holders nor the names of the contributors may be used to endorse or promote products derived from this software without specific prior written permission.

This software is provided by the copyright holders and contributors “as is” and any express or implied warranties, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose are disclaimed. In no event shall copyright holders or contributors be liable for any direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if advised of the possibility of such damage.