UCamCopy logo

UCamCopy for UCCNC

User Manual — Version 2.400

A video-camera based reverse-engineering and tracing plugin for UCCNC
Manual revision: October 11, 2026
www.craftycnc.com

1. Introduction

UCamCopy is a vision-based probing and line-following plugin for the UCCNC machine-control software. It needs a webcam, preferably a “microscope” camera with fairly high magnification and adjustable focus. The camera image is processed with the EMGU/OpenCV libraries to find edges, lines, circles and enclosed shapes. Once an edge or target is found, UCamCopy drives the machine along it and records the path to a DXF file (and optionally a CSV file), so that you can reconstruct or copy existing geometry.

Camera orientation is essential Your camera must be oriented so that +X is at the right of the image and +Y is at the top of the image. Use the cross-hair lines as a reference against a horizontal or vertical mark, and adjust the camera as close to perfect as you can.

There is no scaling or dimensional calibration between the camera image and the machine. The image is used in a unit-less way to calculate position errors, and those errors drive the machine’s velocity through a closed-loop PID (proportional / integral / differential) controller using gains that you enter. The PID only generates velocity commands. Every dimension recorded in the DXF comes from UCCNC’s actual axis position in the active coordinate system, so the recorded data is as accurate as your machine’s steps-per-unit calibration.

UCamCopy shares its 3D viewer with the sibling plugin ProbeIt for UCCNC, so both plugins get the same viewer features.

2. Important: limitations and safety

2.1 Do not multi-task while running

UCamCopy relies on UCCNC to jog the machine. Jogging is disabled whenever UCCNC loses keyboard focus in Windows, so movements stop if you switch to another program while UCamCopy is running. There is no way around this other than not multi-tasking while video probing. You can move freely between UCCNC, the UCamCopy main window and the UCamCopy viewer window. UCamCopy notices when focus is lost and aborts the running operation properly.

2.2 Warning and disclaimer

UCamCopy tries to be as reliable as possible, but it operates your machine through UCCNC and its settings. Setting up UCCNC, your machine and the camera is your responsibility. You are responsible for checking and testing all signals, for the setup of your machine, and for becoming familiar with the software and its routines.

Machining is dangerous. Even though UCamCopy is only a video-probing utility and is not used while cutting, operate the machine as carefully as if you were machining. Never place your hands in the machine’s working envelope while video probing. Always turn off or disconnect the spindle motor power when a camera is mounted. Do not video probe at excessive feed rates, and use common sense. By using UCamCopy you accept all liability for damage or harm that could be caused by its use, to you and to your equipment. If you do not agree, do not use this software.

UCamCopy for UCCNC is still in development. It has been tested to make it as bug-free as possible, but it is not guaranteed to work with every setup. CraftyCNC is not liable for any damage or lost time resulting from its use. Probe-It, UCamCopy and CraftyCNC are in no way affiliated with CNCDrive or UCCNC.

3. Requirements and installation

3.1 UCCNC

The plugin works on both x86 and x64 computers running UCCNC, and is written for UCCNC versions that use .NET 4.0. UCCNC 2.2116 moved to a newer OpenTK graphics library, so there are two builds:

UCamCopy versionWorks with UCCNC
2.2xx (for example 2.203)2.2115 and earlier
2.3xx and 2.4xx (this manual)2.2116 and later

If the wrong build is installed for your UCCNC version, UCamCopy will not run and will not appear in the list of plugins to enable. Install the one that matches your UCCNC.

3.2 Equipment

You need a video camera connected and configured on the PC that runs UCCNC. Notes on the camera:

I have not tested many cameras; see the appendix for what I use and what I do not recommend. The plugin has been tested with UC100, UC300eth, UC400eth and AXBBe motion controllers, but any controller offered by CNCDrive should work equally well.

3.3 Installing

Install with the self-installer EXE file. The plugin is installed to the UCCNC plugins folder; its settings, input and output folders live in plugins\UCamCopy\ (see appendix B).

4. Trial and licensing

UCamCopy installs in a demonstration mode. In Demo Mode all features are fully functional for a trial period, so that you can try it before buying. The window title bar and the About tab show the current status.

To get a license, send an email asking to purchase one, and include the License ID shown on the About tab. The license code is created and verified from that ID, which is generated from your UCCNC motion controller’s serial number. After payment, a passkey for that ID is emailed to you. Enter it in the Passkey box on the About tab and click Validate License Key. The status then shows Licensed and all limitations are lifted.

The About tab
Figure 1. The About tab, with the License ID and the license status.

The Check Online for New Version button on the About tab compares your version with the latest one on the CraftyCNC website.

5. Enabling and starting the plugin

UCamCopy is a plugin and must be enabled in UCCNC before it can run.

5.1 Enabling the plugin

  1. In UCCNC, open the General Setup tab and click Configure plugins.
  2. Tick Enabled for UCamCopy.
  3. If you want UCamCopy to appear whenever UCCNC starts, also tick Call startup.
  4. Restart UCCNC. A restart is required before UCamCopy can run.
UCCNC General Setup tab with the Configure plugins button
Figure 2. The Configure plugins button on UCCNC’s General Setup tab.
UCCNC plugins configuration window
Figure 3. The plugins configuration window. Tick Enabled, and Call startup if wanted.

If UCamCopy is not listed, something went wrong with the installation: check that UCamCopy.dll is in the UCCNC plugins\ folder and that you installed the build that matches your UCCNC version (section 3.1).

