Skip to content

Instantly share code, notes, and snippets.

@jdiez17
Created May 29, 2014 00:50
Show Gist options
  • Save jdiez17/986f30c18a7d43126a73 to your computer and use it in GitHub Desktop.
Save jdiez17/986f30c18a7d43126a73 to your computer and use it in GitHub Desktop.
diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 52e6832..d6b9da9 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -76,7 +76,7 @@
#endif
// Define this to set a custom name for your generic Mendel,
-// #define CUSTOM_MENDEL_NAME "This Mendel"
+#define CUSTOM_MENDEL_NAME "Kossel"
// Define this to set a unique identifier for this printer, (Used by some programs to differentiate between machines)
// You can use an online service to generate a random UUID. (eg http://www.uuidgenerator.net/version4)
@@ -103,7 +103,7 @@
// Make delta curves from many straight lines (linear interpolation).
// This is a trade-off between visible corners (not enough segments)
// and processor overload (too many expensive sqrt calls).
-#define DELTA_SEGMENTS_PER_SECOND 160
+#define DELTA_SEGMENTS_PER_SECOND 100
// Center-to-center distance of the holes in the diagonal push rods.
#define DELTA_DIAGONAL_ROD 186.0 // mm
@@ -121,7 +121,7 @@
#define DELTA_RADIUS (DELTA_SMOOTH_ROD_OFFSET-DELTA_EFFECTOR_OFFSET-DELTA_CARRIAGE_OFFSET)
// Print surface diameter/2 minus unreachable space (avoid collisions with vertical towers).
-#define DELTA_PRINTABLE_RADIUS 70.0
+#define DELTA_PRINTABLE_RADIUS 75.0
// Effective X/Y positions of the three vertical towers.
#define SIN_60 0.8660254037844386
@@ -378,16 +378,16 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#ifdef ENABLE_AUTO_BED_LEVELING
// these are the positions on the bed to do the probing
- #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS-10)
- #define LEFT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
- #define RIGHT_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
- #define BACK_PROBE_BED_POSITION DELTA_PROBABLE_RADIUS
- #define FRONT_PROBE_BED_POSITION -DELTA_PROBABLE_RADIUS
+ #define DELTA_PROBABLE_RADIUS (DELTA_PRINTABLE_RADIUS-9)
+ #define LEFT_PROBE_BED_POSITION -DELTA_PRINTABLE_RADIUS
+ #define RIGHT_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS
+ #define BACK_PROBE_BED_POSITION DELTA_PRINTABLE_RADIUS
+ #define FRONT_PROBE_BED_POSITION -DELTA_PRINTABLE_RADIUS
// these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
#define X_PROBE_OFFSET_FROM_EXTRUDER 0.0
#define Y_PROBE_OFFSET_FROM_EXTRUDER 0.0
- #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.0
+ #define Z_PROBE_OFFSET_FROM_EXTRUDER 0.1 // Increase this if the first layer is too thin.
#define Z_RAISE_BEFORE_HOMING 4 // (in mm) Raise Z before homing (G28) for Probe Clearance.
// Be sure you have this distance over your Z_MAX_POS in case
@@ -395,7 +395,8 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define XY_TRAVEL_SPEED 8000 // X and Y axis travel speed between probes, in mm/min
#define Z_RAISE_BEFORE_PROBING 5 //How much the extruder will be raised before traveling to the first probing point.
- #define Z_RAISE_BETWEEN_PROBINGS 2 //How much the extruder will be raised when traveling from between next probing points
+ #define Z_RAISE_BETWEEN_PROBINGS 1 //How much the extruder will be raised when traveling from between next probing points
+ #define Z_RAISE_AFTER_PROBING 50 //How much the extruder will be raised after the last probing point.
//If defined, the Probe servo will be turned on only during movement and then turned off to avoid jerk
@@ -427,7 +428,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#define ACCURATE_BED_LEVELING
#ifdef ACCURATE_BED_LEVELING
- #define ACCURATE_BED_LEVELING_POINTS 7
+ #define ACCURATE_BED_LEVELING_POINTS 9
#define ACCURATE_BED_LEVELING_GRID_X ((RIGHT_PROBE_BED_POSITION - LEFT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS - 1))
#define ACCURATE_BED_LEVELING_GRID_Y ((BACK_PROBE_BED_POSITION - FRONT_PROBE_BED_POSITION) / (ACCURATE_BED_LEVELING_POINTS - 1))
@@ -500,7 +501,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
//#define EEPROM_CHITCHAT
// Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
+#define PLA_PREHEAT_HOTEND_TEMP 235 // Current J-Head thermistor reads hot
#define PLA_PREHEAT_HPB_TEMP 70
#define PLA_PREHEAT_FAN_SPEED 255 // Insert Value between 0 and 255
@@ -622,7 +623,7 @@ const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic o
#endif
// Panucatt VIKI LCD with status LEDs, integrated click & L/R/U/P buttons, separate encoder inputs
-//#define LCD_I2C_VIKI
+#define LCD_I2C_VIKI
#ifdef LCD_I2C_VIKI
// This uses the LiquidTWI2 library v1.2.3 or later ( https://github.com/lincomatic/LiquidTWI2 )
// Make sure the LiquidTWI2 directory is placed in the Arduino or Sketchbook libraries subdirectory.
diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index bd86c26..8d9fdd5 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -42,7 +42,7 @@
//Show Temperature ADC value
//The M105 command return, besides traditional information, the ADC value read from temperature sensors.
-//#define SHOW_TEMP_ADC_VALUES
+#define SHOW_TEMP_ADC_VALUES
// extruder run-out prevention.
//if the machine is idle, and the temperature over MINTEMP, every couple of SECONDS some filament is extruded
@@ -382,7 +382,7 @@ const unsigned int dropsegments=5; //everything with less than this number of st
// The number of linear motions that can be in the plan at any give time.
// THE BLOCK_BUFFER_SIZE NEEDS TO BE A POWER OF 2, i.g. 8,16,32 because shifts and ors are used to do the ring-buffering.
#if defined SDSUPPORT
- #define BLOCK_BUFFER_SIZE 16 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
+ #define BLOCK_BUFFER_SIZE 32 // SD,LCD,Buttons take more memory, block buffer needs to be smaller
#else
#define BLOCK_BUFFER_SIZE 64 // maximize block buffer
#endif
diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp
index 899c3f1..0a3d47c 100644
--- a/Marlin/Marlin_main.cpp
+++ b/Marlin/Marlin_main.cpp
@@ -883,8 +883,8 @@ static void set_bed_level_equation(float z_at_xLeft_yFront, float z_at_xRight_yF
}
#endif // ACCURATE_BED_LEVELING
-bool touching_print_surface() {
- return rawBedSample() < 512; // ADC goes from 0 to 1023
+bool touching_print_surface(int threshold) {
+ return rawBedSample() < threshold;
}
static void run_z_probe() {
@@ -892,18 +892,21 @@ static void run_z_probe() {
#ifdef DELTA
#ifdef FSR_BED_LEVELING
- feedrate = 120; //mm/min
+ feedrate = 600; //mm/min
float step = 0.05;
int direction = -1;
- while (!touching_print_surface()) {
+ // Consider the glass touched if the raw ADC value is reduced by 5% or more.
+ int analog_fsr_untouched = rawBedSample();
+ int threshold = analog_fsr_untouched * 95 / 100;
+ while (!touching_print_surface(threshold)) {
destination[Z_AXIS] += step * direction;
prepare_move_raw();
st_synchronize();
}
- while (step > 0.01) {
- step *= 0.95;
- feedrate *= 0.95;
- direction = touching_print_surface() ? 1 : -1;
+ while (step > 0.005) {
+ step *= 0.8;
+ feedrate *= 0.8;
+ direction = touching_print_surface(threshold) ? 1 : -1;
destination[Z_AXIS] += step * direction;
prepare_move_raw();
st_synchronize();
@@ -1623,7 +1626,7 @@ void process_commands()
#ifdef DELTA
// Avoid probing the corners (outside the round or hexagon print surface) on a delta printer.
float distance_from_center = sqrt(xProbe*xProbe + yProbe*yProbe);
- if (distance_from_center > DELTA_PROBABLE_RADIUS - 1) continue;
+ if (distance_from_center > DELTA_PROBABLE_RADIUS) continue;
#endif //DELTA
float z_before = probePointCounter == 0 ? Z_RAISE_BEFORE_PROBING :
@@ -1686,6 +1689,7 @@ void process_commands()
#endif // ACCURATE_BED_LEVELING
+ do_blocking_move_to(MANUAL_X_HOME_POS, MANUAL_Y_HOME_POS, Z_RAISE_AFTER_PROBING);
st_synchronize();
#ifndef SERVO_ENDSTOPS
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment