Homing Z Axis

227 views
Skip to first unread message

Duncan Ellison

unread,
Dec 22, 2019, 12:15:39 PM12/22/19
to OpenPnP
Firstly, let me say a huge thank you to the developers of the OpenPNP project.  

I have my machine at the moving and doing things stage and this is something I could not have contemplated if OpenPNP did not exist.

Now ...  I have a prebuilt head from China (lazy? .. not really, I wanted to actually get the the finish line in months rather than years)  like this : https://www.aliexpress.com/item/4000106377338.html?spm=a2g0s.12269583.0.0.3c4e18adONDwzQ

It's a cam / level operated dual slide system with spring return. I'm really struggling to figure out how to home the Z axis.

The head has two really nice genuine Omron optical sensors at the TOP of each slide, so in one direction, I can back off until the sensor turns on, but this doesn't work if the Z axis happens to be on the other side of zero, it will just keep moving looking for an endstop sensor that isn't there and crash the slide into the endstop.

I guess the ideal would be to check which sensor is on and which is off, calculate the direction to turn, then keep turning until both sensors trigger, but I can't find any functionality in OpenPNP that would do this.

The other way to 'home' the Z axis, would be to turn the Z motor (only) off and the slides would return to their natural zero point under spring tension, but I can't see a way to do this either.

Happy to experiment, but I could use some pointers in the right direction here, surely I'm not the only one to be using these heads?

Duncan
 

Mike M.

unread,
Dec 22, 2019, 3:57:29 PM12/22/19
to OpenPnP
Hi,
Did you install OpenPnP 2 or 1, are you running it with Smoothieboard?
Mike

Duncan Ellison

unread,
Dec 22, 2019, 4:07:09 PM12/22/19
to OpenPnP
Mike,

Thanks for the reply.

That's a good question.  About says I'm running Version: 2019-12--5_15-54-26.e723bec  It doesn't give an actual version.  The last update in the change list was 24/11/2019, so I assumed that it was 2.0, but that might be too much of an assumption.

I guess I can overwrite the install with a fresh copy to be sure that it's 2.0.

And yes, I'm using Smoothieboard wired in the conventional way for OpenPnp

Duncan

Duncan Ellison

unread,
Dec 22, 2019, 4:12:10 PM12/22/19
to OpenPnP
OK, Looks like I WAS running 1.0, now updated to 2.0  - does that make a difference to the Z axis homing?

Mike M.

unread,
Dec 22, 2019, 4:28:12 PM12/22/19
to OpenPnP
Search this group for ; C-axis endstop / levelling ?
And adjust Z limit for middle homing.
I’m on mobile Phone now -
I hope you get Z going the right way !
Mike

Mike M.

unread,
Dec 22, 2019, 4:56:24 PM12/22/19
to OpenPnP
Here the video ; https://youtu.be/R4ZGYkgMLdw
Mike

Mike M.

unread,
Dec 22, 2019, 4:58:12 PM12/22/19
to OpenPnP
Wrong one!
Mike

Jason von Nieda

unread,
Dec 22, 2019, 8:45:13 PM12/22/19
to ope...@googlegroups.com
Hi Duncan,

My preference for this is do the second option - turn off power to the motor and let the springs do the work. Here is the homing sequence I use in Smoothie for this:

M84 ; Disable steppers so that the Z axis returns to center.
G92 Z0
G28 X0 Y0
T1
G92 E0
T0
G92 E0

Just set that as your HOME_COMMAND and you should be good to go.

Jason


--
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/c87c972b-5fab-4065-97e3-f35b1b746967%40googlegroups.com.

ma...@makr.zone

unread,
Dec 23, 2019, 4:20:57 AM12/23/19
to ope...@googlegroups.com

Hi Duncan

I'm assuming that the optical sensor will remain ON as long as one nozzle is lower than the leveled-point, right?

If that is the case, you can use the special Smoothieware firmware that I built. I created a Pull Request with Smoothieware, but it got not (yet?) merged.  You can read all about it there:

https://github.com/Smoothieware/Smoothieware/pull/1423

You can build that yourself or download the firmware here:

https://makr.zone/firmware_edge_endstop_release.bin

Note, that myself I don't have a dual nozzle machine, but it was reported working by others, including Mike M. (the right movie is this).
https://www.youtube.com/watch?v=clSgZcXOxtI&feature=youtu.be

See also:

https://groups.google.com/forum/#!msg/openpnp/2zbqS_uHGAg/76zeHIfXDwAJ 

https://github.com/openpnp/openpnp/wiki/GcodeDriver:-Axis-Mapping#axis-transforms

_Mark

Mike M.

unread,
Dec 23, 2019, 5:02:07 AM12/23/19
to OpenPnP
 Hello Mark & Duncan,

There is a difference in Head Duncan is using - China build - it is spring return to Z=0 as Jason mentioned above, here second nozzle does not move above Z =0 and Duncan will not be able to use your firmware - Am I correct ?

CamTransform for details!


@Duncan - this head has as well sensors for Nozzle rotation = ="0" which we in Open PnP do not use

Mike

Mike M.

unread,
Dec 23, 2019, 5:11:06 AM12/23/19
to OpenPnP
@Duncan
Could you please measure how much is the travel in Z ? (of the two nozzles).
Mike

Mike M.