5.2 Assigning a button code

To have UCamCopy appear when you ask for it, give it a button code that it listens for. In the plugins configuration window click Configure next to UCamCopy, type any number in the code box and click Set.

The Config dialog
Figure 4. Setting the button code that opens the plugin.

You can then assign that number in UCCNC’s I/O Trigger → HotKeys section, so that a key combination opens UCamCopy. In the example below the key code 110080 (Ctrl+Alt+P) triggers function number 3332, which opens UCamCopy because 3332 is the code entered in Figure 4.

UCCNC hotkeys table with key code 110080 assigned to function 3332
Figure 5. A hotkey assigned to the plugin’s button code.

You can also add a screen button in UCCNC and give it the same button code. The last way to open UCamCopy is to reopen the plugin configuration window and click Show.

6. The windows

UCamCopy is made of two main windows, plus a few settings windows:

Windows snap to one another when you drag them close together. When the viewer is stuck to the main window the pair moves as a group if you drag the main window; grab the viewer and pull to unstick it. UCamCopy works best at a screen resolution of 1280 × 1024 or higher.

The main window with the 3D viewer beside it
Figure 6. The main window and the 3D viewer.

6.1 Settings windows

The settings are not in tabs under the video any more. They are in separate windows that you open from the Settings menu, the first item of the menu strip above the camera view:

Menu entryContents
Image DetectionAuto Tune, the HSV option, blur, Canny, circle and line-detection values (section 10)
Offset & VelocityCamera/spindle offset moves and calibration (section 17), PID mode, gains and axis enables (section 13)
General SettingsInterface, safety and jogging, startup and updates, video overlay, detection colors, defaults and backup, DXF recording, live info (section 18)

The windows have a blue frame, can be dragged anywhere (also onto a second monitor), and remember where you left them. They snap to the other UCamCopy windows too. Closing a window only hides it. The viewer has its own settings window, opened from its toolbar.

The Settings menu with Image Detection, Offset and Velocity, and General Settings
Figure 7. The Settings menu.

6.2 Hiding panels

The side panels can be tucked away to give the video more room. The small arrow buttons on their edges (labelled Hide / Show) slide a panel away and bring it back. The viewer has the same strips for its two right-hand panels (Hide DRO / Info and Hide Layers / File Info). Which panels are shown, and how wide they are, is remembered.

The E-Stop button flashes while UCCNC is in E-Stop, so it is hard to miss.

7. The main window

The main window gives access to all of UCamCopy’s features, laid out in a way similar to UCCNC’s own screen:

The main window
Figure 8. The main window.

7.1 Special Operations and Configuration Help

The Special Operations menu holds the arc/circle collection dialog (section 12.3) and the G68 rotation setup. The Configuration Help menu opens two guides that walk you through the first setup: camera alignment, and calibrating axis velocity (section 13).

8. Quick start

This is the shortest path from an unconfigured install to a traced part. Each step is described in detail in the later sections.

  1. Enable the plugin and restart UCCNC (section 5), then open UCamCopy.
  2. Select your camera in the left panel and start it. Check focus and lighting in the Camera Capture view.
  3. Align the camera so that image-up is Y+ and image-right is X+, using the Configuration Help → camera alignment guide (section 13).
  4. Set the PID gains with a dot on a piece of paper (section 13.3). Do this once per machine and camera zoom.
  5. Put the part under the camera so the edge to trace is in view, open Settings → Image Detection and click Auto Tune (section 10).
  6. Select Lines / Edges, check that the mask shows a single clean line with a target dot at each end (section 11).
  7. Click the DXF button on the top panel so it shows DXF ON (section 15).
  8. Press Run (or the space bar) to start tracing, and press it again to stop.
  9. Click Save DXF.

9. The camera and the image views

The left panel controls the camera and selects which stage of the image processing is displayed.

The left panel
Figure 9. The left panel.

The Use HSV color for edges and detections checkbox (in the Image Detection window, next to Auto Tune) makes UCamCopy use color information instead of grayscale to find edges. This helps when your part looks similar to its background in grayscale. It is always better to create a color or shade difference yourself, for example by placing the part on light or dark paper.

9.1 Zoom and field of view

I usually zoom in so that about 1 cm (0.5 inch) spans the width of the camera view. Even with 640 × 480 pixels that gives less than 0.001 inch (0.015 mm) per pixel, which makes UCamCopy accurate without any calibration.

Camera view of a scale in millimetres
Millimetres
Camera view of a scale in inches
Inches

9.2 How the image is processed

EMGU/OpenCV captures the video and runs several steps to find lines, edges and circles:

Grayscale flow (HSV off): Capture → Grayscale → Blur → Mask (narrow region of the image) → Canny filter (edge detection) → Detections → output to drive the machine.

HSV color flow (HSV on): Capture → HSV conversion → Blur → Mask → Canny filter → Detections → output to drive the machine.

The Select View options let you look at each stage, so you can set thresholds more easily. During normal operation you will leave Composite Output selected.

9.3 The image views

The pictures below all use the same example part so you can compare the stages.

Camera Capture

The original, unmodified camera image. Use it to check lighting and focus.

Camera Capture view
Figure 10. Camera Capture.

Mask Only

A black and white picture of the mask. Image processing is limited to what falls in the white area.

Mask Only view
Figure 11. Mask Only.

Edges (Canny)

