Welcome! Log In Create A New Profile

Advanced

Auto Bed Leveling Compile problem

Posted by Harvey_S 
Auto Bed Leveling Compile problem
March 19, 2016 11:13AM
I am building a home brew printer and have run into a problem with auto bed leveling (ABL).
The printer has a large print volume or 340 x 400 x 360, and is a gantry design with the bed only moving in the Z axis direction. My electronics is an Arduino Mega2650 clone with a Ramps 1.4 IO board. Everything works well other than the ABL.
When I decided to add auto bed leveling, I updated to the latest stable Marlin (1.1.0-RC3 - 01 December 2015). One decision that I made (and the source of my problems), is to keep the Z home switch separate from the Z probe used for ABL. I reassigned IO pins so that the pin normally used for Z_max (19) is now the Z_probe pin and left Z_min as it was. This is probably not necessary, but I feel better about having the ability to reconfigure the machine without moving wires around and it puts all of the endstops in one area.

From Pins_Ramps_13.h;

#define Z_MIN_PIN 18
//#define Z_MAX_PIN 19 // Swapped Z_MAX_PIN with Z_MIN_PROBE_PIN
#define Z_MAX_PIN 32
................
#if ENABLED(Z_MIN_PROBE_ENDSTOP)
// Define a pin to use as the signal pin on Arduino for the Z_PROBE endstop.
#define Z_MIN_PROBE_PIN 19 // Swapped Z_MAX_PIN with Z_MIN_PROBE_PIN
#endif

When I first compiled the code, I did not enable this line

#define DISABLE_Z_MIN_PROBE_ENDSTOP

in Configuration.h and the system responded to the G29 command without ever moving the gantry. I think this is because it was using the Z_min endstop input and that was always satisfied after doing a Z home.
A check of the inputs with M119 showed that X,Y,Z and Z probe were being sensed correctly.
The meaning of that line was somewhat ambiguous. I think it means not to use the Z probe as the endstop. So I enabled the line and recompiled. This resulted in an error message from SanityCheck.h. The lines in SanityCheck.h are:

#if ENABLED(Z_MIN_PROBE_ENDSTOP)
#if !PIN_EXISTS(Z_MIN_PROBE)
#error You must have a Z_MIN_PROBE_PIN defined in your pins_XXXX.h file if you enable Z_MIN_PROBE_ENDSTOP.
#endif

I traced this back to the following lines in Pins.h;


#if ENABLED(DISABLE_Z_MIN_PROBE_ENDSTOP) || DISABLED(Z_MIN_PROBE_ENDSTOP) // Allow code to compile regardless of Z_MIN_PROBE_ENDSTOP setting.
#undef Z_MIN_PROBE_PIN
#define Z_MIN_PROBE_PIN -1
#endif

Now this says that it allows the code to compile regardless of Z_MIN_PROBE_ENDSTOP setting, but it seems to be doing the opposite.
As a test I added

#define Z_MIN_PROBE_PIN 19

immediately after the #endif and the code compiles. I wont leave a kludge like that in my software, but it helps to identify what is happening.
I haven't had a chance to run this on the machine yet, So I don't know that the problem behavior has been fixed. I am looking for an understanding of the software and it's behavior.
Can somebody help me understand what I have to do to enable separate Z_min and Z_probe inputs.
Re: Auto Bed Leveling Compile problem
March 19, 2016 05:43PM
Quote
Harvey_S
When I decided to add auto bed leveling, I updated to the latest stable Marlin (1.1.0-RC3 - 01 December 2015). One decision that I made (and the source of my problems), is to keep the Z home switch separate from the Z probe used for ABL.

You may not realize this... But the RCBugFix branch is always better than the RC branch... The RC branch is frozen and RCBugFix is the RC branch with bug fixes applied to it.

You would be much better off using RCBugFix !
Sorry, only registered users may post in this forum.

Click here to login