Freeze on performing Nozzle Tip Calibration

77 views
Skip to first unread message

Nikolay Alekseev

unread,
Jul 21, 2025, 2:26:26 PM7/21/25
to OpenPnP
I built my machine and set up the software using the Setup and Calibration guide. Everything was going well until I started calibrating the nozzle tips.
The default pipeline couldn't detect the circle because the maxDistance parameter is set to -1 by pipeline caller and couldn't be changed.
I added a new DetectCircularSymmetry pipeline element, specified this parameter and everything worked when I tested the pipeline.
After saving the pipeline and trying to calibrate the nozzle tip, the nozzle rotates and the first photo is taken. I see the circle detection on the screen but after that the interface practically freezes for about 8 minutes. After that I get an exception "std::exception: bad allocation" and the calibration is suspended. The interface works again and I get some logs:

2025-07-21 18:59:13.192 AbstractHeadMountable DEBUG: N1.moveTo((337.740000, 209.200000, 0.000000, -180.000000 mm), 1.0)
2025-07-21 18:59:13.196 ReferenceNozzleTipCalibration DEBUG: [nozzleTipCalibration]starting measurement; angleStart: -180.0, angleStop: 180.0, angleIncrement: 60.0, angleSubdivisions: 5
2025-07-21 18:59:13.197 ReferenceNozzleTipCalibration DEBUG: [nozzleTipCalibration]i: 0, measureAngle: -180.0
2025-07-21 18:59:13.197 AbstractHeadMountable DEBUG: N1.moveTo((337.740000, 209.200000, 0.000000, -180.000000 mm), 1.0)
2025-07-21 18:59:13.201 ReferenceActuator DEBUG: HeadCameraLight.actuate(false)
2025-07-21 18:59:13.202 GcodeDriver DEBUG: [HeadGcodeDriver:COM5] >> M3S0 ;, 20000
2025-07-21 18:59:13.207 GcodeDriver$ReaderThread TRACE: [HeadGcodeDriver:COM5] << ok
2025-07-21 18:59:13.208 GcodeDriver TRACE: Position report: ok
2025-07-21 18:59:13.208 GcodeDriver TRACE: [HeadGcodeDriver:COM5] confirmed M3S0 ;
2025-07-21 18:59:13.209 Scripting TRACE: Scripting.on Camera.BeforeSettle
2025-07-21 18:59:13.210 AbstractSettlingCamera TRACE: TableCamera settling fixed time 3000ms
2025-07-21 18:59:16.213 Scripting TRACE: Scripting.on Camera.BeforeCapture
2025-07-21 18:59:16.241 Scripting TRACE: Scripting.on Camera.AfterCapture
2025-07-21 18:59:16.242 Scripting TRACE: Scripting.on Camera.AfterSettle
2025-07-21 19:07:44.879 AbstractHeadMountable DEBUG: N1.moveTo((337.740000, 209.200000, 0.000000, 180.000000 mm), 1.0)
2025-07-21 19:07:45.044 GcodeDriver DEBUG: [HeadGcodeDriver:COM5] >> G1   A180.0000    F20000 ; move to target, 20000
2025-07-21 19:07:45.069 GcodeDriver$ReaderThread TRACE: [HeadGcodeDriver:COM5] << ok
2025-07-21 19:07:45.073 GcodeDriver TRACE: Position report: ok
2025-07-21 19:07:45.073 GcodeDriver TRACE: [HeadGcodeDriver:COM5] confirmed G1   A180.0000    F20000 ; move to target
2025-07-21 19:07:45.080 GcodeDriver DEBUG: [HeadGcodeDriver:COM5] >> G4 P0 ; Wait for moves to complete before returning, 20000
2025-07-21 19:07:46.491 GcodeDriver$ReaderThread TRACE: [HeadGcodeDriver:COM5] << ok
2025-07-21 19:07:46.491 GcodeDriver TRACE: Position report: ok
2025-07-21 19:07:46.491 GcodeDriver TRACE: [HeadGcodeDriver:COM5] confirmed G4 P0 ; Wait for moves to complete before returning
2025-07-21 19:07:46.497 AbstractHeadMountable DEBUG: N1.moveToSafeZ(1.0)
2025-07-21 19:07:46.497 AbstractMachine TRACE: Exception caught, executing pending motion: java.lang.Exception: std::exception: bad allocation
at org.opencv.imgproc.Imgproc.GaussianBlur_2(Native Method)
at org.opencv.imgproc.Imgproc.GaussianBlur(Imgproc.java:1109)
at org.openpnp.machine.reference.ReferenceNozzleTipCalibration.addBackgroundImage(ReferenceNozzleTipCalibration.java:1026)
at org.openpnp.machine.reference.ReferenceNozzleTipCalibration.findCircle(ReferenceNozzleTipCalibration.java:990)
at org.openpnp.machine.reference.ReferenceNozzleTipCalibration.calibrate(ReferenceNozzleTipCalibration.java:762)
at org.openpnp.machine.reference.ReferenceNozzleTipCalibration.calibrate(ReferenceNozzleTipCalibration.java:883)
at org.openpnp.machine.reference.wizards.ReferenceNozzleTipCalibrationWizard.lambda$calibrate$4(ReferenceNozzleTipCalibrationWizard.java:669)
at org.openpnp.util.UiUtils.lambda$submitUiMachineTask$0(UiUtils.java:69)
at org.openpnp.spi.base.AbstractMachine$1.call(AbstractMachine.java:575)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:317)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
at java.base/java.lang.Thread.run(Thread.java:1575)
2025-07-21 19:07:46.555 AbstractMachine TRACE: Machine entering idle state.
2025-07-21 19:07:46.715 MessageBoxes DEBUG: Error: java.lang.Exception: std::exception: bad allocation


Apparently I'm missing something. But I'm not strong in Java and this is the first time I set up a machine.
2025-07-21 200702.png
2025-07-21 192159.png

tonyl...@gmail.com

unread,
Jul 21, 2025, 3:53:17 PM7/21/25
to OpenPnP
Please post your machine.xml file.  There could be a number of issues: Have you calibrated your bottom camera? Have you set the Vision Diameter for the nozzle tip? 

Nikolay Alekseev

unread,
Jul 21, 2025, 4:08:56 PM7/21/25
to OpenPnP
Thank you for reply! machine.xml attached.
machine.xml

tonyl...@gmail.com

unread,
Jul 21, 2025, 4:58:30 PM7/21/25
to OpenPnP
Yeah, you have at least both problems I mentioned. You need to calibrate your bottom camera units per pixel, and you need to set the Vision Diameter on each of your nozzle tips. Are you using Issues and Solutions? It should guide you through those steps.

Nikolay Alekseev

unread,
Jul 22, 2025, 9:36:12 AM7/22/25
to OpenPnP
Thank you! The pixel per millimeter parameter was indeed missing despite the fact that I calibrated it. Apparently I misclicked something. Now everything works.
Reply all
Reply to author
Forward
0 new messages