Thank for testing this.
Re 1)
Only if you fundamentally change the machine in terms of the
camera, its mounting point, the lens. For slight changes, it would
probably suffice to redo the advanced calibration. For larger
changes, like changing the camera model, video mode, mount point,
exchanging the lens (different focal length) etc. it's probably
easier to just re-open all the issues back to the preliminary
camera calibration. But then also re-open steps in between, like
the precision nozzle offset etc. as they are dependent.
Note: if you fundamentally change the camera X/Y mounting point,
you might lose all the coordinates you captured (feeders, nozzle
tip changer etc.). These can in theory be safeguarded, by
carefully re-referencing everything to the homing fiducial (if you
had one), but how to achieve this, is beyond this description.
Re 2)
The secondary fiducial can shift, because the Advanced Camera Calibration corrects the tilt of the camera, which means that the center of the camera view is shifted so it looks down on the machine precisely perpendicular to the machine X/Y-plane. This means that all future X/Y coordinates captured with that camera will be accurate at any Z height. But this was not yet the case when the camera was only preliminary calibrated, therefore the secondary fiducial was captured when the camera view still had the tilt, so it may appear shifted once the tilt is corrected.
However, as the primary fiducial must be at the default Z
height, it should not shift. Instead, the center shift brought in
by correcting the tilt should be compensated by a
dynamic head offset applied to the camera (i.e they should cancel
each other out).
To illustrate with the image below: The tilt shift changes the
camera view center from the raw pixel center (red ray) to the
perpendicular (blue ray). The raw camera view (black outline) is
shifted, rectified with X/Y, and cropped (green rectangle). To
compensate for the tilt shift (green arrow), camera head-offsets
are applied internally. But at a higher Z (secondary fiducial) the
head offsets are too much, therefore the raw-captured secondary
fiducial appears slightly shifted. Obviously, no such thing will
ever happen with locations captured after the advanced
calibration (i.e. those captured with the blue-line).

If you see the primary fiducial shifted, this might be a bug, then please provide more info.
Note: the fiducial coordinates are not that important. As long as
the fiducial vision still finds them, they're OK. It is also OK to
have a removable, hand-mounted calibration rig, that might shift a
bit. The fiducials are always re-calibrated before they are used
inside any subsequent calibration routines.
However, the example also shows that it is important to apply the
Advanced Camera Calibration before camera-capturing
important locations at Z coordinates different than default Z /
PCB surface Z.
_Mark
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/cdd4ff8c-19c5-4963-8e94-c197ef742f69n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/ea6a6eef-cc3c-43e8-b31e-e8a94948bef2n%40googlegroups.com.
> It doesn't work the same after advanced calibration.
Physically, yes that's true. The tilt shift is applied.
Optically, in the camera view cross-hairs, this should not be the
case. They should pinpoint the same spot as before, assuming
that spot is at default Z, i.e. the same Z as the primary
calibration fiducial and (typically) PCB surface Z.
Please report whether your homing fiducial is at default Z.
If this is the case and if I understand your description
correctly, this would point to a bug in the Advanced Camera
Calibration and/or my invocation of it in Issues & Solutions.
> I also have a question/comment about Z parking.
I will investigate if this has changed.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CABRkqyD2Z2pdC3jKRHG%3Dvpj0G9g2SeiCUebW7CA6YM%3DwVzMB_Q%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/c1714302-8a22-1699-38b0-fb817191c2d5%40makr.zone.
About the Z parking:
I've looked it up, the Park Z button never moved other tools to
Safe Z. Only the selected tool.
However, due to the rather new Auto tool select option
and the urge to enable this option for use with virtual camera Z
axes and 3D units per pixel, this might still become more of a
problem, now.
https://github.com/openpnp/openpnp/wiki/3D-Units-per-Pixel
Therefore, I added a new option on the Machine, where you can enable the safer behavior:

https://github.com/openpnp/openpnp/pull/1355
Available in the testing version (wait a few minutes for it to be deployed).
https://openpnp.org/test-downloads/
@Jim, please test, if possible,
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/c1714302-8a22-1699-38b0-fb817191c2d5%40makr.zone.
About the Advanced Camera Calibration:
I'm afraid I have to defer to @TonyLuken
to find the issue.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CABRkqyBd3h9eJbFCg73LaVRqT0x%2BbwXbBVnMsNkCfhRbL_PD%2Bg%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/63fa00d3-2ddc-4498-9d76-11798dbbc3e5n%40googlegroups.com.
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/_BqWBSMAdt8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/b58c48e1-7868-459d-893e-ccd234b2c8b7n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/3e640b7c-5608-24a9-dd78-939b7b6100b4%40makr.zone.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/beb7fca5-0176-4932-a8fc-62a40686886dn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/beb7fca5-0176-4932-a8fc-62a40686886dn%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/cb2042d9-1ad2-497b-92ef-dd0a8c5c8fe4n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/cb2042d9-1ad2-497b-92ef-dd0a8c5c8fe4n%40googlegroups.com.
Anyone experiencing disabled “Accept” buttons in the last test version inside I&S…?
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/3c1339df-d8b2-4a72-add8-f55c0964a428n%40googlegroups.com.