unread,
Dec 23, 2019, 5:31:48 AM12/23/19
to OpenPnP
and Vacuum is achieved by Vacuum ejector - so you will need compressed air to achieve vacuum for nozzles - 2nd small hose seam to be for "puff" at placement of element from nozzle to PCB?!
Here is how it seams to be:

Duncan Ellison

unread,
Dec 23, 2019, 9:54:01 AM12/23/19
to OpenPnP
Hi Mike / MikeM. / Jason,

Thanks for all the help guys.

So this is what I learned :

1. There's a coolo neato bleeding edge way to do Z homing that involves new firmware and code tinkering 
2. There's a brutal, but practical way of doing it by cutting the motor power.

on balance, I think I'll go with 2. until I have time to go down the other rabbit hole ;-)

@Mike M.   Thanks for your input, yes that's exactly the head I'm using.  I'm guessing this is actually used on some commercially produced Chinese machine because it's very well engineered and has super expensive Panasonic and Omron optical sensors.  I'm laughing at the picture you sent, because all I got parts and had to figure the rest out myself, I could have used that last week!  Thankfully I got it mostly right.  I have compressed air in the shop, so that's no biggy.  The vacuum ejectors and manifold valves work exactly as advertised and deliver a really nice suck and blow action.

The travel on the Z Axis is quite small - only 20mm - but just enough for my purposes.


@Jason - Thanks for that guidance - it nearly works !  The issue I'm having is that the nozzle that is down at the time of homing isn't retracting fully to the 0 position.  If I use the code as you posted it, actually nothing happens.  I believe that this is because the next command in the pipeline follows up so quickly that the motor doesn't have time to release.  I added an M600 (suspend) after the M84 (Motors off) and it now tries to return to zero, but doesn't quite make it before the motors go into holding again.  Run the HOME several times and it incrementally works it's way back to zero.  What I need is a way to introduce a short delay in the command processing (500mS??), but it doesn't look like Smoothie has any inbiult way to do this and I don't think OPnP does either - any ideas ?

20191223_143321_resized.jpg

20191223_143350_resized.jpg




 

Jason von Nieda

unread,
Dec 23, 2019, 10:19:02 AM12/23/19
to ope...@googlegroups.com

I'm not sure if it will work, as I think we've run into issues with it in Smoothie before, but it might do the trick.

Jason


--
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.

Mike M.

unread,
Dec 23, 2019, 12:08:29 PM12/23/19
to OpenPnP
Hi Duncan,
Head (as it is today) has changed in past two years to this shape -for hobby machines...
Note to your 1st picture :
 I would fix the yellow and red vacuum hose at top of Head -to go straight up first (for abt 2-3cm) in order to lower the torque needed on Nema8 when they rotate the parts!

Cheers
Mike

Mike M.

unread,
Dec 23, 2019, 12:13:05 PM12/23/19
to OpenPnP
Like this:

Duncan Ellison

unread,
Dec 23, 2019, 1:11:59 PM12/23/19
to OpenPnP
Hi Jason,

Thanks for the hint.  That worked fine for me.

M84     ;Turn off steppers to home Z
G4 S1   ; Wait one second to settle
G92 Z0
M400
G28 X0 Y0
T1
G92 E0
T0
G92 E0

When homing I guess you want to be sure that the nozzles are not down before you start dragging them across the table and this seems to work fine.

I've got another problem though now in that when PARKING, it wants to put the second nozzle in full down mode BEFORE moving. I'm guessing this is something to do with the Cam based head rather than a belt driven one and it thinks it's really moving it to zero before parking, but I'll have to investigate that a bit more.

Anyways, I can confirm that the G4 command definitely seems to work for this application at least.  
To unsubscribe from this group and stop receiving emails from it, send an email to ope...@googlegroups.com.

Duncan Ellison

unread,
Dec 23, 2019, 1:14:11 PM12/23/19
to OpenPnP
Hi Mike,

Good tip on the vacuum tubes.  I had noticed that they were pulling on the slides and offsetting the zero position a bit, I've got some 90 degree adaptors, so I'll fit those to give the tubes a better angle.

Duncan

Jason von Nieda

unread,
Dec 23, 2019, 1:17:35 PM12/23/19
to ope...@googlegroups.com

And that you set the nozzle head z offset for each nozzle to -(cam-wheel-radius + cam-wheel-gap)

Jason


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/c26972dc-fb14-430f-bd0a-3596f1266092%40googlegroups.com.

Duncan Ellison

unread,
Dec 23, 2019, 3:14:32 PM12/23/19
to OpenPnP
Hi Jason,
OK, will do.

I've got :

            <axis name="z" type="Z" home-coordinate="0.0">
               <head-mountable-ids class="java.util.HashSet">
                  <string>N1</string>
                  <string>N2</string>
               </head-mountable-ids>
               <transform class="org.openpnp.machine.reference.driver.GcodeDriver$CamTransform" cam-radius="23.0" cam-wheel-radius="15.0" cam-wheel-gap="0.0">
                  <negated-head-mountable-id>N2</negated-head-mountable-id>
               </transform>
            </axis>

in the machine.xml - does that look about right?

Duncan

Jason von Nieda

unread,
Dec 23, 2019, 3:16:26 PM12/23/19
to ope...@googlegroups.com
That looks good, so just make sure each nozzle has a head Z offset of -15.

Jason


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/cb1bb0d4-8feb-4599-9cb4-deeab8badd34%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages