Z-max Endstop mount for Primo Core

In the past I glued a protrusion onto the Z rail, above the tool holder and poking out away from the center assembly so it easily cleared between the bearings on the Z axis. Then I glued on another little arm sticking out from the center assembly with the endstop in position to detect the protrusion when the Z axis raised high enough.

I think I will do this again except I am wanting to make the Z axis removable. So I was thinking instead of a square trigger, perhaps a triangular ramp and for the endstop I would use one of those with the roller on the end. If it’s positioned properly then it should allow the Z axis to raise beyond the trigger point to remove it. This would introduce a “glancing blow” which you were concerned about but I am optimistic that if the angle is steep enough the repeatability should still be pretty decent.

Good to hear what others have done. Sounds like that’s another solution where the end-stop is mounted to the center assembly.

I was looking at the crazy idea of slotting the Z tube at the very bottom and having the end stop mounted to the nut trap with the arm sticking through the slot in the tube. That way when it hits the base it triggers and the wires could just go up an through the pipe. I decided against it because it seemed to tight to fit for the end stop inside and it was a very glancing blow.

Maybe glancing blows are not so bad. I cant say i have run a proper study. I just remember 3D printer people saying its best to remove the arms and use just the buttons for better repeatability.

I would think that if the ramp is at a 45 degree angle like this:
image
then one mm of travel upward would produce 1mm of outward deflection on the endstop, so the basic sensitivity is approximately the same as hitting the endstop square.

If it’s a shallow angle or uncontrolled, like if you’re hitting off a random corner of something, then I would be concerned it might not have the same repeatability. Triggering on a square corner you might be able to achieve the same effect by bending the endstop like this if there is no roller:

image

For my case I don’t want to have to worry about catching the endstop when removing and reinserting the Z axis, but if it’s going to be relatively permanent this could be pretty simple. Going inside the tubes is interesting too, if you can find the room.

Do you have a picture of your setup?

I actually think the error is related to the cosine and not that tangent function. So for the 45deg angle you would have 0.707 travel you will get 1 unit instead of 1:1 at perpendicular because you are moving down the hypotenuse. I don’t think it maters though with good limit switches and the speed at which the micro controller is checking due to it’s processing speed. So now i am thinking glancing is not that big of deal as long as your speed is slow. Which most firmware get to the stops fast then double back at a much slower speed.

If i had not teared apart my machine in glee to build the Primo i would strap a limit switch on the end of my mill at normal, 45, and 30 degree angles and run a bunch of G30s to see if angle of attack mattered that much for repeatability. I agree with your figures and I don’t think in practice the 45 degree angle would be an issue.

My setup requires me to pull the screw i hit to remove the tool carrier. It would be nice to have a setup where it just un-threads if the stops don’t work and cannot bind on the stop like my current approach. I just couldn’t find a way to mount something like your setup without drilling an extra hole in the conduit since it has to be in the tool holders shadow. Makes sense if you bonded it. Might drill and do a rivnut for attaching a ramp.

Maybe we could run it in the tube without cutting anything. See pic below. If I designed the nut cap to protrude a few mm outside the tube while holding a roller type it might just hit the core. It is costing a few mm of travel but that’s a number i can live with. :grinning:

My picture is of the old nut trap and tool holder.

1 Like

I am not naysaying. I think this is neat, and you’re clearly thinking through this and working hard to communicate it, so I’m a fan. I bet @vicious1 would want to accommodate mods like this.

But if you want a global reference and you have a probe, can you probe at a particular XY to min? Probe at Xmax, Ymax and then just move up to Zmax?

G28 X
G28 Y
G1 X450 Y350 F1200
G28 Z
G1 Z80 F600
G1 X225 Y175 F1200

A script like that would give you an absolute global measurement of your workspace and you can still probe the surface, right? As long as X450 Y350 was always clear.

This one is going to be long because I am going to try and convince you about the joys of a Zmax for repetitive job milling. *1 :sunglasses:

Absolutely you can do what you are saying. Some people have a negative zone off the work area for a touch plate to home off the tool. I think this is what you are doing by going to your Xmax and Ymax and keeping a touch plate there. On my setup I probe Zmin with a metal touch plate as well when setting up all my offsets. I also always keep it safely off to the side… I mean i would never accidentally leave it or some other tool in the area and start a job… :zipper_mouth_face: Which means I would have to drag it out for setup again if my machine lost power or i let the motors idle… maybe because i hit the panic button.

