Code Modifications for homing Z

Hello folks,

I am looking to home my LRCNC to -x -y -z so if you are looking at the cut area it would be bottom left z-down. I am looking to do something similar to the video from Teaching Tech " MPCNC Lowrider part 2 - belts, wiring, firmware: Ramps + SKR V1.3, TMC5160 & touch screen"

but instead of Y home being away, it would be towards you. The most recent build of the SKR-Pro code 2.0.9.2 for the LR, homes the Z direction upwards and I would like it to travel down. In modifying the Configuration.h file to have the following:

#define Z_HOME_DIR +1 I changed it to #define Z_HOME_DIR -1
I also changed the line:
#define Z_MIN_ENDSTOP_INVERTING true to #define Z_MIN_ENDSTOP_INVERTING false

My thoughts behind the changes is that it would stop Z when the switches are open and would move the Z down till the switches open.
The issue I am having when compiling the code is that when the Z_HOME_DIR -1 is defined the compile fails with the following:
Marlin/src/gcode/calibrate/…/…/module/endstops.h:77:85: error: ‘Z_MIN’ was not declared in this scope; did you mean ‘Z2_MIN’?

Any input would be appreciated!

-Z home dir is the default, so there were several steps taken to make it switch to +Z. They are controlled by this script:

Compare that to the settings needed on the MPCNC (XXYYZ):

My guess is that the probe settings took away the definition for Z_MIN. So you have to reverse those changes.

Jeffeb3

Thanks for posting the information! I realized that after I posted the question two things came to mind about how I was approaching the problem. The first being that I forgot the “bed” technically moves “up” or “down” not the router bit. The second was that after changing my reference point, I had incorrectly wired up the Z motors. After changing these two things and retesting the bed zeroing everything seemed to work fine.

If I am still incorrect in this thought process, please let me know!

Thanks again!

@jeffeb3

Alright, well I tested the crown code with the cnc and discovered I had the Z steppers wired backwards yet again, so when I ran the code it would drive into the bed then back off, essentially backwards of what the thing should have been doing. I elevated the head, and swapped the motor polarity and re-ran the code elevated above the bed. This time it ran as expected. Now the headache that I have is when homing the Z, it rises up without stopping.

This is how I have my Z-stops configured. With this background should I modify the code so that instead of the gantry going up on Z home, it goes down? This is what would make the most sense to me.

The gantry should definitely home up instead of down because if you have a bit in the router and you home it, it will ram it through your table.

1 Like

Loke Rob said, the home position for the LowRider should be up instead of down. You want to be able to probe to zero, but homing to the top instead of the bottom allows you to level the Z motors without crashing the tool into the spoilboard. Its a bit of a different way of thinking compared to a 3D printer (Though the “repeat” works this way for rough bed levelling, and for much the same reason.)

I should have seen this sooner!

The bit moves up with +Z. Right is +X. Away is +Y. As long as you can stand somewhere and this is true, then it is ok.

I would agree with the advice that moving the Z endstops under the table, so they trigger when the Z moves to the top. It is very convenient too, when you just want the machine out of the way. The Z probe will still make sure the Z=0 is at the top of your workpiece.

Folks,

Thanks for the replies! I ended up not connecting the Z-Stop switches for the time being and am opting to set the height by jogging the gantry to my desired position. I have also turned off the Z-Probe option in the post processing for the time being. I want to get used to the nuances of the machine first before deciding to dive into modifying the firmware options.

Thanks again!

1 Like