Commit 971c0ac5 authored by MagoKimbra's avatar MagoKimbra

Merge branch 'Development'

parents f7820b15 704a4ba0
### Version 4.1.5
* Implemented FAST_PWM_FAN and FAN_SOFT_PWM 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.
* Critical stepper motor frequency bugfix
* General bugfix
### 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
......@@ -98,9 +81,10 @@
//This is for controlling a fan to cool down the stepper drivers
//it will turn on when any driver is enabled
//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_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 // 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
......@@ -349,11 +334,12 @@
// it can e.g. be used to change z-positions in the print startup phase in real-time
// does not respect endstops!
//#define BABYSTEPPING
#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!
#define BABYSTEP_INVERT_Z false //true for inverse movements in Z
#define BABYSTEP_Z_MULTIPLICATOR 2 //faster z movements
#define BABYSTEP_XY // not only z, but also XY in the menu. more clutter, more functions
// not implemented for CoreXY and deltabots!
#define BABYSTEP_INVERT_Z false // true for inverse movements in Z
#define BABYSTEP_Z_MULTIPLICATOR 2 // faster z movements
#endif
// extruder advance constant (s2/mm3)
......
......@@ -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,9 @@ extern int fanSpeed;
#if ENABLED(FAN_SOFT_PWM)
extern unsigned char fanSpeedSoftPwm;
#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)
digitalWrite(CONTROLLERFAN_PIN, speed);
analogWrite(CONTROLLERFAN_PIN, speed);
#if ENABLED(FAN_SOFT_PWM)
fanSpeedSoftPwm_controller = speed;
#else
digitalWrite(CONTROLLERFAN_PIN, speed);
analogWrite(CONTROLLERFAN_PIN, speed);
#endif
}
}
......
......@@ -41,7 +41,6 @@
#define DOGLCD // Support for I2C LCD 128x64 (Controller SSD1306 graphic Display Family)
#endif
#if ENABLED(PANEL_ONE)
#define SDSUPPORT
#define ULTIMAKERCONTROLLER
......@@ -98,7 +97,6 @@
/**
* I2C PANELS
*/
#if ENABLED(LCD_I2C_SAINSMART_YWROBOT)
// This uses the LiquidCrystal_I2C library ( https://bitbucket.org/fmalpartida/new-liquidcrystal/wiki/Home )
// Make sure it is placed in the Arduino libraries directory.
......@@ -368,7 +366,7 @@
#define MAX_PROBE_Y (min(Y_MAX_POS, Y_MAX_POS + Y_PROBE_OFFSET_FROM_EXTRUDER))
// Z_RAISE_AFTER_PROBING is not for all probes. Be sure that it is zero in that cases
#if (NUM_SERVOS == 0) && !defined(Z_PROBE_SLED)
#if (NUM_SERVOS == 0) && DISABLED(Z_PROBE_SLED)
#undef Z_RAISE_AFTER_PROBING
#define Z_RAISE_AFTER_PROBING 0
#endif
......@@ -379,13 +377,20 @@
*/
#define SERVO_LEVELING (defined(SERVO_ENDSTOPS) && defined(DEACTIVATE_SERVOS_AFTER_MOVE))
/**
* Sled Options
*/
/**
* Sled Options
*/
#if ENABLED(Z_PROBE_SLED)
#define Z_SAFE_HOMING
#endif
/**
* Babystepping
*/
#if ENABLED(CARTESIAN)
#define BABYSTEPPING // On Cartesian printer this can be enabled as default as fully working
#endif
/**
* MAX_STEP_FREQUENCY differs for TOSHIBA OR ARDUINO DUE OR ARDUINO MEGA
*/
......@@ -431,8 +436,10 @@
#undef SD_DETECT_INVERTED
#endif
// Power Signal Control Definitions
// By default use Normal definition
/**
* Power Signal Control Definitions
* By default use Normal definition
*/
#ifndef POWER_SUPPLY
#define POWER_SUPPLY 0
#endif
......@@ -524,7 +531,7 @@
#else
#define ARRAY_BY_EXTRUDER(v1, v2, v3, v4, v5, v6, v7, v8, v9, v10) { v1 }
#endif
#define ARRAY_BY_EXTRUDERS(v1) ARRAY_BY_EXTRUDER(v1, v1, v1, v1, v1, v1, v1, v1, v1, v1)
/**
......@@ -673,8 +680,14 @@
#endif
#endif
/**
* Buzzer
*/
#define HAS_BUZZER (PIN_EXISTS(BEEPER) || defined(LCD_USE_I2C_BUZZER))
/**
* Servos
*/
#if HAS_SERVOS
#if X_ENDSTOP_SERVO_NR >= 0 || Y_ENDSTOP_SERVO_NR >= 0 || Z_ENDSTOP_SERVO_NR >= 0
#define HAS_SERVO_ENDSTOPS true
......
......@@ -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).
digitalWrite(pin, newFanSpeed);
analogWrite(pin, newFanSpeed);
#if ENABLED(FAN_SOFT_PWM)
fanSpeedSoftPwm_auto = newFanSpeed;
#else
digitalWrite(pin, newFanSpeed);
analogWrite(pin, newFanSpeed);
#endif
}
void checkExtruderAutoFans() {
......@@ -940,17 +956,45 @@ void tp_init() {
ANALOG_SELECT(FILWIDTH_PIN);
#endif
#if HAS_CONTROLLERFAN
SET_OUTPUT(CONTROLLERFAN_PIN); //Set pin used for driver cooling fan
#if ENABLED(FAST_PWM_FAN)
setPwmFrequency(CONTROLLERFAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#if ENABLED(FAN_SOFT_PWM)
soft_pwm_fan_controller = fanSpeedSoftPwm_controller / 2;
#endif
#endif
#if HAS_AUTO_FAN_0
pinMode(EXTRUDER_0_AUTO_FAN_PIN, OUTPUT);
SET_OUTPUT(EXTRUDER_0_AUTO_FAN_PIN);
#if ENABLED(FAST_PWM_FAN)
setPwmFrequency(EXTRUDER_0_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#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);
#if ENABLED(FAST_PWM_FAN)
setPwmFrequency(EXTRUDER_1_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#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);
#if ENABLED(FAST_PWM_FAN)
setPwmFrequency(EXTRUDER_2_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#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);
#if ENABLED(FAST_PWM_FAN)
setPwmFrequency(EXTRUDER_3_AUTO_FAN_PIN, 1); // No prescaling. Pwm frequency = F_CPU/256/8
#endif
#endif
#if ENABLED(FAN_SOFT_PWM)
#if HAS_AUTO_FAN
soft_pwm_fan_auto = fanSpeedSoftPwm_auto / 2;
#endif
#endif
#if HAS_POWER_CONSUMPTION_SENSOR
......@@ -1339,7 +1383,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,11 +1423,30 @@ 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);
pwm_count &= 0x7f;
#else // SLOW_PWM_HEATERS
/*
* SLOW PWM HEATERS
......@@ -1439,8 +1521,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);
......@@ -1450,7 +1570,7 @@ ISR(TIMER0_COMPB_vect) {
if ((pwm_count % 64) == 0) {
slow_pwm_count++;
slow_pwm_count &= 0x7f;
// HOTEND 0
if (state_timer_heater_0 > 0) state_timer_heater_0--;
#if HOTENDS > 1 // HOTEND 1
......@@ -1466,7 +1586,7 @@ ISR(TIMER0_COMPB_vect) {
if (state_timer_heater_BED > 0) state_timer_heater_BED--;
#endif
} // (pwm_count % 64) == 0
#endif // SLOW_PWM_HEATERS
#define SET_ADMUX_ADCSRA(pin) ADMUX = BIT(REFS0) | (pin & 0x07); ADCSRA |= BIT(ADSC)
......@@ -1478,6 +1598,7 @@ ISR(TIMER0_COMPB_vect) {
// Prepare or measure a sensor, each one every 14th frame
switch(temp_state) {
case PrepareTemp_0:
#if HAS_TEMP_0
START_ADC(TEMP_0_PIN);
......
<img align="right" src="Documentation/Logo/MarlinKimbra%20Logo%20GitHub.png" />
# MarlinKimbra 3D Printer Firmware
## Version 4.1.4 dev
## Version 4.1.5 dev
* [Configuration & Compilation](/Documentation/Compilation.md)
* Supported
......
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