Basic config question

I’ve completed the build about a year ago and have never been able to figure out how to set home. Now it appears that I have to predefine table dimensions, etc in the configuration.h file. If this is true, what value is the dual endstop .bin file that can be downloaded? I guess I thought it would work as there are no real instructions in the build process about doing this.

Am I correct in my assumptions and if so, where would I find the preconfigured marlis firmware files to edit and compile. I’ve been so confused, but I think it
s starting to make sense. I feel so stupid after all of this.

Is there a specific reason you are compiling your own vs using Ryan’s preconfigured version?

Also some info needed on your build like, what does do you have, do you have the tft screen, raspberry pi? Edit: Sorry noticed we are in the SKR board info now

Don’t. This stuff is all so complex and there’s so many things that have no universal standard

The machine has a maximum operational movement envelope, which is what you’d define in the configuration.h file. If the machine is equipped with homing and/or limit switches, it can determine the tool location within this machining envelope through a homing process for any axis with a switch/sensor.

The workpiece then gets placed somewhere within that machining work envelope. Since each workpiece can be a different size, and placed in a different location, probing is often used to identify the workpiece origin.

With the MPCNC, it is common to “jog” (manually move) the tool to the desired X and Y origin point, then use a touch-probe (like the tiny touch plate) in conjunction with a macro to set the Z height. The workpiece coordinates can then be set as an “offset” of the machine coordinates with the G92 command.

In its simplest form you can simply jog the tool to where you want the workpiece/job origin to be, with the tool touching the top of the work, and execute a G92 X0 Y0 Z0.

I feel so stupid after all of this.

In some ways, this is not a simple question, and questions about home are frequent topics on this forum. The issue is that there are multiple ways of defining and setting home. So, don’t feel stupid, and feel free to ask any question on the forum.

The first thing to understand is that for almost all MPCNC users, home is relative to the stock, not relative to the machine. For most MPCNC jobs, home is either the top of the stock in the middle of the stock, or the top of the stock in the lower left corner of the stock. You select the stock point when you do the CAM to generate your g-code, and it is up to you to position the router at that point on the stock and set that as (0,0,0) for your job. The sequence of events is:

  1. Define the stock point in CAM (there is default if you don’t set it)
  2. Optionally square the machine.
  3. Move the router so that the tip of the bit is at the stock point relative to the stock you have mounted.
  4. Set that as the home position.

For MPCNC users, step 4 is usually done by setting the machine origin to the stock origin. It is done by executing this line:

G92 X0 Y0 Z0

All CAM solutions and some g-code sender solutions have ways this line can automatically be added to all your g-code files.

The purpose of dual endstops is not to define home, but to square the machine. You can get nearly as square by simply pushing your axes against the stops before engaging the steppers.

A lot of the project I make don’t require the small additional squareness provided by electronic stops. So, I just push my axes against the stops and then drag by the middle of each cross tubing to position my router over the stock point, and then manually adjust the Z height to have the router bit touching the stock. I do this all before turning on the electronics.

As for the machine size in the configuration file, as long as the size in the firmware is larger than your machine, there is no reason to change the firmware. If it is smaller and you try to home too far away, the firmware will stop with an error. I don’t know which version of the firmware you are running, but later versions of Marlin maintained by V1 have large default working sizes to avoid any issues.

If you want to compile your own firmware so you can make changes, you will find the V1 maintained versions here. You follow the PlatformIO instructions to compile the firmware.

I noticed you had another thread like this in February. and mentioned some experience with 3d printers, they work similarly but differently.

So with a 3d printer you use G28 to set home (AKA homing all axies) which when g28 completes it sets X,Y,Z to 0, then normally you issue the 3d printer to start printing. the 3d printer knows where to print as in your slicer you set the position of the workpiece on the bed.

With a CNC its done a little different. in your Cam software (estlcam, vcarve, etc) you will setup your cut but the cnc will not know the position of the workpiece. So with the CNC you will issue G28 to get everything to the start, make sure endstops and everything is functioning as normal you will then drive your CNC to the workpiece, attach your bit (if you haven’t already), and if you have a touch probe you will issue G38.2 Z0 which simply tells the CNC to go down until the probe makes a connection. You then will have to set your position to zero via the G92 command (G92 basically tells the machine what value to associate with X,Y,Z) so you would set it to X0,Y0,Z(thickness of your touchplate), if you do not have a touch plate you will simply lower Z until the bit make contact with the workpiece (making sure not to go to far down, if you have a feeler gauge for your 3d printer you can use that then go down the thickness of the feeler gauge, Then for no touch plate you would issue G92 X0 Y0 Z0 as the bit is in contact with the workpiece.

One thing that could cause issue too is in your gcode file you do not want to issue G28 until the end as this will reset your G92 command

Here is a list of what I do:

Turn on CNC
Issue G28 to home all axis
Place workpiece on worksurface and secure in place
attach bit being used
manually drive cnc to starting position of workpiece
start gcode
my first few lines of Gcode are G92 X0 Y0 (sets X & Y to 0), Then using M0 it pauses to make sure I am ready to use the touch plate. After I hit the button on my TFT screen it then issues command G38.2 Z0 which will lower the Z axis until it makes contact with the touchplate. Once it makes contact it will issue G92 Z1.88 this sets Z to 1.88mm which is the thickness of my specific touch plate. It will then issue M0 again so I can detach the touch plate and do any last minute prep before starting

I thought that I had to configure the bed size. I guess I’m putting too much thought into this. Basically, as I understand it, home is set for each job. Put the stock down and issue the home command as mentioned below and then just go for it. I seem to have over-engineered my brain on this one. KISS would have been the thing to do, right?

1 Like

basically yes, there are ways you can use absolute positioning vs relative but it is much more complex and usually requires a third part app like CNC.js

it can be very intimidating at first, especially coming from a 3d printer background. It helps to know Gcode but the process is just so different from 3d printing it can be hard to grasp it initially

The firmware knowing the machine size is used only in a couple of places. First (and most likely to catch folks) is during auto-squaring with dual end stops. If the gantry has to travel further than the defined machine size, the firmware (Marlin, at least) will bug out. This is easily managed by keeping the gantry near-ish to the origin. The other time it can cause issues is when it gets referenced using soft endstops, which is where the firmware determines that the gcode will send the spindle out of bounds. But that’s an advanced feature, IIRC, and not usually an issue. For the longest time (and still?), most Marlin-driven MPCNCs have had a machine size of 200mmx200mm or whatever the default Marlin printer size is.

Thanks everyone. I guess I just need to remember that home is where the part is :wink:

3 Likes

Glad it sounds like you are figuring it out. Don’t be afraid to ask questions on here if you have anything else you’re perplexed on

This could be a great, cheesy slogan for a CNC. Take note, @vicious1. :smile:

1 Like

This was also the hardest easy concept for me to grasp when starting with the mpcnc.