Customize "Go to sensor"
- tom_no
- 
				 Topic Author Topic Author
- Offline
- Junior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 31
- Thank you received: 7
			
	
						13 Apr 2024 15:56		 -  13 Apr 2024 16:05		#298174
		by tom_no
	
	
		
			
	
	
			 		
													
	
				Customize "Go to sensor" was created by tom_no			
			
				Hi,
Got an issue with the default "Go to sensor" button ignoring tool offsets (X and Y axis).
It is possible to customize the script behind the button, or is it all hard coded?
Edit: Running LinuxCNC 2.9.2 with QT Dragon HD and Probe Basic.
					Got an issue with the default "Go to sensor" button ignoring tool offsets (X and Y axis).
It is possible to customize the script behind the button, or is it all hard coded?
Edit: Running LinuxCNC 2.9.2 with QT Dragon HD and Probe Basic.
		Last edit: 13 Apr 2024 16:05  by tom_no.			
			Please Log in or Create an account to join the conversation.
- cmorley
- Away
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 7230
- Thank you received: 2106
			
	
						13 Apr 2024 23:47				#298209
		by cmorley
	
	
		
			
	
	
			 		
													
	
				Replied by cmorley on topic Customize "Go to sensor"			
			
				Its in the python handler file
In 2.9.2:
in 2.9.3:			
					In 2.9.2:
     def btn_goto_sensor_clicked(self):
         x = float(self.w.lineEdit_sensor_x.text())
         y = float(self.w.lineEdit_sensor_y.text())
        if not STATUS.is_metric_mode():
            x = x / 25.4
            y = y / 25.4
         ACTION.CALL_MDI("G90")
         ACTION.CALL_MDI_WAIT("G53 G0 Z0")
         command = "G53 G0 X{:3.4f} Y{:3.4f}".format(x, y)
         ACTION.CALL_MDI_WAIT(command, 10)
in 2.9.3:
    def btn_goto_location_clicked(self):
        dest = self.w.sender().property('location')
        if dest == 'home':
            x = float(self.w.lbl_home_x.text())
            y = float(self.w.lbl_home_y.text())
        elif dest == 'sensor':
            x = float(self.w.lineEdit_sensor_x.text())
            y = float(self.w.lineEdit_sensor_y.text())
        else:
            return
        if STATUS.is_metric_mode():
            x = INFO.convert_machine_to_metric(x)
            y = INFO.convert_machine_to_metric(y)
        else:
            x = INFO.convert_machine_to_imperial(x)
            y = INFO.convert_machine_to_imperial(y)
        ACTION.CALL_MDI("G90")
        ACTION.CALL_MDI_WAIT("G53 G0 Z0")
        command = "G53 G0 X{:3.4f} Y{:3.4f}".format(x, y)
        ACTION.CALL_MDI_WAIT(command, self.calc_mdi_move_wait_time(x,y))
		The following user(s) said Thank You: tommylight, Pro_El 	
			Please Log in or Create an account to join the conversation.
- tom_no
- 
				 Topic Author Topic Author
- Offline
- Junior Member
- 
				  
		Less
		More
		
			
	
		- Posts: 31
- Thank you received: 7
			
	
						14 Apr 2024 19:37				#298251
		by tom_no
	
	
		
			
	
			
			 		
													
	
				Replied by tom_no on topic Customize "Go to sensor"			
			
				Thanks for the reply cmorley!
Can't see anything in the code that should make the scripts ignore tool offsets, so tried to dig a step deeper. Found that the tool offsets are ignored in G53 movements for machine coordinates, but not in G54, G55 user coordinate systems.
Is this a bug or a feature?
Is the solution to do the Go-to-sensor movement in one of the user coordinate systems for machines with multiple spindles?
					Can't see anything in the code that should make the scripts ignore tool offsets, so tried to dig a step deeper. Found that the tool offsets are ignored in G53 movements for machine coordinates, but not in G54, G55 user coordinate systems.
Is this a bug or a feature?
Is the solution to do the Go-to-sensor movement in one of the user coordinate systems for machines with multiple spindles?
Please Log in or Create an account to join the conversation.
- cmorley
- Away
- Moderator
- 
				  
		Less
		More
		
			
	
		- Posts: 7230
- Thank you received: 2106
			
	
						15 Apr 2024 02:47				#298267
		by cmorley
	
	
		
			
	
			
			 		
													
	
				Replied by cmorley on topic Customize "Go to sensor"			
			
				It's a feature.
linuxcnc.org/docs/devel/html/gcode/coord...ne-coordinate-system
You could use macro buttons to add your own button that calls arbitrary Gcode:
linuxcnc.org/docs/devel/html/gui/qtdragon.html#_macro_buttons
					linuxcnc.org/docs/devel/html/gcode/coord...ne-coordinate-system
You could use macro buttons to add your own button that calls arbitrary Gcode:
linuxcnc.org/docs/devel/html/gui/qtdragon.html#_macro_buttons
Please Log in or Create an account to join the conversation.
		Moderators: cmorley	
		Time to create page: 0.125 seconds	