Sorry, I never had that issue. Tony would be the expert on that.
Best, Jim
From: ope...@googlegroups.com <ope...@googlegroups.com> On Behalf Of fxframes
Sent: Monday, January 03, 2022 4:25 PM
To: OpenPnP <ope...@googlegroups.com>
Subject: Re: [OpenPnP] questions about the new camera calibrations in Issues/Solutions

To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7c6a5235-2e3b-4706-a207-0225de15aebdn%40googlegroups.com.
Hi, Tony. I can’t do that until tomorrow, sorry. I have left work.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7a8132f3-bf14-47ec-9ee0-6dce745e14c3n%40googlegroups.com.
Hi Jim,
I re-checked the source code and ran a test and I can almost
certainly exclude such a behavior. The code is simple and was
properly pushed too:
> re-built
Am I right to assume you run from git?
Are sure everything got properly merged, and you are truly on the test branch?
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CABRkqyDFUfZhcTi-XO879M7TK0vk2iAme%3D7O4mK-Srs9FJ0Y8g%40mail.gmail.com.
Hi fxframes,
Is this reproducible?
I checked the source code. The only way this can happen should be
when you select multiple lines in the issues list, but your
screenshot does not look that way.
If you press Find Issues & Solutions again and then
click on that single line again, does it remain?
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7c6a5235-2e3b-4706-a207-0225de15aebdn%40googlegroups.com.
Also send the log, maybe there's a hidden exception.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/30a060c6-f4c5-593d-99e0-922d6c4a13c2%40makr.zone.

Hi fxframes
Remember, when you did the preliminary calibration, you had to adjust the fiducial diameter. And it seemed to have worked then, right?
Have you since
If in doubt, re-open all the calibrations steps back to the
preliminary primary fiducial camera calibration. Enable Include
Solved, select issues, and press Reopen.

Then redo them in order.
_Mark
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/cdff2743-0a6e-41d6-89c2-8d869a442bc3n%40googlegroups.com.
That’s what I did before testing the new camera calibrations because it asked for the original primary and secondary fiducial setup which was done a while ago and I wasn’t sure, so I decided to redo everything. I’ll try once again.
> No, No.
> I wasn’t sure, so I decided to redo everything. I’ll try once again.
Wait. In that case, no!
Can you screen-record another attempt at Advanced Camera Calibration?
_Mark
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/8C7E39D5-9F4E-4E76-8A67-3F442D3D5B6E%40gmail.com.
Videos are often sooo good for diagnosis. 😉
There seems to be no camera settling taking place. And sure enough, if I look at a log you posted a while back:
2022-01-04 13:15:07.658 Scripting TRACE:
Scripting.on Camera.BeforeCapture
2022-01-04 13:15:07.667 Scripting TRACE: Scripting.on
Camera.AfterCapture
You have a mere 9ms settling time. No reasonable camera is that
fast, no reasonable DIY machine that stiff .
https://github.com/openpnp/openpnp/wiki/Camera-Settling
_Mark
Here it is. Thanks for looking into this.