I live in an apartment and I have been told by my wife that me and the mistress… ahem the MPCNC can only make noise at certain times of the day. I do hate to waste active time with setup time. So I usually do all my setup on weekday nights quietly off my global positions. Then on weekends start running jobs. *2

Having a global Z machine position is not a necessary but a creature comfort. Once you have a quick to access global Z from a max Z stop you don’t need to drag out the touch plate all the time if you know you spoil board height with your current tool since you can reference that location for your offsets. My only down time is changing stock while the machine is sitting out of the way homed.

I also love turning on my machine hitting home all which is Z full up till stops, then X and Y and knowing exactly where i am and ready to start the next program. Home All also puts the head up and out of the way and in the back of the box for loading and unloading material on my rig. (Z+, X-, Y+)

I calculate the G92 (offsets) based on my G30 values when I was being quiet the night before. If the job has multiple tools i will go to the top surface of the piece and let my bit slide bring the head down to the correct position and then tighten the collet so again no touch plate needed.

With my current Zmax setup i can change tools doing the offests the night before and be withing 3 thou (using calibrated fingernail check) on surface finish between the two tools.

This is an example of my start Gcode form my leveling excel sheet:
For this example the offset is 0.0,0.0,-8.99.

; Home
G28
; Goto XY of Job (excel input)
G0 X10 Y140
; Goto Z high safe
G0 Z20
; Set work (excel calculated from G30 at work piece middle)
G92 X10.0 Y140.0 Z11.01
; Run job

*1 - This is a hobby machine so all of this is moot. The easiest way to use it is drag it to position with the motors idle and then call that zero with the bit touching the material. I am trying to run it like a real machine so if I move up to industry level CnC my tool process matches. This is extremely useful for PCB milling though where you need to account for board warp and loosing power means you have to probe map the area again if you don’t have some reference plane.

*2 - My shroud is lined with sound dampening towels and foam so honestly the loudest part is the vacuum outside the machine when i close it up. All neighbors have said they can’t hear me maybe the slight hum of a vacuum so they don’t care. I originally tried having the vacuum in the box with the machine and it was super nice and quiet so much i could probably run at night. Only problem it was like running a blow dryer in there. So i had to move the vacuum out and add cool air intake. Was not going to build a heat exchange… I was dangerously close to thinking about it. :rofl: Also I need the vacuum because with no vacuum the dust gets way too bad in the box and when i open the door it would snow sawdust everywhere…

1 Like

Other than the fact you have to travel to the home position and get the touch plate out, I think everything you described could be handled by homing down and driving up. All of the probing, the repeatability, and the precision is the same. You can take the gcode I put up and put it on the sd card and run it with the lcd, or add it to the custom menu. Easy, if you ask me.

You don’t have to convince me, it is your machine, and I am already a fan of giving you the power to do what you want with it. If you want to add rgb leds to the core, I wouldn’t, but I would want you to be able to do that with your machine.

1 Like

This gets tricky if you don’t know what tool you have, e.g. if you have a pen or a DW660 or something else, maybe no tool at all. I think this could work if you homed off the bottom of the Z tubes, using an endstop that’s fixed in the upper right corner and high enough off the work surface that you can home regardless of tool and not crash the tool. You might have to raise Z a bit before homing X and Y to ensure you don’t crash into your Z endstop from the side. It won’t eat but a tiny amount into your workspace, but it would get in the way if you wanted to mill a workpiece that’s somewhat larger than your work area. This is not necessarily a practical problem but it still “feels right” to integrate zmax into the Z axis and center assembly.

I used glue, so it’s permanent all the same, but foam tape would probably work. And actually I lied. I mounted (glued) the endstop on the tube and the protrusion on the center assembly, but I should have done it the other way. (I had a reason for doing it backwards but it’s complicated.) The first scene in this video shows the endstop (teal color) stuck to the tube and a chunk of wood stuck in place for it to trigger against: https://www.youtube.com/watch?v=OTaon2fveP4

I don’t know enough about the max endstops. I have wanted to implement a max for awhile (just as a personal pref)

What I’d like to know with the zmax: if I change the g28 for the z to raise up and trigger zmax (I almost always use g38.2 for all z operations), can I call a g0/g1 to go above it? Or will it hit that z height and stop.

Ie: if I have a zmax at 80mm, say, and I’m at 78mm and I call a g0 z10 (g91 mode), will it go to the max and stop? Or will it continue to go because I’m in g91?

Or if I’m running g90, what if I call a g0 z90?

The firmware is set up to only notice the endstops when homing. This is so they don’t affect the job if they accidentally trigger while milling. You can enable them. I think they are called “hard stops” in the firmware (hard is relative, I guess).

1 Like

It’s
#define MIN_SOFTWARE_ENDSTOPS
and
#define MAX_SOFTWARE_ENDSTOPS

In the non-dual endstop firmware both min and max are disabled in all three axes.
In dual-endstop software it is enabled only for MIN X and MIN Y. The rest, MIN Z and MAX X, MAX Y, and MAX Z are not enabled so it allows movement beyond the “ends”.

One thing if you home upward it does set your position (equivalent to G92) equal to Z_MAX_POS which is 200 if you never modify it. Just like homing downward sets your position equal to zero. That has the potential to be surprising if you forget. Not that it’s ever happened to me where G1 Z10 crashes into the table, of course… :slight_smile:

1 Like

Yeah I would never have that happen either… :innocent:

Just to add the the limit discussion, it is nice when you set both software max and min for your global X&Y with correct workspace dimensions because you can run commands a little bit outside you space like for facing a part right at the edge of you work area and not run the risk of crashing the machine skipping steps and loosing your work. (It just stops at an invisible wall and then comes right back when the command position is back in your workspace.) Its also nice if you want an off limits area for tools like a touch plate that can only be reached when you shut off soft limits with an M-command. The software limits have saved me from hitting the ends of the machine when i fat fingered an extra zero. Same with Zmax if you turn it on in your example case it would stop at Zmax even thought your final position on the LCD would read your commanded position. So you could never accidentally demount your tool assembly from the core. Your Z min direction is always the wild west :cowboy_hat_face: since you set it so global zero is some amount into your spoil board with your normal bit length. I set my Z workspace so that with my standard bit size i can never get too far past my spoil board. So if i mess up a drill operation it does not go through the table. Again though i would never do that just like Jamie.

So are you thinking its better to have the switch on the stationary core and have the impactor on the Z assembly?

I mean I can make it work for me, but curious if there is a consensus on how to do it, such that it makes its way into the vanilla files. I don’t change my tool holder often so one screw locking the assembly was not a big deal but i could see how having it removable without issue would be better, so now I don’t know if i like my original idea. could make the screw spring loaded so you can pull it.

I unfortunately had sad news today all my gears and idlers for the 10mm belt just went from processing to back order. So it might be a while till i get the machine running again… I also can only get the 20 tooth gear, it looks like it should fit fine i just have to change my steps to less. I guess i will sacrifice precision for torque.

I can assemble it and make motor noises as i push it around by hand. :rofl:
I guess this gives me time to design dust collector mounts as well. I think that is why Ryan put all these little holes in the core assembly for crazy people like me to hang flair.

1 Like

Seems to me that grbl and linuxcnc have the concept of machine coordinates and work coordinates that is quite useful. In order to automate homing a z end stop is required. Sure it’s possible to use a probe but in my mind that’s used to set work coordinates. Machine coordinates require a fixed position. Am I missing something?

Marlin also has machine coordinates and work coordinates, it’s just not used as much.

And practically speaking it’s not the end of the world to use “machine coordinates” as far as the controller is aware when in reality they are workspace coordinates, so for example doing G28 Z against the workpiece instead of a fixed machine reference. A huge percentage of simple jobs don’t require the distinction.

Now if you have multiple setups or precise fixturing then the distinction between machine coordinates and workspace coordinates matters and Z home must be an absolute machine relative location.

That makes sense. Absolute machine position also allows you to restore position after a complete power cycle. That’s a nice feature for a single end stop.

For those who are interested, I wanted to share my solution for implementing a Zmax limit switch. It uses a small switch affixed to a mount that sandwiches the leadscrew nut.

My main motivation to have a Zmax was to prevent the rail from coming out of the core. I had to enable fulltime limit switches in the firmware. I learned the hard way, however, that the z-max endstop does not record the position of the stop.

Because the available z travel is dependent on the workpiece thickness, I discovered on a recent thick project that the z-max switch triggered on a Z move but Marlin does not acknowledge its stopped position. This caused it to think that the cutter was much higher than the actual position. When the gcode continued to run, it plunged way deep into the work. No problems since its all just test cuts I’m making now to break in the machine.

My wishlist item is for the machine coordinates to home to Zmax and in workspace coordinates to home to Zmin. (touch plate). This would be the perfect solution since I can then home to machine coordinates for tool changes and then back to workspace origin.

Somehow G38.2 doesnt work for me and I think I read somewhere that you cant have both G38.2 and G28 working at the same time.

Thanks for the limit switch mount idea.
As for how I use the global machine to set my work coordinates. I don’t G38.2
I always manually set up my work coordinates with a G92 command. After I manually probe with a G30.

My process:
1.) I first home.
2.) Go to my work piece XY location i want to be probed as the height location. (Usually the center of the piece.)
3.) Run G30 and record it in my excel. (See attached) Remember to attach your probe… :innocent:
4.) Execute a G92 based on my excel results. (I use Repetier so G92 in CNC mode sets offsets) I am pretty sure Marlin has something like that as well.

In my excel attached the global and work for XY are the same so Global and Wanted are the same.
levels.zip (8.8 KB)

Lets make it more interesting.
For example lets say i have a sign that was 100mm by 200mm with G-code origin at lower left of the material top surface.
My machine size is 600mm x 300mm and lets say i jigged the part dead center in my workspace.
My Global would be 300mm, 150mm. (Jigged center so 1/2 workspace.)
My Wanted would be 50mm, 100mm. (Dead center of my part so 1/2 its size because origin is at bottom left.) (If your gcode had the center of the sign as origin you would say you wanted 0,0)

If you update the excel your new values would look like this.
;G-code for file
; Home
G92
; Goto XY (global)
G0 X300 Y150
; Goto Z safe (global)
G0 Z20
; Set work (work start)
G92 X50.0 Y100.0 Z11.01
; Offset -250.00 -50.00 -8.99
; Begin CNC G-code

You can now always run this code even after power failure since its based on machine global. It will be milling air if you are restarting till it catches up to where it was. If i have to stop because of any reason. I just send the Pause command which lifts the head and shut it off. Then next day start the program over no code changes. Most of my jobs are 1/2 hour so its faster (lazier…) for it to cut air then to re-gcode everything.

I have the wood store cut my plywood into standard blank sizes so if i need to make a few signs I can just jig and go just as fast as my 3D printer startup time. I do purge my files on the SD card and re-probe after a spoil board change.

2 Likes

It is possible to have both commands working at the same time, but it’s very tricky to configure correctly. Some settings do not really seem to work as advertised or in the way you would expect from the comments in the config file.

I could only get Marlin to work properly for both G28 (homing) and G38 (probing) when I configured the probe to use the z_min endstop. My github account has my Marlin config in case you want to check your config against mine. It’s pretty confusing how Marlin handles z_probe vs z_min etc.

1 Like

It is possible. The most important thing is to not use the option #define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN, in other words you must comment out or remove this line. This is the opposite of what the name would suggest if you are using ZMAX for homing and ZMIN for probing. Then #define Z_MIN_PROBE_PIN to whatever you want (including potentially Z_MIN_PIN).

And #define FIX_MOUNTED_PROBE and you should be good. (And of course #define G38_PROBE_TARGET within Configuration_adv.h.)

Attaching using the leadscrew nut screws is clever and I like that idea. My only concern is tightening down the leadscrew nut requires that it be at just the right angle, or else it can bind on the leadscrew. The usual approach is to leave it loose so it can tilt slightly to acommodate slight inaccuracies.

Why come up with a simple solution when you can make something overly complex… :sweat_smile:

So i decided to try out the glancing blow switch mounted on the bottom integrated with my new vacuum mount. Since I had to make a new vacuum mount that did not limit my travel but still nested behind the core. (Which is very tight now…) The switch seem to make good contact and i can pull my heads out without worrying about the switch. I think i am going to go the route of just building a full z assembly for each major tool.

Yeah that’s 4 x 1" aluminum tubes acting as my vacuum… :see_no_evil:
Still waiting on parts so wont know how it works until then.
Assembly seems good and doesn’t bind anything up on dry fit.