MarlinFirmware / Marlin

Marlin is an optimized firmware for RepRap 3D printers based on the Arduino platform. Many commercial 3D printers come with Marlin installed. Check with your vendor if you need source code for your specific machine.
https://marlinfw.org
GNU General Public License v3.0
16.21k stars 19.22k forks source link

Auto-leveling not working as expected in Robo3D R1 #2293

Closed WheresWaldo closed 9 years ago

WheresWaldo commented 9 years ago

Background: Robo3D R1 (R1) with auto-level and 8 mm threaded rods using stock firmware based on 1.0.0 works after a fashion. This is a report about auto-leveling in 1.0.2 release with the proper modifications for use on the R1.

Issue stems from the use of Z_PROBE_OFFSET_FROM_EXTRUDER. I will explain as best as I can. The R1 uses two switches under the x-carriage in parallel to determine when it has hit the endstop for the Z axis. These switches are normally closed and actuating either results in the endstop being triggered. They are affixed to nuts that can travel independently from the Z axis mounts. When the lead screws are turned beyond the point that the extruder head hits the bed, one or both switches activate (open). This is how the R1 knows it has hit the endstop. The distance the lead screws move between the time that the hotend hits the bed and the switch actually triggers the endstop was measured on my machine, but should apply to all R1's with auto-leveling, the Z_PROBE_OFFSET_FROM_EXTRUDER will be a negative value. In my specific case one or both switches trigger -1.19 mm from the top of the bed.

On line 402 this offset was inserted in the proper line. Among other changes in Configuration.h to make it work for the R1.

--- D:\Documents\Arduino\Marlin-1.0.2-1\Marlin\Configuration.h 6/14/2015  4:07:30 PM
+++ D:\Documents\Arduino\Robo_1.0.2\Configuration.h 6/14/2015  4:09:02 PM
@@ -28,34 +28,34 @@
 //#define STRING_VERSION "1.0.2"

 #define STRING_VERSION_CONFIG_H __DATE__ " " __TIME__ // build date and time
-#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(BH, R1 Single Extruder)" //--ROBO-BH

 // SERIAL_PORT selects which serial port should be used for communication with the host.
 // This allows the connection of wireless adapters (for instance) to non-default port pins.
@@ -44,54 +44,54 @@
 // The following define selects which electronics board you have.
 // Please choose the name from boards.h that matches your setup
 #ifndef MOTHERBOARD
-  #define MOTHERBOARD BOARD_ULTIMAKER
+  #define MOTHERBOARD BOARD_RAMPS_13_EFB   //--ROBO-BH
 #endif

 // Define this to set a custom name for your generic Mendel,
-// #define CUSTOM_MENDEL_NAME "This Mendel"
+#define CUSTOM_MENDEL_NAME "Robo3D v1.0.2" //--ROBO-BH

 // 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)
@@ -104,113 +104,113 @@
 // 147 is Pt100 with 4k7 pullup
 // 110 is Pt100 with 1k pullup (non standard)

-#define TEMP_SENSOR_0 -1
+#define TEMP_SENSOR_0 1        //--ROBO-BH
-#define TEMP_SENSOR_1 -1
+#define TEMP_SENSOR_1 0    //--ROBO-BH
 #define TEMP_SENSOR_2 0
-#define TEMP_SENSOR_BED 0
+#define TEMP_SENSOR_BED 1  //--ROBO-BH

 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
 //#define TEMP_SENSOR_1_AS_REDUNDANT
@@ -129,138 +129,138 @@
 // When temperature exceeds max temp, your heater will be switched off.
 // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
 // You should use MINTEMP for thermistor short/failure protection.
-#define HEATER_0_MAXTEMP 275
+#define HEATER_0_MAXTEMP 330   //--ROBO-BH
 #define HEATER_1_MAXTEMP 275
 #define HEATER_2_MAXTEMP 275
-#define BED_MAXTEMP 150
+#define BED_MAXTEMP 120        //--ROBO-BH

 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
 // average current. The value should be an integer and the heat bed will be turned on for 1 interval of
@@ -219,225 +219,225 @@
 //if PREVENT_DANGEROUS_EXTRUDE is on, you can still disable (uncomment) very long bits of extrusion separately.
 #define PREVENT_LENGTHY_EXTRUDE

