Commit ee98a976 authored by MagoKimbra's avatar MagoKimbra

New Pid endstop and fix M303 error

parent 7f4d4221
...@@ -21,7 +21,6 @@ ...@@ -21,7 +21,6 @@
// startup. Implementation of an idea by Prof Braino to inform user that any changes made to this // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
// build by the user have been successfully uploaded into firmware. // build by the user have been successfully uploaded into firmware.
#define STRING_VERSION "4.1.3" #define STRING_VERSION "4.1.3"
#define STRING_URL "reprap.org"
#define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes. #define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
#define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1 #define STRING_SPLASH_LINE1 "v" STRING_VERSION // will be shown during bootup in line 1
...@@ -222,6 +221,7 @@ ...@@ -222,6 +221,7 @@
#define PID_FUNCTIONAL_RANGE 10 // degC #define PID_FUNCTIONAL_RANGE 10 // degC
#define PID_INTEGRAL_DRIVE_MAX PID_MAX // Limit for the integral term #define PID_INTEGRAL_DRIVE_MAX PID_MAX // Limit for the integral term
#define K1 0.95 // Smoothing factor within the PID #define K1 0.95 // Smoothing factor within the PID
#define MAX_OVERSHOOT_PID_AUTOTUNE 20 // Max valor for overshoot autotune
// HotEnd{HE0,HE1,HE2,HE3} // HotEnd{HE0,HE1,HE2,HE3}
#define DEFAULT_Kp {40, 40, 40, 40} // Kp for E0, E1, E2, E3 #define DEFAULT_Kp {40, 40, 40, 40} // Kp for E0, E1, E2, E3
......
...@@ -31,7 +31,7 @@ ...@@ -31,7 +31,7 @@
/** /**
* Whenever an M104 or M109 increases the target temperature the firmware will wait for the * Whenever an M104 or M109 increases the target temperature the firmware will wait for the
* WATCH_TEMP_PERIOD to transpire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE * WATCH_TEMP_PERIOD to expire, and if the temperature hasn't increased by WATCH_TEMP_INCREASE
* degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109, * degrees, the machine is halted, requiring a hard reset. This test restarts with any M104/M109,
* but only if the current temperature is far enough below the target for a reliable test. * but only if the current temperature is far enough below the target for a reliable test.
*/ */
......
...@@ -36,6 +36,7 @@ ...@@ -36,6 +36,7 @@
#define BIT(b) (1<<(b)) #define BIT(b) (1<<(b))
#define TEST(n,b) (((n)&BIT(b))!=0) #define TEST(n,b) (((n)&BIT(b))!=0)
#define SET_BIT(n,b,value) (n) ^= ((-value)^(n)) & (BIT(b))
#define RADIANS(d) ((d)*M_PI/180.0) #define RADIANS(d) ((d)*M_PI/180.0)
#define DEGREES(r) ((d)*180.0/M_PI) #define DEGREES(r) ((d)*180.0/M_PI)
#define NOLESS(v,n) do{ if (v < n) v = n; }while(0) #define NOLESS(v,n) do{ if (v < n) v = n; }while(0)
......
...@@ -3667,11 +3667,13 @@ inline void gcode_G92() { ...@@ -3667,11 +3667,13 @@ inline void gcode_G92() {
didXYZ = true; didXYZ = true;
} }
} }
#if defined(DELTA) || defined(SCARA) if (didXYZ) {
if (didXYZ) sync_plan_position_delta(); #if defined(DELTA) || defined(SCARA)
#else sync_plan_position_delta();
if (didXYZ) sync_plan_position(); #else
#endif sync_plan_position();
#endif
}
} }
#ifdef ULTIPANEL #ifdef ULTIPANEL
...@@ -5961,7 +5963,7 @@ inline void gcode_T() { ...@@ -5961,7 +5963,7 @@ inline void gcode_T() {
#else // !DUAL_X_CARRIAGE #else // !DUAL_X_CARRIAGE
// Offset hotend (only by XY) // Offset hotend (only by XY)
#if HOTENDS > 1 #if HOTENDS > 1
for (int i=X_AXIS; i<=Y_AXIS; i++) for (int i = X_AXIS; i <= Y_AXIS; i++)
current_position[i] += hotend_offset[i][target_extruder] - hotend_offset[i][active_extruder]; current_position[i] += hotend_offset[i][target_extruder] - hotend_offset[i][active_extruder];
#endif // HOTENDS > 1 #endif // HOTENDS > 1
...@@ -6409,7 +6411,10 @@ void process_next_command() { ...@@ -6409,7 +6411,10 @@ void process_next_command() {
#endif // PREVENT_DANGEROUS_EXTRUDE #endif // PREVENT_DANGEROUS_EXTRUDE
case 303: // M303 PID autotune case 303: // M303 PID autotune
gcode_M303(); break; gcode_M303();
gcode_LastN += 1;
FlushSerialRequestResend();
break;
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
case 304: // M304 case 304: // M304
......
...@@ -39,15 +39,15 @@ ...@@ -39,15 +39,15 @@
#endif #endif
#endif #endif
#define START "start" //start for host #define START "start" //start for host
#define OK "ok" //ok answer for host #define OK "ok" //ok answer for host
#define ER "Error:" //error for host #define ER "Error: " //error for host
#define WT "wait" //wait for host #define WT "wait" //wait for host
#define DB "<MK4>: " //message for user #define DB "MK4: " //message for user
#define RS "Resend:" //resend for host #define RS "Resend: " //resend for host
#define PAUSE "//action:pause" //command for host that support action #define PAUSE "//action:pause" //command for host that support action
#define RESUME "//action:resume" //command for host that support action #define RESUME "//action:resume" //command for host that support action
#define DISCONNECT "//action:disconnect" //command for host that support action #define DISCONNECT "//action:disconnect" //command for host that support action
#define SERIAL_INIT(baud) MYSERIAL.begin(baud), delay(1) #define SERIAL_INIT(baud) MYSERIAL.begin(baud), delay(1)
#define SERIAL_WRITE(x) MYSERIAL.write(x) #define SERIAL_WRITE(x) MYSERIAL.write(x)
......
...@@ -76,6 +76,11 @@ volatile long endstops_trigsteps[3] = { 0 }; ...@@ -76,6 +76,11 @@ volatile long endstops_trigsteps[3] = { 0 };
volatile long endstops_stepsTotal, endstops_stepsDone; volatile long endstops_stepsTotal, endstops_stepsDone;
static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROBE as BIT value static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROBE as BIT value
static char old_endstop_bits = 0; // use X_MIN, X_MAX... Z_MAX, Z_PROBE
#ifdef Z_DUAL_ENDSTOPS
static char old_dual_endstop_bits = 0; // actually only implemented for Z
#endif
#ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED #ifdef ABORT_ON_ENDSTOP_HIT_FEATURE_ENABLED
bool abort_on_endstop_hit = false; bool abort_on_endstop_hit = false;
#endif #endif
...@@ -84,35 +89,6 @@ static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROB ...@@ -84,35 +89,6 @@ static volatile char endstop_hit_bits = 0; // use X_MIN, Y_MIN, Z_MIN and Z_PROB
int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT; int motor_current_setting[3] = DEFAULT_PWM_MOTOR_CURRENT;
#endif #endif
#if HAS_X_MIN
static bool old_x_min_endstop = false;
#endif
#if HAS_X_MAX
static bool old_x_max_endstop = false;
#endif
#if HAS_Y_MIN
static bool old_y_min_endstop = false;
#endif
#if HAS_Y_MAX
static bool old_y_max_endstop = false;
#endif
static bool old_z_min_endstop = false;
static bool old_z_max_endstop = false;
#ifdef Z_DUAL_ENDSTOPS
static bool old_z2_min_endstop = false;
static bool old_z2_max_endstop = false;
#endif
#ifdef Z_PROBE_ENDSTOP // No need to check for valid pin, SanityCheck.h already does this.
static bool old_z_probe_endstop = false;
#endif
#ifdef NPR2
static bool old_e_min_endstop = false;
#endif
static bool check_endstops = true; static bool check_endstops = true;
volatile long count_position[NUM_AXIS] = { 0 }; volatile long count_position[NUM_AXIS] = { 0 };
...@@ -159,11 +135,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 }; ...@@ -159,11 +135,11 @@ volatile signed char count_direction[NUM_AXIS] = { 1, 1, 1, 1 };
#define Z_APPLY_STEP(v,Q) \ #define Z_APPLY_STEP(v,Q) \
if (performing_homing) { \ if (performing_homing) { \
if (Z_HOME_DIR > 0) {\ if (Z_HOME_DIR > 0) {\
if (!(old_z_max_endstop && (count_direction[Z_AXIS] > 0)) && !locked_z_motor) Z_STEP_WRITE(v); \ if (!(TEST(old_endstop_bits, Z_MAX) && (count_direction[Z_AXIS] > 0)) && !locked_z_motor) Z_STEP_WRITE(v); \
if (!(old_z2_max_endstop && (count_direction[Z_AXIS] > 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \ if (!(TEST(old_dual_endstop_bits, Z_MAX) && (count_direction[Z_AXIS] > 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \
} else {\ } else {\
if (!(old_z_min_endstop && (count_direction[Z_AXIS] < 0)) && !locked_z_motor) Z_STEP_WRITE(v); \ if (!(TEST(old_endstop_bits, Z_MIN) && (count_direction[Z_AXIS] < 0)) && !locked_z_motor) Z_STEP_WRITE(v); \
if (!(old_z2_min_endstop && (count_direction[Z_AXIS] < 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \ if (!(TEST(old_dual_endstop_bits, Z_MIN) && (count_direction[Z_AXIS] < 0)) && !locked_z2_motor) Z2_STEP_WRITE(v); \
} \ } \
} else { \ } else { \
Z_STEP_WRITE(v); \ Z_STEP_WRITE(v); \
...@@ -489,24 +465,33 @@ ISR(TIMER1_COMPA_vect) { ...@@ -489,24 +465,33 @@ ISR(TIMER1_COMPA_vect) {
// Check endstops // Check endstops
if (check_endstops) { if (check_endstops) {
#define _ENDSTOP(axis, minmax) axis ##_## minmax ##_endstop char current_endstop_bits;
#ifdef Z_DUAL_ENDSTOPS
char current_dual_endstop_bits;
#endif
#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN
#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING
#define _OLD_ENDSTOP(axis, minmax) old_## axis ##_## minmax ##_endstop
#define _AXIS(AXIS) AXIS ##_AXIS #define _AXIS(AXIS) AXIS ##_AXIS
#define _HIT_BIT(AXIS) AXIS ##_MIN #define _ENDSTOP_HIT(AXIS) endstop_hit_bits |= BIT(_ENDSTOP(AXIS, MIN))
#define _ENDSTOP_HIT(AXIS) endstop_hit_bits |= BIT(_HIT_BIT(AXIS)) #define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX
#define UPDATE_ENDSTOP(axis,AXIS,minmax,MINMAX) \ // GET_ENDSTOP_STATUS: set the current endstop bits for an endstop to its status
bool _ENDSTOP(axis, minmax) = (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)); \ #define GET_ENDSTOP_STATUS(endstop, AXIS, MINMAX) SET_BIT(endstop, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX)))
if (_ENDSTOP(axis, minmax) && _OLD_ENDSTOP(axis, minmax) && (current_block->steps[_AXIS(AXIS)] > 0)) { \ // TEST_ENDSTOP: test the old and the current status of an endstop
#define TEST_ENDSTOPS(AXIS, MINMAX) (TEST(current_endstop_bits, _ENDSTOP(AXIS, MINMAX)) && TEST(old_endstop_bits, _ENDSTOP(AXIS, MINMAX)))
// TEST_DUAL_ENDSTOP: same like TEST_ENDSTOP for dual endstops
#define TEST_DUAL_ENDSTOPS(AXIS, MINMAX) (TEST(current_dual_endstop_bits, _ENDSTOP(AXIS, MINMAX)) && TEST(old_dual_endstop_bits, _ENDSTOP(AXIS, MINMAX)))
#define UPDATE_ENDSTOP(AXIS,MINMAX) \
GET_ENDSTOP_STATUS(current_endstop_bits, AXIS, MINMAX); \
if (TEST_ENDSTOPS(AXIS, MINMAX) && (current_block->steps[_AXIS(AXIS)] > 0)) { \
endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \ endstops_trigsteps[_AXIS(AXIS)] = count_position[_AXIS(AXIS)]; \
_ENDSTOP_HIT(AXIS); \ _ENDSTOP_HIT(AXIS); \
step_events_completed = current_block->step_event_count; \ step_events_completed = current_block->step_event_count; \
} \ }
_OLD_ENDSTOP(axis, minmax) = _ENDSTOP(axis, minmax);
#ifdef COREXY #ifdef COREXY
// Head direction in -X axis for CoreXY bots. // Head direction in -X axis for CoreXY bots.
// If DeltaX == -DeltaY, the movement is only in Y axis // If DeltaX == -DeltaY, the movement is only in Y axis
...@@ -522,7 +507,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -522,7 +507,7 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
{ {
#if HAS_X_MIN #if HAS_X_MIN
UPDATE_ENDSTOP(x, X, min, MIN); UPDATE_ENDSTOP(X, MIN);
#endif #endif
} }
} }
...@@ -533,7 +518,7 @@ ISR(TIMER1_COMPA_vect) { ...@@ -533,7 +518,7 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
{ {
#if HAS_X_MAX #if HAS_X_MAX
UPDATE_ENDSTOP(x, X, max, MAX); UPDATE_ENDSTOP(X, MAX);
#endif #endif
} }
} }
...@@ -548,12 +533,12 @@ ISR(TIMER1_COMPA_vect) { ...@@ -548,12 +533,12 @@ ISR(TIMER1_COMPA_vect) {
#endif #endif
{ // -direction { // -direction
#if HAS_Y_MIN #if HAS_Y_MIN
UPDATE_ENDSTOP(y, Y, min, MIN); UPDATE_ENDSTOP(Y, MIN);
#endif #endif
} }
else { // +direction else { // +direction
#if HAS_Y_MAX #if HAS_Y_MAX
UPDATE_ENDSTOP(y, Y, max, MAX); UPDATE_ENDSTOP(Y, MAX);
#endif #endif
} }
#ifdef COREXY #ifdef COREXY
...@@ -563,43 +548,38 @@ ISR(TIMER1_COMPA_vect) { ...@@ -563,43 +548,38 @@ ISR(TIMER1_COMPA_vect) {
#if HAS_Z_MIN #if HAS_Z_MIN
#ifdef Z_DUAL_ENDSTOPS #ifdef Z_DUAL_ENDSTOPS
GET_ENDSTOP_STATUS(current_endstop_bits, Z, MIN);
#if HAS_Z2_MIN
GET_ENDSTOP_STATUS(current_dual_endstop_bits, Z, MIN);
#endif
bool z_test = TEST_ENDSTOPS(Z, MIN)
#if HAS_Z2_MIN
&& TEST_DUAL_ENDSTOPS(Z, MIN)
#endif
;
bool z_min_endstop = READ(Z_MIN_PIN) != Z_MIN_ENDSTOP_INVERTING, if (z_test && current_block->steps[Z_AXIS] > 0) {
z2_min_endstop =
#if HAS_Z2_MIN
READ(Z2_MIN_PIN) != Z2_MIN_ENDSTOP_INVERTING
#else
z_min_endstop
#endif
;
bool z_min_both = z_min_endstop && old_z_min_endstop,
z2_min_both = z2_min_endstop && old_z2_min_endstop;
if ((z_min_both || z2_min_both) && current_block->steps[Z_AXIS] > 0) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_hit_bits |= BIT(Z_MIN); endstop_hit_bits |= BIT(Z_MIN);
if (!performing_homing || (performing_homing && z_min_both && z2_min_both)) //if not performing home or if both endstops were trigged during homing... if (!performing_homing || (performing_homing && !z_test)) //if not performing home or if both endstops were trigged during homing...
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
} }
old_z_min_endstop = z_min_endstop;
old_z2_min_endstop = z2_min_endstop;
#else // !Z_DUAL_ENDSTOPS #else // !Z_DUAL_ENDSTOPS
UPDATE_ENDSTOP(z, Z, min, MIN); UPDATE_ENDSTOP(Z, MIN);
#endif // !Z_DUAL_ENDSTOPS #endif // !Z_DUAL_ENDSTOPS
#endif // Z_MIN_PIN #endif // Z_MIN_PIN
#ifdef Z_PROBE_ENDSTOP #ifdef Z_PROBE_ENDSTOP
UPDATE_ENDSTOP(z, Z, probe, PROBE); UPDATE_ENDSTOP(Z, PROBE);
z_probe_endstop = (READ(Z_PROBE_PIN) != Z_PROBE_ENDSTOP_INVERTING); GET_ENDSTOP_STATUS(current_endstop_bits, Z, PROBE);
if (z_probe_endstop && old_z_probe_endstop) {
if(TEST_ENDSTOPS(Z, PROBE))
{
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS]; endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_hit_bits |= BIT(Z_PROBE); endstop_hit_bits |= BIT(Z_PROBE);
} }
old_z_probe_endstop = z_probe_endstop;
#endif #endif
} }
else { // z +direction else { // z +direction
...@@ -607,40 +587,39 @@ ISR(TIMER1_COMPA_vect) { ...@@ -607,40 +587,39 @@ ISR(TIMER1_COMPA_vect) {
#ifdef Z_DUAL_ENDSTOPS #ifdef Z_DUAL_ENDSTOPS
bool z_max_endstop = READ(Z_MAX_PIN) != Z_MAX_ENDSTOP_INVERTING, GET_ENDSTOP_STATUS(current_endstop_bits, Z, MAX);
z2_max_endstop = #if HAS_Z2_MAX
#if HAS_Z2_MAX GET_ENDSTOP_STATUS(current_dual_endstop_bits, Z, MAX);
READ(Z2_MAX_PIN) != Z2_MAX_ENDSTOP_INVERTING #endif
#else
z_max_endstop
#endif
;
bool z_max_both = z_max_endstop && old_z_max_endstop,
z2_max_both = z2_max_endstop && old_z2_max_endstop;
if ((z_max_both || z2_max_both) && current_block->steps[Z_AXIS] > 0) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_hit_bits |= BIT(Z_MIN);
// if (z_max_both) ECHO_EV("z_max_endstop = true"); bool z_test = TEST_ENDSTOPS(Z, MAX)
// if (z2_max_both) ECHO_EV("z2_max_endstop = true"); #if HAS_Z2_MAX
&& TEST_DUAL_ENDSTOPS(Z, MAX)
#endif
;
if (!performing_homing || (performing_homing && z_max_both && z2_max_both)) //if not performing home or if both endstops were trigged during homing... if (z_test && current_block->steps[Z_AXIS] > 0) {
endstops_trigsteps[Z_AXIS] = count_position[Z_AXIS];
endstop_hit_bits |= BIT(Z_MIN);
if (!performing_homing || (performing_homing && !z_test)) //if not performing home or if both endstops were trigged during homing...
step_events_completed = current_block->step_event_count; step_events_completed = current_block->step_event_count;
} }
old_z_max_endstop = z_max_endstop;
old_z2_max_endstop = z2_max_endstop;
#else // !Z_DUAL_ENDSTOPS #else // !Z_DUAL_ENDSTOPS
UPDATE_ENDSTOP(z, Z, max, MAX); UPDATE_ENDSTOP(Z, MAX);
#endif // !Z_DUAL_ENDSTOPS #endif // !Z_DUAL_ENDSTOPS
#endif // Z_MAX_PIN #endif // Z_MAX_PIN
} }
old_endstop_bits = current_endstop_bits;
#ifdef Z_DUAL_ENDSTOPS
old_dual_endstop_bits = current_dual_endstop_bits;
#endif
} }
// Take multiple steps per interrupt (For high speed moves) // Take multiple steps per interrupt (For high speed moves)
for (int8_t i = 0; i < step_loops; i++) { for (int8_t i = 0; i < step_loops; i++) {
#ifndef AT90USB #ifndef AT90USB
......
...@@ -55,9 +55,9 @@ float current_temperature_bed = 0.0; ...@@ -55,9 +55,9 @@ float current_temperature_bed = 0.0;
#endif #endif
#ifdef PIDTEMPBED #ifdef PIDTEMPBED
float bedKp=DEFAULT_bedKp; float bedKp = DEFAULT_bedKp;
float bedKi=(DEFAULT_bedKi*PID_dT); float bedKi = (DEFAULT_bedKi*PID_dT);
float bedKd=(DEFAULT_bedKd/PID_dT); float bedKd = (DEFAULT_bedKd/PID_dT);
#endif //PIDTEMPBED #endif //PIDTEMPBED
#ifdef FAN_SOFT_PWM #ifdef FAN_SOFT_PWM
...@@ -181,8 +181,7 @@ static void updateTemperaturesFromRawValues(); ...@@ -181,8 +181,7 @@ static void updateTemperaturesFromRawValues();
//================================ Functions ================================ //================================ Functions ================================
//=========================================================================== //===========================================================================
void PID_autotune(float temp, int hotend, int ncycles) void PID_autotune(float temp, int hotend, int ncycles) {
{
float input = 0.0; float input = 0.0;
int cycles = 0; int cycles = 0;
bool heating = true; bool heating = true;
...@@ -300,7 +299,7 @@ void PID_autotune(float temp, int hotend, int ncycles) ...@@ -300,7 +299,7 @@ void PID_autotune(float temp, int hotend, int ncycles)
} }
} }
} }
if (input > temp + 20) { if (input > temp + MAX_OVERSHOOT_PID_AUTOTUNE) {
ECHO_LM(ER, MSG_PID_TEMP_TOO_HIGH); ECHO_LM(ER, MSG_PID_TEMP_TOO_HIGH);
return; return;
} }
...@@ -315,7 +314,7 @@ void PID_autotune(float temp, int hotend, int ncycles) ...@@ -315,7 +314,7 @@ void PID_autotune(float temp, int hotend, int ncycles)
} }
else { else {
p = soft_pwm[hotend]; p = soft_pwm[hotend];
ECHO_SMV(OK, MSG_T, input); ECHO_SMV(OK, MSG_T, input, 1);
ECHO_EMV(MSG_AT, p); ECHO_EMV(MSG_AT, p);
} }
......
...@@ -66,7 +66,7 @@ extern float current_temperature_bed; ...@@ -66,7 +66,7 @@ extern float current_temperature_bed;
#ifdef PIDTEMP #ifdef PIDTEMP
extern float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS]; extern float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS];
#define PID_PARAM(param,e) param[e] // use macro to point to array value #define PID_PARAM(param, e) param[e] // use macro to point to array value
float scalePID_i(float i); float scalePID_i(float i);
float scalePID_d(float d); float scalePID_d(float d);
float unscalePID_i(float i); float unscalePID_i(float i);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment