Various Laser / Spindle improvements (#15335)

This commit is contained in:
Ben
2020-04-03 01:31:08 +01:00
committed by GitHub
parent e7e9304819
commit df8b7dfc40
24 changed files with 776 additions and 169 deletions

View File

@ -52,7 +52,7 @@
#endif
#if HAS_CUTTER
#include "../feature/spindle_laser.h"
#include "../feature/spindle_laser_types.h"
#endif
// Feedrate for manual moves
@ -88,6 +88,23 @@ enum BlockFlag : char {
BLOCK_FLAG_SYNC_POSITION = _BV(BLOCK_BIT_SYNC_POSITION)
};
#if ENABLED(LASER_POWER_INLINE)
typedef struct {
uint8_t status, // See planner settings for meaning
power; // Ditto; When in trapezoid mode this is nominal power
#if ENABLED(LASER_POWER_INLINE_TRAPEZOID)
uint8_t power_entry; // Entry power for the laser
#if DISABLED(LASER_POWER_INLINE_TRAPEZOID_CONT)
uint8_t power_exit; // Exit power for the laser
uint32_t entry_per, // Steps per power increment (to avoid floats in stepper calcs)
exit_per; // Steps per power decrement
#endif
#endif
} block_laser_t;
#endif
/**
* struct block_t
*
@ -174,12 +191,36 @@ typedef struct block_t {
uint32_t sdpos;
#endif
#if ENABLED(LASER_POWER_INLINE)
block_laser_t laser;
#endif
} block_t;
#define HAS_POSITION_FLOAT ANY(LIN_ADVANCE, SCARA_FEEDRATE_SCALING, GRADIENT_MIX, LCD_SHOW_E_TOTAL)
#define BLOCK_MOD(n) ((n)&(BLOCK_BUFFER_SIZE-1))
#if ENABLED(LASER_POWER_INLINE)
typedef struct {
/**
* Laser status bitmask; most bits are unused;
* 0: Planner buffer enable
* 1: Laser enable
* 2: Reserved for direction
*/
uint8_t status;
/**
* Laser power: 0 or 255 in case of PWM-less laser,
* or the OCR value;
*
* Using OCR instead of raw power,
* as it avoids floating points during move loop
*/
uint8_t power;
} settings_laser_t;
#endif
typedef struct {
uint32_t max_acceleration_mm_per_s2[XYZE_N], // (mm/s^2) M201 XYZE
min_segment_time_us; // (µs) M205 B
@ -190,6 +231,9 @@ typedef struct {
travel_acceleration; // (mm/s^2) M204 T - Travel acceleration. DEFAULT ACCELERATION for all NON printing moves.
feedRate_t min_feedrate_mm_s, // (mm/s) M205 S - Minimum linear feedrate
min_travel_feedrate_mm_s; // (mm/s) M205 T - Minimum travel feedrate
#if ENABLED(LASER_POWER_INLINE)
settings_laser_t laser;
#endif
} planner_settings_t;
#if DISABLED(SKEW_CORRECTION)