Minimal probing cycle working. Supports both G38.2 for error and G38.3 when no errors are desired.

This commit is contained in:
Robert Grzesek
2014-02-25 12:19:52 -08:00
parent 1fd45791a5
commit 0a46dfe0b9
10 changed files with 211 additions and 3 deletions

View File

@ -67,6 +67,13 @@
#define STATE_HOLD bit(5) // Executing feed hold
// #define STATE_JOG bit(6) // Jogging mode is unique like homing.
// Values that define the probing state machine.
#define PROBE_OFF 0 //No probing
#define PROBE_ACTIVE 1 //Actively watching the input pin. If it is triggered, the stante is changed to PROBE_COPY_POSITION
#define PROBE_COPY_POSITION 2 //In this state, the current position will be copied to probe_position in the stepper ISR. State is then changed to PROBE_OFF.
//Copying to a separate set of variables ensures that no race condition can occur if the ISR updates the main position variables
//while the probing routine is copying them.
// Define global system variables
typedef struct {
uint8_t abort; // System abort flag. Forces exit back to main loop for reset.
@ -76,6 +83,8 @@ typedef struct {
int32_t position[N_AXIS]; // Real-time machine (aka home) position vector in steps.
// NOTE: This may need to be a volatile variable, if problems arise.
uint8_t auto_start; // Planner auto-start flag. Toggled off during feed hold. Defaulted by settings.
uint8_t probe_state; // Probing state value. Used in the mc_probe_cycle(), the PINOUT_PIN IRT, and the stepper ISR to coordinate the probing cycle.
int32_t probe_position[N_AXIS]; // Copy of the position when the probe is triggered that can be read/copied without worring about changes in the middle of a read.
} system_t;
extern system_t sys;