Welcome! Log In Create A New Profile

Advanced

Marlin homing problem

Posted by thren 
Marlin homing problem
January 17, 2016 01:20AM
After putting my i3 rework in storage and waiting a few months Im ready to be confused again and have started trying to get it working smiling smiley
Built from parts.
All of yesterday.... trying to get endstops working.. finally got everything going in the correct direction and endstops working.

endstop setup is ...x endstop RH side of carriage. Y endstop at rear of carriage, z endstop left hand side and at bottom.

When I hit the home all button in pronterface all axis home.
They all then retract a bit. so the extruder ends up about 8mm above the bed and x and y maybe about 15 - 20 mm in from endstop.
I cannot manually move the motors in pronterface after homing.
Attached is my endstop marlin code. Any help appreciated, need the motors to move to continue calibration.

Cheers

//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================

// Uncomment the following line to enable CoreXY kinematics
// #define COREXY

// 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_YMAX
  // #define ENDSTOPPULLUP_ZMAX
  // #define ENDSTOPPULLUP_XMIN
  // #define ENDSTOPPULLUP_YMIN
  // #define ENDSTOPPULLUP_ZMIN
#endif

#ifdef ENDSTOPPULLUPS
  #define ENDSTOPPULLUP_XMAX
  #define ENDSTOPPULLUP_YMAX
  #define ENDSTOPPULLUP_ZMAX
  #define ENDSTOPPULLUP_XMIN
  #define ENDSTOPPULLUP_YMIN
  #define ENDSTOPPULLUP_ZMIN
#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 Y_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.
const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
//#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS

// Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
  #define DISABLE_MAX_ENDSTOPS
#endif

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define E_ENABLE_ON 0 // For all extruders

// Disables axis when it's not being used.
#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z false
#define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled

#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR true    // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR false   // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false

// 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.

// Travel limits after homing
#define X_MAX_POS 0
#define X_MIN_POS 250
#define Y_MIN_POS 210
#define Y_MAX_POS 0
#define Z_MAX_POS 0
#define Z_MIN_POS 180

#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)
Re: Marlin homing problem
January 17, 2016 04:36AM
"endstop setup is ...x endstop RH side of carriage. Y endstop at rear of carriage, z endstop left hand side and at bottom."

so x is a max endstop, y is a min endstop and z is a min endstop

so

// 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

should be

// 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


now if it homes in the wrong direction you have to invert the axis direction, not the homeing direction.

ie play with the following as needed

#define INVERT_X_DIR true
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false

NB you haven’t mentioned your controller, some controllers, like ramps for eg, have different pins for min and max endstops, make sure this is also correct or the axis will not stop when it hits the endstop.

Edited 2 time(s). Last edit at 01/17/2016 04:42AM by Dust.
Re: Marlin homing problem
January 17, 2016 06:18AM
Thanks for the help, controller is ramps 1.4,
will change config to your suggestion and see how it goes
and yes, I got a hand on the different endstop pinouts on the board.......

Last time I got this far it did my head in grinning smiley and put it in storage, this time Im hoping to get a bit further.

Edited 1 time(s). Last edit at 01/17/2016 06:20AM by thren.
Re: Marlin homing problem
January 17, 2016 06:56AM
Have done this

Quote


"should be
// 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

now if it homes in the wrong direction you have to invert the axis direction, not the homeing direction. ie play with the following as needed
#define INVERT_X_DIR true
#define INVERT_Y_DIR true
#define INVERT_Z_DIR false"

for my sanity Im happy working out 1 axis at a time cause once I get one the other 2 will follow.....so after setting the above...and setting home direction correctly on X axis...

X travels in correct direction
m119 shows x max triggered
switch is plugged into ramps 1.4 x+ pins
when I home x wants to over run the axis.


#define INVERT_X_DIR true    // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR true   // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR false   // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false

// 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.

// Travel limits after homing
#define X_MAX_POS 0
#define X_MIN_POS 200
#define Y_MIN_POS 0
#define Y_MAX_POS 210
#define Z_MAX_POS 180
#define Z_MIN_POS 0

#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)

thanks for your time

Edited 1 time(s). Last edit at 01/17/2016 07:05AM by thren.
Re: Marlin homing problem
January 17, 2016 07:08AM
k smiling smiley happy days Y and z are working as they should. I think I can sort x out now those 2 axis are working, x is over running home.

thanks for the help so far
Re: Marlin homing problem
January 17, 2016 07:46AM
Himm, X max should be working.. I'm wondering if you have dodgy switch, ie when the carriage hit the endstop it doesn't trigger

move the carriage far right but not hitting the endstop. Send m119 X-Max should be open
move the carriage right a bit more till it hits the endstop. Send m119 X-Max should be triggered
Re: Marlin homing problem
January 18, 2016 04:17AM
Quote
Dust


