Newbie question about offsets and homing

More
13 May 2012 17:35 #20056 by Bullseye
If because of the questions I pose I am in the wrong forum, please let me know and and I will re-post.
I have a home built 3 axis machine running LinuxCNC 2.5.0 with limit switches installed on all three axises and using a combination limit/home switch configuration. My question concerns homing and offsets from the home position. I use the machine mostly for doing engraving and want to do multiple objects one after the other. When I home the machine (using the limit switches), and then execute the Gcode, the first iteration works fine. Then when I put the second workpiece in the fixture to hold it for engraving. When the same Gcode is executed again, the cutter moves to a location that is offset in all 3 axises unless I close and completely reset LinuxCNC. Checking the offsets shows that there are now work offsets in the register. I am not using any G53, G54 or G92 commands or tool compensation commands in my programs (yet).

Question.. How.can I get the machine to automatically return to the home position at the end of a program?
Question...Can I do this using the limit/home switch configuration?
Question... If X0, Y0, Z0 are my mechanical stops as determined by the limit switches how do I properly configure for the soft home and normal home coordinates?
Question...How do I prevent the machine/code from automatically setting work or fixture offsets?

What I want to do is set up the machine, run the program, install another work piece and rerun the code for the second and subsequent pieces. As hard as I try, I have not been able to get this to work properly. Even though I am not (intentionally) using offsets,I believe that my problem is caused mostly by improper set up of the home, safe limit and perhaps coding of some of the initialization parameters.

Any guidance to point me in the right direction will be greatly appreciated since this is my first experience with CNC and I feel like I am in way over my head.
Thanks,

Bill

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

More
13 May 2012 18:51 #20057 by BigJohnT
If you can attach your ngc file maybe we can spot the error.

My first question is are using absolute or relative moves?

To return to the machine home G53 G0 X0 Y0 Z0 will put you back at the machine origin (home position).

John

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

More
13 May 2012 18:53 #20058 by BigJohnT
My second question is are you using CAM generated G code?

John

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

More
14 May 2012 03:02 #20067 by Bullseye
John,
thanks for taking the time to reply.
I have attached the test file that I am using. The code is generated for me by Stickfonts and is all absolute moves. I have tried putting a G53 x0 y0 z0 in the front of the file but it did not seem to help. I still feel that my problem has something to do with my setup.

Bill

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

More
14 May 2012 03:04 #20068 by Bullseye
Sorry but I had to change the file type in order to attach my test file. It is attached to this message.
Bill

File Attachment:

File Name: Test_Program.ngc
File Size:3 KB
Attachments:

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

More
14 May 2012 08:37 #20069 by cncbasher
your test file is missing initialisation values and specific setup details
which for example cancel work offsets etc , set up modes etc .

i'll re do your file and post an update as an example in a few mins , which will show you good practice
an excellent book is ' cnc programing handbook by peter smid ' just about covers every aspect it's worth a good read

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

More
14 May 2012 08:53 #20070 by cncbasher
ok see attached file
i have left gaps to show the parts modified etc .

notice the specific gcode turning off work offsets and setting modes , this is good practice to essentialy set up the machine rather than presume that the machine is correct
at the top of each gcode file and resetting at the end etc .

it also sets tool to be specificly tool 1 etc , i always leave tool 1 to have no offsets in my tool table , so i always have a default

i show this as an example , i'm not saying it's error proof , so check before using etc

File Attachment:

File Name: Test_Program2.ngc
File Size:3 KB
Attachments:

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

More
14 May 2012 09:56 #20072 by andypugh
Bullseye wrote:

the first iteration works fine. Then when I put the second workpiece in the fixture to hold it for engraving. When the same Gcode is executed again, the cutter moves to a location that is offset in all 3 axises unless I close and completely reset LinuxCNC.


I suspect that you are in relative motion (G91) mode, by mistake. It might be that all you need is a G90 command
www.linuxcnc.org/docview/html/gcode/gcode.html#sec:G90-G91

You could possibly set this in the MDI window, and it ought to stick, but it is good practice to set it at the beginning of all programs to be sure.

Another possibility is that you are losing position during a long rapid. This will only happen if the machine speed/accel are set too high though.

in either of the above case Machine -> unhome all / followed by a re-home ought to fix the issue temporarily. If it is a machine-offset being applied, then it won't/

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

More
14 May 2012 12:41 - 14 May 2012 12:44 #20075 by BigJohnT
Bullseye wrote:

John,
thanks for taking the time to reply.
I have attached the test file that I am using. The code is generated for me by Stickfonts and is all absolute moves. I have tried putting a G53 x0 y0 z0 in the front of the file but it did not seem to help. I still feel that my problem has something to do with my setup.

Bill


But you didn't specify absolute in your missing preamble. Also G53 with axis words without a motion word will do nothing. You would have to say "G53 G0 X0 Y0 Z0" to rapid to the machine origin. Notice the G0 rapid word in there.

Your file only contains G0 and G1 moves and I ran it twice in the simulator and don't see anything shifting on the second run so I agree the problem has to be elsewhere.

I have been working on a G code tutorial specifically for LinuxCNC, if you care to look at it the preamble section it will help you prepare a proper preamble for your G code.

One last note the normal file end it M2, I'm not sure what M30 does exactly...

Also, have you tested your machine to make sure your not loosing steps?

linuxcnc.org/docview/html/common/Stepper...ostics.html#_testing

John
Last edit: 14 May 2012 12:44 by BigJohnT.

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

More
14 May 2012 13:04 #20077 by cncbasher
John :
M2 is End program (usualy with reset , no rewind )
M30 is End program ( always with reset and rewind )

so a slight variation John

sorry for hijacking the thread , but just to answer Johns query etc ..
good work on the gcode tutorial to

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

Time to create page: 0.077 seconds
Powered by Kunena Forum