The most important view. It shows the edges the program finds after processing the image inside the masked region (yellow outline). Use the Edge (Canny) Threshold values and Thicken Edge (Canny) Lines to filter the edges until you get a strong, clean result like this one.

Edges (Canny) view
Figure 12. Edges (Canny).

Gray / Blurred

The grayscale image with blur applied. Available only when HSV is not checked. Adjust the Blur Amount in the Image Detection window to remove noise: too much blur makes edge detection difficult, too little leaves a lot of noise.

Gray/Blurred view
Figure 13. Gray / Blurred.

HSV Original

The original image converted to HSV color space and blurred. This can separate the image much better than grayscale, but needs extra thresholds to isolate the area of interest.

HSV Original view
Figure 14. HSV Original.

HSV Threshold

The HSV image needs the Color Detection Thresholding sliders adjusted. On the left below there are no thresholds and the areas are not separated well enough to detect an edge; on the right the thresholds give a clear edge.

HSV threshold with no thresholds set
No thresholds set
HSV threshold after adjustment
After adjusting the sliders
TipHold Shift and click a region of the image to set a first threshold range from that spot, then fine-tune with the sliders. Auto Tune (section 10.2) does this for you from the center of the image.

Composite

The final image, with overlays of the DROs and cross-hairs (if turned on) and the detections that drive the machine. The dark blue arrow is the direction the machine moves when Run is on. Red points and light-blue lines are the detected edges and the endpoints used to calculate the movement.

Composite output view
Figure 15. Composite output.

Multiple View

Shows the four most useful views at once, so you can adjust thresholds without switching back and forth. With HSV on you see the HSV image, HSV threshold, masked Canny edges and composite output; with HSV off you see the gray image, gray threshold, masked Canny edges and composite output.

Multiple view with HSV on
HSV on
Multiple view with HSV off
HSV off (grayscale)

10. Image detection and Auto Tune

Open Settings → Image Detection. The window opens in a Simple view that shows only what most people need: Auto Tune and its Undo button, the Use HSV color checkbox, the blur value, the Canny low/high thresholds and, when HSV is on, the HSV color range sliders. Tick Advanced settings to show every detection setting.

The Image Detection window, Simple view
Figure 16a. The Image Detection window, Simple view (Advanced settings off).
The Image Detection window with Advanced settings on
Figure 16b. The Image Detection window with Advanced settings on.

10.1 Settings

SettingWhat it does
Blur AmountRemoves noise before edges are found.
Edge (Canny) Threshold Low / HighLimits which edges are kept. Raise them to ignore weak edges.
Thicken Edge (Canny) LinesMakes detected edges thicker. Advanced.
Circle ThresholdHow strong a circle must be to be detected by the circle detector. Advanced.
HSV color rangeWith HSV on, the range of hue, saturation and value that counts as the target.
Use custom line detection settingsWhen ticked, the Hough and merge values below are used. When unticked, built-in defaults are used. Auto Tune turns it on. Advanced.

The line-detection values (Advanced view) control the line detectors and the line-merging algorithm:

10.2 Auto Tune

Finding good blur, Canny and line-detection values by hand can take a while. Auto Tune sets them for you with one click.

  1. Start the camera and put the part under it so that the edge you want is in view. If you use HSV color detection, put the target color at the center of the image first.
  2. Click Auto Tune. It samples a few live frames and tries different blur sizes (and, in HSV mode, different color-range widths). It scores each one by how continuous the resulting edge is and how strong the real image contrast under it is, then fills in the blur, Canny low/high, HSV range and line-detection values with the best result.
  3. A message reports the edge score before and after, and asks whether to keep the new values. Choose Yes to keep them or No to leave your settings as they were.
  4. The Undo button beside Auto Tune puts the previous settings back after you have kept a tune. It is greyed out until a tune has been kept.

Auto Tune needs the camera running (it asks you to start it first). You can still adjust any value by hand afterwards.

Auto Tune keep the new values message
Figure 17. Auto Tune asks whether to keep the new values.

11. Masking

The mask limits the part of the image that is used for detection. It has two shapes (round and rectangular) and an adjustable size. When you edge-trace, the size and shape of the mask are important: they reject noise and keep the tracing on course. The mask follows the angle of the edge it finds, which helps with steering. Items inside the white area of the mask are “seen”; items in the black area are rejected.

Mask Adjustments with the rectangle mask
Rectangular mask settings
Mask Adjustments with the round mask
Round mask settings
Rectangular mask in Mask Only view
Rectangular mask
Round mask in Mask Only view
Round mask

When edge tracing, your goal is to adjust the image and the mask until you have essentially a single line with a target dot at each end inside the mask. That is the line that will be followed.

When to use the maskMasking should be off for intersection, circle and contour detection, and on only for edge following.

12. The detectors

The detector buttons in the bottom panel choose what UCamCopy looks for:

Select Image Detector for Targeting group
Figure 18. Selecting the detector.

12.1 Lines / Edges

The detector you will use most, for auto-tracing the outside edges of objects. It needs a clear edge in the image and a mask that limits detection to the area of interest.

Edge detected and ready to trace
Figure 19. Good edge detection, ready to go.

You choose the direction the machine travels around the perimeter by double-clicking the image to re-orient the mask in the opposite direction:

Mask re-oriented to run the other way
Figure 20. Ready to go the opposite way.

You may have to help by positioning the part so the edge is initially centered, and by orienting the mask. In the next picture the edge is in the right place but is not detected, because the mask is not oriented over the edge:

