Welcome! Log In Create A New Profile

Advanced

Three quick questions

Posted by aamcle 
Three quick questions
February 09, 2019 08:45AM
I have Marlin 2.0 set up on a MKS Gen L every thing is moving in the right directions, homing and heating but there are still a few issues.

Getting it to print in the middle of the bed, I put a test print in the middle of Cura's build platform and the extruder tried to come out of the front of the printer. Which was interesting but not helpful.

1. How do I sort that out? Is it controlled by home offsets?

I'm really struggling to understand the how Marlin handles motion, endstops, invertion, offsets, bed size, travel limits and such.

2, Please can you recommend something I can read? The manual tells me " How to turn a knob" but doesn't give me the overview I need. Why should I turn it and how will it interact with other settings?

Unfortunately I one of the unlucky Gen L owners who have a board that won't drive any of the reprap displays even though I have tried every fix I can find on the net. So I'm considering buying a board from a reputable manufacturer even though it's going to be costly.

Thanks All. Aamcle
Re: Three quick questions
February 09, 2019 08:24PM
there are two parts to printing in the center correctly

1) that the printer X and Y home position (0,0) is actually at 0,0 on the bed
2) that you have the correct bed dimensions defined in your slicer


for 1) simply power on your machine, move Z out of the way so it will not hit anything when X and Y are homed.
Home X and Y axis (use a control program or send the printer: G28 X Y)
move to 0,0 and verify you are physically at position 0,0 (send the printer: G1 X0 Y0 F500) This may not be needed depends if you home to max or not...

If it is not at 0,0 you need to work out why.

its all comes down to this bit of code in configuration.h

// The size of the print bed
#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 200


Firstly the bed size needs to be the print size of your bed.
If you home to min endstops you need to adjust the MIN_POS to match you machine.
This is the home position in relation to 0,0, eg #define X_MIN_POS -10 if X min endstop is left 10 mm from 0
If you home to max endstops you need to adjust the MAX_POS to match your machine
eg #define X_MAX_POS X_BED_SIZE +10 if the X max endstop is right 10mm from X_BED_SIZE


For cura setting see [ultimaker.com]
Re: Three quick questions
February 10, 2019 03:30AM
Thanks Dust.

Aamcle
Re: Three quick questions
February 10, 2019 03:54PM
May I ask about the movement controls?

When I auto home the axis moves in the direction specified by the line in Marlin.

// Direction of endstops when homing; 1=MAX, -1=MIN

#define X_HOME_DIR 1
#define Y_HOME_DIR 1
#define Z_HOME_DIR -1

This home position then becomes the reference point and origin for any subsequent movement, movement from that position is measured in steps or mm. I think I'm correct so far.

My bed.

// The size of the print bed
#define X_BED_SIZE 230
#define Y_BED_SIZE 150

I start getting lost at this point.

When homed my extruder nozzle is 38mm off the bed to the right in the X+ direction and 2mm off the back of the bed in the Y+ direction.

Is this correct?

#define X_MIN_POS (38)
#define Y_MIN_POS (2)
#define Z_MIN_POS 0
#define X_MAX_POS (268)
#define Y_MAX_POS (152)
#define Z_MAX_POS (145)


I'm still unsure how to use Marlin to get it to print in the central of them bed.


Thanks All


Thanks
Re: Three quick questions
February 10, 2019 05:42PM
X min and Y min should be 0
Re: Three quick questions
February 10, 2019 07:40PM
// Direction of endstops when homing; 1=MAX, -1=MIN

#define X_HOME_DIR 1
#define Y_HOME_DIR 1
#define Z_HOME_DIR -1

This home position then becomes the reference point and origin for any subsequent movement, movement from that position is measured in steps or mm. I think I'm correct so far.


Yes, after the machine has homed it thinks it knows where it is.

When homed my extruder nozzle is 38mm off the bed to the right in the X+ direction and 2mm off the back of the bed in the Y+ direction."

