Welcome! Log In Create A New Profile

Advanced

RAMPS 1.4 and MEGA 2560 Printer Setup Help

Posted by JakeKusters 
RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 09, 2020 03:14AM
Howdy

I've claimed this reprap printer from a mate, it was a project for guys doing an apprenticeship and it fell by the way side. I couldn't let it be thrown away or just left to gather dust. I'm experienced in 3D printing and have some Arduino exposure.

The pictures are representative of the state that the below code is from and what Pronterface is throwing at me. At the moment it won't move anywhere (I'm assuming because of endstops being triggered). From what I can tell the remainder of the machine is working, the bed warms up along with the extruder.

The firmware is stock, I've tried messing with it but it didn't get better or worse. Mostly found that the endstops didn't prevent travel. I'll need to calibrate movement at some stage as I don't believe it is travelling the 200mm correctly however that is a future Jake problem. Any help would be greatly appreciated, combine this with my Ender 5 I will be killing it.

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

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

// corse Endstop Settings
// #define ENDSTOPPULLUPS // Comment this out (using // at the start of the line) to disable the endstop pullup resistors

#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_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 DISABLE_MAX_ENDSTOPS


// 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 INVERT_X_DIR false    // 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
#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 200
#define X_MIN_POS 0
#define Y_MAX_POS 200
#define Y_MIN_POS 0
#define Z_MAX_POS 200
#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)

// The position of the homing switches
//#define MANUAL_HOME_POSITIONS  // If defined, MANUAL_*_HOME_POS below will be used
//#define BED_CENTER_AT_0_0  // If defined, the center of the bed is at (X=0, Y=0)

//Manual homing switch locations:
#define MANUAL_X_HOME_POS 0
#define MANUAL_Y_HOME_POS 0
#define MANUAL_Z_HOME_POS 0

//// MOVEMENT SETTINGS
#define NUM_AXIS 4 // The axis order in all axis related arrays is X, Y, Z, E
#define HOMING_FEEDRATE {50*60, 50*60, 4*60, 0}  // set the homing speeds (mm/min)

Pronterface:

SENDING:M119
Reporting endstop status
x_min: TRIGGERED
x_max: TRIGGERED
y_min: TRIGGERED
y_max: TRIGGERED
z_min: TRIGGERED
z_max: TRIGGERED
Re: RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 09, 2020 04:21AM
with endstops triggered you cant home... so you want that fixed.

most people have switch based endstops, either 2 or 3 wires.

if you have two wire endstops you need ENDSTOPPULLUPS enabled.

It is most important these are wired correctly
the ramps endstop plugs have 3 pins, Top is Signal, middle is gnd, and bottom is 5v. It is vitally important that you do not short 5v to gnd via the switch!
for two pins use S and gnd pins.

there are positions for x-min, x-max, y-min, y-max, z-min and z-max
Your config says your homing to min positions ie you should have endstops plugged into the blue areas on this image


It could also be that the switches are just inverted in software.

if you hold down the X endstop and while holding it down send a M119 does it say open?
If it does you just need to invert the endstop ie X_ENDSTOPS_INVERTING change to false.

Edited 6 time(s). Last edit at 08/09/2020 04:50AM by Dust.
Re: RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 09, 2020 07:28AM
Hey

Thanks for helping, these pics may give some more info on what I'm working with:

[ibb.co]
[ibb.co]
[ibb.co]

I've got optical endstops however when I do cut the beam it does this:

x_min: TRIGGERED
x_max: open
y_min: TRIGGERED
y_max: TRIGGERED
z_min: TRIGGERED
z_max: TRIGGERED

3 wire endstops as well. I'm going off that the printer worked at some stage before (that's what I've been told anyway) however I'm up for changing anything. Am I right in thinking the x endstop is incorrect? Also this is just default firmware so how it relates to my current setup may not be one in the same.
Re: RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 09, 2020 08:07AM
I think i've seen pictures of that machine before... years ago...

First thing end stops are physically at right, back and down positions
in config that is the following

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

Endstops look to be plugged correctly into the ramps for this configuration.

you may also find a section like the following, make it look like this. this will remove unused endstop pins from M119 report
//#define USE_XMIN_PLUG
#define USE_YMIN_PLUG
#define USE_ZMIN_PLUG
#define USE_XMAX_PLUG
//#define USE_YMAX_PLUG
//#define USE_ZMAX_PLUG

From what you have told me yes the endstops are inverted
so change to
const bool X_ENDSTOPS_INVERTING = false
const bool Y_ENDSTOPS_INVERTING = false 
const bool Z_ENDSTOPS_INVERTING = false

If that make the endstops work as expected, next thing to check is direction of movement.

in pronterface tell x to move in a positive direction. check the head moves right. if it move left change INVERT_X_DIR to true
next check Y (its reverse of what you think) move in a positive direction, the bed should move forward. If it moves back change INVERT_Y_DIR to true
then check Z. move in a positive direction, Head should move up. If it moves down change INVERT_Z_DIR to flase.


Once these are all correct, carefully try and home the X axis, then the Y and finally Z. (ie have finger on the power switch! ready to turn off)
X and Y aren't a problem, you can just let them run, but for Z I would test with something ready to put in the opto endstop manually and test it that way.. you don't want to ram the hotend through the bed,

Only once your sure Z endstop is in correct place that hotend wont damage the bed do real z homing.

Edited 1 time(s). Last edit at 08/09/2020 08:09AM by Dust.
Re: RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 10, 2020 05:26AM
Awesome so I think we are on to something.

I couldn't find the plug code however I'm not sure it has made much difference. I had to invert the travel direction of the X axis as it was trying to home in the other direction of the endstop.

At home this is what I have:

x_min: open
x_max: TRIGGERED
y_min: TRIGGERED
y_max: open
z_min: TRIGGERED
z_max: open

So I guess my next two questions are:

1. Does the following movements out of home look correct:
X: Movement in X- direction required (this confuses me).
Y: Movement in Y+ direction required.
Z: Movement in Z+ direction required

2. I'm telling it to move a total of 200 on Pronterface which equates to half the bed. Is there a guide on adjusting this?

Also I really appreciate the help, I've never been this close to success!
Re: RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 10, 2020 08:08AM
1) yes, because your X home is at the right, home location is X200. your only option is left

2) there are two things at play here Steps/mm and microstepping.

Under each stepper driver are 3 sets of jumpers. These set the microstepping. You need to know what these are set to.
You also need to know your stepper drivers. as different stepper drivers uses the micro stepping jumpers differently.

The steps/mm is calculated from math... or use an online calculator
eg [blog.prusaprinters.org] scroll down to stepper motors

The other option is to simply move and measure. Calculate percentage difference and adjust the steps/mm
for eg you say it you requested 200, it moved 100, so multiple current steps/mm by 2.

These can be adjusted by editing Configuration.h
a line something like #define DEFAULT_AXIS_STEPS_PER_UNIT { 80, 80, 4000, 500 }

Here is a gotcha, if you have eeprom enabled eeprom values are used over firmware settings.

in that case use M92 see [marlinfw.org]
set the new steps/mm then save settings with a M500
Re: RAMPS 1.4 and MEGA 2560 Printer Setup Help
August 15, 2020 11:39PM
Just an update. I seem much closer to printing. I've adjusted those values and it travels the size of the bed (need to adjust Y endstop as it is just a smidge too long). Next test will be clearing out the nozzle and seeing how filament goes but I'm more over that now because of works printers issues.

I appreciate the help.
Sorry, only registered users may post in this forum.

Click here to login