Commit 39da0e9f authored by MagoKimbra's avatar MagoKimbra

Add tone temperature and fix delta bed probe

parent 20661668
...@@ -49,7 +49,7 @@ ...@@ -49,7 +49,7 @@
#define Z_PROBE_DEPLOY_END_LOCATION {0, 0, 30, 0} // X, Y, Z, E end location for z-probe deployment sequence #define Z_PROBE_DEPLOY_END_LOCATION {0, 0, 30, 0} // X, Y, Z, E end location for z-probe deployment sequence
#define Z_PROBE_RETRACT_START_LOCATION {0, 0, 30, 0} // X, Y, Z, E start location for z-probe retract sequence #define Z_PROBE_RETRACT_START_LOCATION {0, 0, 30, 0} // X, Y, Z, E start location for z-probe retract sequence
#define Z_PROBE_RETRACT_END_LOCATION {0, 0, 30, 0} // X, Y, Z, E end location for z-probe retract sequence #define Z_PROBE_RETRACT_END_LOCATION {0, 0, 30, 0} // X, Y, Z, E end location for z-probe retract sequence
#define AUTOLEVEL_GRID 30 // Distance between autolevel Z probing points, should be less than print surface radius/3. #define AUTOLEVEL_GRID 20 // Distance between autolevel Z probing points, should be less than print surface radius/3.
//=========================================================================== //===========================================================================
//=============================Mechanical Settings=========================== //=============================Mechanical Settings===========================
...@@ -123,7 +123,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o ...@@ -123,7 +123,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
//Manual homing switch locations: //Manual homing switch locations:
#define MANUAL_X_HOME_POS 0 #define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0 #define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 202 // Distance between nozzle and print surface after homing. #define MANUAL_Z_HOME_POS 210 // Distance between nozzle and print surface after homing.
//// MOVEMENT SETTINGS //// MOVEMENT SETTINGS
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
...@@ -134,10 +134,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o ...@@ -134,10 +134,10 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,80,451,451,451,451} // X, Y, Z, E0, E1, E2, E3 #define DEFAULT_AXIS_STEPS_PER_UNIT {80,80,80,451,451,451,451} // X, Y, Z, E0, E1, E2, E3
#define DEFAULT_MAX_FEEDRATE {300,300,300,45,45,45,45} // X, Y, Z, E0, E1, E2, E3 (mm/sec) #define DEFAULT_MAX_FEEDRATE {300,300,300,45,45,45,45} // X, Y, Z, E0, E1, E2, E3 (mm/sec)
#define DEFAULT_RETRACTION_MAX_FEEDRATE {80,80,80,80} // E0, E1, E2, E3 (mm/sec) #define DEFAULT_RETRACTION_MAX_FEEDRATE {80,80,80,80} // E0, E1, E2, E3 (mm/sec)
#define DEFAULT_MAX_ACCELERATION {2000,2000,2000,2000} // X, Y, Z, E maximum start speed for accelerated moves. #define DEFAULT_MAX_ACCELERATION {2000,2000,2000,1000} // X, Y, Z, E maximum start speed for accelerated moves.
#define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves #define DEFAULT_ACCELERATION 1000 // X, Y, Z and E max acceleration in mm/s^2 for printing moves
#define DEFAULT_RETRACT_ACCELERATION 4000 // X, Y, Z and E max acceleration in mm/s^2 for retracts #define DEFAULT_RETRACT_ACCELERATION 2500 // X, Y, Z and E max acceleration in mm/s^2 for retracts
// The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously) // The speed change that does not require acceleration (i.e. the software might assume it can be done instantaneously)
#define DEFAULT_XYJERK 20.0 // (mm/sec) #define DEFAULT_XYJERK 20.0 // (mm/sec)
......
...@@ -211,6 +211,7 @@ void prepare_move(); ...@@ -211,6 +211,7 @@ void prepare_move();
void kill(); void kill();
void pause(); void pause();
void Stop(); void Stop();
void temptone();
bool IsStopped(); bool IsStopped();
......
...@@ -435,6 +435,8 @@ unsigned long starttime=0; ...@@ -435,6 +435,8 @@ unsigned long starttime=0;
unsigned long stoptime=0; unsigned long stoptime=0;
static uint8_t tmp_extruder; static uint8_t tmp_extruder;
static boolean beeptemphe = false;
static boolean beeptemphb = false;
#ifdef NPR2 #ifdef NPR2
static float color_position[] = COLOR_STEP; //variabile per la scelta del colore static float color_position[] = COLOR_STEP; //variabile per la scelta del colore
...@@ -1479,7 +1481,7 @@ float z_probe() { ...@@ -1479,7 +1481,7 @@ float z_probe() {
} }
feedrate = homing_feedrate[Z_AXIS]; feedrate = homing_feedrate[Z_AXIS];
destination[Z_AXIS] = mm+3; destination[Z_AXIS] = mm+2;
prepare_move_raw(); prepare_move_raw();
return mm; return mm;
} }
...@@ -1493,8 +1495,11 @@ void calibrate_print_surface(float z_offset) { ...@@ -1493,8 +1495,11 @@ void calibrate_print_surface(float z_offset) {
for (int x = -3*dir; x != 4*dir; x += dir) { for (int x = -3*dir; x != 4*dir; x += dir) {
if (x*x + y*y < 11) { if (x*x + y*y < 11) {
destination[X_AXIS] = AUTOLEVEL_GRID * x - z_probe_offset[X_AXIS]; destination[X_AXIS] = AUTOLEVEL_GRID * x - z_probe_offset[X_AXIS];
if (destination[X_AXIS]<X_MIN_POS) destination[X_AXIS]=X_MIN_POS;
if (destination[X_AXIS]>X_MAX_POS) destination[X_AXIS]=X_MAX_POS;
destination[Y_AXIS] = AUTOLEVEL_GRID * y - z_probe_offset[Y_AXIS]; destination[Y_AXIS] = AUTOLEVEL_GRID * y - z_probe_offset[Y_AXIS];
if (destination[Y_AXIS]<Y_MIN_POS) destination[Y_AXIS]=Y_MIN_POS;
if (destination[Y_AXIS]>Y_MAX_POS) destination[Y_AXIS]=Y_MAX_POS;
probe_count = 0; probe_count = 0;
probe_z = -100; probe_z = -100;
probe_h = -100; probe_h = -100;
...@@ -1528,15 +1533,19 @@ void calibrate_print_surface(float z_offset) { ...@@ -1528,15 +1533,19 @@ void calibrate_print_surface(float z_offset) {
} }
SERIAL_ECHOLN(""); SERIAL_ECHOLN("");
} }
} }
float probe_bed(float x, float y) { float probe_bed(float x, float y) {
//Probe bed at specified location and return z height of bed //Probe bed at specified location and return z height of bed
float probe_bed_z, probe_z, probe_h, probe_l; float probe_bed_z, probe_z, probe_h, probe_l;
int probe_count; int probe_count;
// feedrate = homing_feedrate[Z_AXIS]; // feedrate = homing_feedrate[Z_AXIS];
destination[X_AXIS] = x - z_probe_offset[X_AXIS]; destination[X_AXIS] = x - z_probe_offset[X_AXIS];
if (destination[X_AXIS]<X_MIN_POS) destination[X_AXIS]=X_MIN_POS;
if (destination[X_AXIS]>X_MAX_POS) destination[X_AXIS]=X_MAX_POS;
destination[Y_AXIS] = y - z_probe_offset[Y_AXIS]; destination[Y_AXIS] = y - z_probe_offset[Y_AXIS];
if (destination[Y_AXIS]<Y_MIN_POS) destination[Y_AXIS]=Y_MIN_POS;
if (destination[Y_AXIS]>Y_MAX_POS) destination[Y_AXIS]=Y_MAX_POS;
destination[Z_AXIS] = bed_level_c - z_probe_offset[Z_AXIS] + 3; destination[Z_AXIS] = bed_level_c - z_probe_offset[Z_AXIS] + 3;
prepare_move(); prepare_move();
st_synchronize(); st_synchronize();
...@@ -3410,6 +3419,7 @@ Sigma_Exit: ...@@ -3410,6 +3419,7 @@ Sigma_Exit:
setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset); setTargetHotend1(code_value() == 0.0 ? 0.0 : code_value() + duplicate_extruder_temp_offset);
#endif #endif
setWatch(); setWatch();
beeptemphe=true;
break; break;
case 111: // M111 - Debug mode case 111: // M111 - Debug mode
if (code_seen('S')) debugLevel = code_value(); if (code_seen('S')) debugLevel = code_value();
...@@ -3427,6 +3437,7 @@ Sigma_Exit: ...@@ -3427,6 +3437,7 @@ Sigma_Exit:
case 140: // M140 set bed temp case 140: // M140 set bed temp
if(debugDryrun()) break; if(debugDryrun()) break;
if (code_seen('S')) setTargetBed(code_value()); if (code_seen('S')) setTargetBed(code_value());
beeptemphb=true;
break; break;
case 105 : // M105 case 105 : // M105
if(setTargetedHotend(105)) break; if(setTargetedHotend(105)) break;
...@@ -5608,6 +5619,10 @@ void manage_inactivity() ...@@ -5608,6 +5619,10 @@ void manage_inactivity()
} }
} }
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
temptone();
#endif
#ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH #ifdef CHDK //Check if pin should be set to LOW after M240 set it to HIGH
if (chdkActive && (millis() - chdkHigh > CHDK_DELAY)) if (chdkActive && (millis() - chdkHigh > CHDK_DELAY))
{ {
...@@ -5621,14 +5636,10 @@ void manage_inactivity() ...@@ -5621,14 +5636,10 @@ void manage_inactivity()
kill(); kill();
#endif #endif
/**********************************************************************\
****************** Firmware Marlin by MagoKimbra **********************\
***********************************************************************/
#if defined(PAUSE_PIN) && PAUSE_PIN > -1 #if defined(PAUSE_PIN) && PAUSE_PIN > -1
if( 0 == READ(PAUSE_PIN) ) if( 0 == READ(PAUSE_PIN) )
pause(); pause();
#endif #endif
/**********************************************************************/
#if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1 #if defined(CONTROLLERFAN_PIN) && CONTROLLERFAN_PIN > -1
controllerFan(); //Check if fan should be turned on to cool stepper drivers down controllerFan(); //Check if fan should be turned on to cool stepper drivers down
...@@ -5668,11 +5679,11 @@ void manage_inactivity() ...@@ -5668,11 +5679,11 @@ void manage_inactivity()
check_axes_activity(); check_axes_activity();
} }
void kill() { void kill()
#if defined(KILL_PIN) && KILL_PIN > -1 {
#if defined(KILL_PIN) && KILL_PIN > -1
cli(); // Stop interrupts cli(); // Stop interrupts
disable_heater(); disable_heater();
disable_x(); disable_x();
disable_y(); disable_y();
disable_z(); disable_z();
...@@ -5692,15 +5703,60 @@ void kill() { ...@@ -5692,15 +5703,60 @@ void kill() {
#endif #endif
} }
#if (LARGE_FLASH == true && ( BEEPER > 0 || defined(ULTRALCD) || defined(LCD_USE_I2C_BUZZER)))
void temptone()
{
if (!isHeatingHotend(active_extruder) && degTargetHotend(active_extruder)!=0 && beeptemphe)
{
int beepS = 200;
int beepP = 500;
int beepN = 3;
for (int i = 0; i < beepN; ++i)
{
#if BEEPER > 0
tone(BEEPER, beepS);
delay(beepP);
noTone(BEEPER);
#elif defined(ULTRALCD)
lcd_buzz(beepS, beepP);
#elif defined(LCD_USE_I2C_BUZZER)
lcd_buzz(beepP, beepS);
#endif
delay(beepP);
}
beeptemphe=false;
}
else if (!isHeatingBed() && degTargetBed()!=0 && beeptemphb)
{
int beepS = 100;
int beepP = 500;
int beepN = 2;
for (int i = 0; i < beepN; ++i)
{
#if BEEPER > 0
tone(BEEPER, beepS);
delay(beepP);
noTone(BEEPER);
#elif defined(ULTRALCD)
lcd_buzz(beepS, beepP);
#elif defined(LCD_USE_I2C_BUZZER)
lcd_buzz(beepP, beepS);
#endif
delay(beepP);
}
beeptemphb=false;
}
}
#endif
#if defined(PAUSE_PIN) && PAUSE_PIN > -1 #if defined(PAUSE_PIN) && PAUSE_PIN > -1
void pause() void pause()
{ {
enquecommand("M600 X0 Z+5"); enquecommand("M600 X0 Z+5");
enquecommand("G4 P0"); enquecommand("G4 P0");
enquecommand("G4 P0"); enquecommand("G4 P0");
enquecommand("G4 P0"); enquecommand("G4 P0");
} }
#endif #endif
void Stop() void Stop()
......
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