Nozzle calibration is causing crashes on nozzle tip unload

76 views
Skip to first unread message

Chris

unread,
Mar 12, 2026, 5:36:15 PMMar 12
to OpenPnP
New to openPnP, and I can't figure this out. 

I have setup my nozzle station using the standard 4 position routine. It's a simple station with no extra actuators, just slide the nozzle tip under a "U" shape in a plate and pull the head off it. I'm using CP45 nozzle tips. When I run through the positions manually the nozzles load and unload perfectly. However, when I try to use the automated load/load commands it crashes on unload. What appears to be happening is that the calibration offset is being applied to the nozzle station locations, which causes it to crash. For example, if my Y location for a specific nozzle station is -229.574, and then the calibration finds that the nozzle center is offset in Y by 0.6mm, when it unloads it moves instead to -230.174, which is not aligned to the station, and crashes the tip.

I cannot figure out how to change this behavior. I would not expect the calibration to override the location of the nozzle station, and it is making auto load/unload completely unusable. 

I'd love any guidance on what settings I'm missing. I'm on version 2.6_2026-03-01_12-37-59.5bd404c Thank you. 

Chris

unread,
Mar 17, 2026, 4:37:44 PMMar 17
to OpenPnP
copy/paste of my reply in the github issue report:
Video makes this much easier to see. I printed a dummy nozzle tip that has an exaggerated 2mm runout. Before calibration the unload lines up with my dummy nozzle station. After calibration, the unload is misaligned to the station by the runout. I purposely installed the tip with as much of the runout in the Y axis as I could. On a real nozzle this means the machine will crash when unloading. Nozzles with very small runout get away with it because the runout is less than the tolerance in the nozzle station. But it still shouldn't happen.
https://youtu.be/7tRSpvzrmds

Chris

unread,
Mar 19, 2026, 3:22:19 PMMar 19
to OpenPnP
I wrote a script that solves this and doesn't require altering the openpnp software, however, I STRONGLY believe the behavior needs to be corrected in the actual code, because it doesn't make sense the way it's working right now. 


in the scripting/events folder, create a script called NozzleTip.BeforeUnload.py


print("BeforeUnload: Script started for nozzle={} tip={}".format(nozzle.name, nozzleTip.name))
try:
    cal = nozzleTip.calibration
    print("BeforeUnload: cal={}  isCalibrated={}".format(cal, cal.isCalibrated(nozzle)))
    # Try reset(nozzle) first, fall back to reset() with no args
    try:
        cal.reset(nozzle)
        print("BeforeUnload: cal.reset(nozzle) succeeded")
    except TypeError:
        cal.reset()
        print("BeforeUnload: cal.reset() (no args) succeeded")
    print("BeforeUnload: isCalibrated after reset: {}".format(cal.isCalibrated(nozzle)))
    print("BeforeUnload: offset after reset: {}".format(cal.getCalibratedOffset(nozzle, 0.0)))
except Exception as e:
    print("NozzleTip.BeforeUnload error: {}".format(str(e)))







There's a lot of extra prints in there, I was figuring out how the scripting works while I wrote this, and you don't need them all if you're not watching the logs. But this script runs automatically at nozzle unload and resets all the calibration offsets so the machine unloads at the raw tool changer positions, just like it does when it loads the tip. 


The minimal version would be:

try:
    cal = nozzleTip.calibration
    # Try reset(nozzle) first, fall back to reset() with no args
    try:
        cal.reset(nozzle)
    except TypeError:
        cal.reset()
except Exception as e:
    print("NozzleTip.BeforeUnload error: {}".format(str(e)))


Reply all
Reply to author
Forward
0 new messages