Hello Guest it is March 28, 2024, 07:10:31 PM

Author Topic: Trying to understand offsets  (Read 4085 times)

0 Members and 1 Guest are viewing this topic.

Offline Sage

*
  •  365 365
    • View Profile
Trying to understand offsets
« on: September 05, 2008, 02:30:17 PM »
I'm new to using offsets so I thought I write a short program to see if my understanding is correct. I won't attach it as someone may be able to explain what's going on just by looking at the code below. I haven't run it on my machine yet but, by following the machine co-ordinates DRO it looks like it is working properly but the toolpath screen seems confused.
 It should machine three 1" squares the first with it's bottom left corner at 0,0 the second starting at the upper right corner of the first at 1,1 and the third starting at the upper right corner of the second at 2,2.
Maybe someone can explain why the machine co-ordinates DRO looks corect but the toopath seems to write over the same squares more than once it might help me. (I tried bot normal and table modes of toolpath and neither looked correct)
Thanks
Sage

(Setup as follows)
(manually set the following X,Y fixture offsets in config)
(G54 is co-ordinates 0,0)
(G55 is co-ordinates 1,1)
(G56 is co-ordinates 2,2)
(Z is zeroed at work surface)
(Set M1 optional stop on to observe movement)
(ref all home)
(run program)
(tool path screen shows ok with 3 boxes linked top left to bottom right)
(if program is run production movements are correct on machine co-ordinates DRO)
(on tool path screen production movements are confused)

(program starts here)
M1 (stop to view screen)
Z.1 (tool up to stay clear)
G54 (reset offsets)
G0X0Y0 (go fast to 0,0)
m1 (stop to view screen)
Z-.010F1 (tool slowly into work 10thou)
X1F5 (mill a 1" square)
Y1
X0
Y0
G0Z.1 (tool up quickly)
g55 (Load second set of offsets)
G0X0Y0 (go quickly to new 0,0 location which is actually 1,1)
m1 (stop to view screen)
Z-.010F1
X1F5 (mill a 1" square)
Y1
X0
Y0
G0Z.1
g56
G0X0Y0 (go quickly to new 0,0 location which is actually 2,2)
m1
Z-.010F1
X1F5
Y1
X0
Y0
G0Z.1
G54 (cancel offsets)
M30 (end and rewind)

« Last Edit: September 05, 2008, 02:32:51 PM by Sage »

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Trying to understand offsets
« Reply #1 on: September 05, 2008, 07:44:28 PM »
Looks like a toolpath bug
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Trying to understand offsets
« Reply #2 on: September 06, 2008, 03:34:38 AM »
There is no bug.

Mach3 keeps track of its position in Machine Co-ordinates. These are only changable by homing. If homing switches are fitted, then the machine homes and stops and the machine co-ordinates go to zero. You cannot change these co-ordinates. (Yes, If your home switches are disabled, then pressing the Ref All Home button turns all three axis to 0 at any position - but you would normally use the switches)

It is doubtful that the home switches will be in a position where any useful work can be done, and certainly not in a position where the program was written from, so offsets are used. Each program should have the offset from the home position written in at the beginning of the program. In other words you jog your machine to the position where your program starts and then zero the program co-ordinates (displayed if you click the machine co-ordinates button and the led surround goes off). Program co-ordinates can be zeroed at any position.

So you now have you machine at the start point of your program. If you look at the program co-ordinates it will show 0,0. but if you look at the machine co-ordinates it will still show the position of the table as offset from the home position. If you have no offset selected then G54 is the default offset, and if you look in Config/Fixtures, you will see that g54 has these co-ordinates entered in automatically. If you transfer these co-ordinates, say to G55 (or any of the other 255 slots), then if you amend your Gcode program and include g55 at the begining, then the machine knows where to start, and if you were in a professional machine shop, you would home you machine and then when you run the program, the machine automatically moves to the correct position for the start of that program.

For us mere mortals, however, following the position in Machine Co-ordinates is confusing, because the figures refer to some obscure position that the machine knows, but we don't, so we follow the proceedings in program co-ordinates, because they also relate to the program we have written, and we can check it as we go along.

The toolpath window only displays Program Co-ordinates so where you are doing the same pattern at different offsets it seems to repeat over itself.

What you are doing is setting the machine up so that your Machine Co-ordinate position co-incides with your first program co-ordinate position (G54 is 0,0) so as far as the machine is concerned, that is it's home position. It ignores g54 since it is no offset.
It runs the programĀ  from 0,0 and if you look at program and machine co-ordinates you will see they co-incide.
When you feed in g55, the 0,0 position for the program moves to machine co-ordinates 1,1. The program runs from 0.0 again, but it starts at machine position 1,1, and so on. The toolpath window just displays the program, not the machine co-ordinates.

I see in the program you have g54 and then put the comment "reset offsets". g54 does not reset the offsets, it is an offset in it's own right, it is just that you have set it to 0,0. and therefore it is using the machine co-ordinate position.

There is nothing wrong with what you are doing, providing you remember to RefAllHome at your 0,0 point. Indeed if you had some sort of switches you could set to home to this position it would be most convenient. Mine are lasers shining on detectors so I could possible do it, but with mechanical switches it is difficult.

But that it the explanation. If you think about it, if you home you table somewhere out of the way, and RefAllHome, (to zero your machine-co-ordinates) then jog to your starting position and then zero your program co-ordinates - check g54 - it might read 5,4 (for simplicity).
If you now alter g55 to read 6,5 and g56 to 7,6 you will get the same effect. Jog your table anywhere and set it running.

The machine will pick up G54 and run to the first start positiom, then g55 and run to the second start position and g56 and run to the third position.

Offsets are all calculated from the 0,0 machine co-ordinates 0,0 position
















« Last Edit: September 06, 2008, 03:38:33 AM by jimpinder »
Not me driving the engine - I'm better looking.

Offline ger21

*
  • *
  •  6,295 6,295
    • View Profile
    • The CNC Woodworker
Re: Trying to understand offsets
« Reply #3 on: September 10, 2008, 09:21:10 PM »
I think I worded that wrong. Not a toolpath bug, but a toolpath display bug. The issue, though, is that prior to running the program, the toolpath displays all three squares, in the correct positions, but when the program is run, the display shows all three squares being cut in the same spot.

You're saying this is the way it's supposed to look? Imo, the display should show where the tool is, and it's not doing that.
Gerry

2010 Screenset
http://www.thecncwoodworker.com/2010.html

JointCAM Dovetail and Box Joint software
http://www.g-forcecnc.com/jointcam.html

Offline jimpinder

*
  •  1,232 1,232
  • Wakefield, West Yorks, UK
    • View Profile
Re: Trying to understand offsets
« Reply #4 on: September 10, 2008, 09:49:46 PM »
This has been known about for some time.

I suppose the problem is one of compromise.

The pattern is shown correctly at the start, because Mach runs through the full program, and then displays it, all from Machine Co-ordinates. The yellow line display of the cutter runs from program co-ordinates.

To have the display show all the offsets, all the time, would mean that the display would have to run from the Machine Co-ordinates, not the program co-ordinates. This means for those with home switches and such, the whole area of movement of the table would be shown, when all you are really interested in is the actual bit where the cutter is, and I can't really see a simple way of "focusing" on the bit you are interested in and leaving the rest out.




Not me driving the engine - I'm better looking.