Nozzle change Homing Z ( or any other axis carring nozzles)

162 views
Skip to first unread message

Mike Menci

unread,
Sep 22, 2023, 6:06:16 PM9/22/23
to OpenPnP
Mark 
Many times my nozzles after change in Tool changer loose position due to steppers loosing steps when placing or taking out nozzles. 
Is it or would it be possible to home only nozzle caring axis after nozzle change before going to camera and nozzle calibration? 
Mike

mark maker

unread,
Sep 23, 2023, 6:06:25 AM9/23/23
to ope...@googlegroups.com

Hi Mike

I really, really think you should fix the step losing. If this is really impossible, then you can follow this conversation to do visual homing in a script.

https://groups.google.com/g/openpnp/c/cZSn8Tmvsm0/m/HqW6WyZfAgAJ

_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/318172b1-e1f0-49e2-b8bb-00b5a6b5258bn%40googlegroups.com.

Mike Menci

unread,
Sep 23, 2023, 7:19:37 AM9/23/23
to OpenPnP
Hello Mark, 
As you know my Qadro Head is very small in size and I am using two Nema14 steppers for my Z & A axis which do not produce a lot of torque, so I am limited here with "Push - pull" force for nozzle change. I no not loose steps in operation and vertical travel + homing works great form me.... 
Scripting - I could add but after Open PnP2 my scripts do not work any more.... 

I had couple of them - see enclosed - can you advice why this is not the case any more with Open PnP 2 ?
I would not mind if I could do homing with script ? 
Thanks
Mike
N1_to_Camera.bsh .png
C__Users_hp_.openpnp1_scripts_Scripts_my.png

Mike Menci

unread,
Sep 24, 2023, 2:57:46 PM9/24/23
to OpenPnP
Hi, 
Can someone correct for me this N1 to Camera.js

nozzlename = "N1";      // Name of your Nozzle
cameraname = "Bottom";  // Name of your BottomVision Camera

print("### Move Nozzle '" + nozzlename + "' to Camara '" + cameraname + "' ###");

2023-09-24 20:50:43.912 GcodeAsyncDriver DEBUG: [Smoothie:COM4] commandQueue offer >> M810
2023-09-24 20:50:43.913 GcodeAsyncDriver$WriterThread TRACE: [Smoothie:COM4] >> M810
2023-09-24 20:50:43.913 GcodeDriver$ReaderThread TRACE: [Smoothie:COM4] << ok
2023-09-24 20:50:43.927 AbstractHeadMountable DEBUG: N1.moveToSafeZ(0.84)
2023-09-24 20:50:43.974 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, NaN, 0.000000 mm), 1.0)
2023-09-24 20:50:43.979 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, -25.000000, 0.000000 mm), 1.0)
2023-09-24 20:50:43.983 Scripting TRACE: Script N1_to_Camera.js executed in 276.019 milliseconds
2023-09-24 20:51:28.010 Scripting TRACE: org.openjdk.nashorn.api.scripting.NashornScriptEngine@2607238b scripting engine borrowed from pool in 0.0382 milliseconds
2023-09-24 20:51:28.014 SystemLogger INFO: ### Move Nozzle 'N1' to Camara 'Bottom' ###

2023-09-24 20:51:28.018 GcodeAsyncDriver DEBUG: [Smoothie:COM4] commandQueue offer >> M810
2023-09-24 20:51:28.018 GcodeAsyncDriver$WriterThread TRACE: [Smoothie:COM4] >> M810
2023-09-24 20:51:28.018 AbstractHeadMountable DEBUG: N1.moveToSafeZ(0.84)
2023-09-24 20:51:28.018 GcodeDriver$ReaderThread TRACE: [Smoothie:COM4] << ok
2023-09-24 20:51:28.018 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, -1.000000, 0.000000 mm), 0.84)
2023-09-24 20:51:28.020 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, NaN, 0.000000 mm), 1.0)
2023-09-24 20:51:28.021 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, -25.000000, 0.000000 mm), 1.0)
2023-09-24 20:51:28.022 Scripting TRACE: Script N1_to_Camera.js executed in 9.0352 milliseconds

Mike Menci

