Slow trailing steps fix. Added more defaults.

- Fixed an issue (hopefully) with slow trailing steps after a
triangular velocity profile move. Sets the trapezoid tick cycle counter
to the correct value for an accurate reproduction of the deceleration
curve. Keeps it from arriving too early to the target position, which
causes the slow trailing steps.

- Added Zen Toolworks 7x7 to default settings.

- Updated readme with new edge build.
This commit is contained in:
Sonny Jeon 2012-12-16 16:58:44 -07:00
parent e21d6a2fc4
commit c8b53b9d0a
4 changed files with 50 additions and 11 deletions

1
.gitignore vendored
View File

@ -1,3 +1,4 @@
*.hex
*.o *.o
*.elf *.elf
*.DS_Store *.DS_Store

View File

@ -14,7 +14,8 @@ _**Master Branch:**_
* [Grbl v0.8c Atmega328p 16mhz 9600baud](http://bit.ly/SSdCJE) * [Grbl v0.8c Atmega328p 16mhz 9600baud](http://bit.ly/SSdCJE)
_**Edge/Development Branch:**_ _**Edge/Development Branch:**_
* [Grbl v0.9a Build 2012-12-10](http://bit.ly/UDBwpZ) * [Grbl v0.9a Build 2012-12-16](http://bit.ly/UUTOD4) : Axes acceleration and maximum velocity independence installed. Lowered 20kHz step rate max. Bugs still exist. For testing only. Settings WILL be over-written.
* [Grbl v0.9a Build 2012-12-10](http://bit.ly/UDBwpZ) : New experimental stepper algorithm. Smoother. 30kHz max. Bugs exist (Homing). For testing only. Settings WILL be over-written.
_**Archives:**_ _**Archives:**_
* [Grbl v0.8a Atmega328p 16mhz 9600baud](http://bit.ly/TVCTVv) * [Grbl v0.8a Atmega328p 16mhz 9600baud](http://bit.ly/TVCTVv)
@ -51,4 +52,4 @@ _**Archives:**_
*Important note for Atmega 168 users:* Going forward, support for Atmega 168 will be dropped due to its limited memory and speed. However, legacy Grbl v0.51 "in the branch called 'v0_51' is still available for use. *Important note for Atmega 168 users:* Going forward, support for Atmega 168 will be dropped due to its limited memory and speed. However, legacy Grbl v0.51 "in the branch called 'v0_51' is still available for use.
_The project was initially inspired by the Arduino GCode Interpreter by Mike Ellery_ _The project was initially inspired by the Arduino GCode Interpreter by Mike Ellery_

View File

@ -55,14 +55,14 @@
#endif #endif
#ifdef DEFAULTS_SHERLINE_5400 #ifdef DEFAULTS_SHERLINE_5400
// Description: Sherline 5400 mill with three NEMA 23 185 oz-in stepper motors, driven by // Description: Sherline 5400 mill with three NEMA 23 Keling KL23H256-21-8B 185 oz-in stepper motors,
// three Pololu A4988 stepper drivers with a 30V, 6A power supply at 1.5A per winding. // driven by three Pololu A4988 stepper drivers with a 30V, 6A power supply at 1.5A per winding.
#define MICROSTEPS 4 #define MICROSTEPS 2
#define STEPS_PER_REV 200.0 #define STEPS_PER_REV 200.0
#define MM_PER_REV (0.050*MM_PER_INCH)) // 0.050 inch/rev leadscrew #define MM_PER_REV (0.050*MM_PER_INCH) // 0.050 inch/rev leadscrew
#define DEFAULT_X_STEPS_PER_MM (STEP_PER_REV*MICROSTEPS/MM_PER_REV) #define DEFAULT_X_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
#define DEFAULT_Y_STEPS_PER_MM (STEP_PER_REV*MICROSTEPS/MM_PER_REV) #define DEFAULT_Y_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
#define DEFAULT_Z_STEPS_PER_MM (STEP_PER_REV*MICROSTEPS/MM_PER_REV) #define DEFAULT_Z_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
#define DEFAULT_STEP_PULSE_MICROSECONDS 10 #define DEFAULT_STEP_PULSE_MICROSECONDS 10
#define DEFAULT_MM_PER_ARC_SEGMENT 0.1 #define DEFAULT_MM_PER_ARC_SEGMENT 0.1
#define DEFAULT_RAPID_FEEDRATE 635.0 // mm/min (25ipm) #define DEFAULT_RAPID_FEEDRATE 635.0 // mm/min (25ipm)
@ -119,4 +119,36 @@
#define DEFAULT_N_ARC_CORRECTION 25 #define DEFAULT_N_ARC_CORRECTION 25
#endif #endif
#ifdef DEFAULTS_ZEN_TOOLWORKS_7x7
// Description: Zen Toolworks 7x7 mill with three Shinano SST43D2121 65oz-in NEMA 17 stepper motors.
// Leadscrew is different from some ZTW kits, where most are 1.25mm/rev rather than 8.0mm/rev here.
// Driven by 30V, 6A power supply and TI DRV8811 stepper motor drivers.
#define MICROSTEPS 8
#define STEPS_PER_REV 200.0
#define MM_PER_REV 8.0 // 8 mm/rev leadscrew
#define DEFAULT_X_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
#define DEFAULT_Y_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
#define DEFAULT_Z_STEPS_PER_MM (STEPS_PER_REV*MICROSTEPS/MM_PER_REV)
#define DEFAULT_STEP_PULSE_MICROSECONDS 10
#define DEFAULT_MM_PER_ARC_SEGMENT 0.1
#define DEFAULT_RAPID_FEEDRATE 2500.0 // mm/min
#define DEFAULT_FEEDRATE 1000.0 // mm/min
#define DEFAULT_ACCELERATION 150.0*60*60 // 150 mm/min^2
#define DEFAULT_JUNCTION_DEVIATION 0.05 // mm
#define DEFAULT_STEPPING_INVERT_MASK (1<<Y_DIRECTION_BIT)
#define DEFAULT_REPORT_INCHES 0 // false
#define DEFAULT_AUTO_START 1 // true
#define DEFAULT_INVERT_ST_ENABLE 0 // false
#define DEFAULT_HARD_LIMIT_ENABLE 0 // false
#define DEFAULT_HOMING_ENABLE 0 // false
#define DEFAULT_HOMING_DIR_MASK 0 // move positive dir
#define DEFAULT_HOMING_RAPID_FEEDRATE 500.0 // mm/min
#define DEFAULT_HOMING_FEEDRATE 50.0 // mm/min
#define DEFAULT_HOMING_DEBOUNCE_DELAY 100 // msec (0-65k)
#define DEFAULT_HOMING_PULLOFF 1.0 // mm
#define DEFAULT_STEPPER_IDLE_LOCK_TIME 25 // msec (0-255)
#define DEFAULT_DECIMAL_PLACES 3
#define DEFAULT_N_ARC_CORRECTION 25
#endif #endif
#endif

View File

@ -263,9 +263,14 @@ ISR(TIMER1_COMPA_vect)
} else if (st.step_events_completed >= current_block->decelerate_after) { } else if (st.step_events_completed >= current_block->decelerate_after) {
// Reset trapezoid tick cycle counter to make sure that the deceleration is performed the // Reset trapezoid tick cycle counter to make sure that the deceleration is performed the
// same every time. Reset to CYCLES_PER_ACCELERATION_TICK/2 to follow the midpoint rule for // same every time. Reset to CYCLES_PER_ACCELERATION_TICK/2 to follow the midpoint rule for
// an accurate approximation of the deceleration curve. // an accurate approximation of the deceleration curve. For triangle profiles, down count
// from current cycle counter to ensure exact deceleration curve.
if (st.step_events_completed == current_block-> decelerate_after) { if (st.step_events_completed == current_block-> decelerate_after) {
st.trapezoid_tick_cycle_counter = CYCLES_PER_ACCELERATION_TICK/2; if (st.trapezoid_adjusted_rate == current_block->nominal_rate) {
st.trapezoid_tick_cycle_counter = CYCLES_PER_ACCELERATION_TICK/2; // Trapezoid profile
} else {
st.trapezoid_tick_cycle_counter = CYCLES_PER_ACCELERATION_TICK-st.trapezoid_tick_cycle_counter; // Triangle profile
}
} else { } else {
// Iterate cycle counter and check if speeds need to be reduced. // Iterate cycle counter and check if speeds need to be reduced.
if ( iterate_trapezoid_cycle_counter() ) { if ( iterate_trapezoid_cycle_counter() ) {