diff --git a/Documentation/Logo/marlinwiki.png b/Documentation/Logo/marlinwiki.png new file mode 100755 index 0000000000..23588b2483 Binary files /dev/null and b/Documentation/Logo/marlinwiki.png differ diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 10aa47f802..e90fa7cef7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -4052,18 +4052,13 @@ inline void gcode_M303() { } #ifdef SCARA - - /** - * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) - */ - inline bool gcode_M360() { - SERIAL_ECHOLN(" Cal: Theta 0 "); + bool SCARA_move_to_cal(uint8_t delta_x, uint8_t delta_y) { //SoftEndsEnabled = false; // Ignore soft endstops during calibration //SERIAL_ECHOLN(" Soft endstops disabled "); if (! Stopped) { //get_coordinates(); // For X Y Z E F - delta[X_AXIS] = 0; - delta[Y_AXIS] = 120; + delta[X_AXIS] = delta_x; + delta[Y_AXIS] = delta_y; calculate_SCARA_forward_Transform(delta); destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS]; destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS]; @@ -4074,25 +4069,20 @@ inline void gcode_M303() { return false; } + /** + * M360: SCARA calibration: Move to cal-position ThetaA (0 deg calibration) + */ + inline bool gcode_M360() { + SERIAL_ECHOLN(" Cal: Theta 0 "); + return SCARA_move_to_cal(0, 120); + } + /** * M361: SCARA calibration: Move to cal-position ThetaB (90 deg calibration - steps per degree) */ inline bool gcode_M361() { SERIAL_ECHOLN(" Cal: Theta 90 "); - //SoftEndsEnabled = false; // Ignore soft endstops during calibration - //SERIAL_ECHOLN(" Soft endstops disabled "); - if (! Stopped) { - //get_coordinates(); // For X Y Z E F - delta[X_AXIS] = 90; - delta[Y_AXIS] = 130; - calculate_SCARA_forward_Transform(delta); - destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS]; - destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS]; - prepare_move(); - //ClearToSend(); - return true; - } - return false; + return SCARA_move_to_cal(90, 130); } /** @@ -4100,20 +4090,7 @@ inline void gcode_M303() { */ inline bool gcode_M362() { SERIAL_ECHOLN(" Cal: Psi 0 "); - //SoftEndsEnabled = false; // Ignore soft endstops during calibration - //SERIAL_ECHOLN(" Soft endstops disabled "); - if (! Stopped) { - //get_coordinates(); // For X Y Z E F - delta[X_AXIS] = 60; - delta[Y_AXIS] = 180; - calculate_SCARA_forward_Transform(delta); - destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS]; - destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS]; - prepare_move(); - //ClearToSend(); - return true; - } - return false; + return SCARA_move_to_cal(60, 180); } /** @@ -4121,20 +4098,7 @@ inline void gcode_M303() { */ inline bool gcode_M363() { SERIAL_ECHOLN(" Cal: Psi 90 "); - //SoftEndsEnabled = false; // Ignore soft endstops during calibration - //SERIAL_ECHOLN(" Soft endstops disabled "); - if (! Stopped) { - //get_coordinates(); // For X Y Z E F - delta[X_AXIS] = 50; - delta[Y_AXIS] = 90; - calculate_SCARA_forward_Transform(delta); - destination[X_AXIS] = delta[X_AXIS]/axis_scaling[X_AXIS]; - destination[Y_AXIS] = delta[Y_AXIS]/axis_scaling[Y_AXIS]; - prepare_move(); - //ClearToSend(); - return true; - } - return false; + return SCARA_move_to_cal(50, 90); } /** @@ -4142,20 +4106,7 @@ inline void gcode_M303() { */ inline bool gcode_M364() { SERIAL_ECHOLN(" Cal: Theta-Psi 90 "); - // SoftEndsEnabled = false; // Ignore soft endstops during calibration - //SERIAL_ECHOLN(" Soft endstops disabled "); - if (! Stopped) { - //get_coordinates(); // For X Y Z E F - delta[X_AXIS] = 45; - delta[Y_AXIS] = 135; - calculate_SCARA_forward_Transform(delta); - destination[X_AXIS] = delta[X_AXIS] / axis_scaling[X_AXIS]; - destination[Y_AXIS] = delta[Y_AXIS] / axis_scaling[Y_AXIS]; - prepare_move(); - //ClearToSend(); - return true; - } - return false; + return SCARA_move_to_cal(45, 135); } /** diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index d55abe52dc..2c45caf6eb 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -403,7 +403,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Note: this feature occupies 10'206 byte #ifdef AUTO_BED_LEVELING_GRID -home_offset // set the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 #define BACK_PROBE_BED_POSITION 180 diff --git a/Marlin/example_configurations/Felix/Configuration_DUAL.h b/Marlin/example_configurations/Felix/Configuration_DUAL.h index 650d49e2f6..446ca85e25 100644 --- a/Marlin/example_configurations/Felix/Configuration_DUAL.h +++ b/Marlin/example_configurations/Felix/Configuration_DUAL.h @@ -403,7 +403,6 @@ const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of // Note: this feature occupies 10'206 byte #ifdef AUTO_BED_LEVELING_GRID -home_offset // set the rectangle in which to probe #define LEFT_PROBE_BED_POSITION 15 #define RIGHT_PROBE_BED_POSITION 170 #define BACK_PROBE_BED_POSITION 180 diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index 26360a5144..cf431cc6f4 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -177,7 +177,7 @@ static volatile bool temp_meas_ready = false; // Init min and max temp with extreme values to prevent false errors during startup static int minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP, HEATER_3_RAW_LO_TEMP); static int maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP, HEATER_3_RAW_HI_TEMP); -static int minttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 0, 0, 0, 0 ); +static int minttemp[EXTRUDERS] = { 0 }; static int maxttemp[EXTRUDERS] = ARRAY_BY_EXTRUDERS( 16383, 16383, 16383, 16383 ); //static int bed_minttemp_raw = HEATER_BED_RAW_LO_TEMP; /* No bed mintemp error implemented?!? */ #ifdef BED_MAXTEMP @@ -197,8 +197,8 @@ static float analog2tempBed(int raw); static void updateTemperaturesFromRawValues(); #ifdef WATCH_TEMP_PERIOD - int watch_start_temp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0,0); - unsigned long watchmillis[EXTRUDERS] = ARRAY_BY_EXTRUDERS(0,0,0,0); + int watch_start_temp[EXTRUDERS] = { 0 }; + unsigned long watchmillis[EXTRUDERS] = { 0 }; #endif //WATCH_TEMP_PERIOD #ifndef SOFT_PWM_SCALE @@ -661,12 +661,6 @@ void manage_heater() { updateTemperaturesFromRawValues(); - #ifdef HEATER_0_USES_MAX6675 - float ct = current_temperature[0]; - if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0); - if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0); - #endif //HEATER_0_USES_MAX6675 - unsigned long ms = millis(); // Loop through all extruders @@ -1145,28 +1139,28 @@ void disable_heater() { for (int i=0; i 1 && HAS_TEMP_1 - target_temperature[1] = 0; - soft_pwm[1] = 0; - WRITE_HEATER_1(LOW); + DISABLE_HEATER(1); #endif #if EXTRUDERS > 2 && HAS_TEMP_2 - target_temperature[2] = 0; - soft_pwm[2] = 0; - WRITE_HEATER_2(LOW); + DISABLE_HEATER(2); #endif #if EXTRUDERS > 3 && HAS_TEMP_3 - target_temperature[3] = 0; - soft_pwm[3] = 0; - WRITE_HEATER_3(LOW); + DISABLE_HEATER(3); #endif #if HAS_TEMP_BED @@ -1257,9 +1251,15 @@ enum TempState { // Timer 0 is shared with millies // ISR(TIMER0_COMPB_vect) { + #ifdef TEMP_SENSOR_1_AS_REDUNDANT + #define TEMP_SENSOR_COUNT 2 + #else + #define TEMP_SENSOR_COUNT EXTRUDERS + #endif + //these variables are only accesible from the ISR, but static, so they don't lose their value static unsigned char temp_count = 0; - static unsigned long raw_temp_value[EXTRUDERS] = { 0 }; + static unsigned long raw_temp_value[TEMP_SENSOR_COUNT] = { 0 }; static unsigned long raw_temp_bed_value = 0; static TempState temp_state = StartupDelay; static unsigned char pwm_count = BIT(SOFT_PWM_SCALE); @@ -1475,6 +1475,7 @@ ISR(TIMER0_COMPB_vect) { #endif temp_state = PrepareTemp_BED; break; + case PrepareTemp_BED: #if HAS_TEMP_BED START_ADC(TEMP_BED_PIN); @@ -1488,6 +1489,7 @@ ISR(TIMER0_COMPB_vect) { #endif temp_state = PrepareTemp_1; break; + case PrepareTemp_1: #if HAS_TEMP_1 START_ADC(TEMP_1_PIN); @@ -1501,6 +1503,7 @@ ISR(TIMER0_COMPB_vect) { #endif temp_state = PrepareTemp_2; break; + case PrepareTemp_2: #if HAS_TEMP_2 START_ADC(TEMP_2_PIN); @@ -1514,6 +1517,7 @@ ISR(TIMER0_COMPB_vect) { #endif temp_state = PrepareTemp_3; break; + case PrepareTemp_3: #if HAS_TEMP_3 START_ADC(TEMP_3_PIN); @@ -1527,6 +1531,7 @@ ISR(TIMER0_COMPB_vect) { #endif temp_state = Prepare_FILWIDTH; break; + case Prepare_FILWIDTH: #if HAS_FILAMENT_SENSOR START_ADC(FILWIDTH_PIN); @@ -1545,6 +1550,7 @@ ISR(TIMER0_COMPB_vect) { temp_state = PrepareTemp_0; temp_count++; break; + case StartupDelay: temp_state = PrepareTemp_0; break; @@ -1554,7 +1560,7 @@ ISR(TIMER0_COMPB_vect) { // SERIAL_ERRORLNPGM("Temp measurement error!"); // break; } // switch(temp_state) - + if (temp_count >= OVERSAMPLENR) { // 10 * 16 * 1/(16000000/64/256) = 164ms. if (!temp_meas_ready) { //Only update the raw values if they have been read. Else we could be updating them during reading. #ifndef HEATER_0_USES_MAX6675 @@ -1579,52 +1585,53 @@ ISR(TIMER0_COMPB_vect) { #if HAS_FILAMENT_SENSOR current_raw_filwidth = raw_filwidth_value >> 10; // Divide to get to 0-16384 range since we used 1/128 IIR filter approach #endif - + temp_meas_ready = true; temp_count = 0; - for (int i = 0; i < EXTRUDERS; i++) raw_temp_value[i] = 0; + for (int i = 0; i < TEMP_SENSOR_COUNT; i++) raw_temp_value[i] = 0; raw_temp_bed_value = 0; - #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP - #define GE0 <= - #define LE0 >= + #ifdef HEATER_0_USES_MAX6675 + float ct = current_temperature[0]; + if (ct > min(HEATER_0_MAXTEMP, 1023)) max_temp_error(0); + if (ct < max(HEATER_0_MINTEMP, 0.01)) min_temp_error(0); #else - #define GE0 >= - #define LE0 <= + #if HEATER_0_RAW_LO_TEMP > HEATER_0_RAW_HI_TEMP + #define GE0 <= + #else + #define GE0 >= + #endif + if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); + if (minttemp_raw[0] GE0 current_temperature_raw[0]) min_temp_error(0); #endif - if (current_temperature_raw[0] GE0 maxttemp_raw[0]) max_temp_error(0); - if (current_temperature_raw[0] LE0 minttemp_raw[0]) min_temp_error(0); #if EXTRUDERS > 1 #if HEATER_1_RAW_LO_TEMP > HEATER_1_RAW_HI_TEMP #define GE1 <= - #define LE1 >= #else #define GE1 >= - #define LE1 <= #endif if (current_temperature_raw[1] GE1 maxttemp_raw[1]) max_temp_error(1); - if (current_temperature_raw[1] LE1 minttemp_raw[1]) min_temp_error(1); + if (minttemp_raw[1] GE0 current_temperature_raw[1]) min_temp_error(1); + #if EXTRUDERS > 2 #if HEATER_2_RAW_LO_TEMP > HEATER_2_RAW_HI_TEMP #define GE2 <= - #define LE2 >= #else #define GE2 >= - #define LE2 <= #endif if (current_temperature_raw[2] GE2 maxttemp_raw[2]) max_temp_error(2); - if (current_temperature_raw[2] LE2 minttemp_raw[2]) min_temp_error(2); + if (minttemp_raw[2] GE0 current_temperature_raw[2]) min_temp_error(2); + #if EXTRUDERS > 3 #if HEATER_3_RAW_LO_TEMP > HEATER_3_RAW_HI_TEMP #define GE3 <= - #define LE3 >= #else #define GE3 >= - #define LE3 <= #endif if (current_temperature_raw[3] GE3 maxttemp_raw[3]) max_temp_error(3); - if (current_temperature_raw[3] LE3 minttemp_raw[3]) min_temp_error(3); + if (minttemp_raw[3] GE0 current_temperature_raw[3]) min_temp_error(3); + #endif // EXTRUDERS > 3 #endif // EXTRUDERS > 2 #endif // EXTRUDERS > 1 @@ -1632,10 +1639,8 @@ ISR(TIMER0_COMPB_vect) { #if defined(BED_MAXTEMP) && (TEMP_SENSOR_BED != 0) #if HEATER_BED_RAW_LO_TEMP > HEATER_BED_RAW_HI_TEMP #define GEBED <= - #define LEBED >= #else #define GEBED >= - #define LEBED <= #endif if (current_temperature_bed_raw GEBED bed_maxttemp_raw) { target_temperature_bed = 0; diff --git a/Marlin/ultralcd.cpp b/Marlin/ultralcd.cpp index 29b3ca118a..19e3d0c504 100644 --- a/Marlin/ultralcd.cpp +++ b/Marlin/ultralcd.cpp @@ -912,9 +912,9 @@ static void lcd_control_motion_menu() { START_MENU(); MENU_ITEM(back, MSG_CONTROL, lcd_control_menu); #ifdef ENABLE_AUTO_BED_LEVELING - MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.5, 50); + MENU_ITEM_EDIT(float32, MSG_ZPROBE_ZOFFSET, &zprobe_zoffset, 0.0, 50); #endif - MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 500, 99000); + MENU_ITEM_EDIT(float5, MSG_ACC, &acceleration, 10, 99000); MENU_ITEM_EDIT(float3, MSG_VXY_JERK, &max_xy_jerk, 1, 990); MENU_ITEM_EDIT(float52, MSG_VZ_JERK, &max_z_jerk, 0.1, 990); MENU_ITEM_EDIT(float3, MSG_VE_JERK, &max_e_jerk, 1, 990); @@ -926,7 +926,7 @@ static void lcd_control_motion_menu() { MENU_ITEM_EDIT(float3, MSG_VTRAV_MIN, &mintravelfeedrate, 0, 999); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_X, &max_acceleration_units_per_sq_second[X_AXIS], 100, 99000, reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Y, &max_acceleration_units_per_sq_second[Y_AXIS], 100, 99000, reset_acceleration_rates); - MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 100, 99000, reset_acceleration_rates); + MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_Z, &max_acceleration_units_per_sq_second[Z_AXIS], 10, 99000, reset_acceleration_rates); MENU_ITEM_EDIT_CALLBACK(long5, MSG_AMAX MSG_E, &max_acceleration_units_per_sq_second[E_AXIS], 100, 99000, reset_acceleration_rates); MENU_ITEM_EDIT(float5, MSG_A_RETRACT, &retract_acceleration, 100, 99000); MENU_ITEM_EDIT(float5, MSG_A_TRAVEL, &travel_acceleration, 100, 99000);