unread,
Sep 24, 2023, 4:23:57 PM9/24/23
to OpenPnP
Only Up Camera light come ON : 
2023-09-24 22:18:37.241 ReferenceMachine INFO: setHomed(true)
2023-09-24 22:18:37.242 AbstractMachine TRACE: Machine entering idle state.
2023-09-24 22:18:44.702 ScriptEngineKeyedPooledObjectFactory TRACE: nashornscripting engine created in 11.7256 milliseconds
2023-09-24 22:18:44.703 Scripting TRACE: org.openjdk.nashorn.api.scripting.NashornScriptEngine@16dc19a7 scripting engine borrowed from pool in 12.0333 milliseconds
2023-09-24 22:18:44.716 SystemLogger INFO: ### Move Nozzle 'N1' to Camara 'Bottom' ###

2023-09-24 22:18:44.729 GcodeAsyncDriver DEBUG: [Smoothie:COM4] commandQueue offer >> M810
2023-09-24 22:18:44.729 GcodeAsyncDriver$WriterThread TRACE: [Smoothie:COM4] >> M810
2023-09-24 22:18:44.730 GcodeDriver$ReaderThread TRACE: [Smoothie:COM4] << ok
2023-09-24 22:18:44.731 AbstractHeadMountable DEBUG: N1.moveToSafeZ(0.84)
2023-09-24 22:18:44.739 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, NaN, 0.000000 mm), 1.0)
2023-09-24 22:18:44.743 AbstractHeadMountable DEBUG: N1.moveTo((139.815000, 18.617000, -25.000000, 0.000000 mm), 1.0)
2023-09-24 22:18:44.744 Scripting TRACE: Script N1_to_Camera.js executed in 39.0778 milliseconds
JavaScript.png

Mike Menci

unread,
Sep 24, 2023, 5:08:22 PM9/24/23
to OpenPnP
Solved - thanks Gents. 
Mike

Jan

unread,
Sep 25, 2023, 3:17:31 PM9/25/23
to ope...@googlegroups.com
Hi Mike!
Interesting nozzle changer design! Can you share some details for your
head? How do you generate the force to pull out the nozzle? Your homing
video suggests that you're using a cam style design.

Jan

On 23.09.2023 13:19, Mike Menci wrote:
> Hello Mark,
> As you know my Qadro Head
> <https://www.youtube.com/watch?v=CbqQ_7yrL24> is very small in size and
>> https://groups.google.com/d/msgid/openpnp/318172b1-e1f0-49e2-b8bb-00b5a6b5258bn%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/318172b1-e1f0-49e2-b8bb-00b5a6b5258bn%40googlegroups.com?utm_medium=email&utm_source=footer>.
>
> --
> 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
> <mailto:openpnp+u...@googlegroups.com>.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/openpnp/111ad0cc-a907-4810-9d4e-20ec8d467dfen%40googlegroups.com <https://groups.google.com/d/msgid/openpnp/111ad0cc-a907-4810-9d4e-20ec8d467dfen%40googlegroups.com?utm_medium=email&utm_source=footer>.

Mike Menci

unread,
Sep 25, 2023, 4:20:37 PM9/25/23
to OpenPnP
Hi - see my GrabCad @ https://grabcad.com/mike.4.friends-1/models
You will find there more details. I use with Juki rubber seals and Cylindrical head opening which is in extension from Nema8 stepper (no Spring & balls like in Peter- head)... 
I.e -Samsung CP40 has rubber seals on head - I placed them on Juki nozzle (in order to avoid large force/stepper Torque needed for replacing nozzles)....   
Anything else - just ask... 

Mike Menci

unread,
Sep 28, 2023, 6:05:33 AM9/28/23
to OpenPnP
I need help with this Z home script; 
script.png
I get error - see enclosed:
Mike

On Saturday, 23 September 2023 at 12:06:25 UTC+2 ma...@makr.zone wrote:
error.png

Mike Menci

unread,
Sep 28, 2023, 8:11:13 AM9/28/23
to OpenPnP
Wrong script!    disregard previous post
see here 
posx = 100.000;   // x-position [mm]
posy = 100.000;   // y-position [mm]
print("### NozzleTip Loaded ###");
var imports = new JavaImporter(org.openpnp.spi.machine, org.openpnp.model);
with (imports) {
  var head = machine.getDefaultHead();
  var cam = head.getDefaultCamera();
  var loc = new Location(LengthUnit.Millimeters, posx, posy, NaN, NaN);
  // move to location for z-homing
  cam.moveTo(loc, 1.0);
  // home Z
  var act = machine.getActuatorByName("HOME Z");
  if (act) act.actuate(true); else print("### Actuator not found ###");
}

M. Mencinger