Is this correct?


no. and you don't need all the ()'s

lets start with X
you have set #define X_HOME_DIR 1, so the x endstop is on the right hand side of the machine.
The firmware it will look at X_MAX_POS to set this home location
You also say that "extruder nozzle is 38mm off the bed to the right in the X+"
so you need
#define X_MAX_POS X_BED_SIZE + 38
let the compiler do the math for you.
then the min becomes #define X_MIN_POS 0


And now Y (I presume you have a I3 type machine where the bed moves in Y)
You have said "#define Y_HOME_DIR 1"
But you also say "2mm off the back of the bed in the Y+ direction."
If the Y endstop is at the back of the machine, this is the min Y endstop and the bed moving back is Y-
People often get this confused because the bed moves and not the head.
Look a the position of the nozzle on the bed. When Y is homed the bed will be fully back and the nozzle will be over front of the build platform. As you move the bed forward the nozzle moves from 0 to a higher position, so moving forward is y+
You need to set #define Y_HOME_DIR -1
and now since we are looking the the Y_MIN_POS we need to account for the 2mm off the back
so set
#define Y_MIN_POS -2
And the max become
#define Y_MAX_POS Y_BED_SIZE
I also suspect you will need to change #define INVERT_Y_DIR
If it currently says true change it to false or if it currently says false change it to true

Z is fine as
#define Z_MIN_POS 0
#define Z_MAX_POS 145

Edited 2 time(s). Last edit at 02/10/2019 08:49PM by Dust.
Re: Three quick questions
February 11, 2019 08:24AM
Dust.

The printer is a CTC Replicator Dual, it homes to Z Top, X Right, Y Back, the X endstop is on the right of the gantry, the Y endstop is at the left back and the Z endstop is at the top.

The enstops are plugged into Zmin, X max and Y max on the MKS Gen L board.

The build plate only goes up and down.

Homing the axis sends them in the correct directions, right, back and up so that at least seems to be correct. The nozzle when homed is 38 mm to the right (X+) of the bed and 2mm behind (Y+) the bed.

I want the beds origin to match my slicers so it should be in the front left corner. As a result of that choice Y gets higher to the back of the bed and X gets higher as it moves to the right.

I think this must be correct for the movement limits :-

// 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 (268) (thats 230 + 38mm)
#define Y_MAX_POS (152) (thats 150 + 2mm)
#define Z_MAX_POS (145)

Am I right? I not why not? sad smileysad smiley


I’ve included the relevant sections from configuration.h just in case but hopefully they are not needed.

And thanks again for looking over this.

Alan



// Almost all printers will be using one per axis. Probes will use one or more of the
// extra connectors. Leave undefined any used for non-endstop and non-probe purposes.
//#define USE_XMIN_PLUG
//#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
#define USE_XMAX_PLUG
#define USE_YMAX_PLUG
//#define USE_ZMAX_PLUG
The enstops are plugged into Zmin, X max and Y max on the MKS Gen L board.

// Mechanical endstop with COM to ground and NC to Signal uses "false" here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true// set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING true // set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING true // set to true to invert the logic of the probe.

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

// 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 230
#define Y_BED_SIZE 150

// 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 (268)
#define Y_MAX_POS (152)
#define Z_MAX_POS (145)

Re: Three quick questions
February 11, 2019 09:24AM
ok... a replicator clone.... not an I3 type.

Yes this now looks correct for your machine. thumbs up

no way to tell if these are ok by looking at the config file.
#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false
basically if the axis goes the wrong way, then invert that axis.

Just note on your machine Z+ will move the bed down (increasing space between head and bed) and Z- will move the bed up (decreasing space from head to bed)
Re: Three quick questions
February 11, 2019 12:29PM
Thanks Dust,

I've been banging my head on this for some time, I wanted to understand it not just get it going.



Atb. Aamcle
Sorry, only registered users may post in this forum.

Click here to login