|
|
@ -76,9 +76,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SERVOS
|
|
|
|
#if HAS_SERVOS
|
|
|
|
#include "servo.h"
|
|
|
|
#include "servo.h"
|
|
|
|
|
|
|
|
#define EEPROM_NUM_SERVOS NUM_SERVOS
|
|
|
|
#else
|
|
|
|
#else
|
|
|
|
#undef NUM_SERVOS
|
|
|
|
#define EEPROM_NUM_SERVOS NUM_SERVO_PLUGS
|
|
|
|
#define NUM_SERVOS NUM_SERVO_PLUGS
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
|
|
|
#if HAS_BED_PROBE
|
|
|
@ -187,7 +187,7 @@ typedef struct SettingsDataStruct {
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// SERVO_ANGLES
|
|
|
|
// SERVO_ANGLES
|
|
|
|
//
|
|
|
|
//
|
|
|
|
uint16_t servo_angles[NUM_SERVOS][2]; // M281 P L U
|
|
|
|
uint16_t servo_angles[EEPROM_NUM_SERVOS][2]; // M281 P L U
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
|
// DELTA / [XYZ]_DUAL_ENDSTOPS
|
|
|
|
// DELTA / [XYZ]_DUAL_ENDSTOPS
|
|
|
@ -632,36 +632,11 @@ void MarlinSettings::postprocess() {
|
|
|
|
// Servo Angles
|
|
|
|
// Servo Angles
|
|
|
|
//
|
|
|
|
//
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if !(HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES))
|
|
|
|
_FIELD_TEST(servo_angles);
|
|
|
|
|
|
|
|
|
|
|
|
uint16_t servo_angles[NUM_SERVOS][2] = { { 0, 0 } };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SWITCHING_EXTRUDER)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr uint16_t sesa[][2] = SWITCHING_EXTRUDER_SERVO_ANGLES;
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_SERVO_NR][0] = sesa[0][0];
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_SERVO_NR][1] = sesa[0][1];
|
|
|
|
|
|
|
|
#if EXTRUDERS > 3
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][0] = sesa[1][0];
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][1] = sesa[1][1];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#elif ENABLED(SWITCHING_NOZZLE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr uint16_t snsa[] = SWITCHING_NOZZLE_SERVO_ANGLES;
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_NOZZLE_SERVO_NR][0] = snsa[0];
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_NOZZLE_SERVO_NR][1] = snsa[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr uint16_t zsa[] = Z_SERVO_ANGLES;
|
|
|
|
|
|
|
|
servo_angles[Z_PROBE_SERVO_NR][0] = zsa[0];
|
|
|
|
|
|
|
|
servo_angles[Z_PROBE_SERVO_NR][1] = zsa[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // !HAS_SERVOS || !EDITABLE_SERVO_ANGLES
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !HAS_SERVOS
|
|
|
|
|
|
|
|
uint16_t servo_angles[NUM_SERVO_PLUGS][2] = { { 0, 0 } };
|
|
|
|
|
|
|
|
#endif
|
|
|
|
EEPROM_WRITE(servo_angles);
|
|
|
|
EEPROM_WRITE(servo_angles);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1311,10 +1286,14 @@ void MarlinSettings::postprocess() {
|
|
|
|
// SERVO_ANGLES
|
|
|
|
// SERVO_ANGLES
|
|
|
|
//
|
|
|
|
//
|
|
|
|
{
|
|
|
|
{
|
|
|
|
#if !(HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES))
|
|
|
|
_FIELD_TEST(servo_angles);
|
|
|
|
uint16_t servo_angles[NUM_SERVOS][2];
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(EDITABLE_SERVO_ANGLES)
|
|
|
|
|
|
|
|
uint16_t (&servo_angles_arr)[EEPROM_NUM_SERVOS][2] = servo_angles;
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
uint16_t servo_angles_arr[EEPROM_NUM_SERVOS][2];
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
EEPROM_READ(servo_angles);
|
|
|
|
EEPROM_READ(servo_angles_arr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
//
|
|
|
@ -1992,39 +1971,13 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
// Servo Angles
|
|
|
|
// Servo Angles
|
|
|
|
//
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES)
|
|
|
|
#if ENABLED(EDITABLE_SERVO_ANGLES)
|
|
|
|
|
|
|
|
COPY(servo_angles, base_servo_angles);
|
|
|
|
#if ENABLED(SWITCHING_EXTRUDER)
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
#if EXTRUDERS > 3
|
|
|
|
|
|
|
|
#define REQ_ANGLES 4
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
#define REQ_ANGLES 2
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
constexpr uint16_t sesa[] = SWITCHING_EXTRUDER_SERVO_ANGLES;
|
|
|
|
|
|
|
|
static_assert(COUNT(sesa) == REQ_ANGLES, "SWITCHING_EXTRUDER_SERVO_ANGLES needs " STRINGIFY(REQ_ANGLES) " angles.");
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_SERVO_NR][0] = sesa[0];
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_SERVO_NR][1] = sesa[1];
|
|
|
|
|
|
|
|
#if EXTRUDERS > 3
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][0] = sesa[2];
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_EXTRUDER_E23_SERVO_NR][1] = sesa[3];
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#elif ENABLED(SWITCHING_NOZZLE)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr uint16_t snsa[2] = SWITCHING_NOZZLE_SERVO_ANGLES;
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_NOZZLE_SERVO_NR][0] = snsa[0];
|
|
|
|
|
|
|
|
servo_angles[SWITCHING_NOZZLE_SERVO_NR][1] = snsa[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#elif defined(Z_SERVO_ANGLES) && defined(Z_PROBE_SERVO_NR)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
constexpr uint16_t zsa[2] = Z_SERVO_ANGLES;
|
|
|
|
|
|
|
|
servo_angles[Z_PROBE_SERVO_NR][0] = zsa[0];
|
|
|
|
|
|
|
|
servo_angles[Z_PROBE_SERVO_NR][1] = zsa[1];
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_SERVOS && EDITABLE_SERVO_ANGLES
|
|
|
|
//
|
|
|
|
|
|
|
|
// Endstop Adjustments
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
#if ENABLED(DELTA)
|
|
|
|
const float adj[ABC] = DELTA_ENDSTOP_ADJ, dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
|
|
|
|
const float adj[ABC] = DELTA_ENDSTOP_ADJ, dta[ABC] = DELTA_TOWER_ANGLE_TRIM;
|
|
|
@ -2083,6 +2036,10 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Preheat parameters
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LCD_MENU
|
|
|
|
#if HAS_LCD_MENU
|
|
|
|
ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND;
|
|
|
|
ui.preheat_hotend_temp[0] = PREHEAT_1_TEMP_HOTEND;
|
|
|
|
ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND;
|
|
|
|
ui.preheat_hotend_temp[1] = PREHEAT_2_TEMP_HOTEND;
|
|
|
@ -2092,6 +2049,10 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
ui.preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
|
|
|
|
ui.preheat_fan_speed[1] = PREHEAT_2_FAN_SPEED;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Hotend PID
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PIDTEMP)
|
|
|
|
#if ENABLED(PIDTEMP)
|
|
|
|
HOTEND_LOOP() {
|
|
|
|
HOTEND_LOOP() {
|
|
|
|
PID_PARAM(Kp, e) = float(DEFAULT_Kp);
|
|
|
|
PID_PARAM(Kp, e) = float(DEFAULT_Kp);
|
|
|
@ -2101,10 +2062,19 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
PID_PARAM(Kc, e) = DEFAULT_Kc;
|
|
|
|
PID_PARAM(Kc, e) = DEFAULT_Kc;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if ENABLED(PID_EXTRUSION_SCALING)
|
|
|
|
#endif
|
|
|
|
thermalManager.lpq_len = 20; // default last-position-queue size
|
|
|
|
|
|
|
|
#endif
|
|
|
|
//
|
|
|
|
#endif // PIDTEMP
|
|
|
|
// PID Extrusion Scaling
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PID_EXTRUSION_SCALING)
|
|
|
|
|
|
|
|
thermalManager.lpq_len = 20; // Default last-position-queue size
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Heated Bed PID
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(PIDTEMPBED)
|
|
|
|
#if ENABLED(PIDTEMPBED)
|
|
|
|
thermalManager.bed_pid.Kp = DEFAULT_bedKp;
|
|
|
|
thermalManager.bed_pid.Kp = DEFAULT_bedKp;
|
|
|
@ -2112,18 +2082,34 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
thermalManager.bed_pid.Kd = scalePID_d(DEFAULT_bedKd);
|
|
|
|
thermalManager.bed_pid.Kd = scalePID_d(DEFAULT_bedKd);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// LCD Contrast
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_LCD_CONTRAST
|
|
|
|
#if HAS_LCD_CONTRAST
|
|
|
|
ui.set_contrast(DEFAULT_LCD_CONTRAST);
|
|
|
|
ui.set_contrast(DEFAULT_LCD_CONTRAST);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Power-Loss Recovery
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
#if ENABLED(POWER_LOSS_RECOVERY)
|
|
|
|
recovery.enable(true);
|
|
|
|
recovery.enable(true);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Firmware Retraction
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
#if ENABLED(FWRETRACT)
|
|
|
|
fwretract.reset();
|
|
|
|
fwretract.reset();
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Volumetric & Filament Size
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if DISABLED(NO_VOLUMETRICS)
|
|
|
|
#if DISABLED(NO_VOLUMETRICS)
|
|
|
|
|
|
|
|
|
|
|
|
parser.volumetric_enabled =
|
|
|
|
parser.volumetric_enabled =
|
|
|
@ -2148,16 +2134,36 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
|
|
|
|
|
|
|
|
reset_stepper_drivers();
|
|
|
|
reset_stepper_drivers();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Linear Advance
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(LIN_ADVANCE)
|
|
|
|
#if ENABLED(LIN_ADVANCE)
|
|
|
|
LOOP_L_N(i, EXTRUDERS) planner.extruder_advance_K[i] = LIN_ADVANCE_K;
|
|
|
|
LOOP_L_N(i, EXTRUDERS) planner.extruder_advance_K[i] = LIN_ADVANCE_K;
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Motor Current PWM
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_MOTOR_CURRENT_PWM
|
|
|
|
#if HAS_MOTOR_CURRENT_PWM
|
|
|
|
uint32_t tmp_motor_current_setting[3] = PWM_MOTOR_CURRENT;
|
|
|
|
uint32_t tmp_motor_current_setting[3] = PWM_MOTOR_CURRENT;
|
|
|
|
for (uint8_t q = 3; q--;)
|
|
|
|
for (uint8_t q = 3; q--;)
|
|
|
|
stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q]));
|
|
|
|
stepper.digipot_current(q, (stepper.motor_current_setting[q] = tmp_motor_current_setting[q]));
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// CNC Coordinate System
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(CNC_COORDINATE_SYSTEMS)
|
|
|
|
|
|
|
|
(void)gcode.select_coordinate_system(-1); // Go back to machine space
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Skew Correction
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(SKEW_CORRECTION_GCODE)
|
|
|
|
#if ENABLED(SKEW_CORRECTION_GCODE)
|
|
|
|
planner.skew_factor.xy = XY_SKEW_FACTOR;
|
|
|
|
planner.skew_factor.xy = XY_SKEW_FACTOR;
|
|
|
|
#if ENABLED(SKEW_CORRECTION_FOR_Z)
|
|
|
|
#if ENABLED(SKEW_CORRECTION_FOR_Z)
|
|
|
@ -2166,6 +2172,10 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
// Advanced Pause filament load & unload lengths
|
|
|
|
|
|
|
|
//
|
|
|
|
|
|
|
|
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
|
|
#if ENABLED(ADVANCED_PAUSE_FEATURE)
|
|
|
|
for (uint8_t e = 0; e < EXTRUDERS; e++) {
|
|
|
|
for (uint8_t e = 0; e < EXTRUDERS; e++) {
|
|
|
|
fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
|
|
|
|
fc_settings[e].unload_length = FILAMENT_CHANGE_UNLOAD_LENGTH;
|
|
|
@ -2491,7 +2501,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_LEVELING
|
|
|
|
#endif // HAS_LEVELING
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SERVOS && ENABLED(EDITABLE_SERVO_ANGLES)
|
|
|
|
#if ENABLED(EDITABLE_SERVO_ANGLES)
|
|
|
|
|
|
|
|
|
|
|
|
CONFIG_ECHO_HEADING("Servo Angles:");
|
|
|
|
CONFIG_ECHO_HEADING("Servo Angles:");
|
|
|
|
for (uint8_t i = 0; i < NUM_SERVOS; i++) {
|
|
|
|
for (uint8_t i = 0; i < NUM_SERVOS; i++) {
|
|
|
@ -2515,7 +2525,7 @@ void MarlinSettings::reset(PORTARG_SOLO) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#endif // HAS_SERVOS && EDITABLE_SERVO_ANGLES
|
|
|
|
#endif // EDITABLE_SERVO_ANGLES
|
|
|
|
|
|
|
|
|
|
|
|
#if HAS_SCARA_OFFSET
|
|
|
|
#if HAS_SCARA_OFFSET
|
|
|
|
|
|
|
|
|
|
|
|