How to manage a part offset and a local offset
- dansawyer
 - Offline
 - Senior Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 56
 - Thank you received: 1
 
			
	
						22 Jul 2022 04:21				#248004
		by dansawyer
	
	
		
			
	
			
			 		
													
	
				How to manage a part offset and a local offset was created by dansawyer			
			
				The project is to machine parts with individual local subroutines. I tried setting the part offset:
g01 x -[#<_offset>] y -[#<_offset>]
g10 l20 p1 x0 y0
and then set a local subroutine relative
g01 x - [#<_int_width> / 2] y -[#<_int_width> - #<_mill_step>]
g10 l20 p1 x0 y0 ; set the relative axis to
The second g10 overwrites the first g10 and the part offset is lost. In this example: \
1. what command should be used to set the origin for the part?
2. what command should be used to set the local subroutine part origin?
3. How can the first, part origin, be cleared?
4. How can the second, subroutine origin, be cleared?
Thanks, Dan
					g01 x -[#<_offset>] y -[#<_offset>]
g10 l20 p1 x0 y0
and then set a local subroutine relative
g01 x - [#<_int_width> / 2] y -[#<_int_width> - #<_mill_step>]
g10 l20 p1 x0 y0 ; set the relative axis to
The second g10 overwrites the first g10 and the part offset is lost. In this example: \
1. what command should be used to set the origin for the part?
2. what command should be used to set the local subroutine part origin?
3. How can the first, part origin, be cleared?
4. How can the second, subroutine origin, be cleared?
Thanks, Dan
Please Log in or Create an account to join the conversation.
- andypugh
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 19678
 - Thank you received: 4559
 
			
	
						22 Jul 2022 11:44				#248023
		by andypugh
	
	
		
			
	
			
			 		
													
	
				Replied by andypugh on topic How to manage a part offset and a local offset			
			
				It is fairly common to use G92 for this.
linuxcnc.org/docs/stable/html/gcode/g-code.html#gcode:g92
Move the tool to the part origin.
G92 X0 Y0 Z0
{do machining}
G92.1
					linuxcnc.org/docs/stable/html/gcode/g-code.html#gcode:g92
Move the tool to the part origin.
G92 X0 Y0 Z0
{do machining}
G92.1
Please Log in or Create an account to join the conversation.
- dansawyer
 - Offline
 - Senior Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 56
 - Thank you received: 1
 
			
	
						22 Jul 2022 14:01				#248031
		by dansawyer
	
	
		
			
	
			
			 		
													
	
				Replied by dansawyer on topic How to manage a part offset and a local offset			
			
				Thank you. That woried perfectly. Dan			
					Please Log in or Create an account to join the conversation.
- dansawyer
 - Offline
 - Senior Member
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 56
 - Thank you received: 1
 
			
	
						22 Jul 2022 14:21				#248033
		by dansawyer
	
	
		
			
	
			
			 		
													
	
				Replied by dansawyer on topic How to manage a part offset and a local offset			
			
				It would be convinient to call a subroutine within a subroutine and set a local coordinates for that nested call. Assuming the above with g54 working for the first subroutine is there a command that can augment the g54 position for additional subroutine calls?			
					Please Log in or Create an account to join the conversation.
- andypugh
 - 
				
											 - Offline
 - Moderator
 - 
				
			 
		Less
		More
		
			
	
		- Posts: 19678
 - Thank you received: 4559
 
			
	
						29 Jul 2022 11:50				#248611
		by andypugh
	
	
		
			
	
			
			 		
													
	
				Replied by andypugh on topic How to manage a part offset and a local offset			
			
				There is G52, but I have never used it:
linuxcnc.org/docs/stable/html/gcode/coordinates.html#sec:g52
You could also experiment with saving and loading the "modal state":
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m70
					linuxcnc.org/docs/stable/html/gcode/coordinates.html#sec:g52
You could also experiment with saving and loading the "modal state":
linuxcnc.org/docs/stable/html/gcode/m-code.html#mcode:m70
Please Log in or Create an account to join the conversation.
		Time to create page: 0.135 seconds