Homeing X and Y

I have build, setup and made a few projects with my mpcnc and i love it.
But everytime i trie to home x and y in repetierhost it moves a few milimeter to the right and up.
I don’t know if this is normal but i would prefer if it would make the point i tell it to 0,0 and don move further and setting there it’s 0,0
Is there a way to fix this? Could it be i have the wronge firmware?

Most likely the issue is that you wired your switches wrong. The V1 maintained Marlin firmware expects the switches to wired normally closed so they are triggered by opening/breaking the connection. If you wired your switches as normally open, Marlin see the switches as triggered and therefore that your machine is already homed. The small amount of movement you see is the retest sequence where it back off from end stop before doing a slower home test.

You can check the state of your switches by sending an M119 from Repetier-Host or other g-code sending software.

Note that normally closed switches are just a bit safer since if a wire gets knocked off or broken, the stepper will just fail to move rather than banging against the end of your machine. If I’ve correctly identified the problem, and if for some reason you don’t what to go to the trouble of rewiring all of your switches, then the firmware change to normally open switches is easy.


I don’t use switches :smiley:

Without switches you cannot home. The machine is seeing the lack of switches as a open connection, which accounts for your machine’s behavior. The primary reason to home the machine is to square up the axes. You can accomplish the same thing by providing some sort of stop to push your axes against and then moving your motor slightly to lock the steppers or, while pushed against the stops, issuing an M17 g-code. In my opinion, the additional squareness that endstop provides is not necessary for most cutting.

Does that mean i don’t have to home x and y in repretierhost? Can i just start with x and y being red?

I’m not a regular Repetier-Host user, so I don’t know what “being red” means, but no, you don’t have to home your machine in Repetier-Host before sending a file. But you do need the origin of your job set correctly in Marlin before you send your file.

The origin of your job is locked the first time you electronic move with your machine. It can be reset by sending a G92 g-code to Marlin, or, if you have a display, there will be a menu item to reset the coordinates. In addition, almost all CAM and g-code senders, including Repetier-Host, have a way to automatically add a G92 to all scripts.

For most things I do with my machine, ultimate squareness is not required. I push my axes against their stops, then manually drag the axes by the middle of the bars until I have the X and Y where I want it. I then use a piece of paper and twist the lead screw by hand until the bit just scrapes a piece of paper I have on top of the stock. Since I’ve not electronically moved the machine, the position of the bit becomes the home/origin position for the job.

1 Like

Tested it and it worked but i still don’t get what G92 does

G92 sets a current positon. If you send say G92 X30, wherever the tool is currently at becomes X30. So if you move the endmill to the corner of whatever you’re milling, and you have the corner being 0 in your cam application, sending G92 X0 Y0 Z0 will zero our all the cooridinates at the tip of the endmill.

Ok now i understand why it didn’T worked, ijust typed g92 without coordinates,
Would it be possible to write g92 X0 Y0 but no value for z so i can use the touchplate?


Nice, thank you both very much. I learned something today

Here is the code that Ryan suggests for the touch plate he sells:

G28 Z       ; Home Z
G92 Z0.5    ; Account for the thickness of the touch plate
G0 Z5 F480  ; Lift router off touch plate

Any touch plate will have a thickness. Notice how the G92 is uses here to account for the thickness of the touch plate.

Two additional notes:

  • If you know the thickness of your touch plate, you can issue G92 X0 Y0 Z0.5 (with a .5mm touch plate).

  • Repetier Host doesn’t update it’s display of coordinates when G92 is used. There’s a separate @isathome command you can issue in Repetier to get it to line up with the controller’s coordinates, but the machine has to be at 0,0,0 for @isathome to work.

1 Like

Can i just add to this comman a fourth linie with G92 X0 Y0?

if i use this command G92 X0 Y0 Z0.5 i would need to place the mill on the plate am i correct?

The simple script I posted is what you would execute to use the touch plate. It is entirely independent of your G92 X0 Y0. I suggest you just play with some of the commands. As Tom outlines, the values reported by Repetier-Host will not necessarily be accurate. If you have one, look at the coordinates on your display. If not, you can execute an M114 g-code to get the position from Marlin.

In general, CNC machines have two types of coordinates, Machine Coordinates and Workspace coordinates. In 3D printing these two completely overlap, so the distinction is not needed. In CNC work it becomes incredibly valuable to be able to distinguish between them.

“Homing the machine” relies on switches or other sensors to establish a known relationship between the tool and the machine’s movement envelope. This then establishes the machine coordinate system, and by extension the extents of the machines’ work envelope, i.e. how far can it move in each of it’s axes.

The workspace coordinate system is relative to the job being run. There can be multiple workspaces set up in a single machine. Imagine a large CNC with 4 vises permanently installed. As long as you had installed the vises at known locations (or carefully measured their locations after installation) then you could mount a work piece in each vise and use the same gcode to run four copies of the piece. This would be the process (assuming the job can be run with a single tool):

  1. Mount the 4 workpiece blanks in the vises.
  2. Home the machine (using end stops)
  3. Set “workpiece” origin to the first vise.
  4. Run the gcode.
  5. Set “workpiece” origin to the second vise.
  6. Run the gcode.
  7. Set “workpiece” origin to the third vise.
  8. Run the gcode.
  9. Set “workpiece” origin to the fourth vise.
  10. Run the gcode.
  11. Park the tool.

Remove 4 finished pieces. Put in new blanks, re-run the cycle.
Note that for this to work, the vises need to be arranged so that the workpieces for all the jobs still fit within the machine’s working movement envelope.

Now imagine in a machine shop, we run these parts on Mondays, but on Tuesdays we have a fixture plate with 2 vices, and on Wednesdays we run parts where only one fits in the machine at a time. We’d have different “workspace offsets” stored so we could easily shift between our standardized setups. These are called “workspaces” and rely on “workspace offsets” to manage the relationship between each workspace coordinate system and the machine coordinate system. Different controller software/firmware manage workspaces differently. Check out this article in CNC Cookbook if you’re interested in getting down into the weeds on this.

The G92 command is saying “Set the current workspace coordinate system so that the tool is at the location specified in the command.” Most of the time when working on the MPCNC, this means “I’ve already jogged the tool to where I want the origin to be, so set X0 to where X is right now, set Y0 to where Y is right now, and set Z0 where Z is right now” which is why you’ll see “G92 X0 Y0 Z0” spelled out in a lot of the forums. If a touch plate is used, it might be “Leave the X and Y origins alone, but reset Z0 to .5mm below where I am right now since I’ve touched off on a .5mm touch plate” so the command would be “G92 Z0.5” for this case.

The ability of the G92 command to establish workspace coordinates from the current tool position is what makes it possible to use the MPCNC without having end stops installed.


You can see if the write up in the docs makes things clearer:


1 Like