Tweaks and minor bug fixes. Added purge buffer command.

- Added a purge buffer (and lock) command. This is an advanced option
to clear any queued blocks in the buffer in the event of system
position being lost or homed. These queued blocks will likely not move
correctly if not purged. In typical use, the purging command releases
the homing axes lock in case a user need to move the axes off their
hard limit switches, but position is not guaranteed. Homing is advised
immediately after.

- Created a system-wide sync current position function. Cleans up some
of the repetitive tasks in various places in the code that do the same
thing.

- Removed the clear all switches command '$S'. Not really needed and
helped clean up a sync call.

- Other minor tweaks. Readme updated slightly..
This commit is contained in:
Sonny Jeon
2012-11-04 08:44:54 -07:00
parent 4c711a4af7
commit 8c0106c247
12 changed files with 59 additions and 52 deletions

View File

@ -220,10 +220,10 @@ void mc_go_home()
}
// The machine should now be homed and machine zero has been located. Upon completion,
// reset planner and system internal position vectors, but not gcode parser position yet.
plan_clear_position();
clear_vector_float(sys.position);
// reset system position and sync internal position vectors.
clear_vector_float(sys.position); // Set machine zero
sys_sync_current_position();
// Pull-off all axes from limit switches before continuing motion. This provides some initial
// clearance off the switches and should also help prevent them from falsely tripping when
// hard limits are enabled.
@ -237,8 +237,8 @@ void mc_go_home()
st_cycle_start(); // Move it. Nothing should be in the buffer except this motion.
plan_synchronize(); // Make sure the motion completes.
// Explicitly update the gcode parser position since it was circumvented by the pull-off maneuver.
gc_set_current_position(sys.position[X_AXIS],sys.position[Y_AXIS],sys.position[Z_AXIS]);
// The gcode parser position was circumvented by the pull-off maneuver, so sync position vectors.
sys_sync_current_position();
// If hard limits feature enabled, re-enable hard limits interrupt after homing cycle.
if (bit_istrue(settings.flags,BITFLAG_HARD_LIMIT_ENABLE)) { PCICR |= (1 << LIMIT_INT); }