Understanding Homing for a mill
Please Log in or Create an account to join the conversation.
- Todd Zuercher
-
- Away
- Platinum Member
-
- Posts: 4978
- Thank you received: 1377
So under AXIS_0 you would have
HOME = 13.5
HOME_OFFSET = 13.5
under [AXIS_1]
HOME = 14.0
HOME_OFFSET = 14.0
under [AXIS_2]
HOME = 0.0
HOME_OFFSET = 0.0
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
linuxcnc.org/docs/2.6/html/config/ini_config.html
In the TRAJ section of your ini file.
POSITION_FILE = position.txt - If set to a non-empty value, the joint positions are stored between runs in this file. This allows the machine to start with the same coordinates it had on shutdown. This assumes there was no movement of the machine while powered off. If unset, joint positions are not stored and will begin at 0 each time LinuxCNC is started. This can help on smaller machines without home switches.
Normally what I do before shutting down the machine is issue
G53 G0 X0 Y0 Z0
To send the machine to the home positions / index marks before shutting down to be ready for the next run.
Keep in mind you would normally home your machine then jog to your work and "touch off" in the coordinate system you want to work in such as G54. In this case after working in the G54 coordinate system you issue the G53 G0 X0 Y0 Z0 to return the machine to the home position and the G54 offsets can be saved to file. When you restart the machine and home it the offsets will be applied in the coordinate system you are using such as G54.
So...
G54
G0 X0 Y0 Z0 will return you to the "touch off position".
Rick G
Please Log in or Create an account to join the conversation.
Please Log in or Create an account to join the conversation.
Anyone have an idea how to tell linuxcnc to leave these parameter values alone? I am thinking the only option I have is to write a small program that will run prior to linuxcnc launching which will rewrite the stepper.var file and always zero out these three parameters.
Please Log in or Create an account to join the conversation.
I think that you are confusing the concepts of "homing" and "touch off"
I assume that you do not have home switches? In that case you should set the home search and latch velocities to zero in the INI.
Then you jog the machine to marks on the slides that correspond to the (arbitrary) zero points on the axes. With steppers it might be OK for this to simply involve stalling the steppers against the end stops.
Then when you press the "home all" button the axis absolute positions will all be set to zero. That is the machine "homed" and it now knows where the axis limits are, and can avoid running in to them.
Then you "touch off" to set the G54 offsets. This is what sets the difference between the machine absolute positions and the origin of the G-code. (typically a corner of the stock, or the middle of a hole).
You may not have a "home all" button unless each axis has a HOME_SEQUENCE number in the INI file.
If you absolutely insist that you want to clear the G54 offsets on every startup you can put G10 L2 P1 X0 Y0 Z0 in the RS274NGC_STARTUP_CODE section of the INI file. But I don't think that this is the optimum way to work.
Please Log in or Create an account to join the conversation.
I want my home position (which is in machine units) to be at the midpoint of my x travel, at the maximum of my y travel (which moves the table all the way out towards the operator), and at z=0 (which retracts the quill to its upper limit). When I start Linuxcnc I jog the machine to this x,y,z location and then I tell it to home each axis. When this is complete, the upper display in the AXIS GUI reads x = 4.0, y = 5.0, and z = 0. (This makes sense that this upper set of coordinates is displaying the machine units). This initial homing sets the position I want the machine to return to when I do a tool change and when a program finally ends. It also works with the software limits on my table to stop the table prior to physically crashing the machine.
To start machining, I need to set a local coordinate system which will reference the program to a fixed point on the material. In the case of linuxcnc the first local coordinate system is G54. I now move my tool to a predefined point on the material, which in the case of the sample program I am working with, that is the upper left corner of the material (all of my tool paths will be in the positive x and negative y quadrant). I now touch off this location on all three axes assigning the value of 0 to each axis in the G54 coordinate system. Now the AXIS GUI display lists the topmost x,y,z locations as all zeros (which is correct for the G54 coordinate system) even though initially these values showed machine units 1 minute ago when I homed all three axes. The next group of coordinates downward on the AXIS GUI display are labeled G54 and I would assume coordinates labeled G54 should contain the current tool location in G54 coordinate values, but instead it appears these values contain the offset values of the G54 origin from the home position.
Now when I run my program it correctly machines the part and since I end my program with a G53 X4.0 Y5.0 Z-0.01 the machines returns to the home position I specified. One interesting fact is that I can not return the machine to Z=0.0 although that is where the home position was set. If I include my G53 command to have z0.0, instead of z-0.01, linuxcnc tells me the linear move exceeds joint 2's positive limit. I also tried -0.0 and got the same error. Either there is some sort of a round-off error (z=-0.0001 does work), or in a logical IF test in the code there is an error which excludes z=0.0 from being within the limits of the z axis extending from 0.0 to -6.0. (not seeing the code, I would guess there is a logical IF test on the z axis which possibly reads "less than" and really should read "less than or equal to". I also find that if I do an emergency stop halfway through the program and then go to the mdi tab and issue G53 x4.0 y5.0 z0.0, I also get an error about exceeded joint 2's positive limit. I have to make the z value something less than z=0.0 now, even though the G53 command with z=0.0 worked prior to loading and running the program for the first time (and yes on tool offset is zero and it really should not matter if I am in machine units).
NOW comes the crazy part. If I emergency stop the program, and then close linuxcnc, I leave my mill NOT at the home position. When I restart linuxcnc, the program starts up with values listed in the upper set of coordinates shown in the AXIS GUI display which are equal to the offset distance of the G54 origin from the original machine home position. WHY? The tool is not at this position right now. These values have no meaning at this time. If I jog the machine until these values are 0,0,0; I am NOT at the machine's home position because the machine did not stop at the G54 origin. Now when I jog my machine to the physical location were I want the machine's home position to be, and I home the axes, the display DOES NOT show the upper set of coordinates as 4.0, 5.0, 0.0 like it did when I first homed the machine, and like I think it should. The displayed values are now equal to the home position values (4.0,5.0,0.0) offset by these seemingly arbitrary values that appeared when I restarted linuxcnc. The offsets are equal to the distance I moved from the original home position to the original G54 origin which actually have no real value now since when I reset the machine to the home location, it probably will not be exactly the same as the first time, and since the machine did not initially stop at the G54 origin, these offset values have no reference. After I home the machine, If I jog the axes and then issued a G53 x4.0 y5.0 z0.0 command, the machine does return to its home position so I guess that the home setting took, but the display in AXIS is screwy. The upper set of coordinates is not in machine units, but some offset of machine units.
Maybe the whole problem is that I do not understand what the AXIS GUI is telling me. I most assuredly should have a numerical display in the current local coordinate system which is what I expected the values labeled G54 to be, but these values do not change when the program is running. The upper set of coordinates appear to represent the movement of the tool, and shows the tool in its machine units the first time I home the machine with parameter 5221, 5222, and 5223 set to zero, but after a shutdown of the program and a restart, these values really do not represent any logical measurement at start-up or after I home the machine. The G54 offset valeus in parameters 5221, 5222, and 5223 are meaningless after a system shutdown since linuxcnc does not know where the machine was when it was shutdown. At least as far as I can tell, linuxcnc does not save the last physical position of the tool. After the second homing the coordinates should show 4.0,5.0,0.0 ( the home location in machine unit) like it did the first time, but it does not. The coordinates should not be displaying any values associated in any way with the G54 coordinate system since I have yet touched off the part to define the G54 coordinate system.
At least if I zero parameters 5221,5222, and 5223 prior to starting linuxcnc every time, the values in the upper coordinate display make sense; they are in machine units after I home the axes. Is there some other explanation of what these values represent that I am missing? It is also poor that these values at one time represent machine unit and at another time represent the local G54 coordinate system, but there is no labeling identifying which coordinate system the values are in.
My old Dynapath display clearly identified coordinates and what system the values were in. Is there some sort of default convention I should know and don't? Is there some logical explanation I am missing? Currently the only thing that allows the displayed units to make sense is to zero the 5221, 5222, and 5223 parameters so the display shows machine units to start.
Please Log in or Create an account to join the conversation.
Maybe the whole problem is that I do not understand what the AXIS GUI is telling me.
I think that this is probably the case.
The extended DRO shows the offsets, as you have noticed, not any sort of position. I turn that display off, except when I want it.
In the "View" menu un-select offsets and things will tidy up rather.
Also in the "View" menu you will see (near the bottom) an option to view machine coordinates and there is an option to switch to this with the # key.
Back to your scenario. You home the machine, with zero offsets in G54 and the display will show (4,5,0) in both work and machine coordinates. You jog to a point on the work and touch off to show (0,0,0). The display will now show (0,0,0) or some other numbers in machine coordinates if you press #. There is a little tell-tale at the bottom of the screen that tells you what you are viewing.
So, now you e-stop the machine and re-start, you jog to your home positions and the display is not (4,5,0) as you expect. But it will be if you press #. Furthermore, if you switch to relative coordinates and jog to the corner of your work, you will see that the display (relative) is (0,0,0).
This means that on a machine with homing switches, and even with your machine, of you home accurately, you can just press "run" after homing and your G-code will run from the origin you set in the last session. This can be very useful, if, for example, you have already milled-away your reference corner.
You can avoid your can't-get-to-X=0 problem by setting the Z home position to +0.001.
Please Log in or Create an account to join the conversation.
One other issue I have is trying to go back to the home position after the program is done. I can always code in a G53 GO X4.0 y5.0 z0.0 at the end of the program to return to the home position, but then the CAM file ends up machine specific. I have tried doing a G91 G28 X0.0 Y0.0 Z0.0 which should return the tool to the home position if the home position is has been stored in parameters 5161-5166 using a G28.1. I tried this by editing the parameter file and inserting my home position values in these parameters, but once the program ran, the program inserts its own values in parameters 5161 - 5166 even though I never issued a G28.1 command. Any idea why or where linuxcnc is putting values into these parameters? I also found that linuxcnc is putting values in parameters 5181-5186, the parameters used by G30, again even though I do not issue a G30.1. I do not mind editing the parameter file and making it machine specific, but why is linuxcnc putting values into these parameters without me calling the g-codes to do it?
Please Log in or Create an account to join the conversation.