-#define EXTRUDE_MINTEMP 170
+#define EXTRUDE_MINTEMP 165        //--ROBO-BH
 #define EXTRUDE_MAXLENGTH (X_MAX_LENGTH+Y_MAX_LENGTH) //prevent extrusion of very large distances.

 /*================== Thermal Runaway Protection ==============================
@@ -248,262 +248,262 @@
 // uncomment the 2 defines below:

 // Parameters for all extruder heaters
-//#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds
+#define THERMAL_RUNAWAY_PROTECTION_PERIOD 40 //in seconds  --ROBO-BH
-//#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius
+#define THERMAL_RUNAWAY_PROTECTION_HYSTERESIS 4 // in degree Celsius  --ROBO-BH

 // If you want to enable this feature for your bed heater,
 // uncomment the 2 defines below:

 // Parameters for the bed heater
-//#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds
+#define THERMAL_RUNAWAY_PROTECTION_BED_PERIOD 20 //in seconds  --ROBO-BH
-//#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius
+#define THERMAL_RUNAWAY_PROTECTION_BED_HYSTERESIS 2 // in degree Celsius  --ROBO-BH
 //===========================================================================

@@ -272,282 +272,282 @@

 #ifndef ENDSTOPPULLUPS
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
-  // #define ENDSTOPPULLUP_XMAX
+  #define ENDSTOPPULLUP_XMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_YMAX
+  #define ENDSTOPPULLUP_YMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_ZMAX
+  #define ENDSTOPPULLUP_ZMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_XMIN
+  #define ENDSTOPPULLUP_XMIN   //--ROBO-BH
-  // #define ENDSTOPPULLUP_YMIN
+  #define ENDSTOPPULLUP_YMIN   //--ROBO-BH
   // #define ENDSTOPPULLUP_ZMIN
 #endif

@@ -290,302 +290,302 @@
 #endif

 // The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
-const bool X_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. --ROBO-BH
-const bool Y_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. --ROBO-BH
-const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.  --ROBO-BH
-const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. --ROBO-BH
-const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. --ROBO-BH
-const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
+const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop. --ROBO-BH
-//#define DISABLE_MAX_ENDSTOPS
+#define DISABLE_MAX_ENDSTOPS   //ROBO-BH
 //#define DISABLE_MIN_ENDSTOPS

 // Disable max endstops for compatibility with endstop checking routine
@@ -313,319 +313,319 @@
 // Disables axis when it's not being used.
 #define DISABLE_X false
 #define DISABLE_Y false
-#define DISABLE_Z false
+#define DISABLE_Z true //--ROBO-BH
 #define DISABLE_E false // For all extruders
 #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled

@@ -330,344 +330,344 @@
 #define Y_HOME_DIR -1
 #define Z_HOME_DIR -1

-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define min_software_endstops false // If true, axis won't move to coordinates less than HOME_POS. --ROBO-BH
 #define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.

 // Travel limits after homing
-#define X_MAX_POS 205
+#define X_MAX_POS 240    //--ROBO-BH
 #define X_MIN_POS 0
-#define Y_MAX_POS 205
+#define Y_MAX_POS 254   //--ROBO-BH
 #define Y_MIN_POS 0
-#define Z_MAX_POS 200
+#define Z_MAX_POS 240   //--ROBO-BH
 #define Z_MIN_POS 0

 #define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
@@ -346,352 +346,352 @@
 #define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
 //============================= Bed Auto Leveling ===========================

-//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
+#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)   //--ROBO-BH
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.

 #ifdef ENABLE_AUTO_BED_LEVELING
@@ -372,413 +372,413 @@

     // set the rectangle in which to probe
     #define LEFT_PROBE_BED_POSITION 15
-    #define RIGHT_PROBE_BED_POSITION 170
+    #define RIGHT_PROBE_BED_POSITION 200   //--ROBO-BH
-    #define BACK_PROBE_BED_POSITION 180
+    #define BACK_PROBE_BED_POSITION 240        //--ROBO-BH
     #define FRONT_PROBE_BED_POSITION 20

      // set the number of grid points per dimension
      // I wouldn't see a reason to go above 3 (=9 probing points on the bed)
-    #define AUTO_BED_LEVELING_GRID_POINTS 2
+    #define AUTO_BED_LEVELING_GRID_POINTS 3       //--ROBO-BH

   #else  // not AUTO_BED_LEVELING_GRID
     // with no grid, just probe 3 arbitrary points.  A simple cross-product
-    // is used to esimate the plane of the print bed
+    // is used to estimate the plane of the print bed

       #define ABL_PROBE_PT_1_X 15
-      #define ABL_PROBE_PT_1_Y 180
+      #define ABL_PROBE_PT_1_Y 15  //--ROBO-BH
-      #define ABL_PROBE_PT_2_X 15
+      #define ABL_PROBE_PT_2_X 220 //--ROBO-BH
-      #define ABL_PROBE_PT_2_Y 20
+      #define ABL_PROBE_PT_2_Y 15  //--ROBO-BH
-      #define ABL_PROBE_PT_3_X 170
+      #define ABL_PROBE_PT_3_X 114 //--ROBO-BH
-      #define ABL_PROBE_PT_3_Y 20
+      #define ABL_PROBE_PT_3_Y 240 //--ROBO-BH

   #endif // AUTO_BED_LEVELING_GRID

   // these are the offsets to the probe relative to the extruder tip (Hotend - Probe)
   // X and Y offsets must be integers
-  #define X_PROBE_OFFSET_FROM_EXTRUDER -25
+  #define X_PROBE_OFFSET_FROM_EXTRUDER 0       //--ROBO-BH
-  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER 0       //--ROBO-BH
-  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.19    //Found by actual measurement  --ROBO-BH

   #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

-  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
+  #define XY_TRAVEL_SPEED 20000         // X and Y axis travel speed between probes, in mm/min --ROBO-BH

-  #define Z_RAISE_BEFORE_PROBING 15    //How much the extruder will be raised before traveling to the first probing point.
+  #define Z_RAISE_BEFORE_PROBING 5    //How much the extruder will be raised before travelling to the first probing point. --ROBO-BH
-  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
+  #define Z_RAISE_BETWEEN_PROBINGS 3  //How much the extruder will be raised when travelling from between next probing points  --ROBO-BH

   //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
   //#define SLED_DOCKING_OFFSET 5 // the extra distance the X axis must travel to pickup the sled. 0 should be fine but you can push it further if you'd like.
@@ -475,489 +475,489 @@

 //// MOVEMENT SETTINGS
 #define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
+#define HOMING_FEEDRATE {50*60, 50*60, 10*60, 0}  // set the homing speeds (mm/min)    --ROBO-BH

 // default settings

-#define DEFAULT_AXIS_STEPS_PER_UNIT   {78.7402,78.7402,200.0*8/3,760*1.1}  // default steps per unit for Ultimaker
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,2560,810}  // default steps per unit for RoboR1   --ROBO-BH
 #define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec)
 #define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.

-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E max acceleration in mm/s^2 for printing moves
+#define DEFAULT_ACCELERATION          1300    // X, Y, Z and E max acceleration in mm/s^2 for printing moves  --ROBO-BH
 #define DEFAULT_RETRACT_ACCELERATION  3000   // X, Y, Z and E max acceleration in mm/s^2 for retracts

 // Offset of the extruders (uncomment if using more than one and relying on firmware to position when changing).
@@ -493,499 +493,499 @@
 // #define EXTRUDER_OFFSET_Y {0.0, 5.00}  // (in mm) for each extruder, offset of the hotend on the Y axis

 // 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                17.0    // (mm/sec)  --ROBO-BH
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
 #define DEFAULT_EJERK                 5.0    // (mm/sec)

@@ -516,533 +516,533 @@
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
 //define this to enable EEPROM support
-//#define EEPROM_SETTINGS
+#define EEPROM_SETTINGS    //--ROBO-BH
 //to disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
 // please keep turned on if you can.
 //#define EEPROM_CHITCHAT

 // Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
+#define PLA_PREHEAT_HOTEND_TEMP 200     //--ROBO-BH
 #define PLA_PREHEAT_HPB_TEMP 70
 #define PLA_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255

 #define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 100
+#define ABS_PREHEAT_HPB_TEMP 80        //--ROBO-BH
 #define ABS_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255

 //LCD and SD support
@@ -559,565 +559,565 @@
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
 //
 // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
-//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER  //--ROBO-BH

 // The RepRapWorld REPRAPWORLD_KEYPAD v1.1
 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626

Here is the issue. After uploading and resetting the printer I perform a M503 to make sure that I get the following output M206 X0.00 Y0.00 Z-1.19. Once it is determined the correct offset is both in Memory and in EEPROM. I proceed with a G28 followed by a G29.

The output of the G28 is noted in a serial monitor as well as on an LCD Smart Controller installed on the printer. After issuing the G28 but before issuing the G29 the printer moves appropriately to home X then home Y then center the hotend to home Z. The result is that my location is listed as X:120 Y:127 Z:-001.1 (output is truncated by the software). This is behavior that is expected. If I then issue a G1 Z0 I end up with the hotend exactly where I expect it hovering at the top of the bed and Z0 being the actual point it should be. Here is where the problem begins. Now executing a G29 Auto-leveling command, the printer moves to the appropriate nine locations on the print bed and performs a Z axis endstop probe. When it has reached its 9th and final location the firmware makes the assumption that it is resting at the Z0 location when in fact it is actually at the Z axis trigger point. The more egregious part is that the firmware actually believes this point is Z0 + -Z_OFFSET_FROM_EXTRUDER. So not only is it 1.19 mm too low, it is telling me that it is 1.19 mm in the air. Any command to move the Z axis is now too low by double the amount of the offset. This is repeatable with any amount of negative offset you want to put in the Configuration.h file.

To verify that it isn't simply assuming that the Z_PROBE_OFFSET_FROM_EXTRUDER should have been entered as a positive number I edited the source with a +1.19, recompiled and performed the same experiment. This time the result was that the final resting place of the G29 command was still the trigger point but the firmware reported that I was actually at Z:+002.3. Any Z axis moves are now too low by over 3.5 mm. No matter what is placed in Z_PROBE_OFFSET_FROM_EXTRUDER, G29 appears to always assume that the last Z axis endstop trigger point is Z0 and then it adds the positive value of the offset instead of what it really is.

I am willing to provide any additional information and test various solutions to solve this issue. I would not have reported this until I understood the problem and saw no solution in any of the configuration file options.

thinkyhead commented 9 years ago

Great description, and thanks for posting as a diff. Let me see if we're on the same page…

First, you should really be using the latest Development code. A lot has changed since 1.0.2, including adding support for a Z endstop that is also a probe, which makes sense for your machine.

Currently, M206 is used to set the home_offset values. Meanwhile M851 is used to set the Z offset of the probe relative to the nozzle, zprobe_zoffset. So, you might want to try using M851 Z-1.19 in addition to setting the home_offset with M206, since your "probe" is that far from Z=0. This gets a little confusing with your type of setup, so correct me if I'm wrong about setting both options or just one of them. You will also need to enable the new Z_PROBE_ENDSTOP option.

brainscan commented 9 years ago

I made a probe like this a while ago but I had to use a positive offset from extruder as it actually activated below the level of the bed. This then caused other problems with bed levelling so I changed to a capacitance probe. Not sure if it would be the same with yours but from your description it sounds like a similar principle.

Sent from my iPhone

On 15 Jun 2015, at 07:45, Scott Lahteine notifications@github.com wrote:

Great description, and thanks for posting as a diff. Let me see if we're on the same page…

First, you should really be using the latest Development code. A lot has changed since 1.0.2, including adding support for a Z endstop that is also a probe, which makes sense for your machine.

Currently, M206 is used to set the home_offset values. Meanwhile M851 is used to set the offset of the nozzle from the probe, zprobe_zoffset. So, you might want to try using M851 Z-1.19 in addition to setting the home_offset with M206, since your "probe" is that far from Z=0. This gets a little confusing with your type of setup, so correct me if I'm wrong about setting both or just one. You will also need to enable the new Z_PROBE_ENDSTOP option.

— Reply to this email directly or view it on GitHub.

WheresWaldo commented 9 years ago

Please forgive me for not completely understanding how GITHub works, I am not a programmer, more of a documentation writer. I am more than willing and able to put the time in to test this against the development branch, I just did it to the release since it is easier to access the source (I just downloaded the .zip). I was also under the impression that 1.0.2 release was the most stable. So if someone can point me to how to get development branch code in a neat little folder that Arduino IDE can use, it would be most welcome.

AnHardt commented 9 years ago

@WheresWaldo The short way: https://github.com/MarlinFirmware/Marlin/archive/Development.zip The long way: Goto: https://github.com/MarlinFirmware/Marlin At the top left, near the green icon, select the Development branch. Than at the bottom of the right column click DownloadZIP.

Wackerbarth commented 9 years ago

@WheresWaldo -- I strongly recommend that you shift to using git to directly access our repository. https://help.github.com/articles/set-up-git/ provides an excellent description of the setup.

I also recommend that you create your own (free) account on github and fork the Marlin repo. Then you can simply push your changes to your copy and we can reference them.

Don't worry about messing up a commit in your repo. git is very forgiving and allows "do-over".

WheresWaldo commented 9 years ago

I have an account and have forked the branch already. I also have installed Git for Windows. @Wackerbarth you already pointed out a stupid mistake I made with language_en.h. So what I will do is go to my fork, select development branch then download the zip from the link. If I understand GIT correctly since I forked and not cloned any changes you guys/gals make to the dev should show up in my fork. I will do my best to document my findings.

One more stupid question. While working on my changes to Configuration.h I used a new folder in example_configurations, how do I move those files to Development branch without messing up everyone else?

Wackerbarth commented 9 years ago

If you have installed Git for Windows, rather than fetching a .zip file, just use git to make a copy on your local PC. Your reaction of a fork on Github is equivalent to making an archive. It contains only what you put there (initially a copy of the repository that you forked) It does not update automatically.

The easiest way to handle updates is to have two remotes for the local copy of the repository on your PC. Set one (usually called "origin") to point to your github repository. Set the other to point to our MarlinFirmware repository (I call it "upstream" in my setup)

Then, you can "git fetch upstream" and bring the latest changes to your machine. You use "git checkout" to extract a particular version of the code that you wish to use at that time.

I strongly recommend that you learn to use SCM workflows (such as git). It makes life much more manageable and will give you skills that you will continue to use in all of your work.

WheresWaldo commented 9 years ago

Tested against current Development branch and I must have missed something in Configuration.h here is a diff:

--- D:\Documents\Arduino\Marlin upstream\Configuration.h 6/15/2015  8:21:44 AM
+++ D:\Documents\Arduino\Robo_Dev\Configuration.h 6/15/2015  11:48:49 AM
@@ -46,52 +46,52 @@
 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
 // build by the user have been successfully uploaded into firmware.
-#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(BH, R1 Single Extruder)" // Who made the changes. --ROBO-BH
 #define STRING_SPLASH_LINE1 BUILD_VERSION // will be shown during bootup in line 1
 //#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2

@@ -73,79 +73,79 @@

 // Optional custom name for your RepStrap or other custom machine
 // Displayed in the LCD "Ready" message
-// #define CUSTOM_MACHINE_NAME "3D Printer"
+#define CUSTOM_MACHINE_NAME "ROBO3D Dev"   //--ROBO-BH

 // 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)
@@ -147,153 +147,153 @@
 #define TEMP_SENSOR_1 0
 #define TEMP_SENSOR_2 0
 #define TEMP_SENSOR_3 0
-#define TEMP_SENSOR_BED 0
+#define TEMP_SENSOR_BED 1  //--ROBO-BH

 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
 //#define TEMP_SENSOR_1_AS_REDUNDANT
@@ -170,180 +170,180 @@
 // When temperature exceeds max temp, your heater will be switched off.
 // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
 // You should use MINTEMP for thermistor short/failure protection.
-#define HEATER_0_MAXTEMP 275
+#define HEATER_0_MAXTEMP 330   //--ROBO-BH
 #define HEATER_1_MAXTEMP 275
 #define HEATER_2_MAXTEMP 275
 #define HEATER_3_MAXTEMP 275
-#define BED_MAXTEMP 150
+#define BED_MAXTEMP 120        //--ROBO-BH

 // If your bed has low resistance e.g. .6 ohm and throws the fuse you can duty cycle it to reduce the
 // average current. The value should be an integer and the heat bed will be turned on for 1 interval of
@@ -314,337 +314,337 @@

 #ifndef ENDSTOPPULLUPS
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
-  // #define ENDSTOPPULLUP_XMAX
+  #define ENDSTOPPULLUP_XMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_YMAX
+  #define ENDSTOPPULLUP_YMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_ZMAX
+  #define ENDSTOPPULLUP_ZMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_XMIN
+  #define ENDSTOPPULLUP_XMIN   //--ROBO-BH
-  // #define ENDSTOPPULLUP_YMIN
+  #define ENDSTOPPULLUP_YMIN   //--ROBO-BH
-  // #define ENDSTOPPULLUP_ZMIN
+  #define ENDSTOPPULLUP_ZMIN   //--ROBO-BH
   // #define ENDSTOPPULLUP_ZPROBE
 #endif

 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+const bool Z_MIN_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.  --ROBO-BH
 const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-//#define DISABLE_MAX_ENDSTOPS
+#define DISABLE_MAX_ENDSTOPS   //--ROBO-BH
 //#define DISABLE_MIN_ENDSTOPS

 // @section machine
@@ -352,358 +352,358 @@
 // WARNING: When motors turn off there is a chance of losing position accuracy!
 #define DISABLE_X false
 #define DISABLE_Y false
-#define DISABLE_Z false
+#define DISABLE_Z true //--ROBO-BH

 // @section extruder

@@ -362,370 +362,370 @@
 // @section machine

 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
+#define INVERT_X_DIR true  //--ROBO-BH
-#define INVERT_Y_DIR true
+#define INVERT_Y_DIR false //--ROBO-BH
-#define INVERT_Z_DIR false
+#define INVERT_Z_DIR true  //--ROBO-BH

 // @section extruder

@@ -383,389 +383,389 @@
 #define Y_HOME_DIR -1
 #define Z_HOME_DIR -1

-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define min_software_endstops false    // If true, axis won't move to coordinates less than HOME_POS.  --ROBO-BH
 #define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.

 // @section machine
@@ -392,400 +392,400 @@
 #define X_MIN_POS 0
 #define Y_MIN_POS 0
 #define Z_MIN_POS 0
-#define X_MAX_POS 200
+#define X_MAX_POS 240  //--ROBO-BH
-#define Y_MAX_POS 200
+#define Y_MAX_POS 254  //--ROBO-BH
-#define Z_MAX_POS 200
+#define Z_MAX_POS 240  //--ROBO-BH

 //===========================================================================
 //========================= Filament Runout Sensor ==========================
@@ -436,442 +436,442 @@

 // @section bedlevel

-//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
+#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line) --ROBO-BH
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.

 #ifdef ENABLE_AUTO_BED_LEVELING
@@ -459,501 +459,501 @@
   #ifdef AUTO_BED_LEVELING_GRID

     #define LEFT_PROBE_BED_POSITION 15
-    #define RIGHT_PROBE_BED_POSITION 170
+    #define RIGHT_PROBE_BED_POSITION 200   //--ROBO-BH
     #define FRONT_PROBE_BED_POSITION 20
-    #define BACK_PROBE_BED_POSITION 170
+    #define BACK_PROBE_BED_POSITION 240        //--ROBO-BH

     #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this

     // Set the number of grid points per dimension
     // You probably don't need more than 3 (squared=9)
-    #define AUTO_BED_LEVELING_GRID_POINTS 2
+    #define AUTO_BED_LEVELING_GRID_POINTS 3        //--ROBO-BH

   #else  // !AUTO_BED_LEVELING_GRID

       // Arbitrary points to probe. A simple cross-product
       // is used to estimate the plane of the bed.
       #define ABL_PROBE_PT_1_X 15
-      #define ABL_PROBE_PT_1_Y 180
+      #define ABL_PROBE_PT_1_Y 15  //--ROBO-BH
-      #define ABL_PROBE_PT_2_X 15
+      #define ABL_PROBE_PT_2_X 200 //--ROBO-BH
       #define ABL_PROBE_PT_2_Y 20
-      #define ABL_PROBE_PT_3_X 170
+      #define ABL_PROBE_PT_3_X 115 //--ROBO-BH
-      #define ABL_PROBE_PT_3_Y 20
+      #define ABL_PROBE_PT_3_Y 240 //--ROBO-BH

   #endif // AUTO_BED_LEVELING_GRID

   // Offsets to the probe relative to the extruder tip (Hotend - Probe)
   // X and Y offsets must be integers
-  #define X_PROBE_OFFSET_FROM_EXTRUDER -25     // Probe on: -left  +right
+  #define X_PROBE_OFFSET_FROM_EXTRUDER 0     // Probe on: -left  +right      --ROBO-BH
-  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29     // Probe on: -front +behind
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER 0     // Probe on: -front +behind  --ROBO-BH
-  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35  // -below (always!)
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.2  // -below (always!)     --ROBO-BH

   #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

-  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
+  #define XY_TRAVEL_SPEED 20000         // X and Y axis travel speed between probes, in mm/min --ROBO-BH

-  #define Z_RAISE_BEFORE_PROBING 15   //How much the extruder will be raised before traveling to the first probing point.
+  #define Z_RAISE_BEFORE_PROBING 5   //How much the extruder will be raised before traveling to the first probing point.   --ROBO-BH
-  #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
+  #define Z_RAISE_BETWEEN_PROBINGS 3  //How much the extruder will be raised when traveling from between next probing points    --ROBO-BH
-  #define Z_RAISE_AFTER_PROBING 15    //How much the extruder will be raised after the last probing point.
+  #define Z_RAISE_AFTER_PROBING 3    //How much the extruder will be raised after the last probing point.  --ROBO-BH

 //   #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine.
                                                                             //Useful to retract a deployable probe.
@@ -539,545 +539,545 @@
   // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
   // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.

-  //#define Z_PROBE_ENDSTOP
+#define Z_PROBE_ENDSTOP        //--ROBO-BH

 #endif // ENABLE_AUTO_BED_LEVELING

@@ -565,584 +565,584 @@
  * MOVEMENT SETTINGS
  */