Edge not detected because the mask is not over the edge
Figure 21. The mask is not over the edge, so nothing is detected.

Edge tracing

When you are calibrated and ready to trace: switch to line mode, jog until the cross-hair is over an edge, and adjust the image and the mask until you have a clean line with target dots at both ends. The mask aligns itself with the edge and can go either way around the part (clockwise or counter-clockwise makes no difference). Double-clicking near the center of the image re-orients the mask direction.

You can start and stop the velocity and move around as needed to cover all the edges. If the line is lost or the machine gets off track, stop the velocity, jog back into place, adjust the video and mask, and enable velocity control again.

DXF Data (edge trace) group
Figure 22. Edge-trace recording options.

12.2 Intersections

When enabled, the detector looks for the two most prominent lines in the image and uses their intersection as the target. Turn the mask off.

Intersection detection of two lines
Figure 23. Intersection detection.
Under developmentThis detection is somewhat erratic at the moment and is still being improved.

12.3 Circles and arcs

There are two ways to deal with holes and circles.

Circle detector

If the hole is small and fits completely in the camera view, select the circle detector and the machine drives to its center point. It only finds a location; the size of the circle cannot be determined from the camera image alone. Adjust the Circle Threshold until you get a reasonable detection (it may bounce around quite a bit). In the picture, the red dot is the center target and the dark blue arrow is where the machine will drive.

Circle detector
Figure 24. The circle detector.

Arc or Circle From Points dialog

For geometry that is too big for the camera view, open Special Operations → Arc or Circle From Points. The dialog helps you collect circles and arcs into the DXF or find sizes and center points.

Fit Data Points to Arc/Circle dialog
Figure 25. The arc/circle dialog.

Follow the prompts: jog to at least three locations on the arc or circle and click Sample Point at each. With three points the center and the diameter/radius are calculated and shown. You can collect more points for a least-squares fit, and then use the result to:

For an arc you can only use three points: sample one end, a point along the arc, and then the opposite end.

12.4 Contours (enclosed shapes)

Similar to the circle detector, but it finds shapes that are not perfect circles more easily. It is the detector I recommend when calibrating, because it is more reliable and stable than the circle detector and has no threshold to adjust.

Contour detector
Figure 26. The contour detector.

13. Velocity control and PID tuning

Before going far with UCamCopy, set up the PID controllers (proportional / integral / differential) that drive the axes together with the velocity you choose. They are on the Offset & Velocity settings window (Settings → Offset & Velocity).

The Offset and Velocity window
Figure 27. The Offset & Velocity window, PID section.

13.1 Setup helpers

Under the Configuration Help menu, camera alignment and Calibrate Axis Velocity open guides that walk you through the initial setup.

The Align Camera Image entry of the Configuration Help menu and the first page of the alignment guide
Figure 28. The camera alignment guide, opened with Configuration Help → Align Camera Image. Click Next to move through the steps.
Calibration Setup dialog
Figure 29. The Calibrate Axis Velocity guide.

Key points:

13.2 Velocity control mode

ModeHow it worksUse it when
PID OnlyOne PID per axis, aimed at a target held a fixed distance from the current position. The X and Y PIDs calculate separate velocity commands from the difference between target and current position.The part has sharp corners or lots of twists and turns.
PID w/ Centering PIDAs above, plus two “Center PID” loops that reduce the following error between the closest point of the edge and the current position. Recommended. Can be unstable if the center PID is poorly tuned or aggressive; set its max output to 5 or 10% (the limit is 50%).Most work.
Angle/VelocityUses the Center PID loops to put the closest point of the edge at the target, and takes velocity out of PID control: speed and direction come only from the slope of the detected edge. A simplified algorithm that may work better on some machines.The part has long straight sides and few twists.

13.3 PID values

PID is a classic negative-feedback control (servos, thermostats and so on). In UCamCopy it looks at the error in the camera image — how far the center of the picture is from a defined target — and sends velocity commands to UCCNC to drive that error to zero. kP, kI and kD are gain coefficients. They must be set before you let UCamCopy control your machine.

The total gain fed to the machine is the combination of the maximum velocity you enter and the PID gains for the normal and center PIDs. If gains are too high the machine oscillates; if too low, it is slow and the following error grows, which turns into measurement error.

Tuning procedure

Place a small dot on a piece of paper as a target, then:

  1. Turn off Lines / Edges and turn on Contours. When the dot is detected, a target dot appears at the center of the outlined dot. Make sure the mask is off.
  2. Enable only the X PID first (leave the Y PID off with its enable checkbox). The kP, kI and kD values apply to both axes equally, but it is easier to watch one axis at a time.
  3. Jog to one side of the contour (left or right).
  4. Enter a starting value for kP, and leave kI and kD at zero.
  5. Click the Run button. The machine should move the center of the dot to the center of the screen and stop. Turn Run off.
  6. If the machine goes in the wrong direction, stop and check the camera orientation and your axis definitions.
  7. If it goes to the center and stops without oscillating, try a larger kP. If it overshoots and swings back and forth, reduce kP and try again.
  8. When kP is just starting to cause a small overshoot, cut it in half.
  9. Enable the Y PID as well and check that it settles similarly. Reduce the gain if Y oscillates.
  10. Run X and Y together and check that the machine centers on the dot while both axes move.
  11. Leave kP alone and repeat the process for kD only.
  12. Until you are tracing real profiles and watching the line-following behavior, leave kI at zero. It is used to eliminate overall following-error offsets.

