Z Homing and Endstop?

Topics Related to the ORD Bot Printer

Z Homing and Endstop?

Postby tylerv » Mon May 07, 2012 2:55 am

Has anyone else had trouble with their Z-axis endstop?

I've gotten the Z-axis homing working when the endstop is at the bottom, but according to this post, having it at the top is easier in the long run.

When I set up the Marlin config for having the endstop at the top of the Z-axis, the Z-home button in Pronterface does nothing. Similarly, when running a print, X and Y home correctly and the Z stays where ever it was to begin with. Any suggestions?

Here's the Marlin configs I have so far:
Z-axis Endstop at Bottom (works, but not ideal)
Code: Select all
//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================
// Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.

#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#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 max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
#define X_MAX_LENGTH 205
#define Y_MAX_LENGTH 205
#define Z_MAX_LENGTH 200

// The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
#define X_HOME_POS 0
#define Y_HOME_POS 0
#define Z_HOME_POS 0



Z-axis Endstop at Top (doesn't work)
Code: Select all
//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================
// Endstop Settings
#define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

// The pullups are needed if you directly connect a mechanical endswitch between the signal and ground pins.
const bool X_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
const bool Y_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.
const bool Z_ENDSTOPS_INVERTING = true; // set to true to invert the logic of the endstops.

#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR false    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR true     // for Mendel set to false, for Orca set to true

// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#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 max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
#define X_MAX_LENGTH 205
#define Y_MAX_LENGTH 205
#define Z_MAX_LENGTH 200

// The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
#define X_HOME_POS 0
#define Y_HOME_POS 0
#define Z_HOME_POS Z_MAX_LENGTH


Thanks,
--Tyler V.
tylerv
 
Posts: 95
Joined: Thu Mar 03, 2011 4:54 am
Location: Utah, USA

Re: Z Homing and Endstop?

Postby tylerv » Mon May 07, 2012 6:37 am

Okay, false alarm, I figured out why it wouldn't work right.

Turns out in the Pin.h file there are pin numbers assigned for each of the different types of motherboards the firmware will work on. Not knowing about this file, I traced down the Z_HOME_DIR variable to the #define HOMEAXIS(LETTER) macro in Marlin.pde and found that it checks MAX_PIN and MIN_PIN against the homing direction. Searched for that and found the pins.h file where the section for my motherboard only had the Z_MIN_PIN defined. Swapped the values for Z_MAX_PIN and Z_MIN_PIN and everything worked as expected.

Here's the working config (for posterity's sake):

Configuration.h
Code: Select all
// ENDSTOP SETTINGS:
// Sets direction of endstops when homing; 1=MAX, -1=MIN
#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 max_software_endstops true  //If true, axis won't move to coordinates greater than the defined lengths below.
#define X_MAX_LENGTH 205
#define Y_MAX_LENGTH 205
#define Z_MAX_LENGTH 200

// The position of the homing switches. Use MAX_LENGTH * -0.5 if the center should be 0, 0, 0
#define X_HOME_POS 0
#define Y_HOME_POS 0
#define Z_HOME_POS 0


Pins.h
Code: Select all
#if MOTHERBOARD == 62
#undef MOTHERBOARD
#define MOTHERBOARD 6
#define SANGUINOLOLU_V_1_2
#endif
#if MOTHERBOARD == 6
#define KNOWN_BOARD 1
#ifndef __AVR_ATmega644P__
#ifndef __AVR_ATmega1284P__
#error Oops!  Make sure you have 'Sanguino' selected from the 'Tools -> Boards' menu.
#endif
#endif

#define X_STEP_PIN         15
#define X_DIR_PIN          21
#define X_MIN_PIN          18
#define X_MAX_PIN           -1

#define Y_STEP_PIN         22
#define Y_DIR_PIN          23
#define Y_MIN_PIN          19
#define Y_MAX_PIN          -1

#define Z_STEP_PIN         3
#define Z_DIR_PIN          2
#define Z_MIN_PIN          -1
#define Z_MAX_PIN          20
tylerv
 
Posts: 95
Joined: Thu Mar 03, 2011 4:54 am
Location: Utah, USA


Return to ORD Bot

Who is online

Users browsing this forum: No registered users and 50 guests

cron