unread,
Sep 28, 2023, 8:52:32 AM9/28/23
to ope...@googlegroups.com
Here the error after updating Java: 
2023-09-28 14:48:46.671 ReferenceNozzle DEBUG: N1.loadNozzleTip(N1-503): moveTo End Location
2023-09-28 14:48:46.671 AbstractHeadMountable DEBUG: N1.moveTo((156.645009, 383.685009, 0.000000, 0.000000 mm), 0.122)
2023-09-28 14:48:46.672 AbstractHeadMountable DEBUG: N1.moveToSafeZ(0.61)
2023-09-28 14:48:46.672 ReferenceNozzle DEBUG: N1.loadNozzleTip(N1-503): Finished
2023-09-28 14:48:46.672 Scripting TRACE: Scripting.on NozzleTip.Loaded
2023-09-28 14:48:46.673 Scripting TRACE: Scripting.on found NozzleTip.Loaded.js
2023-09-28 14:48:46.901 ScriptEngineKeyedPooledObjectFactory TRACE: nashornscripting engine created in 222.0991 milliseconds
2023-09-28 14:48:46.906 Scripting TRACE: org.openjdk.nashorn.api.scripting.NashornScriptEngine@448545b2 scripting engine borrowed from pool in 230.1935 milliseconds
2023-09-28 14:48:47.015 SystemLogger INFO: ### NozzleTip Loaded ###

2023-09-28 14:48:47.174 AbstractHeadMountable DEBUG: DOWN.moveTo((100.000000, 100.000000, NaN, NaN mm), 1.0)
2023-09-28 14:48:47.180 SystemLogger INFO: ### Actuator not found ###

2023-09-28 14:48:47.183 Scripting TRACE: Script NozzleTip.Loaded.js executed in 269.1328 milliseconds
2023-09-28 14:48:47.184 ReferenceNozzle DEBUG: N1.loadNozzleTip() nozzle tip N1-503 calibration reset
2023-09-28 14:48:47.186 GcodeAsyncDriver DEBUG: [Smoothie:COM4] commandQueue offer >> M204 S1436 G1 X98.8069 Y101.5946     F36717 ; move to target
2023-09-28 14:48:47.187 GcodeAsyncDriver$WriterThread TRACE: [Smoothie:COM4] >> M204S1436G1X98.8069Y101.5946F36717; move to target
2023-09-28 14:48:47.187 GcodeAsyncDriver DEBUG: [Smoothie:COM4] commandQueue offer >> M204 S38 G1 X98.7768 Y101.1420     F600 ; move to target
2023-09-28 14:48:47.187 GcodeAsyncDriver$WriterThread TRACE: [Smoothie:COM4] >> M204S38G1X98.7768Y101.142F600; move to target
2023-09-28 14:48:47.188 AbstractMachine TRACE: Machine entering idle state.
2023-09-28 14:48:47.820 GcodeDriver$ReaderThread TRACE: [Smoothie:COM4] << ok
2023-09-28 14:48:47.821 GcodeDriver$ReaderThread TRACE: [Smoothie:COM4] << ok
2023-09-28 14:48:47.822 GcodeDriver$ReaderThread TRACE: [Smoothie:COM4] << ok



--
Mike

"--
 **************************************************************************************************************
This e-mail may be confidential and it may also be legally privileged. If you are not the addressee you may not copy, forward, disclose or use any part of it. If you have received this message in error, please delete it and all copies from your system and notify the sender immediately by return e-mail. Internet communications cannot be guaranteed to be timely, secure, error or virus-free. The sender does not accept liability for any errors or omissions. 
 SAVE THE NATURE - SAVE PAPER - THINK BEFORE YOU PRINT!  "

Mike Menci

unread,
Sep 28, 2023, 12:59:08 PM9/28/23
to OpenPnP
Hi all  - Mark please read and advice if this error is due to my  Mid-Axis Homing   ? 
I modified the script to: 

posx = 130.000;   // x-position [mm]
posy = 350.000;   // y-position [mm]

print("### NozzleTip Loaded ###");
var imports = new JavaImporter(org.openpnp.spi.machine, org.openpnp.model);
with (imports) {
  var head = machine.getDefaultHead();
  var cam = head.getDefaultCamera();
  var loc = new Location(LengthUnit.Millimeters, posx, posy, NaN, NaN);
  // move to location for z-homing
  cam.moveTo(loc, 1.0);
  // home Z
  var act = machine.getActuatorByName("HOME Z");
  if (act) act.actuate(true); else print("### Actuator not found ###");
  head.moveToSafeZ();
}

and save it under Scripts/Events
I added actuator 
Home Z.png
and it works with :
Home Z acctuator.png
with : 
G code Boolean.png
But it does not bounce beck from home limit switches  - WHY ??? 