move the carriage far right but not hitting the endstop. Send m119 X-Max should be open
move the carriage right a bit more till it hits the endstop. Send m119 X-Max should be triggered

The above is true in pronterface, so end stop is triggered as it should but it still wants to over run the home.
lol, this is about where I got to by myself last time and gave up smiling smiley

do you think it might need adjustment in this code, even though it is counter intuitive ?
//
Travel limits after homing
#define X_MAX_POS 0
#define X_MIN_POS 250
#define Y_MIN_POS 210
#define Y_MAX_POS 0
#define Z_MAX_POS 0
#define Z_MIN_POS 180


also looking at the code the y min/ max code is out of order, not that it should matter , but thats my bodgy coding... will fix it next upload...
again , thanks for the help

Edited 1 time(s). Last edit at 01/18/2016 04:19AM by thren.
Re: Marlin homing problem
January 18, 2016 04:35AM
thats just wrong.... and backwards

If you home to max then tell the printer its now at 0... no idea what that would do... break thing I would guess

also the next line is
#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)

so your printer is X -250 by Y -210, Z -180, which is just silly...

try the defaults.
#define X_MIN_POS 0
#define X_MAX_POS 205 // important to get this correct, as it will move this far left to get to 0
#define Y_MIN_POS 0
#define Y_MAX_POS 205
#define Z_MIN_POS 0
#define Z_MAX_POS 180

Edited 4 time(s). Last edit at 01/18/2016 04:52AM by Dust.
Re: Marlin homing problem
January 18, 2016 05:51AM
I owe you a beer "Dust"
axis are now homing correctly, thank you so very much your a champ.
The final bed dimensions need some work but at least it now homes as expected.

code ended up like this..
//===========================================================================
//=============================Mechanical Settings===========================
//===========================================================================

// Uncomment the following line to enable CoreXY kinematics
// #define COREXY

// 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_YMAX
  // #define ENDSTOPPULLUP_ZMAX
  // #define ENDSTOPPULLUP_XMIN
  // #define ENDSTOPPULLUP_YMIN
  // #define ENDSTOPPULLUP_ZMIN
#endif

#ifdef ENDSTOPPULLUPS
  #define ENDSTOPPULLUP_XMAX
  #define ENDSTOPPULLUP_YMAX
  #define ENDSTOPPULLUP_ZMAX
  #define ENDSTOPPULLUP_XMIN
  #define ENDSTOPPULLUP_YMIN
  #define ENDSTOPPULLUP_ZMIN
#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 Y_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.
const bool X_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool Y_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
const bool Z_MAX_ENDSTOP_INVERTING = true; // set to true to invert the logic of the endstop.
//#define DISABLE_MAX_ENDSTOPS
//#define DISABLE_MIN_ENDSTOPS

// Disable max endstops for compatibility with endstop checking routine
#if defined(COREXY) && !defined(DISABLE_MAX_ENDSTOPS)
  #define DISABLE_MAX_ENDSTOPS
#endif

// For Inverting Stepper Enable Pins (Active Low) use 0, Non Inverting (Active High) use 1
#define X_ENABLE_ON 0
#define Y_ENABLE_ON 0
#define Z_ENABLE_ON 0
#define E_ENABLE_ON 0 // For all extruders

// Disables axis when it's not being used.
#define DISABLE_X false
#define DISABLE_Y false
#define DISABLE_Z false
#define DISABLE_E false // For all extruders
#define DISABLE_INACTIVE_EXTRUDER true //disable only inactive extruders and keep active extruder enabled

#define INVERT_X_DIR false   // for Mendel set to false, for Orca set to true
#define INVERT_Y_DIR true   // for Mendel set to true, for Orca set to false
#define INVERT_Z_DIR false   // for Mendel set to false, for Orca set to true
#define INVERT_E0_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E1_DIR false    // for direct drive extruder v9 set to true, for geared extruder set to false
#define INVERT_E2_DIR false   // for direct drive extruder v9 set to true, for geared extruder set to false

// 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.

// Travel limits after homing
#define X_MAX_POS 205
#define X_MIN_POS 0
#define Y_MAX_POS 205
#define Y_MIN_POS 0
#define Z_MAX_POS 180
#define Z_MIN_POS 0

#define X_MAX_LENGTH (X_MAX_POS - X_MIN_POS)
#define Y_MAX_LENGTH (Y_MAX_POS - Y_MIN_POS)
#define Z_MAX_LENGTH (Z_MAX_POS - Z_MIN_POS)

Im not as stupid as I seem winking smiley but endstop coding is an arcane science to me.
Re: Marlin homing problem
January 18, 2016 03:12PM
First print 20mm cube. Other than the base flaring out it measures 19.88mm all round so Im pretty happy. thanks again.

Sorry, only registered users may post in this forum.

Click here to login