-#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)
+#define HOMING_FEEDRATE {50*60, 50*60, 10*60, 0}  // set the homing speeds (mm/min)    --ROBO-BH

 // default settings

-#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,4000,500}  // default steps per unit for Ultimaker
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,2560,810}  // default steps per unit for RoboR1   --ROBO-BH
-#define DEFAULT_MAX_FEEDRATE          {300, 300, 5, 25}    // (mm/sec)
+#define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    // (mm/sec) --ROBO-BH
-#define DEFAULT_MAX_ACCELERATION      {3000,3000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+#define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot. --ROBO-BH

-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
+#define DEFAULT_ACCELERATION          1500    // X, Y, Z and E acceleration in mm/s^2 for printing moves   --ROBO-BH
 #define DEFAULT_RETRACT_ACCELERATION  3000   // E acceleration in mm/s^2 for retracts
 #define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves

 // 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                17.0    // (mm/sec)  --ROBO-BH
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
 #define DEFAULT_EJERK                 5.0    // (mm/sec)

@@ -607,613 +607,613 @@
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
 //define this to enable EEPROM support
-//#define EEPROM_SETTINGS
+#define EEPROM_SETTINGS    //Should be enabled on all Robo's   --ROBO-BH

 #ifdef EEPROM_SETTINGS
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
@@ -617,628 +617,628 @@
 // @section temperature

 // Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
+#define PLA_PREHEAT_HOTEND_TEMP 200    //--ROBO-BH
 #define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0   // Insert Value between 0 and 255
+#define PLA_PREHEAT_FAN_SPEED 255   // Insert Value between 0 and 255  --ROBO-BH

 #define ABS_PREHEAT_HOTEND_TEMP 240
-#define ABS_PREHEAT_HPB_TEMP 110
+#define ABS_PREHEAT_HPB_TEMP 80        //--ROBO-BH
 #define ABS_PREHEAT_FAN_SPEED 0   // Insert Value between 0 and 255

 //==============================LCD and SD support=============================
@@ -684,690 +684,690 @@
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
 //
 // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
-//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER  //test machine specific will be removed before any pull request --ROBO-BH

 // The RepRapWorld REPRAPWORLD_KEYPAD v1.1
 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626

Uploaded code, connected to printer, reset printer. Made sure that M206 had a value of M206 X0.00 Y0.00 Z-1.20 and M851 had Z-Probe Offset (mm): M851 Z-1.20.

Issued a G28 which should home all. As I expected, it homed X by doing its little dance at the endstop, then homed Y with the same dance. The printer then raised the extruder 5 mm as per line 496, then nothing. It stops before actually probing Z. I am sure that I missed something in Configuration.h, but I just don't see it. Needless to say, if you issue a G29 after that it also does not do any of the Z probing, just zips along to its nine predesignated locations.

I apologize for not being a coder.

thinkyhead commented 9 years ago

under the impression that 1.0.2 release was the most stable

@WheresWaldo Well, 1.0.2 (1.0.2-1, etc.) is stable in the sense that it will only get bug fixes, but it isn't entirely bug-free. If you peek at the Change Log for 1.1 (aka "1.0.3") most of the problems listed as fixed still exist in 1.0.2 and 1.0.2-1.

forgive me for not completely understanding how GITHub works

When you start new work, always create a new branch first. Don't just modify your "Development" branch. The easiest way to create a new branch is to use the Github client or the github site. If you create the new branch using the website, you have to do a git fetch to grab the new branch. If you use a command-line, you can create a new branch from "Development" with the command git checkout Development -b my_new_feature. You will periodically need to update your "Development" branch copy. You can do that with git fetch upstream, git checkout Development, git merge upstream/Development.

WheresWaldo commented 9 years ago

More testing, but now one additional issue has cropped up. First found the line that I missed in Configuration.h Line 333 needed to be true. Now that it is working I booted up verified that M206 and M851 were populated. Issued a G28, dance done but I have no display of Z on Full Graphics LCD Smart Controller. I do know it is resting on the bed at the Z Probe Trigger height. Which previous firmwares would display Z:-001.1, now it displays Z:---.--. Then issuing a G29 command I get back the following results after completion of the nine point dance:

G29 Auto Bed Leveling
Eqn coefficients: a: 0.00035312 b: 0.00061257 d: -0.06589894
planeNormal x: -0.000353 y: -0.000613 z: 1.000000

Bed Level Correction Matrix:
+1.000000 +0.000000 +0.000353
-0.000000 +1.000000 +0.000613
-0.000353 -0.000613 +1.000000

Problem is that the extruder is sitting below the top of the bed again, physically observable that the Z probe is activated. LCD still shows Z:---.--. Now if the printer knew that the extruder was below the bed I can issue a G1 Z0 and it will raise the extruder 1.2 mm, but when I do that instead of moving up 1.2 mm the printer already believes it is at Z0 and does nothing. So other than the display issue (which I am ignoring for now), the development branch appears to work exactly the same as the 1.0.2 release branch with respect to this configuration.

thinkyhead commented 9 years ago

@WheresWaldo Thanks for the update, it is very helpful! So is it the case that your only Z endstop(s) are the switches that are disengaged when the nozzle is resting on the bed? If so, I might be able to try simulating that on my machine by pretending that the Z endstop/probe is like yours. By the way, which X ends are you using for your leveling system? Can you provide a link to them on Youmagine or Thingiverse?

WheresWaldo commented 9 years ago

@thinkyhead, This is a standard current version Robo3D R1, the endstops / Z probes are two switches that travel along the two 8 mm threaded rods, the setup pushes the X Idler up from the bottom to lift the entire Extruder / X - Axis assembly. There are no maximum endstops. robo_internals_2 Just below the idler on both sides there is a switch that is physically attached to a nut that rides up and down the 8 mm threaded rods. When the head hits the build plate, the rods continue moving until the small micro switches are disengaged. robo_internals_3 The X and Y have similar micro switch endstops, the X_MIN is mounted on the front right side of the X Carriage and hits a plastic stop located on the left X Idler. The Y is located under the bed and is triggered by the frame that holds the glass build plate. The only Thingiverse model available is this one here: http://www.thingiverse.com/thing:729956. The Y and Z axis are correctly modeled but the X is an 'improved' version that moved the micro switch to where the screw stop appears in this collection. One note about the Z Axis endstop switches, they are wired in the NC position and are normally open as long as the extruder is not touching the bed, These switches are located under the left and right X Idlers and are wired in parallel. If any switch disengages it closes the circuit to alert the RAMPS board the the Z Minimum endstop has been hit. This is exactly what happens when the printer tries to lower the extruder head below the top surface of the build plate. Obviously the extruder cannot travel below the build plate but the switches attached to those 8 mm nuts continue to move down, it is not instant and requires a bit of travel before it is triggered, hence the need for negative offset. It is a funky but workable solution. I hope that was a thorough enough explanation.

One more note about this type of set-up, it really doesn't matter what size hotend you use since it is triggered by the hotend actually touching the bed, what is really being measured is the travel distance required to trigger the switch as if it were a standalone unit.

WheresWaldo commented 9 years ago

I should add as a side note, if there is any debug code I can enable or temporarily add to my local copy of the development code I compile and upload to my machine I would be happy to do so and report the findings.

I have a bit more background information, maybe this will help. I compared last evenings development source to 1.0.0, Last nights source still works as described above. This is how 1.0.0 behaves: Using a Configuration.h with the correct setting for the printer, compiled and loaded the firmware. Reset the printer. Verified M206 had X0.00 Y0.00 Z-1.20 in it. Since there is no M851 I used M565 instead (based on common knowledge in the Robo community and the reprap.org wiki page). The results are rather interesting. When you issue a G28 command after its three position dance the extruder head is listed as sitting in position X:120 Y:127 Z:-002.4. It is almost as if it took what was in M206 for the probe to extruder offset and added what was in M565, resulting in a position the firmware believes is 2.4 mm below Z0. Then when you issue the subsequent G29 command, the result is that the extruder head, although resting below the top of the build plate, is believed by the firmware to be located at Z-1.2. When followed by a G1 Z0 command, the head is now in the correct location right at the top of the build plate. If you do not use M565 then after the G29 the firmware believes that at the last point the head, which is at the Z probe trigger point, says it is at Z0.

