Java Runtime Exception

80 views
Skip to first unread message

Nom Dinet

unread,
May 22, 2021, 5:37:39 AM5/22/21
to OpenPnP
Dear All,

When trying to edit Nozzle Tip pipeline the following error is thrown:


2021-05-22 19:31:50.813 Scripting TRACE: Scripting.on Camera.BeforeSettle
2021-05-22 19:31:50.815 Scripting TRACE: Scripting.on found Camera.BeforeSettle.js
2021-05-22 19:31:50.856 CvPipeline DEBUG: Stage "0" throws java.lang.RuntimeException: java.lang.Exception: Actuator UpCamLights must not coordinate with machine when actuated outside machine task.
2021-05-22 19:31:50.865 CvPipeline DEBUG: Stage "5" throws java.lang.RuntimeException: java.lang.Exception: Actuator UpCamLights must not coordinate with machine when actuated outside machine task.
2021-05-22 19:31:50.866 MessageBoxes DEBUG: Error: java.lang.RuntimeException: java.lang.Exception: Actuator UpCamLights must not coordinate with machine when actuated outside machine task.

Can I disable the coordination which was recomended by Issues and Solutions or is there another way to avoid this error please?

Regards
Nom

ma...@makr.zone

unread,
May 22, 2021, 8:37:14 AM5/22/21
to ope...@googlegroups.com

Hi Nom

As described here:

https://github.com/openpnp/openpnp/pull/1193

It is normal that exceptions are now thrown from scripts. Exceptions were previously ignored, which could result in bad machine misbehavior, because OpenPnP would get out of sync with the controller.

In your case, this fix now exposed the underlying problem, which is actuator coordination.

First Solution (recommended)

I see you seem to use scripts for lighting. So my first recommendation would be to use the lighting that is now built-in and get rid of the scripts.

It is easy to setup, you can reuse the existing actuator. You can then also switch the lights ON/OFF from a symbol in the camera view:

https://github.com/openpnp/openpnp/wiki/Setup-and-Calibration%3A-Camera-Lighting

The built-in lighting correctly runs the actuation inside a machine task (it opens one shortly, if needed), so coordination works properly.

You can still disable Actuator Coordination, which is actually something I recommend for lighting, because it will enable the light earlier (i.e. when the machine is still moving towards the camera/subject), which helps Camera Settling deal with camera lag, i.e. it will then not mistake a series of early "black" images as settled.

Second Solution (not recommended)

If you want to keep the scripts, you can do one of the following:

  • Do it the same way i.e. use org.openpnp.spi.Machine.executeIfEnabled(Callable<Object>) to execute the actuation in a machine task.
  • Disable Actuator Coordination, again actually recommended.
  • Or as a dirty workaround, somehow catch the exception i.e. make the script behave as before (but may not switch the light and cause problems)

_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/0b993cd8-3495-4ca2-aa33-b52e7ea059c1n%40googlegroups.com.

Nom Dinet

unread,
May 22, 2021, 11:49:38 PM5/22/21
to OpenPnP
Once again thank you Mark for your reply.

I would like to ask why changing the Offsets for the Left Nozzle does it cause the Nozzle Tip in the Right Nozzle to become uncalibrated?  Should this be a separate thread?

Thanks Nom

ma...@makr.zone

unread,
May 23, 2021, 5:01:33 AM5/23/21
to ope...@googlegroups.com

> Should this be a separate thread?

Yes. But I'll answer anyway. :)

> I would like to ask why changing the Offsets for the Left Nozzle does it cause the Nozzle Tip in the Right Nozzle to become uncalibrated?

Calibration is relevant for the combination of nozzle tip and nozzle, i.e. the same nozzle tip can be loaded to any (compatible) nozzle and it can store the calibration for the combination. So theoretically, the nozzle tip could already have calibration stored for the other nozzle as well. It would be a matter of what is configured for automatic recalibration, whether this (now invalid) calibration could be reused.

https://github.com/openpnp/openpnp/wiki/Nozzle-Tip-Calibration-Setup#automatic-recalibration

OpenPnP would have to surgically remove just the needed nozzle/nozzle tip combinations. That's way too complicated. Instead it simply resets all nozzle tip/nozzle combination calibrations. Furthermore, I think the same method is used to invalidate for other invalidating reasons, like changing the bottom camera position, so this is one central routine simply resetting everything.

This is something you will hopefully not do many times on a machine, so I think it is an acceptable simplification :-)

_Mark

Reply all
Reply to author
Forward
0 new messages