--
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/_BqWBSMAdt8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/78d32759-adf5-d9b4-bd56-f78bcef87f17%40makr.zone.
> But my camera settling time is actually set at 300 ms. 🤔
WT...
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/A66226D6-6ED7-4645-B4E3-42334CE84E15%40gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7a8132f3-bf14-47ec-9ee0-6dce745e14c3n%40googlegroups.com.
On 4 Jan 2022, at 15:11, mark maker <ma...@makr.zone> wrote:
> But my camera settling time is actually set at 300 ms. 🤔
WT...
On 04.01.22 16:05, fxframes wrote:
Indeed. 🙂But my camera settling time is actually set at 300 ms. 🤔I’ll try to go through the camera settling procedure/diagnostics anyway.
<Screenshot%202022-01-04%20at%2015.01.46.png>
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/7b9420e3-c6f1-0f67-b9a1-2cb3b25c939e%40makr.zone.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/817865f1-aaec-43b7-ad87-78a42166e711n%40googlegroups.com.
Hi Tony,
Good analysis. Shame on me, I was always testing with Visual
Homing set to the modern ResetToFiducialLocation, now that
you mention it, I guess there is a bug when you use ResetToHomeLocation
which is only used for backwards compatibility with legacy machine
configurations.
https://github.com/openpnp/openpnp/wiki/Visual-Homing
@Jim, am I right you are using ResetToHomeLocation?
I guess it should account for the head offsets here:
Note, this is arguably not a new bug, if my reasoning is
correct, it should always have done that, including way back when
this was still a part of GcodeDriver (from where I took it). The
reason this only pops up now is that there were
traditionally no head offsets for the top camera. Now there are.
I'll fix this.
@Tony, do you agree that the code
for ResetToFiducialLocation
looks good? The head offsets are
accounted for in
toHeadLocation().
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/817865f1-aaec-43b7-ad87-78a42166e711n%40googlegroups.com.
I originally saw this “feature” using my own script, which had been working for several years by now. I am attaching it.
I also saw the same behavior with the ResetToHomeLocation button.
From: ope...@googlegroups.com <ope...@googlegroups.com> On Behalf Of mark maker
Sent: Tuesday, January 04, 2022 1:36 PM
To: ope...@googlegroups.com
Subject: Re: [OpenPnP] questions about the new camera calibrations in Issues/Solutions
Hi Tony,
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/46c1f3e8-2ca4-a4f7-85ca-e7a663e9611e%40makr.zone.
> I originally saw this “feature” using my own script, which had been working for several years by now. I am attaching it.
> I also saw the same behavior with the ResetToHomeLocation button.Sorry, I don't understand what you mean. Do you use Visual Homing? If yes, with ResetToHomeLocation or ResetToFiducialLocation?
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/020301d801a3%24d7fdef70%2487f9ce50%24%40gmail.com.
Also, I observed the same behavior when I hit the red “go to home location button” in the configuration tab.
From: ope...@googlegroups.com <ope...@googlegroups.com> On Behalf Of mark maker
Sent: Tuesday, January 04, 2022 1:36 PM
To: ope...@googlegroups.com
Subject: Re: [OpenPnP] questions about the new camera calibrations in Issues/Solutions
Hi Tony,
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/46c1f3e8-2ca4-a4f7-85ca-e7a663e9611e%40makr.zone.
Hi, Tony. Does this mean I have a problem in my machine.xml file?
Best, Jim
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/a7c64f57-36dd-4ca2-bdc2-a7baffa4ff27n%40googlegroups.com.
No, you found a bug with that legacy option: ResetToHomeLocation,
thanks for reporting it!
👍
https://github.com/openpnp/openpnp/wiki/Visual-Homing#setting-up-visual-homing
https://github.com/openpnp/openpnp/wiki/Visual-Homing#method-for-old-machines
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/022301d801a9%24499a2810%24dcce7830%24%40gmail.com.
Hi Jim,
There is a new testing version of OpenPnP 2.0 available. You are in a unique position to really physically test it. Please help! 😁
https://openpnp.org/test-downloads/
See the PR:
https://github.com/openpnp/openpnp/pull/1356
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/133d50cb-b410-2ef7-e22a-938cc4c81823%40makr.zone.
No problem. I am actually REALLY glad to be of any help! I ask so many questions and you develop so many great features! I will do it in the morning, I have already left work.
Best, Jim
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/64e3dbe1-ce43-5dbf-27a3-bacf34fbae5d%40makr.zone.



To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/64e3dbe1-ce43-5dbf-27a3-bacf34fbae5d%40makr.zone.
Nice, thanks!
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/CABRkqyAP6F57Xf3K4VCoLDoW7pVF1TqLGz5bURBJ9UZt%3DbTJ7w%40mail.gmail.com.
> the head is trying to move beyond the X Axis soft limit when homing and it's hitting the limit switch
Yes, if the camera tilt was unfortunate and the homing fiducial
very close to the electro-mechanical homing position, this can
happen. I know this was the standard way to do it, before the ResetToHomingLocation
method was introduced, which advocates a more central homing
fiducial position (and obviously the machine explicitly moving
towards it, before visually homing):
https://github.com/openpnp/openpnp/wiki/Visual-Homing#mounting-a-fiducial
> Also maybe let people know that if you have a diffuser on your uploading camera this procedure will wreck it. =)
A better warning is in the pipeline.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/4996a028-fb91-41a8-a57d-ebd922bc2af6n%40googlegroups.com.
> It just occurred to me - what good is having a diffuser mounted higher than the level where you are going to be doing part bottom vision? Doesn't the diffuser need to be lower than the bottom of the part?
I was aware that we must assume that cameras are sunken beneath
tables, perhaps in some kind of shaft, so the focal plane is
aligned with the table/PCB surface. The focal plane may be
slightly beneath the table, i.e. we could bump into walls of said
shaft. I wasn't thinking of a diffuser, though, I can't think of
why a diffuser would be higher up than the part it is supposed to
light.
However, I was always also working under the assumption that the
bare nozzle tip (and we recommend to use the finest!) is free to
move over the whole camera view. Only when a large tip and/or part
is loaded, must one be more prudent, as the part could bump into
walls on the side.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/1fe26abd-c73e-41fb-ac38-753ba06c65adn%40googlegroups.com.