If I may ask a few very noobish question, why were the offsets separated like this? Wouldn't the Z_PROBE_OFFSET_FROM_EXTRUDER and the offset used by M851 be the same in all cases? After all you are testing for bed leveling with the probe and it hasn't magically changed position between the G28 and G29 commands.

paulusjacobus commented 9 years ago

Hi,

I believe this nasty bug (i.e. extruder is writing in the air after auto leveling) is a logical error in the routine Marlin_main.cpp. I have created a new branch with my proposed fix. It does now work great on my reprap printer and CURA. For those interested in the bug see https://github.com/MarlinFirmware/Marlin/compare/Release...paulusjacobus:patch-1 my CURA start up routine is

G21        ;metric values
M82        ;set extruder to absolute mode
M107       ;start with the fan offG28 X0 Y0  ;move X/Y to min endstops
G28 X0 Y0 Z0     ;move Z to min endstops
G92 X0 Y0 Z0;
G28 X0 Y0
G29         ; ABL
G1 X 0 F(travel_speed)
G1 y 0 F(travel_speed)
G1 Z 15.5 F{travel_speed} ;move the platform down 15mm
G92 E0                  ;zero the extruded length
G1 F200 E3              ;extrude 3mm of feed stock
G92 E0                  ;zero the extruded length again
G1 F{travel_speed}
;Put printing message on LCD screen
M117 Printing...
thinkyhead commented 9 years ago

a logical error in the routine Marlin_main.cpp

We've narrowed it down even more than that! It seems likely that it is one of the changes shown in this commit: https://github.com/thinkyhead/Marlin/commit/3f0a990360d04a45c11ba6ebdfeff2b16d26bf34

We'd prefer to have this bugfix against the current Development branch, but I will have a look at your patched version of 1.0.2 and see what you found there.

thinkyhead commented 9 years ago

@Roxy-3DPrintBoard What do you think of this change? https://github.com/MarlinFirmware/Marlin/compare/Release...paulusjacobus:patch-1

Ha, answered my own question: https://github.com/MarlinFirmware/Marlin/issues/2040#issuecomment-116050448

thinkyhead commented 9 years ago

wouldn't Z_PROBE_OFFSET_FROM_EXTRUDER and the offset used by M851 be the same in all cases?

No. The Z_PROBE_OFFSET_FROM_EXTRUDER constant is just the default value. The zprobe_zoffset variable contains the actual current value, whether read from EEPROM or changed with M851. This is a variable so it can be changed by the user without having to re-flash Marlin.

thinkyhead commented 9 years ago

there is any debug code I can enable or temporarily add to my local copy of the development code

I will be re-building my debug branch against the current code shortly. I have to fix up my fork since the Development branch was scrubbed (to my horror) recently in order to remove all merge commits.

WheresWaldo commented 9 years ago

As soon as you give me an indication that the commit is ready to go I will test this against the dev branch, or should it be the Development branch?

WheresWaldo commented 9 years ago

I just tested this against the dev branch with PR#2351 and it appears to be working correctly. I need to do a couple of test prints to make sure. Now another issue has cropped up making this a 100% visual verification, the Full Graphics LCD no longer displays Z position. I will open a new issue for that.

More info: I have now tested this fix with several iterations of startup gcode and it appears to work every single time. I would say this is fixed, at least in this instance. Also works identically in Development branch

thinkyhead commented 9 years ago

2351 has been merged, so the current Development branch no longer has that particular issue. One of the last things remaining is to ensure that the Z position is determined correctly when leveling is completed. A recent code patch was applied to properly (we hope!) account for the distance from the nozzle to the probe, but it still needs thorough testing.

I have yet to fix up my debug branch for the latest Development code, as it's probably going to be an hour of rebasing, but I will post it as soon as I can.

WheresWaldo commented 9 years ago

I have been using the Development branch since the merge and haven't seen any issues. As soon as you get the debug stuff up I will be more than happy to test it.

WheresWaldo commented 9 years ago

As of July 20.

Still have an issue with G28. Expected behavior: It moves the extruder to the left, does the soft double-tap and sets the X Axis end stop position to 0. It then moves the extruder to the front of the bed, does the soft double-tap and sets the Y axis end stop to 0. It moves the extruder to the middle of the bed and probes with a double-tap to set the Z axis end stop. It then displays the Z position as 1 mm and M119 shows the Z endstop as triggered.

z_min: TRIGGERED

Issuing the command G1 Z1.1 results in the following report for the Z endstop.

z_min: open

Issuing a G1 Z0 pushes the extruder head further into the bed and leaves the Z endstop in a triggered state.

In Configuration.h the Z_PROBE_OFFSET_FROM_EXTRUDER is defined as -1.2 (I will include a diff from the default Marlin Configuration.h at the end of this comment). Ignoring this for a moment to issue a G29 command immediately following the G28 command gives the following results: The extruder is moved through each of its nine probe locations and does the double-tap on the bed. At the end of the probing the extruder rests at the ninth test location with a location listed as X:199.9 Y:208.9 Z:1 but it is not 1 mm off the bed as the following output is received from the M119 command:

Send: M119
Recv: Reporting endstop status
Recv: x_min: open
Recv: y_min: open
Recv: z_min: TRIGGERED
Recv: z_probe: open
Recv: ok

As you can see, Marlin thinks the extruder is 1 mm above the print bed, when in fact it is below the print bed by a distance of 0.1 - 0.2 mm. Issuing any command that would move the probe to Z0 would simply push the head into the bed further. Issuing a command to move the head up an additional 0.1 or 0.2 mm will open the z_min endstop.

There are no commands in the startup gcode that manipulate the zprobe_offset.

--- D:\Documents\Arduino\Marlin_Development\Configuration.h 7/20/2015  11:48:11 AM
+++ D:\Documents\Arduino\Robo_Development_07202015\Configuration.h 7/20/2015  5:46:04 PM
@@ -44,54 +44,54 @@
 #endif

 // User-specified version info of this build to display in [Pronterface, etc] terminal window during
 // startup. Implementation of an idea by Prof Braino to inform user that any changes made to this
 // build by the user have been successfully uploaded into firmware.
-#define STRING_CONFIG_H_AUTHOR "(none, default config)" // Who made the changes.
+#define STRING_CONFIG_H_AUTHOR "(BH, R1 Single Extruder)" //--ROBO-BH Who made the changes.
 #define STRING_SPLASH_LINE1 BUILD_VERSION // will be shown during bootup in line 1
 //#define STRING_SPLASH_LINE2 STRING_DISTRIBUTION_DATE // will be shown during bootup in line 2

 // @section machine

@@ -71,81 +71,81 @@
   #define MOTHERBOARD BOARD_RAMPS_13_EFB
 #endif

 // Optional custom name for your RepStrap or other custom machine
 // Displayed in the LCD "Ready" message
-// #define CUSTOM_MACHINE_NAME "3D Printer"
+#define CUSTOM_MACHINE_NAME "RoBo3D 42203b"  //--ROBO-BH

 // 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)
 // #define MACHINE_UUID "00000000-0000-0000-0000-000000000000"

@@ -141,155 +141,155 @@
 // 998 and 999 are Dummy Tables. They will ALWAYS read 25°C or the temperature defined below.
 //     Use it for Testing or Development purposes. NEVER for production machine.
 //     #define DUMMY_THERMISTOR_998_VALUE 25
 //     #define DUMMY_THERMISTOR_999_VALUE 100
 // :{ '0': "Not used", '4': "10k !! do not use for a hotend. Bad resolution at high temp. !!", '1': "100k / 4.7k - EPCOS", '51': "100k / 1k - EPCOS", '6': "100k / 4.7k EPCOS - Not as accurate as Table 1", '5': "100K / 4.7k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '7': "100k / 4.7k Honeywell 135-104LAG-J01", '71': "100k / 4.7k Honeywell 135-104LAF-J01", '8': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT", '9': "100k / 4.7k GE Sensing AL03006-58.2K-97-G1", '10': "100k / 4.7k RS 198-961", '11': "100k / 4.7k beta 3950 1%", '12': "100k / 4.7k 0603 SMD Vishay NTCS0603E3104FXT (calibrated for Makibox hot bed)", '13': "100k Hisens 3950  1% up to 300°C for hotend 'Simple ONE ' & hotend 'All In ONE'", '60': "100k Maker's Tool Works Kapton Bed Thermistor beta=3950", '55': "100k / 1k - ATC Semitec 104GT-2 (Used in ParCan & J-Head)", '2': "200k / 4.7k - ATC Semitec 204GT-2", '52': "200k / 1k - ATC Semitec 204GT-2", '-2': "Thermocouple + MAX6675 (only for sensor 0)", '-1': "Thermocouple + AD595", '3': "Mendel-parts / 4.7k", '1047': "Pt1000 / 4.7k", '1010': "Pt1000 / 1k (non standard)", '20': "PT100 (Ultimainboard V2.x)", '147': "Pt100 / 4.7k", '110': "Pt100 / 1k (non-standard)", '998': "Dummy 1", '999': "Dummy 2" }
-#define TEMP_SENSOR_0 1
+#define TEMP_SENSOR_0 1        //--ROBO-BH for E3Dv6 use 5 for Hexagon use 1
 #define TEMP_SENSOR_1 0
 #define TEMP_SENSOR_2 0
 #define TEMP_SENSOR_3 0
-#define TEMP_SENSOR_BED 0
+#define TEMP_SENSOR_BED 1  //--ROBO-BH

 // This makes temp sensor 1 a redundant sensor for sensor 0. If the temperatures difference between these sensors is to high the print will be aborted.
 //#define TEMP_SENSOR_1_AS_REDUNDANT
 #define MAX_REDUNDANT_TEMP_SENSOR_DIFF 10

@@ -168,178 +168,178 @@
 #define BED_MINTEMP 5

 // When temperature exceeds max temp, your heater will be switched off.
 // This feature exists to protect your hotend from overheating accidentally, but *NOT* from thermistor short/failure!
 // You should use MINTEMP for thermistor short/failure protection.
-#define HEATER_0_MAXTEMP 275
+#define HEATER_0_MAXTEMP 320   //--ROBO-BH
 #define HEATER_1_MAXTEMP 275
 #define HEATER_2_MAXTEMP 275
 #define HEATER_3_MAXTEMP 275
 #define BED_MAXTEMP 150

@@ -203,227 +203,218 @@
   #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
   #define PID_INTEGRAL_DRIVE_MAX PID_MAX  //limit for the integral term
   #define K1 0.95 //smoothing factor within the PID

