From f6dc60bbde61c6e804ae8dbb2d7f5a0e662a2c33 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sat, 25 Jul 2020 13:54:51 +1000 Subject: [PATCH 001/316] plasmac: change gcode feed rate warnings --- configs/by_machine/plasmac/plasmac_gcode.py | 38 ++++++++++++--------- 1 file changed, 21 insertions(+), 17 deletions(-) diff --git a/configs/by_machine/plasmac/plasmac_gcode.py b/configs/by_machine/plasmac/plasmac_gcode.py index 06b9d4e50e..d857140ea4 100755 --- a/configs/by_machine/plasmac/plasmac_gcode.py +++ b/configs/by_machine/plasmac/plasmac_gcode.py @@ -53,6 +53,7 @@ thisMaterial = 0 offsetG41 = False cutType = int(Popen('halcmd getp plasmac_run.cut-type', stdout = PIPE, shell = True).communicate()[0]) +feedWarning = False #pauseAtEnd = 2 # error dialog def dialog_error(mode, title, error): @@ -574,23 +575,26 @@ def get_materials(): # FIX_ME if state tag ups pin released in master branch if linuxcnc.version.startswith('2.9.') or True: - if cutFeed and cutFeed != codeFeed: - wng = 'Gcode feed rate is F{:0.{}f}\n'.format(codeFeed, dec) - wng += '\nMaterial #{} feed rate is F{:0.{}f}\n'.format(material, cutFeed, dec) - wng += '\nTHC calculations will be based on the\n' - wng += 'material #{} feed rate which may cause issues.\n'.format(material) - else: - wng = 'Gcode feed rate is F{:0.{}f}\n'.format(codeFeed, dec) - wng += '\nMaterial #{} feed rate is F{:0.{}f}\n'.format(material, cutFeed, dec) - wng += '\nThis will cause the THC calculations\n' - wng += 'to use the motion.requested-vel HAL pin\n' - wng += 'which is not recommended.\n' - wng += '\nThe recommended settings are to use\n' - wng += 'F#<_hal[plasmac.cut-feed-rate]>\n' - wng += 'in the G-Code file and a valid cut feed rate\n' - wng += 'in the material cut parameters.\n' - wng += '\nWarning near line #{}\n'.format(lineNum) - dialog_error(gtk.MESSAGE_WARNING, 'Feed Rate WARNING', wng) + if not feedWarning: + if cutFeed and cutFeed != codeFeed: + wng = 'Gcode feed rate is F{:0.{}f}\n'.format(codeFeed, dec) + wng += '\nMaterial #{} feed rate is F{:0.{}f}\n'.format(material, cutFeed, dec) + wng += '\nTHC calculations will be based on the\n' + wng += 'material #{} feed rate which may cause issues.\n'.format(material) + else: + wng = 'Gcode feed rate is F{:0.{}f}\n'.format(codeFeed, dec) + wng += '\nMaterial #{} feed rate is F{:0.{}f}\n'.format(material, cutFeed, dec) + wng += '\nThis will cause the THC calculations\n' + wng += 'to use the motion.requested-vel HAL pin\n' + wng += 'which is not recommended.\n' + wng += '\nThe recommended settings are to use\n' + wng += 'F#<_hal[plasmac.cut-feed-rate]>\n' + wng += 'in the G-Code file and a valid cut feed rate\n' + wng += 'in the material cut parameters.\n' + wng += '\nFirst warning near line #{}\n'.format(lineNum) + wng += '\nPlease check all feed rates.\n'.format(material) + dialog_error(gtk.MESSAGE_WARNING, 'Feed Rate WARNING', wng) + feedWarning = True else: pass From cc120cc1323f5589012f3b5904d369d7cf8d4de1 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 26 Jul 2020 11:24:08 +1000 Subject: [PATCH 002/316] plasmac: allow consumable change during rapid motion --- configs/by_machine/plasmac/plasmac.tcl | 4 +++- src/hal/components/plasmac.comp | 24 ++++++++++++++---------- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/configs/by_machine/plasmac/plasmac.tcl b/configs/by_machine/plasmac/plasmac.tcl index a7b45231c5..7b458b2361 100644 --- a/configs/by_machine/plasmac/plasmac.tcl +++ b/configs/by_machine/plasmac/plasmac.tcl @@ -15,7 +15,6 @@ net plasmac:feed-override halui.feed-override.value => plasmac.feed net plasmac:feed-reduction motion.analog-out-03 => plasmac.feed-reduction net plasmac:float-switch-out debounce.0.0.out => plasmac.float-switch net plasmac:motion-type motion.motion-type => plasmac.motion-type -net plasmac:offset-current axis.z.eoffset => plasmac.offset-current net plasmac:ohmic-probe-out debounce.0.2.out => plasmac.ohmic-probe net plasmac:program-is-idle halui.program.is-idle => plasmac.program-is-idle net plasmac:program-is-paused halui.program.is-paused => plasmac.program-is-paused @@ -24,6 +23,9 @@ net plasmac:requested-velocity motion.requested-vel => plasmac.requ net plasmac:thc-disable motion.digital-out-02 => plasmac.thc-disable net plasmac:torch-off motion.digital-out-03 => plasmac.torch-off net plasmac:units-per-mm halui.machine.units-per-mm => plasmac.units-per-mm +net plasmac:x-offset-current axis.x.eoffset => plasmac.x-offset-current +net plasmac:y-offset-current axis.y.eoffset => plasmac.y-offset-current +net plasmac:z-offset-current axis.z.eoffset => plasmac.z-offset-current # outputs net plasmac:adaptive-feed plasmac.adaptive-feed => motion.adaptive-feed diff --git a/src/hal/components/plasmac.comp b/src/hal/components/plasmac.comp index ff8170ca32..0d1882edb9 100644 --- a/src/hal/components/plasmac.comp +++ b/src/hal/components/plasmac.comp @@ -66,7 +66,6 @@ pin in s32 motion_type "motion type, connect to motion.moti pin in bit move_down "external thc down switch [mode 2])"; pin in bit move_up "external thc up switch [mode 2]"; pin in bit multi_tool "allows the use of multiple tools"; -pin in float offset_current "current z axis offset, connect to axis.z.eoffset"; pin in bit ohmic_probe_enable "ohmic probe enable input"; pin in float ohmic_probe_offset "Z axis offset for ohmic probe (machine units)"; pin in s32 ohmic_max_attempts "maximum ohmic probe attempts before fallback to float switch"; @@ -108,7 +107,10 @@ pin in float units_per_mm "for scale calcs, connect to halui.m pin in bit use_auto_volts "use calculated voltage for thc baseline"; pin in s32 xy_feed_rate "feed-rate for consumable change"; pin in float x_offset "offest to apply to axis x for consumable change"; +pin in float x_offset_current "current x axis offset, connect to axis.x.eoffset"; pin in float y_offset "offest to apply to axis y for consumable change"; +pin in float y_offset_current "current z axis offset, connect to axis.y.eoffset"; +pin in float z_offset_current "current z axis offset, connect to axis.z.eoffset"; /* OUTPUT PINS */ pin out float adaptive_feed "for reverse-run, connect to motion.adaptive-feed"; @@ -314,7 +316,7 @@ FUNCTION(_) { /* output the relative Z height */ if(zero_target){ - z_relative = offset_current - zero_target * offset_scale; + z_relative = z_offset_current - zero_target * offset_scale; }else{ z_relative = axis_z_position - axis_z_min_limit; } @@ -513,14 +515,14 @@ FUNCTION(_) { probe_inhibit = FALSE; }else if(!probe_inhibit){ /* if we get a paused motion request and we are paused */ - if(paused_motion_speed && stop_type == PAUSE){ + if(paused_motion_speed && (stop_type == PAUSE || stop_type == WAIT)){ state = PAUSED_MOTION; /* if we get a consumable change start request and we are paused */ - }else if(consumable_change && stop_type == PAUSE && !consumable_changing){ + }else if(consumable_change && (stop_type == PAUSE || stop_type == WAIT) && !consumable_changing){ state = CONSUMABLE_CHANGE_ON; /* if we get a consumable change stop request and we are changing consumables */ - }else if(!consumable_change && stop_type == PAUSE && consumable_changing){ + }else if(!consumable_change && (stop_type == PAUSE || stop_type == WAIT) && consumable_changing){ state = CONSUMABLE_CHANGE_OFF; /* if we get a torch start request and we are stopped or waiting for a restart */ @@ -695,7 +697,7 @@ FUNCTION(_) { ohmic_attempts = 0; }else if(!float_switch && !ohmic_detected){ if(axis_z_position - (probe_velocity * offset_scale) <= axis_z_min_limit + (0.25 * units_per_mm )){ - if(probe_at_bottom - offset_current < 0.0001){ + if(probe_at_bottom - z_offset_current < 0.0001){ probe_at_bottom = 0; if(!probe_test){ rtapi_print_msg(RTAPI_MSG_ERR,"bottom limit reached while probing down.\n" @@ -709,7 +711,7 @@ FUNCTION(_) { probe_test_error = TRUE; } }else{ - probe_at_bottom = offset_current; + probe_at_bottom = z_offset_current; } }else{ z_offset_counts -= probe_velocity; @@ -927,8 +929,8 @@ FUNCTION(_) { z_offset_counts += setup_velocity; }else{ z_offset_counts = cut_target; - if((int)floor(offset_current / offset_scale) <= cut_target + 1 && - (int)floor(offset_current / offset_scale) >= cut_target - 1){ + if((int)floor(z_offset_current / offset_scale) <= cut_target + 1 && + (int)floor(z_offset_current / offset_scale) >= cut_target - 1){ count = 0; /* set feed rate for this cut */ if(cut_feed_rate > 0){ @@ -1338,6 +1340,7 @@ FUNCTION(_) { } break; case CONSUMABLE_CHANGE_ON: + feed_hold = TRUE; if(!consumable_changing){ if(x_offset == 0 && y_offset == 0){ x_velocity = 0; @@ -1396,9 +1399,10 @@ FUNCTION(_) { y_offset_counts = 0; } } - if(!x_offset_counts && !y_offset_counts){ + if(x_offset_current < 0.001 * units_per_mm && y_offset_current < 0.001 * units_per_mm){ consumable_changing = FALSE; state = IDLE; + feed_hold = FALSE; } break; case DEBUG: From bb5a6f04e2d95a507ff1797e7c30ccd566a13d74 Mon Sep 17 00:00:00 2001 From: Phillip Carter Date: Sun, 26 Jul 2020 17:52:26 +1000 Subject: [PATCH 003/316] plasmac: breakaway and consumable change fix consumable change lockup and velocities breakaway during rapid now errors out --- configs/by_machine/plasmac/plasmac_axis.py | 2 +- configs/by_machine/plasmac/plasmac_config.py | 2 +- configs/by_machine/plasmac/versions.html | 8 ++ src/hal/components/plasmac.comp | 97 +++++++++++++++----- 4 files changed, 82 insertions(+), 27 deletions(-) diff --git a/configs/by_machine/plasmac/plasmac_axis.py b/configs/by_machine/plasmac/plasmac_axis.py index ea0e668409..b06f5c4c2e 100644 --- a/configs/by_machine/plasmac/plasmac_axis.py +++ b/configs/by_machine/plasmac/plasmac_axis.py @@ -700,7 +700,7 @@ def user_button_pressed(button,commands): if w(fbuttons + '.button' + button,'cget','-state') == 'disabled' or \ not commands: return from subprocess import Popen,PIPE - if 'change-consumables' in commands.lower(): + if 'change-consumables' in commands.lower() and not hal.get_value('plasmac.breakaway'): if hal.get_value('axis.x.eoffset-counts') or hal.get_value('axis.y.eoffset-counts'): hal.set_p('plasmac.consumable-change', '0') hal.set_p('plasmac.x-offset', '0') diff --git a/configs/by_machine/plasmac/plasmac_config.py b/configs/by_machine/plasmac/plasmac_config.py index d31c671f7b..4fdc0c9456 100644 --- a/configs/by_machine/plasmac/plasmac_config.py +++ b/configs/by_machine/plasmac/plasmac_config.py @@ -321,7 +321,7 @@ def idle_changed(self, halpin): def __init__(self, halcomp,builder,useropts): - self.plasmacVersion = 'PlasmaC v0.145' + self.plasmacVersion = 'PlasmaC v0.146' self.halcomp = halcomp self.builder = builder diff --git a/configs/by_machine/plasmac/versions.html b/configs/by_machine/plasmac/versions.html index 88d4e543d7..8d53000dd7 100644 --- a/configs/by_machine/plasmac/versions.html +++ b/configs/by_machine/plasmac/versions.html @@ -19,6 +19,14 @@

PlasmaC Updates

+
v0.146 - 2020 Jul 24 +
    +
  • fix consumable change lockup and velocities
  • +
  • breakaway during rapid now errors out
  • +
  • allow consumable change during rapid motion
  • +
  • change gcode feed rate warnings
  • +
+
v0.145 - 2020 Jul 24