When it works, the target dot is brought to the center of the view and stops without oscillating. You can then change the values, jog off center and run again to test them. You want the machine to snap quickly to the dot without oscillating or overshooting.

Units and zoomMy testing was in inch units. Good PID values for your machine depend on your units, steps per unit, camera resolution and zoom. Camera zoom also affects the gains, so try to set things up consistently if your camera has an adjustable zoom.

13.4 Update rate

The PID Update Rate (in ms) is how often the PID loops are calculated and velocity commands are sent to UCCNC. I suggest about 100 ms (10 times per second). It should be slower than the camera’s frame rate by about 50%. For example, a camera running at 15 fps delivers a frame every 67 ms (1/15 = 0.067), so set the update time larger than that; 100 ms gives 10 updates per second. If your camera has a consistently high frame rate you can decrease the value: 50 ms (20 Hz) works with a 30 fps camera.

You can see the real frame rate in the status messages at the bottom of the window:

Video info status: Act FPS and Process FPS
Figure 30. The video info.

14. Running: Run/Stop and recording

UCamCopy does not run routines step by step like a touch probe. Instead you use the Run/Stop button to give UCamCopy control of the axes or to take it away.

Run/Stop button, stopped (red) Run/Stop button, running (green)
Figure 31. The velocity box and Run/Stop button: stopped (left) and running (right).
Move vector in dark blue and target points in red
Figure 32. The move vector (dark blue) and the target points (red).

If there are no targets, jog the machine by hand to bring one into view. If the target is in view but not detected, adjust the image and the detections until it is.

Machine moves can be aborted, and fail safe: if UCamCopy loses focus or cannot move, it stops rather than guessing.

14.1 Working on one file

Once you have opened a file to record to, you can start and stop recording as often as you like. For example, you can record some perimeter feature (click Abort to stop), record a bore or edge feature elsewhere, set a new Z location, go back and record another perimeter, all to the same file. When you are done, save it all with Save DXF.

15. DXF and CSV recording

The top panel controls recording of DXF or CSV data, opening, saving and closing files, choosing the DXF layer to record on, and so on.

The DXF and CSV control bar
Figure 33. The DXF controls at the top of the main window.

You can also record points manually and choose whether each point is joined to the previous one by a line (line join / break).

The Point Sample Distance is used during auto edge tracing and sets how far apart the recorded points are, which controls the resolution of the edge: a smaller number means finer resolution. Edges are recorded as points joined by straight lines. You can fit this data to polyline curves in your CAD or CAM software afterwards.

UCamCopy records to a CSV (comma-separated values) file that Excel can import, to a DXF file, or to both at once. Files are stored in the output folder of the UCamCopy folder (for example C:\UCCNC\plugins\UCamCopy\output\).

UnitsRecorded files are unit-independent. Positions and sizes are written as plain numbers in your native units. If you probe a one-inch (25.4 mm) bore, the circle is recorded with a diameter of 1.000 if UCCNC is in inch mode, or 25.4 in metric mode. Scale the file if you use it directly in CAM or CAD.

15.1 Starting a recording

Turn on the CSV checkbox, the DXF checkbox, or both. You are prompted for a file name; if you select both, the name is used for both formats. Once the DXF or CSV button shows ON and a name has been entered, you only have to trace the part: all data is recorded until you close the file. Starting a DXF recording creates (or selects) the DXF layer for you; use the Active Layer selector to record to a different layer.

DXF ON?DXF points are only added while the DXF button at the top left of the main window shows DXF ON. If traced points are not showing up in the DXF, check that button first.

15.2 Open

If no DXF data has been recorded, Open opens an existing DXF file. You can open several files, which are appended together; new data you collect is merged into them. When you save, you can overwrite or save under a new name. As soon as a file is opened or data is recorded, the button works for saving until you clear the DXF buffer or save the file.

15.3 Empty and Close

While a recording option is on, data keeps being collected and appended internally. After you finish probing a part, click Close DXF to close the file (you are asked to save if you have not). To throw away data you do not want, click Empty DXF, which clears it without saving.

15.4 Save DXF

You can click Save DXF at any time to make sure the results are on disk. If there is no file name yet you are prompted for one; if CSV and perimeter files are selected, they are saved with the same name as the DXF. Once the file has a name it is displayed, so you can confirm where the data is going.

15.5 Save As

To save the DXF data under a different name, use Save As on the viewer toolbar (or Save As… in the viewer’s right-click menu). Unlike Save DXF it writes the file whether or not the DXF button shows ON, and the new file becomes the current file, so a later Save DXF goes there (section 16.9).

16. The 3D viewer and DXF editing

The viewer shows the point cloud and DXF data measured and recorded while you probe, and the camera position in real time. It also shows information about the DXF, lets you control the layers and colors and choose the active layer to record on, and is a basic DXF editor: you can pick, delete, move to another layer and draw lines. Colors and visibility are set by you.

The 3D viewer
Figure 34. The 3D viewer.

16.1 Window layout and panels

Each of the two right-hand panels has a vertical Hide / Show strip beside it. Click it and the panel slides away to give the 3D view more room; click again to bring it back. Drag the left edge of a panel to make it wider or narrower. Which panels are shown, and how wide, is remembered the next time the viewer opens.

File Info panel text
Figure 35. The File Info panel.

16.2 Moving around the view

A short right-click that does not drag opens the right-click menu instead of rotating.