-  // If you are using a pre-configured hotend then you can use one of the value sets by uncommenting it
+// RoBo3D R1  
-  // Ultimaker
+    #define  DEFAULT_Kp 28.67  //--ROBO-BH
-  #define  DEFAULT_Kp 22.2
+    #define  DEFAULT_Ki 2.39   //--ROBO-BH
-  #define  DEFAULT_Ki 1.08
+    #define  DEFAULT_Kd 86.01  //--ROBO-BH
-  #define  DEFAULT_Kd 114
+
-
+// FIND YOUR OWN: "M303 E0 C8 S200" to run autotune on the hotend at 200 degreesC for 8 cycles.    //--ROBO-BH
-  // MakerGear
-  //#define  DEFAULT_Kp 7.0
-  //#define  DEFAULT_Ki 0.1
-  //#define  DEFAULT_Kd 12
-
-  // Mendel Parts V9 on 12V
-  //#define  DEFAULT_Kp 63.0
-  //#define  DEFAULT_Ki 2.25
-  //#define  DEFAULT_Kd 440

 #endif // PIDTEMP

 //===========================================================================
 //============================= PID > Bed Temperature Control ===============
@@ -249,271 +240,256 @@

 #ifdef PIDTEMPBED

   #define PID_BED_INTEGRAL_DRIVE_MAX MAX_BED_POWER //limit for the integral term

-  //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
+//  RoBo3D R1
-  //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
+    #define  DEFAULT_bedKp 147.06  //--ROBO-BH
-  #define  DEFAULT_bedKp 10.00
+    #define  DEFAULT_bedKi 28.77   //--ROBO-BH
-  #define  DEFAULT_bedKi .023
+    #define  DEFAULT_bedKd 187.95  //--ROBO-BH
-  #define  DEFAULT_bedKd 305.4
-
-  //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
-  //from pidautotune
-  //#define  DEFAULT_bedKp 97.1
-  //#define  DEFAULT_bedKi 1.41
-  //#define  DEFAULT_bedKd 1675.16

   // FIND YOUR OWN: "M303 E-1 C8 S90" to run autotune on the bed at 90 degreesC for 8 cycles.
+
 #endif // PIDTEMPBED

 // @section extruder

 //this prevents dangerous Extruder moves, i.e. if the temperature is under the limit
@@ -317,344 +302,329 @@
 // coarse Endstop Settings
 #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

 #ifndef ENDSTOPPULLUPS
   // fine endstop settings: Individual pullups. will be ignored if ENDSTOPPULLUPS is defined
-  // #define ENDSTOPPULLUP_XMAX
+  #define ENDSTOPPULLUP_XMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_YMAX
+  #define ENDSTOPPULLUP_YMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_ZMAX
+  #define ENDSTOPPULLUP_ZMAX   //--ROBO-BH
-  // #define ENDSTOPPULLUP_XMIN
+  #define ENDSTOPPULLUP_XMIN   //--ROBO-BH
-  // #define ENDSTOPPULLUP_YMIN
+  #define ENDSTOPPULLUP_YMIN   //--ROBO-BH
-  // #define ENDSTOPPULLUP_ZMIN
+  #define ENDSTOPPULLUP_ZMIN   //--ROBO-BH
   // #define ENDSTOPPULLUP_ZPROBE
 #endif

 // Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
 const bool X_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Y_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_MIN_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+const bool Z_MIN_ENDSTOP_INVERTING = true; //--ROBO-BH set to true to invert the logic of the endstop.
 const bool X_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Y_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
 const bool Z_MAX_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
-const bool Z_PROBE_ENDSTOP_INVERTING = false; // set to true to invert the logic of the endstop.
+const bool Z_PROBE_ENDSTOP_INVERTING = true; //--ROBO-BH set to true to invert the logic of the endstop.
-//#define DISABLE_MAX_ENDSTOPS
+#define DISABLE_MAX_ENDSTOPS   //--ROBO-BH
 //#define DISABLE_MIN_ENDSTOPS

 // If you want to enable the Z Probe pin, but disable its use, uncomment the line below.
 // This only affects a Z Probe Endstop if you have separate Z min endstop as well and have
 // activated Z_PROBE_ENDSTOP below. If you are using the Z Min endstop on your Z Probe,
@@ -354,376 +339,361 @@

 // Disables axis when it's not being used.
 // WARNING: When motors turn off there is a chance of losing position accuracy!
 #define DISABLE_X false
 #define DISABLE_Y false
-#define DISABLE_Z false
+#define DISABLE_Z false        //--ROBO-BH, better accuracy and LCD display

 // @section extruder

 #define DISABLE_E false // For all extruders
 #define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled

 // @section machine

 // Invert the stepper direction. Change (or reverse the motor connector) if an axis goes the wrong way.
-#define INVERT_X_DIR false
+#define INVERT_X_DIR true  //--ROBO-BH
-#define INVERT_Y_DIR true
+#define INVERT_Y_DIR false //--ROBO-BH
-#define INVERT_Z_DIR false
+#define INVERT_Z_DIR true  //--ROBO-BH

 // @section extruder

 // For direct drive extruder v9 set to true, for geared extruder set to false.
 #define INVERT_E0_DIR false
@@ -385,406 +370,391 @@
 // :[-1,1]
 #define X_HOME_DIR -1
 #define Y_HOME_DIR -1
 #define Z_HOME_DIR -1

-#define min_software_endstops true // If true, axis won't move to coordinates less than HOME_POS.
+#define min_software_endstops false //--ROBO-BH If true, axis won't move to coordinates less than HOME_POS.
 #define max_software_endstops true  // If true, axis won't move to coordinates greater than the defined lengths below.

 // @section machine

 // Travel limits after homing (units are in mm)
 #define X_MIN_POS 0
 #define Y_MIN_POS 0
 #define Z_MIN_POS 0
-#define X_MAX_POS 200
+#define X_MAX_POS 240  //--ROBO-BH
-#define Y_MAX_POS 200
+#define Y_MAX_POS 254  //--ROBO-BH
-#define Z_MAX_POS 200
+#define Z_MAX_POS 240  //--ROBO-BH

 //===========================================================================
 //========================= Filament Runout Sensor ==========================
 //===========================================================================
 //#define FILAMENT_RUNOUT_SENSOR // Uncomment for defining a filament runout sensor such as a mechanical or opto endstop to check the existence of filament
@@ -438,448 +423,433 @@
 //============================ Bed Auto Leveling ============================
 //===========================================================================

 // @section bedlevel

-//#define ENABLE_AUTO_BED_LEVELING // Delete the comment to enable (remove // at the start of the line)
+#define ENABLE_AUTO_BED_LEVELING //--ROBO-BH Delete the comment to enable (remove // at the start of the line)
 #define Z_PROBE_REPEATABILITY_TEST  // If not commented out, Z-Probe Repeatability test will be included if Auto Bed Leveling is Enabled.

 #ifdef ENABLE_AUTO_BED_LEVELING

   // There are 2 different ways to specify probing locations
@@ -460,507 +445,492 @@
   // Note: this feature generates 10KB extra code size
   #define AUTO_BED_LEVELING_GRID

   #ifdef AUTO_BED_LEVELING_GRID

-    #define LEFT_PROBE_BED_POSITION 15
+    #define LEFT_PROBE_BED_POSITION 10     //--ROBO-BH
-    #define RIGHT_PROBE_BED_POSITION 170
+    #define RIGHT_PROBE_BED_POSITION 200   //--ROBO-BH
-    #define FRONT_PROBE_BED_POSITION 20
+    #define FRONT_PROBE_BED_POSITION 5     //--ROBO-BH
-    #define BACK_PROBE_BED_POSITION 170
+    #define BACK_PROBE_BED_POSITION 210        //--ROBO-BH

     #define MIN_PROBE_EDGE 10 // The probe square sides can be no smaller than this

     // Set the number of grid points per dimension
     // You probably don't need more than 3 (squared=9)
-    #define AUTO_BED_LEVELING_GRID_POINTS 2
+    #define AUTO_BED_LEVELING_GRID_POINTS 3       //--ROBO-BH

   #else  // !AUTO_BED_LEVELING_GRID

       // Arbitrary points to probe. A simple cross-product
       // is used to estimate the plane of the bed.
       #define ABL_PROBE_PT_1_X 15
-      #define ABL_PROBE_PT_1_Y 180
+      #define ABL_PROBE_PT_1_Y 15  //--ROBO-BH
-      #define ABL_PROBE_PT_2_X 15
+      #define ABL_PROBE_PT_2_X 200 //--ROBO-BH
       #define ABL_PROBE_PT_2_Y 20
-      #define ABL_PROBE_PT_3_X 170
+      #define ABL_PROBE_PT_3_X 115 //--ROBO-BH
-      #define ABL_PROBE_PT_3_Y 20
+      #define ABL_PROBE_PT_3_Y 240 //--ROBO-BH

   #endif // AUTO_BED_LEVELING_GRID

   // Offsets to the probe relative to the extruder tip (Hotend - Probe)
   // X and Y offsets must be integers
-  #define X_PROBE_OFFSET_FROM_EXTRUDER -25     // Probe on: -left  +right
+  #define X_PROBE_OFFSET_FROM_EXTRUDER 0       //--ROBO-BH Probe on: -left  +right
-  #define Y_PROBE_OFFSET_FROM_EXTRUDER -29     // Probe on: -front +behind
+  #define Y_PROBE_OFFSET_FROM_EXTRUDER 0       //--ROBO-BH Probe on: -front +behind
-  #define Z_PROBE_OFFSET_FROM_EXTRUDER -12.35  // -below (always!)
+  #define Z_PROBE_OFFSET_FROM_EXTRUDER -1.2    //--ROBO-BH -below (always!)

   #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

-  #define XY_TRAVEL_SPEED 8000         // X and Y axis travel speed between probes, in mm/min
+  #define XY_TRAVEL_SPEED 12000         //--ROBO-BH  X and Y axis travel speed between probes, in mm/min

-  #define Z_RAISE_BEFORE_PROBING 15   //How much the extruder will be raised before traveling to the first probing point.
+  #define Z_RAISE_BEFORE_PROBING 5   //--ROBO-BH  How much the extruder will be raised before traveling to the first probing point.
   #define Z_RAISE_BETWEEN_PROBINGS 5  //How much the extruder will be raised when traveling from between next probing points
-  #define Z_RAISE_AFTER_PROBING 15    //How much the extruder will be raised after the last probing point.
+  #define Z_RAISE_AFTER_PROBING 3    //--ROBO-BH  How much the extruder will be raised after the last probing point.

 //   #define Z_PROBE_END_SCRIPT "G1 Z10 F12000\nG1 X15 Y330\nG1 Z0.5\nG1 Z10" //These commands will be executed in the end of G29 routine.
                                                                             //Useful to retract a deployable probe.

   //#define Z_PROBE_SLED // turn on if you have a z-probe mounted on a sled like those designed by Charles Bell
@@ -534,544 +519,529 @@
   // for normally closed configuration and 5V and D32 for normally open configurations. Normally closed configuration is advised and assumed.
   // The D32 pin in Aux 4 on RAMPS maps to the Arduino D32 pin. Z_PROBE_PIN is setting the pin to use on the Arduino. Since the D32 pin on the RAMPS maps to D32 on Arduino, this works.
   // D32 is currently selected in the RAMPS 1.3/1.4 pin file. All other boards will need changes to the respective pins_XXXXX.h file.
   // WARNING: Setting the wrong pin may have unexpected and potentially disastrous outcomes. Use with caution and do your homework.

-  //#define Z_PROBE_ENDSTOP
+  #define Z_PROBE_ENDSTOP  //--ROBO-BH

 #endif // ENABLE_AUTO_BED_LEVELING

 // @section homing
@@ -564,583 +549,568 @@

 #define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)

 // default settings