Hi fxframes,
This is a procedure to "migrate" to the new ResetToFiducialLocation
method, without losing any coordinates you already
captured. I write this for you and other users with a
similar config.
Report back if it works.
I've also added it to the Wiki:
https://github.com/openpnp/openpnp/wiki/Visual-Homing#migrate-to-new-resettofiduciallocation-method
_Mark
--
You received this message because you are subscribed to the Google Groups "OpenPnP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/e74b5422-ec91-4779-9378-9420c9b7882en%40googlegroups.com.
> I already had ResetToFiducialLocation active before all of this. Will #15 still work?
Wait: are you saying that you already had a ResetToFiducialLocation configuration before?
If yes:
Then it is really simple. Just leave out step 9 and stop after
step 13. You are guaranteed to not need steps 14. - 18.
If no:
The important thing is that you have not physically
changed the old fiducial and not changed the fiducial
coordinates in OpenPnP (otherwise restore them from old config).
You can then switch back to ResetToHomingLocation and
proceed with the procedure.
_Mark
Thanks so much Mark, this is very thoughtful.One question though before I proceed: I already had ResetToFiducialLocation active before all of this. Will #15 still work?
On Thursday, January 6, 2022 at 9:37:08 AM UTC ma...@makr.zone wrote:
Hi fxframes,
This is a procedure to "migrate" to the new ResetToFiducialLocation method, without losing any coordinates you already captured. I write this for you and other users with a similar config.
- This works easily, if your fiducial was very near the (electro-mechanical) homing coordinates. Otherwise see 14-17.
- This is delicate: proceed with care and to the dot!
- Leave your existing old homing fiducial physically intact (important!).
- Mount a new fiducial in a more central location, both in X and Y (as described in the Wiki).
- Start OpenPnP fresh.
- (for fxframes's case only) Switch off the Advanced Camera Calibration. This will remove the tilt shift and make Visual Homing work again, temporarily.
- Perform a full machine homing. Make sure the visual homing was successful and your old homing fiducial is perfectly in the cross-hairs, when you move to the home location (your script).
- While the machine is still homed that way, do the following steps (don't interrupt this!)
- Set Homing Method on the head to ResetToFiducialLocation, press Apply.
- Jog to the new homing fiducial, press Visual Test to center the camera perfectly.
- Capture the new Homing Fiducial fiducial location using the usual blue camera button. Press Apply.
- (for fxframes's case only) Switch on the Advanced Camera Calibration again.
- Test a full machine homing. It should now use the new fiducial and the modern ResetToFiducialLocation method. If it works, you're done.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/820e8d6b-a7f0-4358-ad83-eb1382a6c657n%40googlegroups.com.
> Then it is really simple. Just leave out step 9 and stop after step 13. You are guaranteed to not need steps 14. - 18.
You received this message because you are subscribed to a topic in the Google Groups "OpenPnP" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/openpnp/_BqWBSMAdt8/unsubscribe.
To unsubscribe from this group and all its topics, send an email to openpnp+u...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/9962c43e-78ca-dc9a-854d-63baeb792344%40makr.zone.

If you have the fiducial at a new position, you'll lose all captured locations so far, but you knew that (quoting "I know. 🙄"):
Then temporarily switch off any visual homing, set Homing
Method to None.
Then re-home the machine. It should now only do the electro-mechanical homing.
Then proceed as with a new machine:
https://github.com/openpnp/openpnp/wiki/Visual-Homing#method-for-new-machines
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/9c664f45-67c7-4f81-b22e-7b3c3e075c6an%40googlegroups.com.
> I've got a bit confused though about what we are calling
the 'primary' and 'visual homing' fiducials. Is there any
reason why these can't be one and the same?
They can be the same. Your setup sounds good.
I assume you read these directions too, regarding the free to move area around it?
https://github.com/openpnp/openpnp/wiki/Vision-Solutions#calibration-steps
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/17efc85c-148e-4890-a5a8-16974e390e76n%40googlegroups.com.
> So as long as you can jog the camera far enough that you can view the homing fiducial in all four corners of the camera's image without running into an axis limit, you can use it as the primary calibration fiducial as well.
There should be more freedom of motion for the axis backlash
calibration. ~125mm on each side, ideally.
_Mark
To view this discussion on the web visit https://groups.google.com/d/msgid/openpnp/4128de0a-8cd4-411f-8615-f20653407f38n%40googlegroups.com.