Skip to content

Commit d179009

Browse files
committed
plasmac: monitor motion.eoffset-limited to determine if the commanded motion is outside of the soft limits
This is intended to prevent some instances where the commanded movement of the axis under control of eoffsets becomes outside of the soft limits. In these cases, movement will cease and the machine will sit motionless indefinitely. State is reported for future debugging should users encounter this situation.
1 parent 96898f3 commit d179009

2 files changed

Lines changed: 30 additions & 1 deletion

File tree

lib/hallib/plasmac.tcl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ net plasmac:homed motion.is-all-homed => plasmac.homed
1919
net plasmac:ignore-arc-ok-0 motion.digital-out-01 => plasmac.ignore-arc-ok-0
2020
net plasmac:motion-type motion.motion-type => plasmac.motion-type
2121
net plasmac:offsets-active motion.eoffset-active => plasmac.offsets-active
22+
net plasmac:offsets-limited motion.eoffset-limited => plasmac.offsets-limited
2223
net plasmac:program-is-idle halui.program.is-idle => plasmac.program-is-idle
2324
net plasmac:program-is-paused halui.program.is-paused => plasmac.program-is-paused
2425
net plasmac:program-is-running halui.program.is-running => plasmac.program-is-running

src/hal/components/plasmac.comp

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ A plasma cutting table control component for use with the LinuxCNC 2.10.
77

88
=== VERSION
99

10-
015
10+
016
1111

1212
=== SUMMARY
1313

@@ -90,6 +90,7 @@ pin in float offset_probe_y "Y axis offset for offset probe (mac
9090
pin in bit offset_set_probe "deploy probe for setting offsets";
9191
pin in bit offset_set_scribe "deploy scribe for setting offsets";
9292
pin in bit offsets_active "offsets are active, connect to motion.eoffset-active";
93+
pin in bit offsets_limited "offsets are limited, connect to motion.eoffset-limited";
9394
pin in s32 ohmic_max_attempts "maximum ohmic probe attempts before fallback to float switch";
9495
pin in bit ohmic_probe "ohmic probe input, from ohmic-sense-out or external component/pin";
9596
pin in bit ohmic_probe_enable "enable ohmic probe";
@@ -251,6 +252,7 @@ variable int laser_y_target; /* target count for laser recovery y
251252
variable float last_arc_voltage; /* last sensed arc voltage */
252253
variable bool manual_cut; /* manual cut mode is active */
253254
variable int offset_datum; /* datum for safe height calcs */
255+
variable bool offset_limit_error = false; /* has an offset error been reported (prevents repeat messages)*/
254256
variable int offset_max; /* maximum allowed offset */
255257
variable int offset_min; /* minimum allowed offset */
256258
variable float offset_probe_timer; /* offset probe deployment delay time */
@@ -416,6 +418,15 @@ typedef enum{OFF,
416418
RESETTING,
417419
} laser_recovery_state_t;
418420

421+
static const char *state_names[] = {
422+
"IDLE", "PROBE_HEIGHT", "PROBE_DOWN", "PROBE_UP", "ZERO_HEIGHT",
423+
"PIERCE_HEIGHT", "TORCH_ON", "ARC_OK", "PIERCE_DELAY", "PUDDLE_JUMP",
424+
"CUT_HEIGHT", "CUT_MODE_01", "CUT_MODE_2", "PAUSE_AT_END", "SAFE_HEIGHT",
425+
"MAX_HEIGHT", "END_CUT", "END_JOB", "TORCHPULSE", "PAUSED_MOTION",
426+
"OHMIC_TEST", "PROBE_TEST", "SCRIBING", "CONSUMABLE_CHANGE_ON",
427+
"CONSUMABLE_CHANGE_OFF", "CUT_RECOVERY_ON", "CUT_RECOVERY_OFF", "DEBUG"
428+
};
429+
419430
state_t state = IDLE;
420431
stop_type_t stop_type = NONE;
421432
move_direction_t move_direction = ZERO;
@@ -546,6 +557,23 @@ FUNCTION(_) {
546557
}
547558
probe_out = float_switch && tube_cut && state == IDLE;
548559

560+
if(offsets_limited && offsets_active) {
561+
if(!offset_limit_error) {
562+
torch_on = FALSE;
563+
if(program_is_running && !program_is_paused) {
564+
program_pause = TRUE;
565+
}
566+
stop_type = PAUSE;
567+
probe_inhibit = TRUE;
568+
rtapi_print_msg(RTAPI_MSG_ERR,"Offset limit violation (state: %s)\n"
569+
"program is paused.\n", state_names[state]);
570+
state = MAX_HEIGHT;
571+
offset_limit_error = true;
572+
}
573+
} else {
574+
offset_limit_error = false;
575+
}
576+
549577
// I don't recall why z_relative was originally created!!!
550578
// commit # b29d1af 24 Oct 2019
551579
// /* output the relative Z height */

0 commit comments

Comments
 (0)