-#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,4000,500}  // default steps per unit for Ultimaker
+#define DEFAULT_AXIS_STEPS_PER_UNIT   {80,80,2560,780}  //--ROBO-BH Default steps per unit for RoboR1
-#define DEFAULT_MAX_FEEDRATE          {300, 300, 5, 25}    // (mm/sec)
+#define DEFAULT_MAX_FEEDRATE          {500, 500, 5, 25}    //--ROBO-BH (mm/sec)
-#define DEFAULT_MAX_ACCELERATION      {3000,3000,100,10000}    // X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.
+#define DEFAULT_MAX_ACCELERATION      {9000,9000,100,10000}    //--ROBO-BH X, Y, Z, E maximum start speed for accelerated moves. E default values are good for Skeinforge 40+, for older versions raise them a lot.

-#define DEFAULT_ACCELERATION          3000    // X, Y, Z and E acceleration in mm/s^2 for printing moves
+#define DEFAULT_ACCELERATION          1500    //--ROBO-BH X, Y, Z and E acceleration in mm/s^2 for printing moves
 #define DEFAULT_RETRACT_ACCELERATION  3000    // E acceleration in mm/s^2 for retracts
 #define DEFAULT_TRAVEL_ACCELERATION   3000    // X, Y, Z acceleration in mm/s^2 for travel (non printing) moves

 // 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                17.0    //--ROBO-BH (mm/sec)
 #define DEFAULT_ZJERK                 0.4     // (mm/sec)
 #define DEFAULT_EJERK                 5.0    // (mm/sec)

 //=============================================================================
@@ -602,624 +587,609 @@
 // The microcontroller can store settings in the EEPROM, e.g. max velocity...
 // M500 - stores parameters in EEPROM
 // M501 - reads parameters from EEPROM (if you need reset them after you changed them temporarily).
 // M502 - reverts to the default "factory settings".  You still need to store them in EEPROM afterwards if you want to.
 //define this to enable EEPROM support
-//#define EEPROM_SETTINGS
+#define EEPROM_SETTINGS        //--ROBO-BH Should be enabled on all Robo's 

 #ifdef EEPROM_SETTINGS
   // To disable EEPROM Serial responses and decrease program space by ~1700 byte: comment this out:
   #define EEPROM_CHITCHAT // Please keep turned on if you can.
 #endif

 // @section temperature

 // Preheat Constants
-#define PLA_PREHEAT_HOTEND_TEMP 180
+#define PLA_PREHEAT_HOTEND_TEMP 210    //--ROBO-BH
 #define PLA_PREHEAT_HPB_TEMP 70
-#define PLA_PREHEAT_FAN_SPEED 0   // Insert Value between 0 and 255
+#define PLA_PREHEAT_FAN_SPEED 255   //--ROBO-BH Insert Value between 0 and 255

 #define ABS_PREHEAT_HOTEND_TEMP 240
 #define ABS_PREHEAT_HPB_TEMP 110
 #define ABS_PREHEAT_FAN_SPEED 0   // Insert Value between 0 and 255

@@ -679,689 +664,674 @@

 // The RepRapDiscount FULL GRAPHIC Smart Controller (quadratic white PCB)
 // http://reprap.org/wiki/RepRapDiscount_Full_Graphic_Smart_Controller
 //
 // ==> REMEMBER TO INSTALL U8glib to your ARDUINO library folder: http://code.google.com/p/u8glib/wiki/u8glib
-//#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER
+#define REPRAP_DISCOUNT_FULL_GRAPHIC_SMART_CONTROLLER

 // The RepRapWorld REPRAPWORLD_KEYPAD v1.1
 // http://reprapworld.com/?products_details&products_id=202&cPath=1591_1626
 //#define REPRAPWORLD_KEYPAD
 //#define REPRAPWORLD_KEYPAD_MOVE_STEP 10.0 // how much should be moved when a key is pressed, eg 10.0 means 10mm per click
@@ -825,829 +810,815 @@

 #include "Configuration_adv.h"
 #include "thermistortables.h"

 #endif //CONFIGURATION_H
+

As you can see from this diff, nothing of consequence has changed from the one listed above or from the one I am using with firmware from before July 7. If you need, I can test after resetting the Z_PROBE_OFFSET_FROM_EXTRUDER to 0 and report back the results.

WheresWaldo commented 9 years ago

Resetting Z_PROBE_OFFSET_FROM_EXTRUDER to 0 does not change the behavior listing in the comment above. I should mention that M851 was set to -1.0 mm during the above two tests. Changing M851 to 0 and storing that value changes the results of the test. Now when a G28 command is issued the final resting place is listed as X:120.0 Y:127.0 Z:0. But this is also not correct as the 0 location along the Z axis is still 0.1 to 0.2 mm below the surface of the print bed. It is behaving as if the Z_PROBE_OFFSET_FROM_EXTRUDER is totally ignored as what was expected is that after the G28 command, all axes are homed but the probe should be up 1.2 mm. This is evident by the results of the M119 command issued immediately after the G28 command:

SENDING:M119
Reporting endstop status
x_min: open
y_min: open
z_min: TRIGGERED
z_probe: open

Following this command with a G29 command results in the final Z position of 0 which Marlin thinks is at the top of the bed, when in fact it is at the Z probe endstop trigger position. Regardless of what Z_PROBE_OFFSET_FROM_EXTRUDER or M851 (zprobe_offset) are set to, both those appear to be completely ignored for anything except display purposes, as the probe always ends up at the z probe trigger location thinking it is at Z:0 or Z:(0 + zprobe_offset) rather than the top of the bed at the Z:0 location.

WheresWaldo commented 9 years ago

Is this an acceptable workaround. Since I know that we end up at the Z probe endstop trigger point and that is only 0.1 or 0.2 below the non trigger point, if I place a positive number in M851 such as M851 Z0.2 and then do both the G28 and G29 commands. the result would be that the final Z position would be -0.2 mm, then a subsequent G1 Z0 command would actually place me at the top of the print bed.

So I guess my basic questions are: Has the use of M851 changed to require a positive number for negative offset? Has the use of Z_PROBE_OFFSET_FROM_EXTRUDER been superseded by the M851 command?

paulusjacobus commented 9 years ago

@whereswaldo back in June I figured out a part of the bugs surrounding the Autobed levelling issue (mainly air printing). The code has further evolved from that first fix and somewhere various issues have been introduced or discovered (constants and add/subtract sign issues) plus various machine variants. Your questions are very valid but I don't think we can answer them at this stage as many of us still try to understand the code. If we could answer this question then the bugs can be fixed. In my opinion Z_PROBE_OFFSET_FROM_EXTRUDER is the first setting that the firmware uses. M851 is the fine tuning to handle various filaments (some don't stick well and need to be printed with a very narrow hotend/bed gap). My experiences are that version 1.0.2 with a fix is working very reliable but I still need to do minor adjustments with M851 depending on the filament. I included that in my G start code sequence (i.e. G28 X0 Y0 Z0 followed by M851 Z-6.70 and G29. My Z_PROBE_OFFSET_FROM_EXTRUDER is 6.90). Also the ABL feature requires proper homing which a lot of people don't understand and they post this as an issue or ask it to be part of the ABL feature. (G codes in nature are single tasks)

The main question which was posted before June was should we scrap the code and start over or try to fix it. I think to iron out the bugs is still preferable now we have a workable ABL feature although it requires a lot of time to debug it. Maybe we need a small task force to get this sorted out.

WheresWaldo commented 9 years ago

@paulusjacobus I do understand the use of M851 in gcode, but my thinking is slightly different on this matter, ABL and offsets should be to get the printer to a known mechanically sound and accurate state. I know a lot of people use M851 and M565 previous to this to adjust for bed adhesion, not sure that was ever intended to be the best way to do things.

Example, If I have an object model that depends on a layer height that must be precise, using M851 to "adjust for adhesion" can result in a part, that might print perfect and stick just well enough, but be perfectly unusable. So my understanding is that these adjustments are made so we can gain accuracy with our prints. Whether I print a part in PLA, ABS, Nylon, PolyCarb, PET or anything that comes down the line, if I need 20 mm in height I expect 20 mm in height regardless. Otherwise we are relegating 3D printing to occasional trinkets or toys and leaving all the accurate work to the 3D print services. That is not how I want to use my printer, and I feel I am not on the fringes. If 3D printing is to ever become mainstream it has to work on a consumer level, which means it not only has to be a precise machine, it needs accuracy also as well as all the other ease of use requirements that consumer products bring. In my opionion, your slicer is the place to adjust first layer for adhesion, not offsets to extruder height. To that end I am trying to document every thing I find out about making this as accurate as it is precise. As you may have noticed I am trying to give you as much information as possible when testing various sections of code. It not like I am saying "it's broken, fix it!" without any background information.

Now if this is not the development intent of measurements and offsets, to add accuracy to the already built in precision, then I will work around these issues. You can continue to use your printer the way you see fit and I will try to work around the limitations inherent in all projects as ambitious as this. I know you are probably tired reading this long-winded response, but if I might add, it seems to me that the bottom line is that there are no clear objectives set out or documented in how or what these offsets are used for. This leads to different contributors making changes based on their ideas of how it should work. Sorry if this is a little frank, please note that I hold all the contributors here in the highest regard. I don't know if you are from a software background or a mechanical background. Mine is mechanical with a technical understanding of the challenges faced. With this background I tend to look at these as more machine than computing device. I see manufacturers striving to use the best parts for a given price point, these all come with a level of mechanical precision, now my intention as well as other non-programmer types, is to use the adjustments given, whether they be dials on a panel or #defines in a configuration file and make it as accurate as possible.

Does that mean scrapping the current code and starting over, or trying to fix what is there? I will never be the person to answer that. That decision is for the community of code contributors. All I can give is my expectations, opinion and the results of my testing.

paulusjacobus commented 9 years ago

@WheresWaldo

"I know a lot of people use M851 and M565 previous to this to adjust for bed adhesion, not sure that was ever intended to be the best way to do things."

That's the point we don't know what the developer intended, the code is not well documented, that's why it is so difficult to fix this. Sure we all strive to perfect this technology but it is open source and dependent on willingness of complete strangers to invest their time to develop this.

thinkyhead commented 9 years ago

Looks like right now we have a minor regression with G28 not deploying the Z probe – probably due to a bad precompiler condition surrounding deploy_z_probe in homeaxis. Hopefully this will be worked out very soon, but in the meantime be careful if using a Z probe to home and testing the latest code.

Otherwise, the probe final Z position appears to be much better in the latest Development code.

WheresWaldo commented 9 years ago

I was going to test the Development branch tomorrow and report my findings. I have been waiting between testing. I have been currently running Development code from July 20. Other than some irregularities with ABL, the rest of the code seems solid.

Additional notes:

Quick note on Development branch as of evening July 28. Initial test G28 does not home Z, it homes X and Y properly. But simply moves up 5 mm instead of moving to the middle of the bed. Subsequent G29 moves through each of the 9 specified points but simply moves the extruder up 5 mm at each point. I will discontinue testing until some of the remaining pull requests are accepted.

This build was prepared by taking the 7/28 Configuration.h and adding in all the specific changes required by the Robo. then double-checked by doing multiple file compares, to verify all changes were made correctly. I could not find any additional (new) parameters in the Configuration.h file that would explain this behavior.

thinkyhead commented 9 years ago

Turns out that you must have DEACTIVATE_SERVOS_AFTER_MOVE enabled or the probe won't deploy / stow in certain instances. I'm asking around as to whether that makes any sense. The number of servo+endstop+probe settings is starting to get confusing…

thinkyhead commented 9 years ago

