G38.2 for Z on Primo

What would it take to make G38.2 work on the Primo like it does on the LR3? I mostly use my LR3 but when I do want to use the Primo I never remember to change the settings in Estlcam for it. It has me wondering if it would be possible to add an endstop for Z+ on the primo so that the G38.2 would work for setting Z and that would basically make it the same start and tool change code as the LR3. Am i thinking about this correctly? @vicious1 is there any downside to this that I’m not thinking of? Or maybe is there an easier way to remember to change the settings in Estlcam? LOL. I’m truly horrible about that.

1 Like

In this post, I outline a recipe for making the firmware changes for G38.2 on the Promo.

1 Like

Shoot I never thought about it. I think we can just enable the Z probe.

If you want to give it a shot.

opt_set - Z_MIN_PROBE_PIN “Z_MIN_PIN”
disable Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN
enable G38_PROBE_TARGET
enable FIX_MOUNTED_PROBE

1 Like

If I remember right it briefly came up when I was building my LR3 about putting a Z max endstop on the primo but then that was the end of it lol. So if I make that change in the firmware it should work? I know the end code for the LR3 has it do a G28 to bring Z all the way up. I remember we added that because G38.2 wouldn’t work without doing a G28 first. But with no endstop G28 wont be possible anymore right???

I don’t think you need to home before probing, that is the unknown, though.

I think enabling the probe would let you use it. It should be that easy. I have been looking to update the firmware releases but the homing is bit wonky right now, they are heavily modifying it. But if you want to test that and it works I can easily add it to the release as soon as it is stable again.

You mean there is another way then just big writing on your controller cover to remember primo is not g38.2 haha.
I have done this a couple times.

Ok just to make sure I’m not confusing things. The touch plate on the Primo works now. The LR3 uses G28 to home to X Max then G38.2 to use the touch plate to find Z 0. On the Primo it only uses G28 which brings Z down to the touch plate. I guess what I’m hoping for is to keep the same start/tool change/end Gcode for both machines. So if I activate the Probe on the Primo and it still has the G28 for the tool change and end code is that going to mess things up on the Primo?

I am really not sure if you can have both. I am not currently set up to test it. I have GRBL on my primo right now. It needs to be tested. I am not sure if you can have g28 and g38.2 both using the same pins.

I would think it is one or the other, not both.

Now that you mention it, that is not going to help you. The LR3 needs to g28 and then use the probe, the Primo will generally not use g28 Z so the gcode will be different no matter what.

You might as well use the note method.

That’s what i figured. I think it will have to have an endstop so it can home to zmax and then use the touch plate on zmin like the LR3.

I am interested in the difference GRBL offers. I’ve only ever messed with Marlin. Keep us posted on your testing please!

If you are running Marlin on both machines, and if you have a display on both machines, then there may be a workaround. Marlin has a Autostart feature. Marlin also has the ability to set a series of macros.

Assuming these two features work as I anticipate, you could abstract the start code to a macro, have the macro enabled at Autostart, and then just use the macro in your Estlcam or similar tool. The macro would obviously be different between the two machines.

1 Like

I have G38.2 working on my Burly build.

I think all that is needed is:
Within Configuration_adv.h:
#define G38_PROBE_TARGET

Within Configuration.h:
//#define Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN

and
#define Z_MIN_PROBE_PIN Z_MIN_PIN

This is COUNTER-INTUTIVE. You must DISABLE the Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN option, and you assign Z_MIN_PROBE_PIN to be Z_MIN_PIN.

That is because Marlin is goofy about Z-min as endstop vs. Z-min as probe (e.g. bed leveling) and it gets all wacky if Marlin is AWARE that they are the same pin. So you tell Marlin treat them independently but assign them to the same pin. Clear? :face_with_spiral_eyes:

This will set up both G28 and G38.2 as normally-open and triggered when closed, so you can G28 downward with a touchplate, or you can G38.2 downward with a touchplate. (Or G38.2 in X and Y too if you want to get fancy.)

If you want a separate pin for probing vs. homing then you can use #define Z_MIN_PROBE_PIN Z_MAX_PIN or any other pin you have available, but then you have to be careful with which is which, or you can crash while homing or probing if you hook up the wrong one.

Here I posted all the changes to my firmware: https://forum.v1e.com/t/firmware-uncertainties/13919/15

5 Likes

Oh perfect!!

SO I should probably enable this in the firmware.

Well I use my Primo mostly for laser, so GRBL is better for raster burning, but there is no screen support in the branch I am using. When using the laser I have a laptop plugged in, so no a huge deal for me.

1 Like

Would that break G28?

N/M. I just read Jamie’s post. Neat.

3 Likes