Skip to content

Fiducial Locator

markmaker edited this page Jul 20, 2023 · 11 revisions

What is it?

The Fiducial Locator is a piece of software inside OpenPnP which detects the precise fiducial location using the down-looking camera. Fiducials are primarily used to pinpoint the exact position and rotation of a PCB, but other use cases like Visual Homing are also covered.

Operating Principle

  1. It first moves the camera to the expected location of the fiducial. This might be slightly off the true location. In case of PCBs this might be caused by tolerances in manufacturing, or by hand-mounting the board on your machine.
  2. The Locator then detects the fiducial location inside the camera view using computer vision.
  3. If it is not satisfied with the accuracy, it updates the expected location to the detected location and repeats the process. This can happen multiple times.

By re-centering the camera on top of the fiducial it can improve the accuracy. This is due to the fact that when the camera is perpendicularly on top of the fiducial, the view of the fiducial is symmetric, so any errors due to an inaccurate scale of the camera view will be cancelled out, i.e. the fiducial might appear slightly smaller or larger, but that error is symmetrical all around. An error in scale can in turn come from badly calibrated Units per Pixel, or from a difference in true Z, as shown in this illustration:

parallax-error

The re-centering also makes sure that lighting is symmetrical, which might be relevant when the fiducial is very reflective and beveled, which is typically the case for HASL coated PCBs, where the solder coating edges are rounded from surface tension. Asymmetrical lighting might make it appear shifted, inducing positional errors.

Parallax Operating Principle

As an option, OpenPnP allows for an alternative "Parallax" detection method.

Highly reflective fiducials, such as HASL (Hot Air Solder Leveling) surface-finished fiducials, are very hard to properly light. They will likely reflect the camera peeking through the diffuser, therefore, the fiducial might appear (partially) dark and/or not well-formed for detection. Only very elaborate lighting systems, such as co-axial (half-way mirror) lights can overcome the problem. Those lights are expensive/difficult to make, and have down-sides like very narrow viewing angles, high weight and bulky size.

By detecting fiducials from a parallax view-point, the fiducial appears at an angle, and if properly spaced, will reflect the bright diffuser of the camera light. Doing this from two opposite, symmetrical viewpoints, the mid-point can be taken to cancel-out any errors introduced by the angled view.

image

The following animation illustrates how the fiducial shows a unenven dark reflection when seen centered, but is lit fully when seen at a parallax distance:

parallax-animation2

Using the Stock Vision Settings

If your configuration originally comes from an older OpenPnP version, you might not yet have the new stock fiducial vision enabled. If this is the case, the following will let you try the new visions settings. They can then be made the standard if you're satisfied.

  1. Make sure to have View / Selections in Tables / Linked enabled.

  2. In the Placements table, select the fiducial in question:

    image

  3. Go to the Parts tab, the fiducial part should be selected, and then in the drop-down, select the Stock Fiducial Vision Settings:

    image

  4. Go to the Fiducial Vision Settings detail tab and press the Specialize for ... button. This way we're any tweaking will be private to that part:

    image

  5. Then press Pipeline Edit and note the presence of the DetectCircularSymmetry stage that indicates this is the modern stock pipeline:

    image

  6. For troubleshooting, you can enable the "deb0" and "deb1" stages (see in the screenshot above). The vision process will then write debug images to the disk. See where to find them.

  7. Go on to configure and test the Fiducial Locator as shown in the next sections.

  8. Once you're satisfied, you can make it the standard. Use the analog procedure as described for Bottom Vision, here.

Fiducial Vision Settings

Assigning Fiducial Vision Settings

The Fiducial Vision Settings can be assigned to parts and packages. Use the drop-down in the table view:

image

There is the default assigned in Machine Setup / Vision / Fiducial Locator:

image

If a part or package has no setting assigned, it will inherit it from the more general level, a part inherits from its package, a package inherits from the default.

To unassign a setting from a part or package, just select the empty entry from the drop-down. It will then inherit its settings from the more general level.

For further information about this inheritance principle, please watch the (rather old) intro video.

Configuration

image

General

Name of the vision settings.

Assigned to tells you which parts, packages, etc. have this particular Fiducial Vision Settings assigned. Always be aware that any changes you apply to these settings, affect all the parts and packages that have the same settings assigned, or inherited.

Specialize for ... copies the current vision settings and assigns them to the part, package. So any changes you make will only affect this one part or package (in the latter case it might be inherited by parts with that package).

If Generalize is pressed on a package, then the specialized vision settings will be unassigned, and they will now inherit our settings.

If Generalize pressed on the Machine Setup / Vision / Fiducial Locator then the specialized vision settings on all the packages and parts will be unassigned. OpenPnP will ask you to confirm this.

Reset to Default will overwrite the vision settings to the default as set on Machine Setup / Vision / Fiducial Locator.

Enabled allows these vision settings to be used in operation.

Pipeline Edit allows you to edit the specific pipeline.

Pipeline Reset resets the pipeline to the stock vision pipeline.

The green Copy and Paste buttons, allow you to transfer pipelines from settings to settings, or to share them in the community.

Fiducial Locator

The Max. Vision Passes determines how many times the Fiducial Locator will try to improve the fiducial detection, iteratively centering-in on the detected fiducial. See the Operating Principle.

The Max. Linear Offset determines the acceptable residual offset for the fiducial detection. If the residual offset is smaller, then the iteration is stopped early.

When the Parallax Diameter is given, the Fiduial Locator will automatically switch to the parallax mode and perform its detection from two parallax camera view-points on both sides of the expected location of the fiducial. The distance between the two is set by the Parallax Diameter.

If you are aiming for the LEDs of a LED ring, use about half the diameter of the ring (where the LEDs are mounted). Why not the full diameter? Assuming camera and LEDs are at about the same height, the light bounces back on the fiducial in the middle of the distance:

parallax-led-ring

The Parallax Angle determines the angle at which the opposite view-points are spaced from each other. Choose an angle which favors the faster axis of your machine: 0° favors X, 90° favors Y.

Other angles might be used to aim for a specific pair of LEDs of a LED ring reflection, i.e., where the reflection is brightest and most symmetrical around the spot:

Angled Parallax

You can jog-rotate the cross-hairs to measure the angle.

parallax-animation-angled

Testing the Fiducial Locator

Move the camera crosshairs near a fiducial and use the Test Fiducial Locator button to test the detection and iterative centering.

Clone this wiki locally