Homing Fiducial

Setting up the datum board and testing the homing fiducial

Now that fisheye calibration is complete, we can set up the datum board. The datum board is a reference point for everything else you’ll do with the machine. The center dot of the datum board will be the most important calibration point for the machine. It’ll be used to fine-tune the LumenPnP’s XY position after homing to account for any errors in the limit switches.

  1. In the “Machine Controls” pane in the lower left, connect to the LumenPnP if you haven’t already by pressing the power button.
  2. Run a rough home routine by pressing the Home button (shaped like a house). The machine will move to the X, Y, and Z zero positions. The default machine configuration files are set so that OpenPnP will not try to use the homing fiducial yet. Note that the home icon will turn yellow, as the LumenPnP has homed to it’s end stops, but hasn’t completed its full homing routine.
    Connect to the LumenPnP and attempt to home it

Tuning the Homing Fiducial

  1. Click on the Machine Setup tab in the top right pane.

    Selecting the Machine setup tab from the main screen

  2. Click on the “Expand” checkbox to open all of the features about your machine.

    Expanding the Machine Config options

  3. Under Heads, click on ReferenceHead H1

    Reviewing the ReferenceHead options

  4. In the bottom right details pane, you’ll be looking at the Configuration Tab. Change the Homing Method to ResetToFiducialLocation. This will set OpenPnP to use the top camera to look for the homing fiducial to more precisely home the XY gantry, instead of only using the limit switches.

    Switch to using the homing fiducial

  5. Click Apply to save this change.

    Save the homing technique

  6. Click on the “Position Camera over location” icon button show below. This will move the top camera to approximately where your datum board is mounted.

    Position top camera over homing fiducial

  7. In the bottom left Machine Controls pane, Select the Actuators tab.

    Switch to the Actuators Tab

  8. Toggle on the LED ring lights by pressing the LED button.

    Turn on the LEDs

  9. If the fiducial board is not in focus, rotate the Top Camera lens until the board is sharply in focus.

    Turn on the LEDs

  1. Go back to the Jog tab in the “Machine Controls” pane.
    Switch to the jog tab
  2. Set the Distance slider to 0.1 for more precise movements.
    Make the jog controls more precise
  3. Manually jog the head so that the reticle in the center of the Top Camera feed in your top camera view is perfectly centered on the Homing Fiducial in the center of the Opulo logo.
    Center the homing fiducial in the camera view

Check Camera Exposure

Set the exposure for the top camera so that we’re seeing the homing fiducial clearly and sharply.

  1. Navigate to the Machine Setup tab

    Selecting the Machine setup tab from the main screen

  2. Click the “Expand” checkbox if necessary

    Expanding the Machine Config options

  3. Navigate to Heads > ReferenceHead H1 > Cameras > OpenPnPCaptureCamera Top

    Finding the Top Camera Settings

  4. In the lower detail pane, switch to the Device Settings tab

    Switching to the camera device settings

  5. Scroll down if necessary to the Properties list of adjustments for the camera image.

    Top camera properties

  6. The goal here is to make the center fiducial look bright and sharp, and have the surrounding soldermask look dark. In most cases you can simply check the Auto checkbox for Exposure, then uncheck it to save the automatically set value, and this does a good job of making the image look how you want. Note that this may not work in all situations, so you may need to manually adjust the image settings to get a clear image, where the Homing Fiducial is clearly distinguished against the background of the datum board.

    Top camera properly exposed with the auto-exposure turned on

Apply Homing Fiducial Changes

  1. Double-check that:

    1. The Homing Fiducial is in the center of the reticle in the camera feed
    2. The camera image is in sharp focus
    3. The camera image is properly exposed
  2. Go back to Machine Setup and select Heads > ReferenceHead H1.

    Return to the homing fiducial location settings

  3. Click on the “Capture Location” icon button to save the location where OpenPnP will start searching for the Homing Fiducial.

    Capture the location of the homing fiducial

  4. Click Apply to save your changes.

    Save homing fiducial location

  5. Click on the “Home” button in the Machine Controls Pane > Jog Tab and watch your machine home using the limit switches, then move the top camera over the homing fiducial and find its exact location.

Troubleshooting: Vision Pipeline Adjustment

  1. If you find that the machine is having a hard time finding the homing fiducial, you might need to edit the Vision Pipeline for it. You can do that by going to the Machine Setup tab, and selecting Fiducial Locator under Vision. Click the Edit button to adjust the computer vision settings.

  2. There is quite a bit to tuning a vision pipeline, and you should take a look at the OpenPnP documentation. But there are a few things you can pretty easily tweak to get up and running. First, let’s check out what the vision pipeline thinks it’s seeing. In the window that just popped up, click on the row with “DrawCircles” in the Stage column. The image will show you every circle detected from the pipeline, as shown below. If there is more than one, or if the one shown is not perfectly hugging the fiducial, there are tweaks to be made. The image below shows a correctly tuned pipeline, with a single circle encircling the fiducial.

  1. The first variable to address is the threshold value. To access these settings, click on the row with “Threshold” under the Stage column. If the threshold is too low, then we won’t be isolating the area around the fiducial enough. A too low of a threshold value will look like the image below:

Raise the value until the fiducial is a clean, solid circle, as shown below:

  1. Next, we can check and see how many circles the pipeline is finding. We want it to only be finding one, and have it hug the fiducial exactly. Click on the row with “DetectCirclesHough” in the Stage column. In the image below, you can see from the list in the bottom right that two circles have been detected. We can solve this by adjusting “param2” and bumping the value up. The lower the value, the more circles are detected. If the diameter of the circles detected is incorrect, adjust the maxDiameter and minDiameter settings.

With a higher value in the “param2” field, we only detect a single circle.

  1. Lastly, you can confirm that the changes result in accurate fiducial detection. Once again click on the row with “DrawCircles” in the Stage column. The image will show you every circle detected from the pipeline. Confirm there is only one, and it is perfectly hugging the fiducial as shown below.
  1. Exit out of the pipeline editing UI, save your changes, and try to home again. With your vision pipeline tuned, the machine should find the homing fiducial on your machine and center the crosshairs of the top camera on it.

  2. It is likely that the machine will move to the wrong place and not be able to identify the homing fiducial. If this happens, OpenPnP will give an error popup that says FIDUCIAL-HOME no matches found. This is normal, as it means you’ll need to fine-tune the location that OpenPnP moves the LumenPnP to in order to find the homing fiducial. You’ll also note that the home icon will turn yellow, as the LumenPnP has homed to the end stops, but hasn’t completed the full homing routine.

    A first attempt at homing the LumenPnP