Yellow pivot dot while rotating
Figure 36. The pivot dot (yellow) shown while rotating. Its size and color can be changed in the viewer settings.

16.3 Selecting entities

Click a line, circle, arc or polyline to select it. It is drawn in the Selection Color (cyan by default) and its layer and coordinates are shown in the status bar. Before you click, the entity under the pointer is drawn in the Hover Color (orange by default). Open shapes (lines, arcs, open polylines) show a green Start dot and a red End dot, and an arc also shows a blue Center dot. Closed shapes such as circles have none of these.

An entity highlighted under the pointer
Hover
A selected entity with start and end dots
Selected, with Start and End dots

While Select or Zoom Box is on, dragging draws the box instead of panning the view.

The Select tool with a selection box being dragged
Figure 36a. The Select tool on (the button stays highlighted) with a box being dragged. Everything the box touches is selected.

16.4 Delete, Undo and Redo

With entities selected, click Delete (or press Delete) to remove them from the DXF data. Undo (Ctrl+Z) takes back the last change and Redo (Ctrl+Y or Ctrl+Shift+Z) puts back what you just undid. The history covers deleting entities, drawing lines and moving entities to another layer, one change at a time. A new change clears the Redo history, and opening or clearing a DXF clears both.

Any edit marks the DXF as having unsaved changes, so the Save button on the main window becomes available.

The viewer after deleting 89 entities, with the status bar message
Figure 36b. After a delete, the status bar says how many entities were removed and reminds you that Ctrl+Z undoes it. The Cnt column of the layer list drops to match.

16.5 Draw Line

Draw Line adds new lines to the DXF by clicking in the view. Click Draw Line on the toolbar (the button stays highlighted while the tool is on), then:

The viewer toolbar with the Draw Line button highlighted
Figure 36c. The toolbar with Draw Line turned on.
  1. Click the start point. A green dot marks it.
  2. Click the end point. A line is added, and its end point becomes the start of the next line, so you can keep clicking to draw a connected series. A rubber-band line follows the pointer from the start dot.
  3. Press Esc once to end the series (then click a new start point), and Esc again to leave the tool. Clicking the Draw Line button again also turns it off.
Green start dot and an orange rubber-band line following the pointer
Figure 36d. The green start dot, and the orange rubber-band line that follows the pointer. The status bar tells you what to do next.
A connected series of drawn lines, with the rubber-band line from the last point
Figure 36e. A connected series of lines (red). The rubber-band line runs from the last point, ready for the next click.

Snapping: when the pointer is within about 12 pixels of the start or end of an existing line, an orange dot appears on that endpoint and the status bar names it. The point you click is then exactly that endpoint, so lines join cleanly. Away from an endpoint the point is where you click, at Z = 0. Only the endpoints of lines are snap targets; arcs, circles and polylines are not.

Orange snap dot on a line endpoint
Figure 37. Snapping to a line end: the orange dot sits on the endpoint, and the status bar names the line and its layer.

New lines go on the active layer (shown in the Layers panel; one is created if there is none). Each line is one Undo step. Pan, rotate and zoom still work while the tool is on. Use the Top view for drawing: in an edge-on view such as Front or Right a click cannot be placed on the Z = 0 plane.

Lines drawn on the new active layer TestDraw, shown in pink, with the snap dot on an existing line
Figure 37a. Drawing on the active layer. Here a new layer, TestDraw (pink), is the Active Layer, so the new lines are pink and its Cnt goes up as lines are added. The orange dot is snapping to the start of an existing line.

16.6 Layers and Move to Layer

The layer list has these columns: Vis (click to show or hide the layer), Col (double-click to change its color), Del (delete the layer and its entities, after a confirmation), Layer Name (edit it to rename the layer) and Cnt (the number of entities on it). Add Layer creates a new layer and Refresh Layer List rebuilds the list. The Active Layer is the one that newly recorded data and newly drawn lines are put on. Layer names must be unique (upper and lower case count as the same): a name that is already in use is refused, both for a new layer and when renaming.

To move entities to another layer, select them, right-click one of them, choose Move to layer and pick the destination layer. The entities keep their positions; only their layer changes. They stay selected so you can see the result, and Undo moves them back. If the layer you want does not exist yet, create it first with Add Layer or New Layer… in the right-click menu.

The viewer with the Layers panel showing two layers
Figure 38. The layer list in the viewer's DXF/Layers panel, with two layers.

To make a new layer, click Add Layer (or choose New Layer… in the right-click menu). UCamCopy asks for a name, then for a color. If you cancel the color dialog the layer is still created.

The Add new Layer name prompt
Figure 38d. Enter the layer name.
The color chooser for the new layer
Figure 38e. Pick the layer’s color.

Moving entities, step by step: first select them (here part of the red Tri layer is selected, shown in cyan), then right-click one of them and open Move to layer, which lists every layer. Pick the destination.

Entities selected in the Tri layer
Figure 38a. The entities to move are selected.
The Move to layer submenu listing Slot and Tri
Figure 38b. Move to layer lists the layers.
The entities now drawn in the Slot layer color, with the status bar message
Figure 38c. After choosing Slot: the entities are drawn in that layer’s color, the Cnt values change, and the status bar says how many were moved (Undo puts them back).

16.7 Right-click menu

Right-click (without dragging) in the 3D view to open a menu. If you right-click an entity that is not selected, it becomes the selection; if it is already part of the selection the whole selection is kept, so you can act on a group. The menu has:

