Limit/control pin state reporting option

- As a setup feature, users can compile-in input pin status reporting.
Doesn’t do anything special, just prints the binary for the port. 0’s
and 1’s indicate low and high signals on the pins. It’s a bit cryptic
right now, but it’s just a start.

- Added a max step rate check when writing step/mm and max rate
settings. Should help avoid people misdiagnosing problems associated
with going over the 30kHz step rate limit. Right now not enabled. Takes
up over 100k of flash. Need that room for other things right now.
pull/1/head
Sonny Jeon 2015-02-06 20:02:34 -07:00
rodzic a358c6de0b
commit 23c1e154aa
4 zmienionych plików z 29 dodań i 2 usunięć

Wyświetl plik

@ -148,6 +148,12 @@
// NOTE: Will eventually be added to Grbl settings in v1.0.
// #define INVERT_CONTROL_PIN // Default disabled. Uncomment to enable.
// Enable input pin states feedback in status reports. The data is presented as a binary value with
// the bits in the appropriate input pin ports being 0(low) or 1(high). Useful for setting up a new
// CNC machine, but do not recommend keeping this option by default, as it will consume CPU resources
// with little to no benefit during normal operation.
// #define REPORT_INPUT_PIN_STATES // Default disabled. Uncomment to enable.
// ---------------------------------------------------------------------------------------
// ADVANCED CONFIGURATION OPTIONS:
@ -167,6 +173,11 @@
// step smoothing. See stepper.c for more details on the AMASS system works.
#define ADAPTIVE_MULTI_AXIS_STEP_SMOOTHING // Default enabled. Comment to disable.
// Sets the maximum step rate allowed to be written as a Grbl setting. This value is strictly limited
// by the CPU speed and will change if something other than an AVR running at 16MHz is used.
// NOTE: For now disabled, will enable if flash space permits.
// #define MAX_STEP_RATE_HZ 30000 // Hz
// By default, Grbl sets all input pins to normal-high operation with their internal pull-up resistors
// enabled. This simplifies the wiring for users by requiring only a switch connected to ground,
// although its recommended that users take the extra step of wiring in low-pass filter to reduce

Wyświetl plik

@ -75,6 +75,8 @@ void report_status_message(uint8_t status_code)
printPgmString(PSTR("Homing not enabled")); break;
case STATUS_OVERFLOW:
printPgmString(PSTR("Line overflow")); break;
// case STATUS_MAX_STEP_RATE_EXCEEDED:
// printPgmString(PSTR("Step rate > 30kHz")); break;
// Common g-code parser errors.
case STATUS_GCODE_MODAL_GROUP_VIOLATION:
@ -449,5 +451,12 @@ void report_realtime_status()
printFloat_RateValue(st_get_realtime_rate());
#endif
#ifdef REPORT_INPUT_PIN_STATES
printPgmString(PSTR(",Lim:"));
print_uint8_base2(LIMIT_PIN & LIMIT_MASK);
printPgmString(PSTR(",Ctl:"));
print_uint8_base2(CONTROL_PIN & CONTROL_MASK);
#endif
printPgmString(PSTR(">\r\n"));
}

Wyświetl plik

@ -33,6 +33,7 @@
#define STATUS_ALARM_LOCK 9
#define STATUS_SOFT_LIMIT_ERROR 10
#define STATUS_OVERFLOW 11
// #define STATUS_MAX_STEP_RATE_EXCEEDED 12
#define STATUS_GCODE_UNSUPPORTED_COMMAND 20
#define STATUS_GCODE_MODAL_GROUP_VIOLATION 21

Wyświetl plik

@ -200,8 +200,14 @@ uint8_t settings_store_global_setting(uint8_t parameter, float value) {
if (parameter < N_AXIS) {
// Valid axis setting found.
switch (set_idx) {
case 0: settings.steps_per_mm[parameter] = value; break;
case 1: settings.max_rate[parameter] = value; break;
case 0:
// if (value*settings.max_rate[parameter] > (MAX_STEP_RATE_HZ*60.0)) { return(STATUS_MAX_STEP_RATE_EXCEEDED); }
settings.steps_per_mm[parameter] = value;
break;
case 1:
// if (value*settings.steps_per_mm[parameter] > (MAX_STEP_RATE_HZ*60.0)) { return(STATUS_MAX_STEP_RATE_EXCEEDED); }
settings.max_rate[parameter] = value;
break;
case 2: settings.acceleration[parameter] = value*60*60; break; // Convert to mm/min^2 for grbl internal use.
case 3: settings.max_travel[parameter] = -value; break; // Store as negative for grbl internal use.
}