mark maker

unread,
Sep 29, 2023, 3:11:26 AM9/29/23
to ope...@googlegroups.com

I'm busy/away, so I won't be online much.

According to the log it does not find the actuator.

2023-09-28 14:48:47.180 SystemLogger INFO: ### Actuator not found ###

I don't know why. Maybe a space after the name?

_Mark

Mike Menci

unread,
Sep 29, 2023, 5:18:42 AM9/29/23
to OpenPnP
Hello Mark, 
I solved SystemLogger INFO: ### Actuator not found ### Error !

Now  this "HOME Z" Actuator start Homing A and Z and it works from  "Actuator Jog Panel" --------- BUT without retracting back from mid Axis limits!? 

Enclosed Homing machine sequence completed OK and 

than (Jog Panel Home Z actuator test) Home Z&A Log file  where I see Homing Z starts with no error in Log but :    
- my nozzles do  not retract back from home Z &A  limit switches  - WHY ??? - which means my 4 nozzles are not leveled. 

Please have a look at this subject when you find time. 
Take your time !
Thank you in advance! 
Mike

Mike Menci

unread,
Sep 29, 2023, 5:19:25 AM9/29/23
to OpenPnP
Enclosure was missing - its here: 
MachineHome+Home Z&A.txt

mark maker

unread,
Sep 29, 2023, 7:38:55 AM9/29/23
to ope...@googlegroups.com

This is impossible to debug from afar, using just the log.

Things to check:

  1. Have you loaded my firmware for sure?
    Go to driver / Driver Settings and press Detect Firmware. Send string.
  2. Have you configured the release_first options in the config.txt? (you would have two entries)
    endstop.minz.release_first                   true 
    

    https://makr.zone/smoothieware-new-firmware-for-pnp/500/

  3. Does it actually work in the initial homing?
_Mark

Mike Menci

unread,
Sep 29, 2023, 7:56:36 AM9/29/23
to OpenPnP
See answer between your lines: 

On Friday, 29 September 2023 at 13:38:55 UTC+2 ma...@makr.zone wrote:

This is impossible to debug from afar, using just the log.

Things to check:

  1. Have you loaded my firmware for sure?
    Go to driver / Driver Settings and press Detect Firmware. Send string.
String: 
 FIRMWARE_NAME:Smoothieware, FIRMWARE_URL:http%3A//smoothieware.org, X-SOURCE_CODE_URL:https%3A//github.com/markmaker/Smoothieware/tree/feature/best-for-pnp, FIRMWARE_VERSION:feature/best-for-pnp-23a1f0db, X-FIRMWARE_BUILD_DATE:Feb 15 2021 20:36:17, X-SYSTEM_CLOCK:120MHz, X-AXES:6, X-PAXES:6, X-GRBL_MODE:0, X-CNC:0, X-MSD:1

ok C: X:48.7768 Y:251.1420 Z:0.0000 A:0.0000 B:0.0000 C:0.0000


  1. Have you configured the release_first options in the config.txt? (you would have two entries)
    endstop.minz.release_first true
No, but I have this in my config file: 
 # Z axis (M1)
gamma_steps_per_mm                           400                # Z axis Belt GT2 mm pitch 1/1 gear Steps per mm for gamma stepper
gamma_step_pin                               2.2               # Pin for gamma stepper step signal
gamma_dir_pin                                0.20             # (! reverse) Pin for gamma stepper direction, add '!'reverse direction
gamma_en_pin                                 0.19             # Pin for gamma enable
gamma_current                                0.27               # 1.5 Z stepper motor current
gamma_max_rate                              5000               # 45000 mm/min Maximum rate in mm/min
# gamma_acceleration 1000 # 30000 Acceleration in mm/sec²

# A axis = Z1 (M2)
delta_steps_per_mm                           400                # Z1 axis Belt GT2 mm pitch 1/1 gear Steps per mm for gamma stepper
delta_step_pin                               2.1                #Pin for delta stepper step signal
delta_dir_pin                                0.11!              #(! reverse)  Pin for delta stepper direction
delta_en_pin                                 0.10               # Pin for delta enable
beta_current                                 0.27               # Z1 stepper motor current (mapped to beta current output)
delta_max_rate                              5000                # 45000 mm/min Maximum rate in mm/min
# delta_acceleration 1000                # 30000 Acceleration in mm/sec²
AND for Homing Z & A; 
# Z HOMING to Z max
endstop.maxz.enable                          true             # enable an endstop
endstop.maxz.pin                             1.29^             # pin 1.29^
endstop.maxz.homing_direction                home_to_max       # direction it moves to the endstop
endstop.maxz.homing_position                 30               # the cartesian coordinate this is set to when it homes
endstop.maxz.axis                            Z                 # the axis designator
endstop.maxz.max_travel                      32               # mm is maximum travel before it times out
endstop.maxz.fast_rate                       30               # fast homing rate in mm/sec
endstop.maxz.slow_rate                       15                 # 18 slow homing rate in mm/sec
endstop.maxz.retract                         1.9                # 1.9 bounce off away from endstop in mm - LEVEL Nozzles Avg_23

