@@ -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
9090pin in bit offset_set_probe "deploy probe for setting offsets";
9191pin in bit offset_set_scribe "deploy scribe for setting offsets";
9292pin 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";
9394pin in s32 ohmic_max_attempts "maximum ohmic probe attempts before fallback to float switch";
9495pin in bit ohmic_probe "ohmic probe input, from ohmic-sense-out or external component/pin";
9596pin in bit ohmic_probe_enable "enable ohmic probe";
@@ -251,6 +252,7 @@ variable int laser_y_target; /* target count for laser recovery y
251252variable float last_arc_voltage; /* last sensed arc voltage */
252253variable bool manual_cut; /* manual cut mode is active */
253254variable int offset_datum; /* datum for safe height calcs */
255+ variable bool offset_limit_error = false; /* has an offset error been reported (prevents repeat messages)*/
254256variable int offset_max; /* maximum allowed offset */
255257variable int offset_min; /* minimum allowed offset */
256258variable 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+
419430state_t state = IDLE;
420431stop_type_t stop_type = NONE;
421432move_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