Settings refactoring. Bug fixes. Misc new features.
This is likely the last major change to the v0.9 code base before push to master. Only two minor things remain on the agenda (CoreXY support, force clear EEPROM, and an extremely low federate bug). - NEW! Grbl is now compile-able and may be flashed directly through the Arduino IDE. Only minor changes were required for this compatibility. See the Wiki to learn how to do it. - New status reporting mask to turn on and off what Grbl sends back. This includes machine coordinates, work coordinates, serial RX buffer usage, and planner buffer usage. Expandable to more information on user request, but that’s it for now. - Settings have been completely renumbered to allow for future new settings to be installed without having to constantly reshuffle and renumber all of the settings every time. - All settings masks have been standardized to mean bit 0 = X, bit 1 = Y, and bit 2 = Z, to reduce confusion on how they work. The invert masks used by the internal Grbl system were updated to accommodate this change as well. - New invert probe pin setting, which does what it sounds like. - Fixed a probing cycle bug, where it would freeze intermittently, and removed some redundant code. - Homing may now be set to the origin wherever the limit switches are. Traditionally machine coordinates should always be in negative space, but when limit switches on are on the opposite side, the machine coordinate would be set to -max_travel for the axis. Now you can always make it [0,0,0] via a compile-time option in config.h. (Soft limits routine was updated to account for this as well.) - Probe coordinate message immediately after a probing cycle may now be turned off via a compile-time option in config.h. By default the probing location is always reported. - Reduced the N_ARC_CORRECTION default value to reflect the changes in how circles are generated by an arc tolerance, rather than a fixed arc segment setting. - Increased the incoming line buffer limit from 70 to 80 characters. Had some extra memory space to invest into this. - Fixed a bug where tool number T was not being tracked and reported correctly. - Added a print free memory function for debugging purposes. Not used otherwise. - Realtime rate report should now work during feed holds, but it hasn’t been tested yet. - Updated the streaming scripts with MIT-license and added the simple streaming to the main stream.py script to allow for settings to be sent. - Some minor code refactoring to improve flash efficiency. Reduced the flash by several hundred KB, which was re-invested in some of these new features.
This commit is contained in:
14
planner.c
14
planner.c
@ -260,9 +260,9 @@ uint8_t plan_check_full_buffer()
|
||||
invert_feed_rate is true, or as seek/rapids rate if the feed_rate value is negative (and
|
||||
invert_feed_rate always false). */
|
||||
#ifdef USE_LINE_NUMBERS
|
||||
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, int32_t line_number)
|
||||
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate, int32_t line_number)
|
||||
#else
|
||||
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate)
|
||||
void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate)
|
||||
#endif
|
||||
{
|
||||
// Prepare and initialize new block
|
||||
@ -295,7 +295,7 @@ void plan_buffer_line(float *target, float feed_rate, uint8_t invert_feed_rate)
|
||||
unit_vec[idx] = delta_mm; // Store unit vector numerator. Denominator computed later.
|
||||
|
||||
// Set direction bits. Bit enabled always means direction is negative.
|
||||
if (delta_mm < 0 ) { block->direction_bits |= get_direction_mask(idx); }
|
||||
if (delta_mm < 0 ) { block->direction_bits |= get_direction_pin_mask(idx); }
|
||||
|
||||
// Incrementally compute total move distance by Euclidean norm. First add square of each term.
|
||||
block->millimeters += delta_mm*delta_mm;
|
||||
@ -406,6 +406,14 @@ void plan_sync_position()
|
||||
}
|
||||
|
||||
|
||||
// Returns the number of active blocks are in the planner buffer.
|
||||
uint8_t plan_get_block_buffer_count()
|
||||
{
|
||||
if (block_buffer_head >= block_buffer_tail) { return(block_buffer_head-block_buffer_tail); }
|
||||
return(BLOCK_BUFFER_SIZE - (block_buffer_tail-block_buffer_head));
|
||||
}
|
||||
|
||||
|
||||
// Re-initialize buffer plan with a partially completed block, assumed to exist at the buffer tail.
|
||||
// Called after a steppers have come to a complete stop for a feed hold and the cycle is stopped.
|
||||
void plan_cycle_reinitialize()
|
||||
|
Reference in New Issue
Block a user