# A=Z1 HOMING to A max
endstop.maxa.enable                          true             # enable an endstop
endstop.maxa.pin                             1.28^             # pin 1.28^
endstop.maxa.homing_direction                home_to_max       # direction it moves to the endstop
endstop.maxa.homing_position                 30               # the cartesian coordinate this is set to when it homes
endstop.maxa.axis                            A                 # the axis designator
endstop.maxa.max_travel                      32               # mm is maximum travel before it times out
endstop.maxa.fast_rate                       30               # fast homing rate in mm/sec
endstop.maxa.slow_rate                       15                 # 18 slow homing rate in mm/sec
endstop.maxa.retract                         0.5          

YES BASIC MACHINE HOMING WORKS WELL!
 
my Config file enclosed and machine file. 
Mike
Mike_config.txt
Mike_machine.xml

mark maker

unread,
Sep 29, 2023, 8:22:55 AM9/29/23
to ope...@googlegroups.com

The you need to add

endstop.maxz.release_first true

endstop.maxa.release_first true

in their respective groups.

Otherwise it is clear that it won't work as my Smoothie firmware fix for mid-axis homing is actually disabled.

The fact that it may work in basic homing would suggest that the nozzles by sheer coincidence (or by spring retraction/motor off)  happen to be on the "right side" off the switch when you home, i.e. where the switch is not engaged.

I'm a bit surprised by that config.txt omission, given we closely cooperated to develop that feature in the first place, but I guess that was your old two-nozzle machine... ? 😉



_Mark

Mike Menci

unread,
Sep 29, 2023, 9:37:42 AM9/29/23
to OpenPnP
Hello Mark, 
Thank you for taking time and for your fast reply!

I tested again my PnP with my current config.txt and my Homing was working as expected and for longer time now all normal. 
Than I tested with unchanged Conf.  Homing  and I moved my Z and A axis (by Hand) to: 
- both axis switches engaged, 
- both axis Homing LS disengaged, 
- 1axis engaged + 1 disengaged,
And in all this cases basic Machine Homing was working. - For your kind Info! 

Next test: 
I added to my Config your proposed config. lines :
 endstop.maxz.release_first true     &   endstop.maxa.release_first true
in their respective groups and machine still performs homing as expected
except 
it does NOT want to cooperate from Jog Actuator 
- Z & A start to move and hit both Limits retract but do not retract enough to level nozzles.   

Trace_trace txt enclosed. 
Add to__config.txt.png
Trace_trace.txt

Mike Menci

unread,
Sep 29, 2023, 9:59:59 AM9/29/23
to OpenPnP
Short Video: 
1) normal machine Homing + Park 2) 0:25 simulate to take a nozzle - 3) 0:38 Home Z & A after nozzle pickup = faulty homing 3) 0:45 Machine Home again Z and A - OK

mark maker

unread,
Sep 30, 2023, 4:09:44 AM9/30/23
to ope...@googlegroups.com

The only thing that comes to mind is the acceleration.

In regular homing you set the acceleration explicitly to 1000mm/s²

In actuator homing you don't set the acceleration. So it takes the last set acceleration, which according to the log was a mere 38mm/s²

This might mean that after hitting the end-stops, it decelerates very slowly and therefore goes way too far until it really stops.

For Smoothie, the feed-rate seems to be set by the fast_rate and slow_rate settings in the config.txt but it seems not the acceleration. If true, this might be seen as a bug, since homing should work the same way every time.

To solve this, I guess you also need to set the same acceleration in the actuator G-code, exactly the same as in home.

_Mark

Mike Menci

unread,
Sep 30, 2023, 8:20:53 AM9/30/23
to OpenPnP
Hello Mark 
Thanks for your suggested solution. 
After adding   M204 S1000 
to Gcode driver Homing works as expected. 
Reply all
Reply to author
Forward
0 new messages