Understanding Homing for a mill

More
02 May 2016 19:14 #74145 by jwsigler
I am trying to setup Linuxcnc to function similar to what my mill use to do under the Dynapath controller. When I start the mill I want to be able to jog the table until it matches up with three index marks. One marker is for the Z axis fully retracted, one on the Y axis with the table all the way out, and the final one on the X axis with the table at its midpoint of travel. This is where I want to set the home position at 13.5, 14.0, 0.0 (x,y,z). Prior to doing this on my big mill, I am working through the procedure on a small sherline mill setting the table at a similar location of 4.5, 5.5, 0.0 (x,y,z). I can get the procedure to work the first time, but if I shut Linuxcnc down, it apparently stores and remembers the last location of the table so when I power up and jog the axes to the home position and then home each axis, the axes are no longer at 4.5,5.5,0. There is an offset applied that is equal to the last know position of the axes. It seems that linuxcnc stores the last position in parameter file in locations 5221,5222,5223 and immediately applies these values as offsets when the program starts. Is there a way to disable these parameters at startup or get the program to ignore them? I want to move the table to a position specified by me with the coordinates for that position hard coded into the ini file. I can go into the parameter file and edited the last known position parameters to be 0.0 and then my homing procedure will work. I guess I could always write a small program that would run prior to starting linuxcnc which would zero out these parameters, but I should be able to do this some way within linuxcnc. Any suggestions?

Please Log in or Create an account to join the conversation.

More
02 May 2016 21:06 #74147 by Todd Zuercher
Is your problem that the axis moves when when you try home it and you want it to stay put? To do what I think your trying to do, in your ini file the HOME and HOME_OFFSET settings need to match.
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.

More
03 May 2016 00:42 #74151 by jwsigler
Thanks for the response. I already ran into and figured out the issue of having my home and home offset settings needing to match. The issue I had was that linuxcnc was updating parameters 5221, 5222, and 5223 in the stepper.var file with the last know position when I would exit from the program. When I would restart linuxcnc, the program would read in these values and apply them as an offset to the home position I wanted. I know that linuxcnc was changing these parameter values because I was going in and having to edit them back to 0.0 to get the homing scheme that I wanted to use to work. The really weird thing is that today after I started working on the problem again, and I went in and edited the stepper.var file and changed parameters 5221, 5222, and 5223 back to zero; and ever since making those changes, linuxcnc has quit changing them when I quit the program. I know it was updating them yesterday and it was driving me crazy trying to figure out how to handle it, but today it has stopped. I do not know if there is some flag that I possibly turned off today which stops it from storing the last known position in these parameter values. These parameters are the x,y,z offset values for coordinate system 1 (G54) and supposedly they are persistent parameters, but not anymore as of today. If anyone knows of a flag which makes, or un-makes these parameters from being persistent I could use the information in case I run into this problem again. Thanks.

Please Log in or Create an account to join the conversation.

More
03 May 2016 05:46 - 03 May 2016 06:10 #74156 by Rick G
Take a look here...
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
Last edit: 03 May 2016 06:10 by Rick G.

Please Log in or Create an account to join the conversation.

More
03 May 2016 15:15 #74176 by jwsigler
An enabled position_file is exactly what was happening to me and it was driving me crazy. The confusing thing is that I do not have the variable position_file anywhere in my ini file, and especially in the TRAJ section where it is suppose to be. Just to be sure this does not happen again, I am going to insert the position_file variable with an empty value in my ini file so Linuxcnc knows not to store the joint positions. Thanks for the assist.

Please Log in or Create an account to join the conversation.

More
03 May 2016 22:09 - 03 May 2016 22:13 #74204 by jwsigler
Alright this is not working. I just ran a simple program and it did not end well which is not a big deal since I am running this on my small sherline mill. Stalling a small stepper motor is not a disaster. I exited out of Linuxcnc and when I went back into LinuxCNC I found that the last position of the mill had been written into parameters 5221, 5222, and 5223. Now when I adjust the axis to the home location and then try to home the machine, linuxcnc wants to use the values in 5221, 5222, and 5223 as offsets to the homing operation. If I look at the AXIS gui, the X, y, z values in the upper left of the graphical display start at the last machine position just prior to the crash. If I have an error and the machine crashes, it would be nice for the values of x, y, z, to be left as zero. I need a way to tell linuxcnc to leave the values in parameters 5221, 5222, and 5223 alone. I do not need linuxcnc to add insult to injury. I understand there is a POV that would say "restart the machine from the last position when it crashed", but I am more comfortable with admitting my error, re-positioning the machine to its original home position and then telling linuxcnc to reset at this know home position.

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.
Last edit: 03 May 2016 22:13 by jwsigler.

Please Log in or Create an account to join the conversation.

More
04 May 2016 15:37 #74232 by andypugh
5221 and so on are the G54 offsets.

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.

More
04 May 2016 20:16 #74244 by jwsigler
I am not sure where the confusion is.
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.

More
04 May 2016 21:35 #74246 by andypugh

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.

More
05 May 2016 05:40 #74254 by jwsigler
Well that is disappointing. I was kind of hoping that there was some flag I missed which would have the display showing machine units, local coordinate system units, distance to go, etc. all at the same time. I will have to work with what I can until I get time to design my own GUI. I did try the trick of setting my Zmax value to 0.001 and that fixed the problem of getting an error when the machine homes to Z0.0.
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.

Time to create page: 0.124 seconds
Powered by Kunena Forum