Entries that do not apply, such as Delete with nothing selected, are greyed out.

The viewer right-click menu with one entity selected
Figure 39. The right-click menu with an entity selected. The keyboard shortcut for each entry is shown beside it.
The viewer right-click menu with nothing selected, Delete and Move to layer greyed out
Figure 39a. With nothing selected, Delete, Move to layer and Clear selection are greyed out.

16.8 Viewer settings

The Display Options menu turns the Axis / WCS indicator, the grid and the current-position marker (Show Cur. Position) on and off. The colors and sizes are in the viewer’s settings window, opened from the toolbar. Its groups are collapsible; Viewer Colors and Sizes are open by default.

Click a color swatch to change that color. The settings are saved with the viewer settings when you click Save Settings on the main window.

The viewer settings window
Figure 40. The viewer settings window.

16.9 Saving a copy of the DXF (Save As)

Click Save As on the viewer toolbar, or Save As… in the right-click menu, to save the DXF data to a new file. The save dialog opens in the folder of the current file with its name filled in, ready to change. The data is written whether or not the DXF button on the main window shows ON, and the new file becomes the current file: the name shown on the main window changes to it, and a later Save DXF goes there. The original file is not changed. Save As writes only the DXF; the CSV and perimeter files are written by Save DXF.

17. Camera / spindle offset

You will most likely have the camera side-mounted to your spindle. The offset controls (in Settings → Offset & Velocity) let you set the offset between the spindle and the camera and then toggle the machine from one position to the other.

This is a good setup tool: use the camera and cross-hairs (or the detectors, or the arc/circle routines) to locate the origin you want, then move the spindle to that location and zero the DROs.

The Offset and Velocity window
Figure 41. The camera/spindle offset controls.

Each session, the first time you zero an axis or use a button to move between the spindle and the camera, you are asked which position you are currently using (camera or spindle). From then on the buttons only toggle between the two.

18. General settings, settings files and backups

18.1 General Settings window

Settings → General Settings holds the options that are not about image detection. They are in collapsible groups in two columns; whether each group is open is saved with your other settings.

GroupWhat is in it
InterfaceEnable Tool Tips?, Enable Error Message/hints?, Group Minimize/Restore All Windows?, and the Config ‘Open’ Button Code button, which opens the dialog described in section 5.2.
Safety & JoggingDisable Jogging in UCCNC interface? turns off jogging from UCCNC’s screen, the arrow keys (if assigned) and the fly-out jog panel, so UCamCopy is in control and a stray key press cannot jog the machine. Check for softlimits, abort if hit stops and reports if a soft limit is hit during a move.
Startup & UpdatesAuto Save ‘settings’ on close? saves your settings when the plugin window is closed. Auto Check for New Version Enabled? checks the website for a newer version when the plugin starts (if you have a network connection). The Check Online for New Version button on the About tab works whether or not this is ticked.
Video OverlayDROs on the image overlay, DRO color, cross-hair overlay, cross-hair color, line width, circle radius and number of cross-hair circles.
Detection ColorsThe colors of the detected line, the target point and the move vector.
Defaults & BackupSet Defaults – INCH, Set Defaults – MM, Save current as defaults… and Restore from backup….
DXF RecordingRecord Z on zero plane, the Z value to record as, circle size to draw on “record pt”, and cross-hairs on circle.
Live InfoThe live detection information that is also shown at the bottom left of the main window: video info (image size, actual and processing frame rate), mask info (the mask angle) and line info (lines found, and lines left after merging similar ones).
The General Settings window
Figure 42. The General Settings window, with all groups open. Click a group header to open or close it.

18.2 Saving settings

Click Save Settings on the main window to save your settings (the controls of the main window and the settings windows, and the viewer settings). Settings are only saved when you click the button, plus an automatic save when the plugin closes if Auto Save is on and the settings loaded properly. If the settings could not be read when the plugin started, nothing is auto-saved over them.

18.3 Defaults

The first time UCamCopy runs with no saved settings, it asks whether you work in inch or metric and loads matching starting values. You can also choose a settings file instead. The starting values are sensible first-pass settings for both the main window and the viewer; the metric set has the feedrates and lengths converted (for example the probing velocity is 102 mm/min instead of 4 in/min, and the viewer’s grid is 127 mm across instead of 5 in). Please check the values against your machine, camera and zoom, especially the PID gains (section 13).

18.4 Where the files are, and backups

Everything is in plugins\UCamCopy\Settings\ inside your UCCNC folder:

File / folderWhat it is
UCamCopy.xml, UCamCopyViewer.xmlThe main window and viewer settings: every checkbox, number, text, combo, color and group state.
UCamCopy.settings.xmlWindow positions, sizes and panel state. On the first run, values from an older install are imported once.
Backups\Rotating backups (the newest 10 of each file), made whenever a settings file is about to change.
SettingsLoad.logOne line for every save, load and restore, plus anything that could not be applied and why. Look here first when “a setting didn’t stick”.
WindowPositions.xmlWhere each settings window was left.
Defaults\The defaults you saved.

Settings are written safely (a new file is written and checked before it replaces the old one), and a settings file that cannot be read is never overwritten by the defaults.

Restore from backup… (General Settings, Defaults & Backup) lists the backups and puts the one you choose back.

19. Troubleshooting