@WheresWaldo Try my debug_G29 branch and post the log output. It should reveal why your homing and leveling are breaking down.

WheresWaldo commented 9 years ago

DEACTIVATE_SERVOS_AFTER_MOVE makes no sense at all since there are no servos in this setup, Also if I enable this line I have to enable a bunch more that define the number of servos and the angles and endstops. This certainly cannot be a requirement moving forward!

Here is the output from G28 followed by G29:

>>> G28
SENDING:G28
gcode_G28 >>>
setup_for_endstop_move > enable_endstops(true)
>>> homeaxis(0)
> enable_endstops(false)
> enable_endstops(true)
> TRIGGER ENDSTOP > current_position: (0.00, 0.00, 0.00)
set_axis_is_at_home 0 > (home_offset[axis]==0.00) > current_position: (0.00, 0.00, 0.00)
> AFTER set_axis_is_at_home > current_position: (0.00, 0.00, 0.00)
<<< homeaxis(0)
> homeX: (0.00, 0.00, 0.00)
>>> homeaxis(1)
> enable_endstops(false)
> enable_endstops(true)
> TRIGGER ENDSTOP > current_position: (0.00, 0.00, 0.00)
set_axis_is_at_home 1 > (home_offset[axis]==0.00) > current_position: (0.00, 0.00, 0.00)
> AFTER set_axis_is_at_home > current_position: (0.00, 0.00, 0.00)
<<< homeaxis(1)
> homeY: (0.00, 0.00, 0.00)
> Z_SAFE_HOMING >>>
Raise Z (before homing) by 4.00
> home_all_axis > current_position: (0.00, 0.00, 0.00)
> home_all_axis > destination: (120.00, 127.00, 4.00)
>>> homeaxis(2)
> enable_endstops(false)
> enable_endstops(true)
> TRIGGER ENDSTOP > current_position: (120.00, 127.00, 0.00)
set_axis_is_at_home 2 > (home_offset[axis]==0.00) > current_position: (120.00, 127.00, -0.72)
> AFTER set_axis_is_at_home > current_position: (120.00, 127.00, -0.72)
<<< homeaxis(2)
<<< Z_SAFE_HOMING
> (home_all_axis || homeZ) > final: (120.00, 127.00, -0.72)
ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
>>> G29
SENDING:G29
gcode_G29 >>>
G29 Auto Bed Leveling
setup_for_endstop_move > enable_endstops(true)
z_before = (before) 5.00
probe_pt >>>
> ProbeAction:1
> current_position: (120.00, 127.00, -0.72)
Z Raise to z_before 5.00
> do_blocking_move_to_z 5.00
do_blocking_move_to: (120.00, 127.00, 5.00)
> do_blocking_move_to_xy 10.00, 5.00
do_blocking_move_to: (10.00, 5.00, 5.00)
> ProbeDeploy
deploy_z_probe > current_position: (10.00, 5.00, 5.00)
run_z_probe > current_position: (10.00, 5.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (10.00, 5.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (10.00, 5.00, 4.28)
> do_blocking_move_to_xy 105.00, 5.00
do_blocking_move_to: (105.00, 5.00, 4.28)
run_z_probe > current_position: (105.00, 5.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (105.00, 5.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (105.00, 5.00, 4.28)
> do_blocking_move_to_xy 200.00, 5.00
do_blocking_move_to: (200.00, 5.00, 4.28)
run_z_probe > current_position: (200.00, 5.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (200.00, 5.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (200.00, 5.00, 4.28)
> do_blocking_move_to_xy 200.00, 107.00
do_blocking_move_to: (200.00, 107.00, 4.28)
run_z_probe > current_position: (200.00, 107.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (200.00, 107.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (200.00, 107.00, 4.28)
> do_blocking_move_to_xy 105.00, 107.00
do_blocking_move_to: (105.00, 107.00, 4.28)
run_z_probe > current_position: (105.00, 107.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (105.00, 107.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (105.00, 107.00, 4.28)
> do_blocking_move_to_xy 10.00, 107.00
do_blocking_move_to: (10.00, 107.00, 4.28)
run_z_probe > current_position: (10.00, 107.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (10.00, 107.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (10.00, 107.00, 4.28)
> do_blocking_move_to_xy 10.00, 209.00
do_blocking_move_to: (10.00, 209.00, 4.28)
run_z_probe > current_position: (10.00, 209.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (10.00, 209.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (10.00, 209.00, 4.28)
> do_blocking_move_to_xy 105.00, 209.00
do_blocking_move_to: (105.00, 209.00, 4.28)
run_z_probe > current_position: (105.00, 209.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:2
> current_position: (105.00, 209.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (105.00, 209.00, 4.28)
> do_blocking_move_to_xy 200.00, 209.00
do_blocking_move_to: (200.00, 209.00, 4.28)
run_z_probe > current_position: (200.00, 209.00, -0.72)
> ProbeStow (stow_z_probe will do Z Raise)
stow_z_probe > current_position: (200.00, 209.00, -0.72)
<<< probe_pt
> probing complete > current_position: (200.00, 209.00, -0.72)
clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > enable_endstops(false)
Eqn coefficients: a: 0.00000000 b: -0.00000000 d: -0.71992187
planeNormal x: -0.000000 y: 0.000000 z: 1.000000
set_bed_level_equation_lsq > current_position: (200.00, 209.00, -0.72)

Bed Level Correction Matrix:
+1.000000 +0.000000 +0.000000
+0.000000 +1.000000 -0.000000
-0.000000 +0.000000 +1.000000
> BEFORE apply_rotation_xyz > z_tmp  = -0.72
> BEFORE apply_rotation_xyz > real_z = -0.72
> AFTER apply_rotation_xyz > z_tmp  = -0.72
> corrected Z in G29: (200.00, 209.00, -0.72)
<<< gcode_G29

Here is a description of the behavior: The extruder never actually moves to the safe home position of 120.00, 127.00, 0.00. Instead, after homing X and Y correctly just moves up. The LCD Smart Controller incorrectly displays X:120.0 Y:127.0 Z:- 0.72, incidentally I have M851 set to 0.72. During the actual auto level it moves the extruder to each of it's nine specified locations, but does not move the extruder up or down. It simply never probes anywhere on the Z axis. The LCD Smart Controller still says Z is - 0.72.

It is obvious I am missing something in Configuration.h (or at least I hope so), I just can't figure out what it is.

WheresWaldo commented 9 years ago

Here is the correct report, after the one line change in Configuration.h:

>>> G28
SENDING:G28
gcode_G28 >>>
setup_for_endstop_move > enable_endstops(true)
>>> homeaxis(0)
> enable_endstops(false)
> enable_endstops(true)
> TRIGGER ENDSTOP > current_position: (0.00, 0.00, 0.00)
set_axis_is_at_home 0 > (home_offset[axis]==0.00) > current_position: (0.00, 0.00, 0.00)
> AFTER set_axis_is_at_home > current_position: (0.00, 0.00, 0.00)
<<< homeaxis(0)
> homeX: (0.00, 0.00, 0.00)
>>> homeaxis(1)
> enable_endstops(false)
> enable_endstops(true)
> TRIGGER ENDSTOP > current_position: (0.00, 0.00, 0.00)
set_axis_is_at_home 1 > (home_offset[axis]==0.00) > current_position: (0.00, 0.00, 0.00)
> AFTER set_axis_is_at_home > current_position: (0.00, 0.00, 0.00)
<<< homeaxis(1)
> homeY: (0.00, 0.00, 0.00)
> Z_SAFE_HOMING >>>
Raise Z (before homing) by 4.00
> home_all_axis > current_position: (0.00, 0.00, 0.00)
> home_all_axis > destination: (120.00, 127.00, 4.00)
>>> homeaxis(2)
> enable_endstops(false)
> enable_endstops(true)
> TRIGGER ENDSTOP > current_position: (120.00, 127.00, 0.00)
set_axis_is_at_home 2 > (home_offset[axis]==0.00) > current_position: (120.00, 127.00, -0.72)
> AFTER set_axis_is_at_home > current_position: (120.00, 127.00, -0.72)
<<< homeaxis(2)
<<< Z_SAFE_HOMING
> (home_all_axis || homeZ) > final: (120.00, 127.00, -0.72)
ENDSTOPS_ONLY_FOR_HOMING enable_endstops(false)
<<< gcode_G28
>>> G29
SENDING:G29
gcode_G29 >>>
G29 Auto Bed Leveling
setup_for_endstop_move > enable_endstops(true)
z_before = (before) 5.00
probe_pt >>>
> ProbeAction:1
> current_position: (120.00, 127.00, -0.72)
Z Raise to z_before 5.00
> do_blocking_move_to_z 5.00
do_blocking_move_to: (120.00, 127.00, 5.00)
> do_blocking_move_to_xy 10.00, 5.00
do_blocking_move_to: (10.00, 5.00, 5.00)
> ProbeDeploy
deploy_z_probe > current_position: (10.00, 5.00, 5.00)
run_z_probe > current_position: (10.00, 5.00, -0.40)
<<< probe_pt
z_before = (between) 4.60
probe_pt >>>
> ProbeAction:0
> current_position: (10.00, 5.00, -0.40)
Z Raise to z_before 4.60
> do_blocking_move_to_z 4.60
do_blocking_move_to: (10.00, 5.00, 4.60)
> do_blocking_move_to_xy 105.00, 5.00
do_blocking_move_to: (105.00, 5.00, 4.60)
run_z_probe > current_position: (105.00, 5.00, -0.43)
<<< probe_pt
z_before = (between) 4.57
probe_pt >>>
> ProbeAction:0
> current_position: (105.00, 5.00, -0.43)
Z Raise to z_before 4.57
> do_blocking_move_to_z 4.57
do_blocking_move_to: (105.00, 5.00, 4.57)
> do_blocking_move_to_xy 200.00, 5.00
do_blocking_move_to: (200.00, 5.00, 4.57)
run_z_probe > current_position: (200.00, 5.00, -0.50)
<<< probe_pt
z_before = (between) 4.50
probe_pt >>>
> ProbeAction:0
> current_position: (200.00, 5.00, -0.50)
Z Raise to z_before 4.50
> do_blocking_move_to_z 4.50
do_blocking_move_to: (200.00, 5.00, 4.50)
> do_blocking_move_to_xy 200.00, 107.00
do_blocking_move_to: (200.00, 107.00, 4.50)
run_z_probe > current_position: (200.00, 107.00, -0.86)
<<< probe_pt
z_before = (between) 4.14
probe_pt >>>
> ProbeAction:0
> current_position: (200.00, 107.00, -0.86)
Z Raise to z_before 4.14
> do_blocking_move_to_z 4.14
do_blocking_move_to: (200.00, 107.00, 4.14)
> do_blocking_move_to_xy 105.00, 107.00
do_blocking_move_to: (105.00, 107.00, 4.14)
run_z_probe > current_position: (105.00, 107.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (105.00, 107.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (105.00, 107.00, 4.28)
> do_blocking_move_to_xy 10.00, 107.00
do_blocking_move_to: (10.00, 107.00, 4.28)
run_z_probe > current_position: (10.00, 107.00, -0.72)
<<< probe_pt
z_before = (between) 4.28
probe_pt >>>
> ProbeAction:0
> current_position: (10.00, 107.00, -0.72)
Z Raise to z_before 4.28
> do_blocking_move_to_z 4.28
do_blocking_move_to: (10.00, 107.00, 4.28)
> do_blocking_move_to_xy 10.00, 209.00
do_blocking_move_to: (10.00, 209.00, 4.28)
run_z_probe > current_position: (10.00, 209.00, -0.56)
<<< probe_pt
z_before = (between) 4.44
probe_pt >>>
> ProbeAction:0
> current_position: (10.00, 209.00, -0.56)
Z Raise to z_before 4.44
> do_blocking_move_to_z 4.44
do_blocking_move_to: (10.00, 209.00, 4.44)
> do_blocking_move_to_xy 105.00, 209.00
do_blocking_move_to: (105.00, 209.00, 4.44)
run_z_probe > current_position: (105.00, 209.00, -0.61)
<<< probe_pt
z_before = (between) 4.39
probe_pt >>>
> ProbeAction:2
> current_position: (105.00, 209.00, -0.61)
Z Raise to z_before 4.39
> do_blocking_move_to_z 4.39
do_blocking_move_to: (105.00, 209.00, 4.39)
> do_blocking_move_to_xy 200.00, 209.00
do_blocking_move_to: (200.00, 209.00, 4.39)
run_z_probe > current_position: (200.00, 209.00, -0.73)
> ProbeStow (stow_z_probe will do Z Raise)
stow_z_probe > current_position: (200.00, 209.00, -0.73)
<<< probe_pt
> probing complete > current_position: (200.00, 209.00, -0.73)
clean_up_after_endstop_move > ENDSTOPS_ONLY_FOR_HOMING > enable_endstops(false)
Eqn coefficients: a: -0.00072437 b: -0.00092869 d: -0.43793921
planeNormal x: 0.000724 y: 0.000929 z: 1.000000
set_bed_level_equation_lsq > current_position: (200.00, 209.00, -0.39)

Bed Level Correction Matrix:
+1.000000 +0.000000 -0.000724
-0.000001 +1.000000 -0.000929
+0.000724 +0.000929 +0.999999
> BEFORE apply_rotation_xyz > z_tmp  = -0.39
> BEFORE apply_rotation_xyz > real_z = -0.73
> AFTER apply_rotation_xyz > z_tmp  = -0.73
> corrected Z in G29: (200.00, 209.00, -0.72)
<<< gcode_G29

It appears to work as you would expect, except for the fact that somewhere in the last 10 days my zprobe_offset changed from a -0.72 to a +0.72 in order for the extruder to be at the top of the bed when issuing a G1 Z0 command. Please note that in all Robo R1 printers the minimum Z endstop triggers below the level of the bed, so all Robo users expect this offset to be negative. You can see from the output that the number somewhere in its travels becomes inverted. I do not believe this is expected or desired behavior.

I hope this output helps.

thinkyhead commented 9 years ago

I've updated my debug branch with the latest code (and moved it under MarlinDev), which has received some adjustments to leveling in recent days.

And, if you wait another few days before testing, there are even more interesting adjustments coming that may affect this. Keep an eye on https://github.com/MarlinFirmware/MarlinDev/pulls for relevant updates.

paulusjacobus commented 9 years ago

Thanks @thinkyhead will be looking forward to test the new code.

WheresWaldo commented 9 years ago

I too will test this. I anxiously await the additional PRs. So far all is working with the exception that M851 mysteriously changed from negative (expected) to positive. I will run any tests you want and post the results from the debug code. I am currently running dev code from 10-AUG-2015 (from the correct GIT).

thinkyhead commented 9 years ago

M851 mysteriously changed from negative (expected) to positive

@WheresWaldo It should remain negative after M851 Z-0.72. Does it change spontaneously?

WheresWaldo commented 9 years ago

What I meant was that using M565 the value needed to be entered as a negative offset, which makes total sense since the endstop is triggered after the extruder touches the bed. The extruder IS the probe. M851 at first was the same way. Somewhere about two weeks ago or so the number had to be input as positive in M851 or it didn't work, totally out of the blue and unexpected. This printer does not have a probe and trigger that activates separately. It is a solution to installing extruders of different lengths, the offset will remain the same regardless the length of the extruder, since the extruder is the actual probing instrument.

thinkyhead commented 9 years ago

@WheresWaldo That's interesting. Marlin doesn't actually implement M565 (set probe offset X, Y, and Z) but only M851. Only Smoothie understands M565 at this time.

With your probe setup, using M851 with a positive value is correct (and would also be correct for M565 with Smoothieware), and should give you the correct Z coordinate (below zero) when you use that probe to home the Z axis with G28. Then, for G29 you just need to have large enough Z_RAISE_* values to make sure the probe is disengaged so the nozzle won't run into anything between probes.

WheresWaldo commented 9 years ago

@thinkyhead Interesting, the Robo implementation of 1.0.0 uses M565 so that is my frame of reference. In 1.0.0 the number entered was negative. When I tried 1.0.2 Release, it too was entered as a negative number. Moving to 1.0.3 Dev and it became M851 and was still a negative entry. Sometime in the last month it became a positive entry. But if you say it should be positive to effect a final negative offset, then I am okay with that, as long as it is documented and stays that way.

BTW, I can finally see some clarity in all the improvements all the developers are making and I really appreciate the work being done. I am awaiting your latest debug build to ferret out the remaining issues (if any) in the ABL code.

thinkyhead commented 9 years ago

it should be positive to effect a final negative offset

No, M851 sets zprobe_zoffset directly. Thus, it should be positive to give a positive offset. A positive offset tells Marlin that the nozzle bed contact Z (the nozzle touching the bed) is greater than the probe trigger point Z. Most probes have a negative offset, meaning that the deployed probe is below the nozzle tip, or, conversely, that the probe trigger point Z will be a higher number than the nozzle bed contact Z.

To give some examples:

Watch out for M206 – make sure you do your testing with M206 Z0 so there's no other offset applied when homing.

Wackerbarth commented 9 years ago

@thinkyhead -- Although your description is correct, I feel that the design is confusing and should be changed to take the position of the nozzle relative to probe and yield a positive value, which is the usual case, "The position of the nozzle when the probe contacts the bed"

thinkyhead commented 9 years ago

@Wackerbarth The user-configurable options and accompanying GCodes have always specified the probe position relative to the nozzle position, and I think this is the correct approach because all machines have nozzles, but not all machines have probes. If the probe is 10mm left of the nozzle, its X offset is specified as #define X_PROBE_OFFSET_FROM_EXTRUDER -10. If the probe is 5mm below its Z offset is specified as #define Z_PROBE_OFFSET_FROM_EXTRUDER -5. I don't see how this is confusing from a user configuration point-of-view, unless there is a pre-existing confusion. These are not intended to indicate "the position of the nozzle" – a concept some-steps-removed from the relative position of the probe – but merely the relative position of the (triggered) probe.

I'm not fond of the idea of now reversing the sign of X_PROBE_OFFSET_FROM_EXTRUDER, Y_PROBE_OFFSET_FROM_EXTRUDER, and Z_PROBE_OFFSET_FROM_EXTRUDER (and zprobe_zoffset – or the 3-element array that will replace it when we implement M565 which also takes nozzle-relative values), nor do I feel that we should reverse the sign given in M851 since it maintains parity with the nozzle-relative configuration options.

Wackerbarth commented 9 years ago

I have no problem using X_PROBE_OFFSET_FROM_EXTRUDER and Y_PROBE_OFFSET_FROM_EXTRUDER as we do now. In reality, it can be shown mathematically that these values are significant only for determining the area in which we probe. In the calculation of the bed tilt, the values of these terms gets canceled and they do not affect the result.

The issue is with the Z component. Although I understand the consistency in describing the probing in terms of the probe location in terms of the Nozzle coordinate system, that is not the only way to describe it. It is perfectly valid, and more intuitive, to describe things in terms of the BED. In particular, we describe the position of the nozzle in terms relation to the registration indicators (limit switches).

In this description frame, we might say that the nozzle is at [-50mm, ..., ...] when the carriage is against the X-min-limit switch.

For the Z component, we would say that the nozzle is [..., ..., Z_PROBE_HEIGHT] ABOVE the bed when the probe triggers by contact with the bed. Except for an unusual case, such as using the nozzle to depress the bed as a probing mechanism, This is a positive number. Most humans think in terms of (unsigned) distances rather than coordinate systems.

I recognize that choosing a particular way to describe a situation is somewhat arbitrary since there are mathematically simple transformation operations which convert from one scheme to the other (in either direction). Choosing a particular scheme INTERNALLY may simplify some of the logic. However, when the user is describing his configuration, we need to be expressing it in the terms which are "user friendly".

I contend that MOST users do not think in "nozzle coordinates". and would find a POSITIVE distance easier to understand.

Your choice to describe the probe position in nozzle coordinates is an ARBITRARY method of doing so. That CHOICE has already created quite a bit of confusion. It reversed the sign of terms previously used. I feel that that choice should be changed and we should revert to a description space which restores the intuitive description.

WheresWaldo commented 9 years ago

I just want to verify that everyone understands, with the Robo printers the nozzle is the probe so a final probe position is also the final nozzle position. The end stop is triggered after the probe/nozzle hits the bed.

I just need to make sure I understand, that the probe and the end stop are actually two different things and they are not being lumped together. My understanding and in my particular case, the probe/nozzle hits the bed but the end stop is not triggered until the z axis is lowered by a specified amount. Since the two are tied together, the result is that the Z axis 0 location specified is where the end stop is triggered, hence the need for the offset. My trigger is below the probe/nozzle so my offset used to be negative. As I mentioned, sometime in the last month it turned positive. Once applied the end stop trigger position now shows a Z axis height below the level of the bed (negative).

@thinkyhead M206 Z0 is always set correctly.

thinkyhead commented 9 years ago

@WheresWaldo Since your min endstop only triggers after the nozzle hits the bed and lowers a little more, then you could actually use M206 to specify that amount – and it should be a negative value in that case. Or, you should enable MANUAL_HOME_POSITIONS and set MANUAL_Z_HOME_POS to that same negative value and leave M206 Z (home_offset[Z_AXIS]) set to 0.

Which value is it that you are currently setting to a positive value, which used to be negative?

WheresWaldo commented 9 years ago

I am only using M851, all other settings are 0. On Aug 15, 2015 7:00 PM, "Scott Lahteine" notifications@github.com wrote:

@WheresWaldo https://github.com/WheresWaldo Since your min endstop only triggers after the nozzle hits the bed and lowers a little more, then you could actually use M206 to specify that amount – and it should be a negative value in that case. Or, you should enable MANUAL_HOME_POSITIONS and set MANUAL_Z_HOME_POS to that same negative value and leave M206 Z ( home_offset[Z_AXIS]) set to 0.

Which value is it that you are currently setting to a positive value, which used to be negative?

— Reply to this email directly or view it on GitHub https://github.com/MarlinFirmware/Marlin/issues/2293#issuecomment-131465116 .

thinkyhead commented 9 years ago

@WheresWaldo I see. Well actually that value is used in set_axis_is_at_home which follows any homing operation. It's subtracted from the current Z position, like so:

if (axis == Z_AXIS) current_position[Z_AXIS] -= zprobe_zoffset;

Thus, after homing, your current Z position will be (for example) -0.5mm if you used M851 Z0.5. That positive value is correct, as it specifies the distance from the nozzle to the probe (in this case it's logically "above" the nozzle). And that line has been in MarlinDev/master (and Marlin/Development) for quite a while now – at least since May 26.

WheresWaldo commented 9 years ago

As long as you guys figure it out I will go along with whatever the decision is. I am using 1.1.0 Dev as a daily driver and it seems to be working well. I can live with any number regardless of sign.