Commit 34e6e297 authored by Simone Primarosa's avatar Simone Primarosa

Update 4.1.5 dev

parent 45fc6b0c
### Version 4.1.5
* Implemented FAN_SOFT_PWM and FAST_PWM_FAN also for other fan that can be added in configuration_adv file.
* Added the ability to set a min speed to the fan that can be added in configuration_adv file.
### Version 4.1.4
* Add support for Piggy Alligator board
* Add Debug_info. Repetier button info for enabled or disabled, or M111 S2 for enabled and M111 S0 for disabled.
......
......@@ -314,6 +314,31 @@
//#define THERMAL_PROTECTION_HOTENDS // Enable thermal protection for all hotends
//#define THERMAL_PROTECTION_BED // Enable thermal protection for the heated bed
//===========================================================================
//======================== Extruder Idle Oozing Prevention =======================
//===========================================================================
/**
* Extruder Idle Oozing Prevention prevents undesired ejection of filament while the printer
* is in idle with the hotend turned on.
* Eg. during the heating up process.
*
* If the extruder motor is idle for more than SECONDS, and the temperature is over IDLE_OOZING_MINTEMP,
* some filament is retracted. The filament retracted is re-added before the next extrusion
* or when the target temperature is less than IDLE_OOZING_MINTEMP and the actual temperature
* is greater than IDLE_OOZING_MINTEMP.
*
* PS: Always remember to set your extruder target temperature to 0°C before shoudown the printer if you enable this feature.
*/
//#define IDLE_OOZING_PREVENT
#define IDLE_OOZING_MINTEMP EXTRUDE_MINTEMP + 5
#define IDLE_OOZING_MAXTEMP IDLE_OOZING_MINTEMP + 5
#define IDLE_OOZING_FEEDRATE 50 //default feedrate for retracting (mm/s)
#define IDLE_OOZING_SECONDS 5
#define IDLE_OOZING_LENGTH 15 //default retract length (positive mm)
#define IDLE_OOZING_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
#define IDLE_OOZING_RECOVER_FEEDRATE 50 //default feedrate for recovering from retraction (mm/s)
//===========================================================================
//============================ User Interfaces ==============================
//===========================================================================
......
......@@ -64,23 +64,6 @@
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
//#define SHOW_TEMP_ADC_VALUES
/**
* Extruder Idle Oozing Prevention
* If the extruder motor is idle for more than SECONDS, and the temperature is over IDLE_OOZING_MINTEMP,
* some filament is retracted. The filament retracted is re-added before the next extrusion
* or when the target temperature is less than IDLE_OOZING_MINTEMP and the actual temperature
* is greater than IDLE_OOZING_MINTEMP.
* PS: Always remember to set your extruder target temperature to 0°C before shoudown the printer if you enable this feature.
*/
//#define IDLE_OOZING_PREVENT
#define IDLE_OOZING_MINTEMP EXTRUDE_MINTEMP + 5
#define IDLE_OOZING_MAXTEMP IDLE_OOZING_MINTEMP + 5
#define IDLE_OOZING_FEEDRATE 50 //default feedrate for retracting (mm/s)
#define IDLE_OOZING_SECONDS 5
#define IDLE_OOZING_LENGTH 15 //default retract length (positive mm)
#define IDLE_OOZING_RECOVER_LENGTH 0 //default additional recover length (mm, added to retract length when recovering)
#define IDLE_OOZING_RECOVER_FEEDRATE 50 //default feedrate for recovering from retraction (mm/s)
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
//#define EXTRUDER_RUNOUT_PREVENT
......@@ -100,7 +83,8 @@
//and turn off after the set amount of seconds from last driver being disabled again
#define CONTROLLERFAN_PIN -1 //Pin used for the fan to cool controller (-1 to disable)
#define CONTROLLERFAN_SECS 60 //How many seconds, after all motors were disabled, the fan should run
#define CONTROLLERFAN_SPEED 255 // == full speed
#define CONTROLLERFAN_SPEED 255 // 255 = full speed
#define CONTROLLERFAN_MIN_SPEED 0
// When first starting the main fan, run it at full speed for the
// given number of milliseconds. This gets the fan spinning reliably
......@@ -122,7 +106,8 @@
#define EXTRUDER_2_AUTO_FAN_PIN -1
#define EXTRUDER_3_AUTO_FAN_PIN -1
#define EXTRUDER_AUTO_FAN_TEMPERATURE 50
#define EXTRUDER_AUTO_FAN_SPEED 255 // == full speed
#define EXTRUDER_AUTO_FAN_SPEED 255 // 255 = full speed
#define EXTRUDER_AUTO_FAN_MIN_SPEED 0
#define LCD_MAX_TEMP_OFFSET -15
......@@ -348,7 +333,11 @@
// Babystepping enables the user to control the axis in tiny amounts, independently from the normal printing process
// it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops!
#ifdef CARTESIAN
#define BABYSTEPPING //On cartesian printer this can be enabled as default as fully working
#else
//#define BABYSTEPPING
#endif
#if ENABLED(BABYSTEPPING)
#define BABYSTEP_XY //not only z, but also XY in the menu. more clutter, more functions
//not implemented for CoreXY and deltabots!
......
......@@ -6,7 +6,7 @@
// #error "You must specify the following parameters related to your distribution"
#if true
#define SHORT_BUILD_VERSION "4.1.4 dev"
#define SHORT_BUILD_VERSION "4.1.5 dev"
#define STRING_DISTRIBUTION_DATE __DATE__ " " __TIME__ // build date and time
// It might also be appropriate to define a location where additional information can be found
#define SOURCE_CODE_URL "https://github.com/MagoKimbra/MarlinKimbra"
......
......@@ -273,6 +273,12 @@ extern int fanSpeed;
#if ENABLED(FAN_SOFT_PWM)
extern unsigned char fanSpeedSoftPwm;
#if HAS_AUTO_FAN_0 || HAS_AUTO_FAN_1 || HAS_AUTO_FAN_2 || HAS_AUTO_FAN_3
extern unsigned char fanSpeedSoftPwm_auto;
#endif
#if HAS_CONTROLLERFAN
extern unsigned char fanSpeedSoftPwm_controller;
#endif
#endif
#if ENABLED(FILAMENT_SENSOR)
......
......@@ -756,10 +756,6 @@ void setup() {
setup_laserbeampin(); // Initialize Laserbeam pin
servo_init();
#if HAS_CONTROLLERFAN
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
#endif
#if HAS_STEPPER_RESET
enableStepperDrivers();
#endif
......@@ -7391,14 +7387,18 @@ void plan_arc(
}
#ifdef INVERTED_HEATER_PINS
uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? 255 : (255 - CONTROLLERFAN_SPEED);
uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? 255 - CONTROLLERFAN_MIN_SPEED : (255 - CONTROLLERFAN_SPEED);
#else
uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? 0 : CONTROLLERFAN_SPEED;
uint8_t speed = (lastMotor == 0 || ms >= lastMotor + (CONTROLLERFAN_SECS * 1000UL)) ? CONTROLLERFAN_MIN_SPEED : CONTROLLERFAN_SPEED;
#endif
// allows digital or PWM fan output to be used (see M42 handling)
#if ENABLED(FAN_SOFT_PWM)
fanSpeedSoftPwm_controller = speed;
#else
digitalWrite(CONTROLLERFAN_PIN, speed);
analogWrite(CONTROLLERFAN_PIN, speed);
#endif
}
}
......
......@@ -60,7 +60,13 @@ float current_temperature_bed = 0.0;
#endif //PIDTEMPBED
#if ENABLED(FAN_SOFT_PWM)
unsigned char fanSpeedSoftPwm;
unsigned char fanSpeedSoftPwm = 0;
#if HAS_AUTO_FAN
unsigned char fanSpeedSoftPwm_Auto = EXTRUDER_AUTO_FAN_MIN_SPEED;
#endif
#if HAS_CONTROLLERFAN
unsigned char fanSpeedSoftPwm_controller = CONTROLLERFAN_MIN_SPEED;
#endif
#endif
unsigned char soft_pwm_bed;
......@@ -128,6 +134,12 @@ static unsigned char soft_pwm[HOTENDS];
#if ENABLED(FAN_SOFT_PWM)
static unsigned char soft_pwm_fan;
#if HAS_AUTO_FAN
static unsigned char soft_pwm_fan_auto;
#endif
#if HAS_CONTROLLERFAN
static unsigned char soft_pwm_fan_controller = 0;
#endif
#endif
#if HAS_AUTO_FAN
static millis_t next_auto_fan_check_ms;
......@@ -374,10 +386,14 @@ int getHeaterPower(int heater) {
#if HAS_AUTO_FAN
void setExtruderAutoFanState(int pin, bool state) {
unsigned char newFanSpeed = (state != 0) ? EXTRUDER_AUTO_FAN_SPEED : 0;
unsigned char newFanSpeed = (state != 0) ? EXTRUDER_AUTO_FAN_SPEED : EXTRUDER_AUTO_FAN_MIN_SPEED;
// this idiom allows both digital and PWM fan outputs (see M42 handling).
#if ENABLED(FAN_SOFT_PWM)
fanSpeedSoftPwm_auto = newFanSpeed;
#else
digitalWrite(pin, newFanSpeed);
analogWrite(pin, newFanSpeed);
#endif
}
void checkExtruderAutoFans() {
......@@ -891,6 +907,12 @@ void tp_init() {
#endif
#if ENABLED(FAN_SOFT_PWM)
soft_pwm_fan = fanSpeedSoftPwm / 2;
#if HAS_CONTROLLERFAN
soft_pwm_fan_controller = fanSpeedSoftPwm_controller / 2;
#endif
#if HAS_AUTO_FAN
soft_pwm_fan_auto = fanSpeedSoftPwm_auto / 2;
#endif
#endif
#endif
......@@ -941,16 +963,20 @@ void tp_init() {
#endif
#if HAS_AUTO_FAN_0
pinMode(EXTRUDER_0_AUTO_FAN_PIN, OUTPUT);
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
#endif
#if HAS_AUTO_FAN_1 && (EXTRUDER_1_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN)
pinMode(EXTRUDER_1_AUTO_FAN_PIN, OUTPUT);
SET_OUTPUT(EXTRUDER_1_AUTO_FAN_PIN);
#endif
#if HAS_AUTO_FAN_2 && (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) && (EXTRUDER_2_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN)
pinMode(EXTRUDER_2_AUTO_FAN_PIN, OUTPUT);
SET_OUTPUT(EXTRUDER_2_AUTO_FAN_PIN);
#endif
#if HAS_AUTO_FAN_3 && (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_0_AUTO_FAN_PIN) && (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_1_AUTO_FAN_PIN) && (EXTRUDER_3_AUTO_FAN_PIN != EXTRUDER_2_AUTO_FAN_PIN)
pinMode(EXTRUDER_3_AUTO_FAN_PIN, OUTPUT);
SET_OUTPUT(EXTRUDER_3_AUTO_FAN_PIN);
#endif
#if HAS_CONTROLLERFAN
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
#endif
#if HAS_POWER_CONSUMPTION_SENSOR
......@@ -1339,7 +1365,26 @@ ISR(TIMER0_COMPB_vect) {
#endif
#if ENABLED(FAN_SOFT_PWM)
soft_pwm_fan = fanSpeedSoftPwm / 2;
#if HAS_CONTROLLERFAN
soft_pwm_fan_controller = fanSpeedSoftPwm_controller / 2;
WRITE(CONTROLLERFAN_PIN, soft_pwm_fan_controller > 0 ? 1 : 0);
#endif
WRITE_FAN(soft_pwm_fan > 0 ? 1 : 0);
#if HAS_AUTO_FAN
soft_pwm_fan_auto = fanSpeedSoftPwm_auto / 2;
#endif
#if HAS_AUTO_FAN_0
WRITE(EXTRUDER_0_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN_1
WRITE(EXTRUDER_1_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN_2
WRITE(EXTRUDER_2_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN_3
WRITE(EXTRUDER_3_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#endif
}
......@@ -1360,6 +1405,25 @@ ISR(TIMER0_COMPB_vect) {
#if ENABLED(FAN_SOFT_PWM)
if (soft_pwm_fan < pwm_count) WRITE_FAN(0);
#if HAS_CONTROLLERFAN
if (soft_pwm_fan_controller < pwm_count) WRITE(CONTROLLERFAN_PIN, 0);
#endif
#if HAS_AUTO_FAN
if (soft_pwm_fan_auto < pwm_count) {
#if HAS_AUTO_FAN_0
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 0);
#endif
#if HAS_AUTO_FAN_1
WRITE(EXTRUDER_1_AUTO_FAN_PIN, 0);
#endif
#if HAS_AUTO_FAN_2
WRITE(EXTRUDER_2_AUTO_FAN_PIN, 0);
#endif
#if HAS_AUTO_FAN_3
WRITE(EXTRUDER_3_AUTO_FAN_PIN, 0);
#endif
}
#endif
#endif
pwm_count += BIT(SOFT_PWM_SCALE);
......@@ -1439,8 +1503,46 @@ ISR(TIMER0_COMPB_vect) {
if (pwm_count == 0) {
soft_pwm_fan = fanSpeedSoftPwm / 2;
WRITE_FAN(soft_pwm_fan > 0 ? 1 : 0);
#if HAS_CONTROLLERFAN
soft_pwm_fan_controller = fanSpeedSoftPwm_controller / 2;
WRITE(CONTROLLERFAN_PIN, soft_pwm_fan_controller > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN
soft_pwm_fan_auto = fanSpeedSoftPwm_auto / 2;
#endif
#if HAS_AUTO_FAN_0
WRITE(EXTRUDER_0_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN_1
WRITE(EXTRUDER_1_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN_2
WRITE(EXTRUDER_2_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
#if HAS_AUTO_FAN_3
WRITE(EXTRUDER_3_AUTO_FAN_PIN, soft_pwm_fan_auto > 0 ? 1 : 0);
#endif
}
if (soft_pwm_fan < pwm_count) WRITE_FAN(0);
#if HAS_CONTROLLERFAN
if (soft_pwm_fan_controller < pwm_count) WRITE(CONTROLLERFAN_PIN, 0);
#endif
#if HAS_AUTO_FAN
if (soft_pwm_fan_auto < pwm_count) {
#if HAS_AUTO_FAN_0
WRITE(EXTRUDER_0_AUTO_FAN_PIN, 0);
#endif
#if HAS_AUTO_FAN_1
WRITE(EXTRUDER_1_AUTO_FAN_PIN, 0);
#endif
#if HAS_AUTO_FAN_2
WRITE(EXTRUDER_2_AUTO_FAN_PIN, 0);
#endif
#if HAS_AUTO_FAN_3
WRITE(EXTRUDER_3_AUTO_FAN_PIN, 0);
#endif
}
#endif
#endif // FAN_SOFT_PWM
pwm_count += BIT(SOFT_PWM_SCALE);
......
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