Customize "Go to sensor"

More
2 years 6 months ago #298174 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.

Please Log in to join the conversation.

More
2 years 6 months ago #298209 by cmorley
Replied by cmorley on topic Customize "Go to sensor"
Its in the python handler file
In 2.9.2:
Code:
     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:
Code:
    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))

Please Log in to join the conversation.

More
2 years 6 months ago #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?

Please Log in to join the conversation.

More
2 years 6 months ago #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

Please Log in to join the conversation.

Time to create page: 0.367 seconds
Powered by Kunena Forum