SymptomCheck
UCamCopy is not in the plugin listIs UCamCopy.dll in the UCCNC plugins folder? Is it the build that matches your UCCNC version (2.2xx for 2.2115 and earlier, 2.3xx/2.4xx for 2.2116 and later)?
The camera is not in the listPlug it in, then click the refresh button next to the camera list. Make sure no other program has the camera open.
Run is on but the machine does not moveMoves only happen when a target is detected. Check that the overlay shows target points and a blue move vector; if not, adjust the image, thresholds and mask, or run Auto Tune. Check that UCCNC has keyboard focus and is not in E-Stop.
The machine goes the wrong wayCheck the camera orientation (+X to the right, +Y up) and the axis definitions in UCCNC. See section 13.
The machine oscillatesThe gains are too high. Reduce kP (and kD); see the tuning procedure in section 13.3.
Movement stops when I use another programUCCNC jogging stops when UCCNC loses focus. Do not multi-task while running (section 2.1).
Edge is found but not tracedThe mask is probably not oriented over the edge. Double-click the image to re-orient it. Check the mask size and Max Angle Delta.
Traced points are not in the DXFMake sure the DXF button shows DXF ON and a file name has been entered (section 15.1).
Low frame rateCheck lighting: many cameras drop to about 10 fps in poor light. Compare Act FPS with Process FPS (section 13.4).
A setting was not rememberedClick Save Settings. Then check Settings\SettingsLoad.log, and use Restore from backup… if needed.
The program is not licensed after I entered the passkeyThe passkey must match the License ID shown on the About tab, which is created from your motion controller’s serial number.

Appendix: reference, versions and cameras

A. Viewer shortcuts

ActionHow
PanLeft mouse button + drag
RotateRight mouse button + drag
ZoomMouse wheel
Reset viewR (pointer over the 3D view)
Select an entityClick; Ctrl/Shift-click to add or remove
Box select / zoom boxSelect or Zoom Box tool, then drag; Alt removes
Clear selection / leave Draw LineEsc
DeleteDelete
Undo / RedoCtrl+Z / Ctrl+Y (or Ctrl+Shift+Z)
Run / Stop (main window)Space bar
Re-orient the mask direction (main window)Double-click the image
Set a first HSV range (main window)Shift-click the image

B. Files and folders

Path (inside the UCCNC folder)Purpose
Plugins\UCamCopy.dllThe plugin
Plugins\UCamCopy\Settings\Settings, backups, defaults and log (section 18.4)
Plugins\UCamCopy\output\Recorded DXF and CSV files
Plugins\UCamCopy\input\Input files
Plugins\UCamCopy\Images\Interface icons
Plugins\UCamCopy\Manual\This manual (opened by the Help button)
Plugins\UCamCopy\README.txt, UCAM_EULA.rtfThe install notes and the license agreement
Emgu.CV.UI.dll, Emgu.CV.World.dll, ZedGraph.dll, DirectShowLib-2005.dll, MagnetWindows.dll, x64\, x86\Video and graphics support files, installed in the UCCNC folder itself and shared with ProbeIt

C. Version history

V2.400 — 10/11/26

For UCCNC 2.2116 and later. A broad round of stability fixes, viewer features and user-interface clean-up on top of V2.301.

V2.203 and V2.301 — 2/29/24

V2.203 is for UCCNC 2.2115 and earlier; V2.301 is for 2.2116 and later. Only a minor bugfix (the license text box on the About tab was hidden); no other functional changes.

V2.203 and V2.300 — 12/29/23

A dual release. UCCNC 2.2116 moved to a newer OpenTK graphics library (3.3.2) that made UCamCopy incompatible unless it referenced the newer library, so the 2.2xx versions are for UCCNC 2.2115 and earlier and the 2.3xx versions are for 2.2116 and later. The viewer was updated to match ProbeIt’s pan/zoom/rotate and gained snap-to-view.

V2.201 — 6/2023

Installer fix only (magnetwindows.dll was missing).

V2.200 — 4/2023

V2.000 — 1/10/21

V1.011 (8/15/2020) and V1.010 (4/6/2020)

Added the 3D viewer, the DROs tab, opening existing DXFs and appending to them, CSV perimeter recording and default XML files for inch and metric; fixed the PID calculation that saturated both axes at 100% on diagonals; masks may be longer than 100 pixels.

V1.001 (12/30/2019) and V1.000 (12/26/2019)

V1.001 fixed the velocity input limit, added Shift-click to pick an HSV color, tool tips and a setting to turn them off, and removed auto-save on close because it could overwrite settings with empty data if UCCNC closed first. V1.000 was the initial demo release.

D. Cameras and FAQ

Cameras. I cannot make a direct recommendation on brand or model since I have only tried a few. In general, look for one that advertises 30 fps and has adjustable focus done with a knob at the back end.

What camera do I use? The one below, bought on Amazon. It is also sold by Oasis Scientific as model V1-PS.

USB digital microscope with a stand
The camera I use.

Things I like:

Things I do not like: some background noise in the image, but I think that is common with all cameras of this type (CMOS sensors).

Any camera I absolutely do not recommend? Yes: the type with a focus wheel near the lens instead of at the back. The lens has play, so the image moves around and the focus does not stay adjusted. It is fine as a real microscope but does not work well mounted on a CNC. This type also had a lower frame rate and a noisier image, and a maximum resolution of only 1920 × 1080.

A camera with a focus wheel near the lens
The kind of camera not to buy for CNC mounting.

UCamCopy! Copyright 2023–2026 by Crafty CNC / Eric Brust. www.craftycnc.com