Welcome! Log In Create A New Profile

Advanced

Marlin upgrade and wrong coordinates

Posted by kevintshaver 
Marlin upgrade and wrong coordinates
January 28, 2019 02:09PM
I am trying to complete an upgrade on my Marlin firmware and I'm really struggling with getting all the movements and coordinates set up correctly. I've gotten to the point where everything moves in the correct directions when I control manually in Repetier. X & Y homing is no problem. When I home Z, the only way it will let me do it is to home X,Y&Z together. There seems quite a bit of difference in the configuration.h options between my older firmware and the 1.1 firmware I'm installing so I can't simply copy & paste the old settings.

The behavior before the firmware upgrade when homing X,Y&Z: printer travels to the X & Y endstops and then moved down to zero Z. When it reached the Z endstop, the print head would move up slightly (~ 3 mm) and then it was done. Repetier would report it's at the correct position 200mm,0mm,3mm.

New behavior: Repetier immediately reports the position as 200mm,0mm,0mm and does not change. The printer travels to the X & Y endstops and then moves to a point somewhat near the center of the build area (~60mm,120mm,2mm), then up a large distance (~12mm). Then it moves down till the endstop is triggered. Then up again (~3mm). The down to trigger endstop again, then finally up another 3mm. At the end it still report the position as 200mm,0mm,0mm when it's actually at 60mm,120mm,3mm.

Does anyone have an idea of what setting I should be looking at? Thanks.


// @section homing

//#define NO_MOTION_BEFORE_HOMING  // Inhibit movement until all axes have been homed

//#define UNKNOWN_Z_NO_RAISE // Don't raise Z (lower the bed) if Z is "unknown." For beds that fall when Z is powered off.

#define Z_HOMING_HEIGHT 2    // (in mm) Minimal z height before homing (G28) for Z clearance above the bed, clamps, ...
                             // Be sure you have this distance over your Z_MAX_POS in case.

// Direction of endstops when homing; 1=MAX, -1=MIN
// :[-1,1]
#define X_HOME_DIR 1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

// @section machine

// The size of the print bed
#define X_BED_SIZE (X_MAX_POS-X_MIN_POS)
#define Y_BED_SIZE (Y_MAX_POS-Y_MIN_POS)

// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS 200
#define Y_MAX_POS 200
#define Z_MAX_POS 160

/**
 * Software Endstops
 *
 * - Prevent moves outside the set machine bounds.
 * - Individual axes can be disabled, if desired.
 * - X and Y only apply to Cartesian robots.
 * - Use 'M211' to set software endstops on/off or report current state
 */

// Min software endstops constrain movement within minimum coordinate bounds
//#define MIN_SOFTWARE_ENDSTOPS
#if ENABLED(MIN_SOFTWARE_ENDSTOPS)
  #define MIN_SOFTWARE_ENDSTOP_X
  #define MIN_SOFTWARE_ENDSTOP_Y
  #define MIN_SOFTWARE_ENDSTOP_Z
#endif

// Max software endstops constrain movement within maximum coordinate bounds
#define MAX_SOFTWARE_ENDSTOPS
#if ENABLED(MAX_SOFTWARE_ENDSTOPS)
  #define MAX_SOFTWARE_ENDSTOP_X
  #define MAX_SOFTWARE_ENDSTOP_Y
  #define MAX_SOFTWARE_ENDSTOP_Z
#endif

#if ENABLED(MIN_SOFTWARE_ENDSTOPS) || ENABLED(MAX_SOFTWARE_ENDSTOPS)
  //#define SOFT_ENDSTOPS_MENU_ITEM  // Enable/Disable software endstops from the LCD
#endif
Re: Marlin upgrade and wrong coordinates
January 28, 2019 03:26PM
Marlin has a function Z_SAFE_HOMING this will allow the nozzle to kind of an "offset center of the bed". depending on the margins and probe location offset area.
It also has functions of Z_CLEARANCE_DEPLOY_PROBE 10 which will allow the nozzle to stop 10 mm above the bed + Z_PROBE_OFFSET_FROM_EXTRUDER -0.5 to deploy a Probe.

If you upload your configuration.h and configuration_adv.h to something like google drive, then post a link we can look and know more about what it is doing...


Computer Programmer / Electronics Technician
Re: Marlin upgrade and wrong coordinates
January 28, 2019 10:06PM
Hello and thanks for the quick answers. I do in fact have the Z_SAFE_HOMING set so that does explain why it moves to the chosen location for z homing. I guess now I am just trying to solve why Repetier reports the location as 200,0,0 after homing rather than where the nozzle actually is. If you are willing to take a look at the config files I would appreciate the help. Thanks.

Configuration.h

Configuration_adv.h
Re: Marlin upgrade and wrong coordinates
January 29, 2019 07:32AM
The only thing I see is you are using variables before they are defined. They may have allowed for this but as a programmer this is really not a good ideal.

#define X_BED_SIZE (X_MAX_POS-X_MIN_POS)
#define Y_BED_SIZE (Y_MAX_POS-Y_MIN_POS)

should look like this
#define X_BED_SIZE 200
#define Y_BED_SIZE 200

// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS X_BED_SIZE
#define Y_MAX_POS Y_BED_SIZE
#define Z_MAX_POS 160

Or

// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS 0
#define Y_MIN_POS 0
#define Z_MIN_POS 0
#define X_MAX_POS 200
#define Y_MAX_POS 200
#define Z_MAX_POS 160

#define X_BED_SIZE (X_MAX_POS-X_MIN_POS)
#define Y_BED_SIZE (Y_MAX_POS-Y_MIN_POS)

Edited 1 time(s). Last edit at 01/29/2019 07:39AM by Roberts_Clif.


Computer Programmer / Electronics Technician
Re: Marlin upgrade and wrong coordinates
January 31, 2019 01:11PM
I want to put a final update on here. Thanks for helping me figure this out.

The problem (Repetier showing wrong coordinates after homing) was solved by doing two things.

1. Upgrade Repetier host software to the latest version. This fixed the x and y coordinate discrepancy with Repetier. At this point x & y were correct after homing but Z was still of by 10.75mm. I think it may be related to the issue in this thread: github Marlin issue

2. Change Z_PROBE_OFFSET_FROM_EXTRUDER from the default setting of -10.75 to 0. I did not make any changes to the stock setting for X_PROBE_OFFSET_FROM_EXTRUDER 38 or Y_PROBE_OFFSET_FROM_EXTRUDER -7.
Sorry, only registered users may post in this forum.

Click here to login