From 2c74930f8278517f02991accb6d646c5b6dc4741 Mon Sep 17 00:00:00 2001 From: GuiHue <51243895+GuiHue@users.noreply.github.com> Date: Sun, 22 Sep 2019 07:59:01 +0200 Subject: [PATCH 1/6] Changed axis commands for 2.8 compatibility --- macros/block_down.ngc | 2 +- macros/probe_down.ngc | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/macros/block_down.ngc b/macros/block_down.ngc index 8d0f746..ffbe2c8 100644 --- a/macros/block_down.ngc +++ b/macros/block_down.ngc @@ -2,7 +2,7 @@ o sub (cancel all Z offsets) G49 G92.1 -G10 L20 P0 Z[#<_hal[axis.2.joint-pos-cmd]>] +G10 L20 P0 Z[#<_hal[axis.z.pos-cmd]>] G91 F #<_hal[probe.ps_searchvel]> diff --git a/macros/probe_down.ngc b/macros/probe_down.ngc index 5799f24..a8dfb1a 100644 --- a/macros/probe_down.ngc +++ b/macros/probe_down.ngc @@ -1,12 +1,13 @@ o sub F#<_ini[TOOLSENSOR]RAPID_SPEED> -G53 G1 Z[#<_ini[AXIS_2]MAX_LIMIT>-0.1] +G90 +G53 G1 Z[#<_ini[AXIS_Z]MAX_LIMIT>-0.1] G53 G1 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>] G53 G1 Z[#<_ini[TOOLSENSOR]Z>] (cancel all Z offsets) G92.1 G49 -G10 L20 P0 Z[#<_hal[axis.2.joint-pos-cmd]>] +G10 L20 P0 Z[#<_hal[axis.z.pos-cmd]>] G91 F #<_hal[probe.ps_searchvel]> From c90d51c0b3ba6de70b2cc417e5b20fadb3d1552d Mon Sep 17 00:00:00 2001 From: GuiHue <51243895+GuiHue@users.noreply.github.com> Date: Sun, 22 Sep 2019 07:59:36 +0200 Subject: [PATCH 2/6] Update README.md --- README.md | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index bc93789..f544974 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ # Probe Screen V2 for LinuxCNC +This version contains minor changes to make probe screen work in 2.8 (axis/joint topic) + Install. ----------------------------------------------------------------------------- 1. Delete (or comment out) from all .hal files lines of the form: @@ -89,4 +91,4 @@ v.2.0.6 При изменении значений параметров с помощью клавиатуры (а не мышкой по стрелкам) обязательно нажать Enter для фиксации новых значений Использовать только! ту кнопку, которая соответствует позиции центроискателя над заготовкой. Для другой кнопки - другая позиция над заготовкой. -Подробнее см. https://vers.by/ru/blog/useful-articles/probe-screen \ No newline at end of file +Подробнее см. https://vers.by/ru/blog/useful-articles/probe-screen From bcb3763e240f077ce9408824abbfae791056cdde Mon Sep 17 00:00:00 2001 From: GuiHue <51243895+GuiHue@users.noreply.github.com> Date: Sun, 22 Sep 2019 08:01:11 +0200 Subject: [PATCH 3/6] Add files via upload --- python/probe_screen.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/python/probe_screen.py b/python/probe_screen.py index bc323fc..ee9b7fc 100644 --- a/python/probe_screen.py +++ b/python/probe_screen.py @@ -2015,7 +2015,7 @@ def on_spbtn_block_height_value_changed( self, gtkspinbutton, data = None ): self.warning_dialog( self, _( "Conversion error in btn_block_height!" ), _( "Please enter only numerical values\nValues have not been applied" ) ) # set koordinate system to new origin - origin = float(self.inifile.find("AXIS_2", "MIN_LIMIT")) + blockheight + origin = float(self.inifile.find("AXIS_Z", "MIN_LIMIT")) + blockheight self.command.mode( linuxcnc.MODE_MDI ) self.command.wait_complete() self.command.mdi( "G10 L2 P0 Z%s" % origin ) From 5da209b91985d35391d2f04a908bf1916902b303 Mon Sep 17 00:00:00 2001 From: GuiHue <51243895+GuiHue@users.noreply.github.com> Date: Sat, 28 Sep 2019 21:12:30 +0200 Subject: [PATCH 4/6] fixed probe_screen.py Small fixes to probe_screen.py to enable jog functions in LinuxCNC 2.8/ Master --- macros/gotots.ngc | 2 +- macros/manual_change.ngc | 8 +++++--- python/probe_screen.py | 16 +++++++--------- 3 files changed, 13 insertions(+), 13 deletions(-) diff --git a/macros/gotots.ngc b/macros/gotots.ngc index c156e6d..ef1102f 100644 --- a/macros/gotots.ngc +++ b/macros/gotots.ngc @@ -1,6 +1,6 @@ o sub F#<_ini[TOOLSENSOR]RAPID_SPEED> -G53 G1 Z[#<_ini[AXIS_2]MAX_LIMIT>] +G53 G1 Z[#<_ini[AXIS_Z]MAX_LIMIT>] G53 G1 X[#<_ini[TOOLSENSOR]X>] Y[#<_ini[TOOLSENSOR]Y>] G53 G1 Z[#<_ini[TOOLSENSOR]Z>] diff --git a/macros/manual_change.ngc b/macros/manual_change.ngc index 4e44a9f..f2882e2 100644 --- a/macros/manual_change.ngc +++ b/macros/manual_change.ngc @@ -17,7 +17,8 @@ O100 return [999] O100 endif ;first go up -G53 G0 Z[#<_ini[AXIS_2]MAX_LIMIT>-0.1] +G90 +G53 G0 Z[#<_ini[AXIS_Z]MAX_LIMIT>-0.1] ; then move to change position G53 G0 X[#<_ini[CHANGE_POSITION]X>] Y[#<_ini[CHANGE_POSITION]Y>] G53 G0 Z[#<_ini[CHANGE_POSITION]Z>] @@ -46,10 +47,11 @@ O400 endif F #<_hal[probe.ps_searchvel]> G91 G38.2 Z #<_ini[TOOLSENSOR]MAXPROBE> -G0 Z0.26 +G38.4 Z2 +;G1 Z0.5 ; This is commented out only for sim. F #<_hal[probe.ps_probevel]> -G38.2 Z-0.5 +G38.2 Z-2 O500 if [#5070 EQ 0] G90 diff --git a/python/probe_screen.py b/python/probe_screen.py index ee9b7fc..c315752 100644 --- a/python/probe_screen.py +++ b/python/probe_screen.py @@ -379,32 +379,30 @@ def on_btn_jog_pressed( self, widget, data = None ): value = 0.2 else: value = 1 - - velocity = float(self.inifile.find("TRAJ", "DEFAULT_VELOCITY")) - + velocity = int(self.inifile.find("TRAJ", "DEFAULT_LINEAR_VELOCITY")) dir = widget.get_label()[1] if dir == "+": direction = 1 else: direction = -1 - + jjogmode=True if self.distance <> 0: # incremental jogging - self.command.jog( linuxcnc.JOG_INCREMENT, axisnumber, direction * velocity, self.distance ) + self.command.jog( linuxcnc.JOG_INCREMENT , jjogmode , axisnumber , direction * velocity , self.distance ) else: # continuous jogging - self.command.jog( linuxcnc.JOG_CONTINUOUS, axisnumber, direction * velocity ) + self.command.jog( linuxcnc.JOG_CONTINUOUS , jjogmode, axisnumber , direction * velocity ) def on_btn_jog_released( self, widget, data = None ): axisletter = widget.get_label()[0] if not axisletter.lower() in "xyzabcuvw": print ( "unknown axis %s" % axisletter ) return - - axis = "xyzabcuvw".index( axisletter.lower() ) + jjogmode=True + axisnumber = "xyzabcuvw".index( axisletter.lower() ) if self.distance <> 0: pass else: - self.command.jog( linuxcnc.JOG_STOP, axis ) + self.command.jog( linuxcnc.JOG_STOP, jjogmode, axisnumber ) # Spin buttons From 3350482c0989090465364ecc143a799f5bc3b6cb Mon Sep 17 00:00:00 2001 From: GuiHue <51243895+GuiHue@users.noreply.github.com> Date: Thu, 3 Oct 2019 10:18:25 +0200 Subject: [PATCH 5/6] Update README.md --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index f544974..961c3dc 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ # Probe Screen V2 for LinuxCNC -This version contains minor changes to make probe screen work in 2.8 (axis/joint topic) +This version contains minor changes to make probe_screen_v2 work in 2.8 (axis/joint topic) +Changes affect macros and probe_screen.py. Install. ----------------------------------------------------------------------------- From 9c4d491824b837835b2091339e2152556cc0e803 Mon Sep 17 00:00:00 2001 From: GuiHue <51243895+GuiHue@users.noreply.github.com> Date: Fri, 4 Oct 2019 18:24:25 +0200 Subject: [PATCH 6/6] fixed jog motions in both referenced and not referenced state --- python/probe_screen.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/python/probe_screen.py b/python/probe_screen.py index c315752..6d65a67 100644 --- a/python/probe_screen.py +++ b/python/probe_screen.py @@ -385,7 +385,8 @@ def on_btn_jog_pressed( self, widget, data = None ): direction = 1 else: direction = -1 - jjogmode=True + jjogmode=True + self.command.teleop_enable(0) if self.distance <> 0: # incremental jogging self.command.jog( linuxcnc.JOG_INCREMENT , jjogmode , axisnumber , direction * velocity , self.distance ) else: # continuous jogging @@ -398,7 +399,7 @@ def on_btn_jog_released( self, widget, data = None ): return jjogmode=True axisnumber = "xyzabcuvw".index( axisletter.lower() ) - + self.command.teleop_enable(0) if self.distance <> 0: pass else: