How to get the machine origin with LINUXCNC

posted in: Tutorials | 0
In this post, I will try to explain something that I said on this blog, and I personally has been somewhat complicated. This is the concept of MACHINE ORIGIN and PART ORIGIN . I will also talk about how they work, what they are for and how to configure them. I hope it turns didactic.

First, what is the part origin?
When we draw any 3D geometry in a CAD program, evidently draw on some orthogonal planes whose intersection is the origin of the piece that we create. Generally, the origin of coordinates, which will be in the CAM program is marked by default as part zero. For the purpose of code, this will always be the origin 0,0,0. So if we tell the router by code that is to be the coordinate x = 40 y = 10, will move to 4cm in the X axis of this origin, and 1 cm in the axis Y. All coordinates are marked in the G code will be with reference to the original part. So far it’s easy.

But that is the origin machine?
Well, 0,0,0 is another origin, but this can be referenced to our router. Like any router, there is a workload, a three-dimensional space where the cutter can get in a 3-axis, it is a cuboid in my case measures 1000mm in X, 500mm in Y and 200mm in Z. This volume, must also have an origin, usually in a corner. And what the point of having this origin? because when we go to load a piece in our program the router (mach3, LinuxCNC), we can place our model anywhere within that workload. The router will always work with respect to the coordinates origin related to machine, but always have the option of making a “transfer of origins.” Let me give a simple example.

Imagine you have a machining program, like the picture below, in which the the workpiece zero is at the base of the L “LinuxCNC”

Inside my workload, I should be able to place this geometry (or machining G code) where I wanted. Now, would you tell the LinuxCNC where I will place, so that the new origin is not in the corner of my workload, but at the base of the L text.
The program, internally what it does is add to all dimensions of the G code, the distance between the origin of the machine coordinates and workpiece coordinates again. This way we will always have the same reference (source machine) and can very easily place our work material which suits us more.

And how is this done in practice with LinuxCNC?
First, whenever we start the program, the origins in X, Y and Z are not the “home” position. As in the previous image, the end of the X-coordinate is not the source symbol (a circle with two black quadrants) which means that the machine does not have a defined origin and therefore will not let you run any code. So the first thing you have to do is set the machine origin.

To do this we must move our router to the point where we want to be the origin machine. In my case, I have a pointed tool, with which I’m moving and I place precisely at a point that I consider my origin machine. At that point, I go to the “Machine / Homing” option and pointed to the current position of each axis of the machine tool as a point origin. From this moment, that will be the corner of my workload, and LinuxCNC understand that beyond these limits, the router can not be moved. This is also helpful not to go and take the movement beyond the physical limits of the machine.
Well, we have defined the origin machine, so now we have to set the part zero. To do this we load the program or G code what we want. In our work material, we have to define where will be the part zero. For example, for the program to draw the word “LinuxCNC” I would use a 135x21mm work material, and would place the origin at the base part of L. If I take the work material and tie it to my bench, I will place my tool tip on the corner where I want material that to be written L. once the tool in this position the coordinates that marks me is the distance LinuxCNC I said before, and that would provide the distance to each coordinate program (but this is done by the program, so do not worry). It’s time to make the transfer origins.
I go to the option of “regular offset” marking each axis, and placing a 0 in the box. Thus we see that the coordinates that mark the screen I have changed all to 0, which now is in my origin piece and in practice, the source that will be used for machining. When you run the program, I’ll do everything in reference to that source.
I know this is not easy to understand, but tested in different parts, finally understands the importance of these concepts.
The practical part of this is that if the work material have defined the part zero, no matter where you put it inside my workload. Just to bring the cutter (or the tip of my tool) to that point, and do a normal offset, I will change the source and machined everything from there.
Now, the interesting and practical of these concepts, we ALWAYS have the same origin machine, because we will have a complete repeatability anything to work. This is essential, for example, if we want to continue processing other day, turn off the computer, and when I go back to start, as we place the origin at a different point, machining moves, teasing the part. However, if we can get the source machine is always the same, this will never happen to us, and we trust that will always go to the right place. This is essential in case we want to machine parts on both sides.

And how can the LinuxCNC do this?
Well you can do so very easily. It has an option to search the origin machine automatically and taking advantage of the limit switches.

The first would set the limit switches so as to allow this option. In the setup wizard LinuxCNC, we need to set the limit switches with this option:

Each pin associated with each axis option “Both Limit + Home X” this means that whenever the limit that axis is reached, will perform the program has reached a physical limit (when machining or moving) or it has come to the machine home position (when you’re looking for)

Then we have to set the conditions of “search” for each axis of this origin


For my X axis, for example we have in the second block of options values ​​to search automatically the machine origin.
These values have not yet entirely clear how they work, and for each machine configuration and various motors, so you can not completely follow this configuration, as this is what works for me.

  • Table Travel: this basically defines the workload, the LinuxCNC know that from the source machine can not move more than 1000mm (in my case) Also, graphically draw a parallelepiped with these measures and to help us to graphically visualize our volume working.
  • Home Search Velocity: the speed with which you go to find the source. It is important to not only the value but also the sign. The value should not be the maximum movement of the engines, mainly by inertia that drag. Since he does not know when he will touch the limit switch until you touch it, and think that when you touch will have to slow down movement 0mm … which does not in any case. So a better slow speed will moderate ideal as it gives you time to stand where it touches and not break anything. The sign is also important because if you define the X axis, in this case, moves to the left or right (depending on where we are interested in having our origin machine)
  • Home Switch Location: this will be the physical distance between the source machine and the point where each axis touches its limit. That is, when I touch the X axis limit, the program automatically placed the origin on this axis machine, before that point 10mm (10mm in my case) in this way we ensure that we will never again touch the end switch. Since the program remember that once defined the origin machine, never allowed to exceed the limits of the workload.
  • Home location: When you have found the origin by touching the Switch, we can make the distance the origin we want to move. Why is it useful? the fact that the machine origin search, does not mean we have to stop the router in an awkward position, in a corner of the workload. My suits me, for example, when the source machine is in Z, then climb to 70mm to have space for mounting the milling cutter you want to use. In X and Y also, as I come to my comfortable.
  • Home latch direction, I am not clear, but I think it refers to an option when you configure a lathe, so I do not pay much attention.
Okay, we have set up our origin to find LinuxCNC machine automatically, now we have to know how. And this is the easiest thing in the world.
We turn on the LinuxCNC, and go to the option “Machine / homing” and choose Restore X axis according as we put in the wizard, the X axis start moving in the direction and speed that you have set up the final play of career. Once touched, in the window where all the coordinates, the icon will go home, and there will be placed at a distance from the contact point with the limit we have placed on “home switch location.” After touching the Switch, it will move in the opposite direction the distance we have placed on “home location”. We repeat this for all axes, and we have the volume of work in the real place, and the machine defined origin. If every time you start the program, do this operation (which need not take more than 20 seconds) will always have our well-placed origins.
Now we just have to tie the material work wherever we want. then go with the tool where you want to place the workpiece origin in the material (here we go with all the precision we want to define the Z for example for making prints, or whatever) and do a regular offset for each axis as interested.
As you see, easy and simple, and extremely helpful. I have suffered many things to discover these concepts and get my router to automatically search out the origins as I wanted, but I have reduced the preparation time of the part a lot.
I hope these instructions will not lose as much time as I have lost. Insist that these concepts can be complicated or messy, or not you succeed to find the ideal solution for your machine configuration. If so, you can always email me. I’ll try to help you in any way I can.