From baff4fa7e6687a01eeb7157fd381bc1996517ea3 Mon Sep 17 00:00:00 2001 From: Alden Hart Date: Sun, 11 Dec 2016 14:40:38 -0500 Subject: [PATCH] Refactored some more system settings; testing axis settings - some tweaks; fixed length of system ID string to accommodate longer strings from Motate. --- g2core/board/Archim/hardware.h | 4 +- g2core/board/ArduinoDue/hardware.h | 4 +- g2core/board/G2v9/hardware.h | 4 +- g2core/board/gquadratic/hardware.h | 4 +- g2core/board/gquintic/hardware.h | 4 +- g2core/board/printrboardg2/hardware.h | 4 +- g2core/board/sbv300/hardware.h | 4 +- g2core/canonical_machine.cpp | 159 ++++++++++++-------------- g2core/canonical_machine.h | 35 ++++-- g2core/config.cpp | 7 +- g2core/config_app.cpp | 42 +++---- g2core/cycle_jogging.cpp | 2 + g2core/plan_arc.h | 2 + 13 files changed, 143 insertions(+), 132 deletions(-) mode change 100755 => 100644 g2core/board/gquintic/hardware.h mode change 100755 => 100644 g2core/board/printrboardg2/hardware.h mode change 100755 => 100644 g2core/board/sbv300/hardware.h diff --git a/g2core/board/Archim/hardware.h b/g2core/board/Archim/hardware.h index 6da17870..9e88aee5 100644 --- a/g2core/board/Archim/hardware.h +++ b/g2core/board/Archim/hardware.h @@ -83,8 +83,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/board/ArduinoDue/hardware.h b/g2core/board/ArduinoDue/hardware.h index e01e70d4..e6022d85 100644 --- a/g2core/board/ArduinoDue/hardware.h +++ b/g2core/board/ArduinoDue/hardware.h @@ -85,8 +85,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/board/G2v9/hardware.h b/g2core/board/G2v9/hardware.h index b8f19f4a..7668b21d 100644 --- a/g2core/board/G2v9/hardware.h +++ b/g2core/board/G2v9/hardware.h @@ -86,8 +86,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/board/gquadratic/hardware.h b/g2core/board/gquadratic/hardware.h index a28bf858..dc87fbee 100644 --- a/g2core/board/gquadratic/hardware.h +++ b/g2core/board/gquadratic/hardware.h @@ -86,8 +86,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/board/gquintic/hardware.h b/g2core/board/gquintic/hardware.h old mode 100755 new mode 100644 index e7fb56ba..5bd64ad3 --- a/g2core/board/gquintic/hardware.h +++ b/g2core/board/gquintic/hardware.h @@ -84,8 +84,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/board/printrboardg2/hardware.h b/g2core/board/printrboardg2/hardware.h old mode 100755 new mode 100644 index 244a2681..44f970e9 --- a/g2core/board/printrboardg2/hardware.h +++ b/g2core/board/printrboardg2/hardware.h @@ -83,8 +83,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/board/sbv300/hardware.h b/g2core/board/sbv300/hardware.h old mode 100755 new mode 100644 index 5ded07eb..0c1ce429 --- a/g2core/board/sbv300/hardware.h +++ b/g2core/board/sbv300/hardware.h @@ -83,8 +83,8 @@ using Motate::OutputPin; *************************/ #define MILLISECONDS_PER_TICK 1 // MS for system tick (systick * N) -#define SYS_ID_DIGITS 12 // actual digits in system ID (up to 16) -#define SYS_ID_LEN 16 // total length including dashes and NUL +#define SYS_ID_DIGITS 16 // actual digits in system ID (up to 16) +#define SYS_ID_LEN 24 // total length including dashes and NUL /************************************************************************************ **** ARM SAM3X8E SPECIFIC HARDWARE ************************************************* diff --git a/g2core/canonical_machine.cpp b/g2core/canonical_machine.cpp index 01d59ec0..7d292cb5 100644 --- a/g2core/canonical_machine.cpp +++ b/g2core/canonical_machine.cpp @@ -546,11 +546,9 @@ stat_t cm_set_tram(nvObj_t *nv) return (STAT_COMMAND_NOT_ACCEPTED); } - } else { return (STAT_INPUT_VALUE_RANGE_ERROR); } - return (STAT_OK); } @@ -569,15 +567,12 @@ stat_t cm_get_tram(nvObj_t *nv) fp_NE(1.0, cm->rotation_matrix[1][1]) || fp_NE(1.0, cm->rotation_matrix[2][2])) { - nv->value = false; } - nv->valuetype = TYPE_BOOL; return (STAT_OK); } - /* * cm_set_model_target() - set target vector in GM model * @@ -2270,12 +2265,17 @@ stat_t cm_get_am(nvObj_t *nv) stat_t cm_set_am(nvObj_t *nv) // axis mode { - nv->valuetype = TYPE_INT; + nv->valuetype = TYPE_NULL; if (cm_get_axis_type(nv->index) == AXIS_TYPE_LINEAR) { - if (nv->value > AXIS_MODE_LINEAR_MAX) { return (STAT_INPUT_VALUE_RANGE_ERROR);} + if (nv->value > AXIS_MODE_LINEAR_MAX) { + return (STAT_INPUT_VALUE_RANGE_ERROR); + } } else { - if (nv->value > AXIS_MODE_ROTARY_MAX) { return (STAT_INPUT_VALUE_RANGE_ERROR);} + if (nv->value > AXIS_MODE_ROTARY_MAX) { + return (STAT_INPUT_VALUE_RANGE_ERROR); + } } + nv->valuetype = TYPE_INT; cm->a[_axis(nv->index)].axis_mode = (cmAxisMode)nv->value; return(STAT_OK); } @@ -2330,39 +2330,40 @@ void cm_set_axis_jerk(const uint8_t axis, const float jerk) * numbers for people to deal with. Jerk values are stored in the system in truncated format; * values are divided by 1,000,000 then reconstituted before use. * - * The set_xjm() nad set_xjh() functions will accept either truncated or untruncated jerk - * numbers as input. If the number is > 1,000,000 it is divided by 1,000,000 before storing. - * Numbers are accepted in either millimeter or inch mode and converted to millimeter mode. - * - * The axis_jerk() functions expect the jerk in divided-by 1,000,000 form + * The axis_jerk() functions expect the jerk in divided-by 1,000,000 form. + * The set_xjm() and set_xjh() functions accept values divided by 1,000,000. + * This is corrected to mm/min^3 by the internals of the code. */ stat_t cm_get_vm(nvObj_t *nv) { return (get_float(nv, cm->a[_axis(nv->index)].velocity_max)); } -stat_t cm_set_vm(nvObj_t *nv) { - uint8_t axis = _axis(nv->index); - set_float(nv, cm->a[axis].velocity_max); - cm->a[axis].recip_velocity_max = 1/nv->value; - return(STAT_OK); - } +stat_t cm_set_vm(nvObj_t *nv) +{ + uint8_t axis = _axis(nv->index); + set_float(nv, cm->a[axis].velocity_max); + cm->a[axis].recip_velocity_max = 1/nv->value; + return(STAT_OK); +} stat_t cm_get_fr(nvObj_t *nv) { return (get_float(nv, cm->a[_axis(nv->index)].feedrate_max)); } -stat_t cm_set_fr(nvObj_t *nv) { - uint8_t axis = _axis(nv->index); - set_float(nv, cm->a[axis].feedrate_max); - cm->a[axis].recip_feedrate_max = 1/nv->value; - return(STAT_OK); - } +stat_t cm_set_fr(nvObj_t *nv) +{ + uint8_t axis = _axis(nv->index); + set_float(nv, cm->a[axis].feedrate_max); + cm->a[axis].recip_feedrate_max = 1/nv->value; + return(STAT_OK); +} stat_t cm_get_jm(nvObj_t *nv) { return (get_float(nv, cm->a[_axis(nv->index)].jerk_max)); } -stat_t cm_set_jm(nvObj_t *nv) { - uint8_t axis = _axis(nv->index); - set_float(nv, cm->a[axis].jerk_max); - cm_set_axis_jerk(axis, nv->value); - return(STAT_OK); - } +stat_t cm_set_jm(nvObj_t *nv) +{ + uint8_t axis = _axis(nv->index); + ritorno(set_float_range(nv, cm->a[axis].jerk_max, JERK_INPUT_MIN, JERK_INPUT_MAX)); + cm_set_axis_jerk(axis, nv->value); + return(STAT_OK); +} stat_t cm_get_jh(nvObj_t *nv) { return (get_float(nv, cm->a[_axis(nv->index)].jerk_high)); } -stat_t cm_set_jh(nvObj_t *nv) { return (set_float(nv, cm->a[_axis(nv->index)].jerk_high)); } +stat_t cm_set_jh(nvObj_t *nv) { return (set_float_range(nv, cm->a[_axis(nv->index)].jerk_high, JERK_INPUT_MIN, JERK_INPUT_MAX)); } /**** Axis Homing Settings * cm_get_hi() - get homing input @@ -2395,61 +2396,51 @@ stat_t cm_set_zb(nvObj_t *nv) { return (set_float(nv, cm->a[_axis(nv->index)].ze /*** Canonical Machine Global Settings ***/ /* - * cm_get_jt() - get junction integration time - * cm_set_jt() - set junction integration time - * cm_get_ct() - get chordal tolerance - * cm_set_ct() - set chordal tolerance + * cm_get_jt() - get junction integration time + * cm_set_jt() - set junction integration time + * cm_get_ct() - get chordal tolerance + * cm_set_ct() - set chordal tolerance + * cm_get_sl() - get soft limit enable + * cm_set_sl() - set soft limit enable + * cm_get_lim() - get hard limit enable + * cm_set_lim() - set hard limit enable + * cm_get_saf() - get safety interlock enable + * cm_set_saf() - set safety interlock enable + * cm_set_mfo() - set manual feedrate override factor + * cm_set_mto() - set manual traverse override factor */ stat_t cm_get_jt(nvObj_t *nv) { return(get_float(nv, cm->junction_integration_time)); } - stat_t cm_set_jt(nvObj_t *nv) { - // Get JT or return range error - ritorno(set_float_range(nv, cm->junction_integration_time, - JUNCTION_INTEGRATION_MIN, - JUNCTION_INTEGRATION_MAX)); - - // Must recalculate the max_junction_accel now that the time quanta has changed. - for (uint8_t axis=0; axisjunction_integration_time, JUNCTION_INTEGRATION_MIN, JUNCTION_INTEGRATION_MAX)); + for (uint8_t axis=0; axischordal_tolerance)); } -stat_t cm_set_ct(nvObj_t *nv) { return(set_float_range(nv, cm->chordal_tolerance, - CHORDAL_TOLERANCE_MIN, - 10000000)); } +stat_t cm_set_ct(nvObj_t *nv) { return(set_float_range(nv, cm->chordal_tolerance, CHORDAL_TOLERANCE_MIN, 10000000)); } -/* - * cm_set_mfo() - set manual feedrate override factor - * cm_set_mto() - set manual traverse override factor - */ +stat_t cm_get_sl(nvObj_t *nv) { return(get_int(nv, cm->soft_limit_enable)); } +stat_t cm_set_sl(nvObj_t *nv) { return(set_int(nv, (uint8_t &)cm->soft_limit_enable, 0, 1)); } -stat_t cm_set_mfo(nvObj_t *nv) -{ - if (nv->value < FEED_OVERRIDE_MIN) { - return (STAT_INPUT_LESS_THAN_MIN_VALUE); - } - if (nv->value > FEED_OVERRIDE_MAX) { - return (STAT_INPUT_EXCEEDS_MAX_VALUE); - } - set_flt(nv); - return(STAT_OK); -} +stat_t cm_get_lim(nvObj_t *nv) { return(get_int(nv, cm->limit_enable)); } +stat_t cm_set_lim(nvObj_t *nv) { return(set_int(nv, (uint8_t &)cm->limit_enable, 0, 1)); } -stat_t cm_set_mto(nvObj_t *nv) -{ - if (nv->value < TRAVERSE_OVERRIDE_MIN) { - return (STAT_INPUT_LESS_THAN_MIN_VALUE); - } - if (nv->value > TRAVERSE_OVERRIDE_MAX) { - return (STAT_INPUT_EXCEEDS_MAX_VALUE); - } - set_flt(nv); - return(STAT_OK); -} +stat_t cm_get_saf(nvObj_t *nv) { return(get_int(nv, cm->safety_interlock_enable)); } +stat_t cm_set_saf(nvObj_t *nv) { return(set_int(nv, (uint8_t &)cm->safety_interlock_enable, 0, 1)); } + +stat_t cm_get_froe(nvObj_t *nv) { return(get_int(nv, cm->gmx.mfo_enable)); } +stat_t cm_set_froe(nvObj_t *nv) { return(set_int(nv, (uint8_t &)cm->gmx.mfo_enable, 0, 1)); } +stat_t cm_get_fro(nvObj_t *nv) { return(get_float(nv, cm->gmx.mfo_factor)); } +stat_t cm_set_fro(nvObj_t *nv) { return(set_float_range(nv, cm->gmx.mfo_factor, FEED_OVERRIDE_MIN, FEED_OVERRIDE_MAX)); } + +stat_t cm_get_troe(nvObj_t *nv) { return(get_int(nv, cm->gmx.mto_enable)); } +stat_t cm_set_troe(nvObj_t *nv) { return(set_int(nv, (uint8_t &)cm->gmx.mto_enable, 0, 1)); } +stat_t cm_get_tro(nvObj_t *nv) { return(get_float(nv, cm->gmx.mto_factor)); } +stat_t cm_set_tro(nvObj_t *nv) { return(set_float_range(nv, cm->gmx.mto_factor, TRAVERSE_OVERRIDE_MIN, TRAVERSE_OVERRIDE_MAX)); } /* * Run Commands @@ -2598,18 +2589,18 @@ void cm_print_sl(nvObj_t *nv) { text_print(nv, fmt_sl);} // TYPE_INT void cm_print_lim(nvObj_t *nv){ text_print(nv, fmt_lim);} // TYPE_INT void cm_print_saf(nvObj_t *nv){ text_print(nv, fmt_saf);} // TYPE_INT -static const char fmt_m48e[] = "[m48e] overrides enabled%11d [0=disable,1=enable]\n"; -static const char fmt_mfoe[] = "[mfoe] manual feed override enab%3d [0=disable,1=enable]\n"; -static const char fmt_mfo[] = "[mfo] manual feedrate override%8.3f [0.05 < mfo < 2.00]\n"; -static const char fmt_mtoe[] = "[mtoe] manual traverse over enab%3d [0=disable,1=enable]\n"; -static const char fmt_mto[] = "[mto] manual traverse override%8.3f [0.05 < mto < 1.00]\n"; -static const char fmt_tram[] = "[tram] is coordinate space rotated to be tram %s\n"; +//static const char fmt_m48e[] = "[m48e] overrides enabled%11d [0=disable,1=enable]\n"; +static const char fmt_froe[] = "[froe] feed override enable%8d [0=disable,1=enable]\n"; +static const char fmt_fro[] = "[fro] feedrate override%15.3f [0.05 < mfo < 2.00]\n"; +static const char fmt_troe[] = "[troe] traverse over enable%8d [0=disable,1=enable]\n"; +static const char fmt_tro[] = "[tro] traverse override%15.3f [0.05 < mto < 1.00]\n"; +static const char fmt_tram[] = "[tram] is coordinate space rotated to be tram %s\n"; -void cm_print_m48e(nvObj_t *nv) { text_print(nv, fmt_m48e);} // TYPE_INT -void cm_print_mfoe(nvObj_t *nv) { text_print(nv, fmt_mfoe);} // TYPE INT -void cm_print_mfo(nvObj_t *nv) { text_print(nv, fmt_mfo);} // TYPE FLOAT -void cm_print_mtoe(nvObj_t *nv) { text_print(nv, fmt_mtoe);} // TYPE INT -void cm_print_mto(nvObj_t *nv) { text_print(nv, fmt_mto);} // TYPE FLOAT +//void cm_print_m48e(nvObj_t *nv) { text_print(nv, fmt_m48e);} // TYPE_INT +void cm_print_froe(nvObj_t *nv) { text_print(nv, fmt_froe);} // TYPE INT +void cm_print_fro(nvObj_t *nv) { text_print(nv, fmt_fro);} // TYPE FLOAT +void cm_print_troe(nvObj_t *nv) { text_print(nv, fmt_troe);} // TYPE INT +void cm_print_tro(nvObj_t *nv) { text_print(nv, fmt_tro);} // TYPE FLOAT void cm_print_tram(nvObj_t *nv) { text_print(nv, fmt_tram);}; // TYPE BOOL /* diff --git a/g2core/canonical_machine.h b/g2core/canonical_machine.h index 48d4e059..26f8c06c 100644 --- a/g2core/canonical_machine.h +++ b/g2core/canonical_machine.h @@ -38,16 +38,16 @@ /* Defines, Macros, and Assorted Parameters */ -#define MODEL (GCodeState_t *)&cm->gm // absolute pointer from canonical machine gm model +#define MODEL (GCodeState_t *)&cm->gm // absolute pointer from canonical machine gm model #define PLANNER (GCodeState_t *)&bf->gm // relative to buffer *bf is currently pointing to #define RUNTIME (GCodeState_t *)&mr.gm // absolute pointer from runtime mm struct -#define ACTIVE_MODEL cm->am // active model pointer is maintained by state management +#define ACTIVE_MODEL cm->am // active model pointer is maintained by state management #define _to_millimeters(a) ((cm->gm.units_mode == INCHES) ? (a * MM_PER_INCH) : a) -#define JOGGING_START_VELOCITY ((float)10.0) #define DISABLE_SOFT_LIMIT (999999) -#define CHORDAL_TOLERANCE_MIN (0.001) +#define JERK_INPUT_MIN (0.01) // minimum allowable jerk setting in millions mm/min^3 +#define JERK_INPUT_MAX (100000) // maximum allowable jerk setting in millions mm/min^3 #define PROBES_STORED 3 // we store three probes for coordinate rotation computation /***************************************************************************** @@ -506,9 +506,22 @@ stat_t cm_get_jt(nvObj_t *nv); // get junction integration time constan stat_t cm_set_jt(nvObj_t *nv); // set junction integration time constant stat_t cm_get_ct(nvObj_t *nv); // get chordal tolerance stat_t cm_set_ct(nvObj_t *nv); // set chordal tolerance +stat_t cm_get_sl(nvObj_t *nv); // get soft limit enable +stat_t cm_set_sl(nvObj_t *nv); // set soft limit enable +stat_t cm_get_lim(nvObj_t *nv); // get hard limit enable +stat_t cm_set_lim(nvObj_t *nv); // set hard limit enable +stat_t cm_get_saf(nvObj_t *nv); // get safety interlock enable +stat_t cm_set_saf(nvObj_t *nv); // set safety interlock enable -stat_t cm_set_mfo(nvObj_t *nv); // set manual feedrate override factor -stat_t cm_set_mto(nvObj_t *nv); // set manual traverse override factor +stat_t cm_get_froe(nvObj_t *nv); // get feedrate override enable +stat_t cm_set_froe(nvObj_t *nv); // set feedrate override enable +stat_t cm_get_fro(nvObj_t *nv); // get feedrate override factor +stat_t cm_set_fro(nvObj_t *nv); // set feedrate override factor + +stat_t cm_get_troe(nvObj_t *nv); // get traverse override enable +stat_t cm_set_troe(nvObj_t *nv); // set traverse override enable +stat_t cm_get_tro(nvObj_t *nv); // get traverse override factor +stat_t cm_set_tro(nvObj_t *nv); // set traverse override factor stat_t cm_set_tram(nvObj_t *nv); // attempt setting the rotation matrix stat_t cm_get_tram(nvObj_t *nv); // return if the rotation matrix is non-identity @@ -555,11 +568,11 @@ stat_t cm_get_tram(nvObj_t *nv); // return if the rotation matrix is non- void cm_print_lim(nvObj_t *nv); void cm_print_saf(nvObj_t *nv); - void cm_print_m48e(nvObj_t *nv); - void cm_print_mfoe(nvObj_t *nv); - void cm_print_mfo(nvObj_t *nv); - void cm_print_mtoe(nvObj_t *nv); - void cm_print_mto(nvObj_t *nv); +// void cm_print_m48e(nvObj_t *nv); + void cm_print_froe(nvObj_t *nv); + void cm_print_fro(nvObj_t *nv); + void cm_print_troe(nvObj_t *nv); + void cm_print_tro(nvObj_t *nv); void cm_print_tram(nvObj_t *nv); // print if the axis has been rotated diff --git a/g2core/config.cpp b/g2core/config.cpp index 0b468b9d..e6e73585 100644 --- a/g2core/config.cpp +++ b/g2core/config.cpp @@ -249,9 +249,12 @@ stat_t get_flt(nvObj_t *nv) * set_data() - set value as 32 bit integer blind cast * set_flt() - set value as float */ -//stat_t set_nul(nvObj_t *nv) { return (STAT_PARAMETER_IS_READ_ONLY); } -stat_t set_nul(nvObj_t *nv) { return (STAT_OK); } // hack until JSON is refactored +stat_t set_nul(nvObj_t *nv) { + nv->valuetype = TYPE_NULL; + return (STAT_PARAMETER_IS_READ_ONLY); // this is what it should be +// return (STAT_OK); // hack until JSON is refactored +} stat_t set_ui8(nvObj_t *nv) { *((uint8_t *)GET_TABLE_WORD(target)) = nv->value; diff --git a/g2core/config_app.cpp b/g2core/config_app.cpp index c102aad2..eeaad3a3 100644 --- a/g2core/config_app.cpp +++ b/g2core/config_app.cpp @@ -102,14 +102,14 @@ static stat_t get_tick(nvObj_t *nv); // get system tick count * the %f in the corresponding format string to set text mode display precision */ const cfgItem_t cfgArray[] = { - // group token flags p, print_func, get_func, set_func, target for get/set, default value - { "sys", "fb", _fipn,2, hw_print_fb, get_flt, set_nul, (float *)&cs.fw_build, G2CORE_FIRMWARE_BUILD }, // MUST BE FIRST! - { "sys", "fbs",_fn, 2, hw_print_fbs,hw_get_fbs,set_nul, (float *)&cs.null, 0 }, - { "sys", "fbc",_fn, 2, hw_print_fbc,hw_get_fbc,set_nul, (float *)&cs.null, 0 }, - { "sys", "fv", _fipn,2, hw_print_fv, get_flt, set_nul, (float *)&cs.fw_version, G2CORE_FIRMWARE_VERSION }, - { "sys", "hp", _fipn,0, hw_print_hp, get_flt, set_flt, (float *)&cs.hw_platform, G2CORE_HARDWARE_PLATFORM }, - { "sys", "hv", _fipn,0, hw_print_hv, get_flt, hw_set_hv,(float *)&cs.hw_version, G2CORE_HARDWARE_VERSION }, - { "sys", "id", _fn, 0, hw_print_id, hw_get_id, set_nul, (float *)&cs.null, 0 }, // device ID (ASCII signature) + // group token flags p, print_func, get_func, set_func, target for get/set, default value + { "sys", "fb", _fipn,2, hw_print_fb, get_flt, set_nul, (float *)&cs.fw_build, G2CORE_FIRMWARE_BUILD }, // MUST BE FIRST! + { "sys", "fbs",_fn, 2, hw_print_fbs, hw_get_fbs, set_nul, (float *)&cs.null, 0 }, + { "sys", "fbc",_fn, 2, hw_print_fbc, hw_get_fbc, set_nul, (float *)&cs.null, 0 }, + { "sys", "fv", _fipn,2, hw_print_fv, get_flt, set_nul, (float *)&cs.fw_version, G2CORE_FIRMWARE_VERSION }, + { "sys", "hp", _fipn,0, hw_print_hp, get_flt, set_nul, (float *)&cs.hw_platform, G2CORE_HARDWARE_PLATFORM }, + { "sys", "hv", _fipn,0, hw_print_hv, get_flt, set_nul, (float *)&cs.hw_version, G2CORE_HARDWARE_VERSION }, + { "sys", "id", _fn, 0, hw_print_id, hw_get_id, set_nul, (float *)&cs.null, 0 }, // device ID (ASCII signature) // dynamic model attributes for reporting purposes (up front for speed) { "", "stat",_f0, 0, cm_print_stat, cm_get_stat, set_nul,(float *)&cs.null, 0 }, // combined machine state @@ -603,19 +603,19 @@ const cfgItem_t cfgArray[] = { { "jid","jidd",_f0, 0, tx_print_nul, get_data, set_data, (float *)&cfg.job_id[3], 0}, // General system parameters - { "sys","jt", _fipn, 2, cm_print_jt, cm_get_jt, cm_set_jt, (float *)&cs.null, JUNCTION_INTEGRATION_TIME }, - { "sys","ct", _fipnc,4, cm_print_ct, cm_get_ct, cm_set_ct, (float *)&cs.null, CHORDAL_TOLERANCE }, - { "sys","sl", _fipn, 0, cm_print_sl, get_ui8, set_01, (float *)&cm->soft_limit_enable, SOFT_LIMIT_ENABLE }, - { "sys","lim", _fipn,0, cm_print_lim, get_ui8, set_01, (float *)&cm->limit_enable, HARD_LIMIT_ENABLE }, - { "sys","saf", _fipn,0, cm_print_saf, get_ui8, set_01, (float *)&cm->safety_interlock_enable, SAFETY_INTERLOCK_ENABLE }, - { "sys","m48e",_fipn,0, cm_print_m48e,get_ui8, set_01, (float *)&cm->gmx.m48_enable, 0 }, // M48/M49 feedrate & spindle override enable - { "sys","mfoe",_fipn,0, cm_print_mfoe,get_ui8, set_01, (float *)&cm->gmx.mfo_enable, FEED_OVERRIDE_ENABLE}, - { "sys","mfo", _fipn,3, cm_print_mfo, get_flt,cm_set_mfo,(float *)&cm->gmx.mfo_factor, FEED_OVERRIDE_FACTOR}, - { "sys","mtoe",_fipn,0, cm_print_mtoe,get_ui8, set_01, (float *)&cm->gmx.mto_enable, TRAVERSE_OVERRIDE_ENABLE}, - { "sys","mto", _fipn,3, cm_print_mto, get_flt,cm_set_mto,(float *)&cm->gmx.mto_factor, TRAVERSE_OVERRIDE_FACTOR}, - { "sys","mt", _fipn,2, st_print_mt, get_flt, st_set_mt,(float *)&st_cfg.motor_power_timeout, MOTOR_POWER_TIMEOUT}, - { "", "me", _f0, 0, st_print_me, get_nul, st_set_me,(float *)&cs.null, 0 }, // GET or SET to enable motors - { "", "md", _f0, 0, st_print_md, get_nul, st_set_md,(float *)&cs.null, 0 }, // GET or SET to disable motors + { "sys","jt", _fipn, 2, cm_print_jt, cm_get_jt, cm_set_jt, (float *)&cs.null, JUNCTION_INTEGRATION_TIME }, + { "sys","ct", _fipnc,4, cm_print_ct, cm_get_ct, cm_set_ct, (float *)&cs.null, CHORDAL_TOLERANCE }, + { "sys","sl", _fipn, 0, cm_print_sl, cm_get_sl, cm_set_sl, (float *)&cs.null, SOFT_LIMIT_ENABLE }, + { "sys","lim", _fipn,0, cm_print_lim, cm_get_lim, cm_set_lim, (float *)&cs.null, HARD_LIMIT_ENABLE }, + { "sys","saf", _fipn,0, cm_print_saf, cm_get_saf, cm_set_saf, (float *)&cs.null, SAFETY_INTERLOCK_ENABLE }, + { "sys","froe",_fipn,0, cm_print_froe,cm_get_froe,cm_get_froe,(float *)&cs.null, FEED_OVERRIDE_ENABLE}, + { "sys","fro", _fipn,3, cm_print_fro, cm_get_fro, cm_set_fro, (float *)&cs.null, FEED_OVERRIDE_FACTOR}, + { "sys","troe",_fipn,0, cm_print_troe,cm_get_troe,cm_get_troe,(float *)&cs.null, TRAVERSE_OVERRIDE_ENABLE}, + { "sys","tro", _fipn,3, cm_print_tro, cm_get_tro, cm_set_tro, (float *)&cs.null, TRAVERSE_OVERRIDE_FACTOR}, + { "sys","mt", _fipn,2, st_print_mt, get_flt, st_set_mt, (float *)&st_cfg.motor_power_timeout, MOTOR_POWER_TIMEOUT}, + { "", "me", _f0, 0, st_print_me, get_nul, st_set_me, (float *)&cs.null, 0 }, // SET to enable motors + { "", "md", _f0, 0, st_print_md, get_nul, st_set_md, (float *)&cs.null, 0 }, // SET to disable motors +// { "sys","m48e",_fipn,0, cm_print_m48e,get_ui8, set_01, (float *)&cm->gmx.m48_enable, 0 }, // M48/M49 feedrate & spindle override enable // Spindle functions { "sys","spep",_fipn,0, cm_print_spep,get_ui8, set_01, (float *)&spindle.enable_polarity, SPINDLE_ENABLE_POLARITY }, diff --git a/g2core/cycle_jogging.cpp b/g2core/cycle_jogging.cpp index e161831e..c9503fa0 100644 --- a/g2core/cycle_jogging.cpp +++ b/g2core/cycle_jogging.cpp @@ -34,6 +34,8 @@ #include "util.h" #include "xio.h" +#define JOGGING_START_VELOCITY ((float)10.0) + /**** Jogging singleton structure ****/ struct jmJoggingSingleton { // persistent jogging runtime variables diff --git a/g2core/plan_arc.h b/g2core/plan_arc.h index 77910258..6f65a871 100644 --- a/g2core/plan_arc.h +++ b/g2core/plan_arc.h @@ -30,6 +30,8 @@ #define ARC_RADIUS_ERROR_MIN ((float)0.005) // min mm where 1% rule applies #define ARC_RADIUS_TOLERANCE ((float)0.001) // 0.1% radius variance test +#define CHORDAL_TOLERANCE_MIN (0.001) // values below this are not accepted + typedef struct arArcSingleton { // persistent planner and runtime variables magic_t magic_start; uint8_t run_state; // runtime state machine sequence