Welcome! Log In Create A New Profile

Advanced

X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley

Posted by Grigo92 
X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley
December 04, 2015 02:38PM
Hello,

I'm working on my delta manipulator and I encountered some difficulties with the end stops.
It isn't supposed to be the 3d printer just yet, my goal is to simply make this thing reach it home position using mechanical end stops for now.
I select the homing option from my reprap discount lcd and all the carriages move to the top as they should.
Unfortunately, when they reach the end stops, the X one doesn't seem to work, while Y and Z work perfectly fine. I tried manually triggering this end stop and it acts as if I wasn't triggering it at all. The carriage continues trying to move to the top.
I can also make move all the carriages in X,Y,Z axis, the delta configurations seems to be working because all 3 carriages work together to move the effector to the right position. Just this homing doesn't work as it's supposed to.

I use 3 identical mechanical end stops, I wired them as NC to the maximum pins on the board. COM to ground and NC to signal.
I disabled the min end stops by using #define DISABLE_MIN_ENDSTOPS.
In configuration_adv.h I have the end stops defined to be used for homing only;
#define ENDSTOPS_ONLY_FOR_HOMING

#define X_HOME_POS MANUAL_X_HOME_POS
#define Y_HOME_POS MANUAL_Y_HOME_POS
#define Z_HOME_POS MANUAL_Z_HOME_POS


I tried replacing the end stops and it didn't work, it was all the same, the X-axis carriage continued to move despite triggering the end stop.

I measured the voltages on the end stops (between the NC and COM) to see if there's 5V after triggering the end stops. Both Y and Z have ~5V when I trigger them so the pull-ups seem to be working fine, but the measurements for the X end stop show only ~1.5V after triggering it.
I even tried using another ramps 1.4 and mega 2560 boards to see if the problem was with the faulty boards and it was the same, 5V for Y and Z end stops after triggering and about 0.1V on the X one, so I guess the problem is something in my software? Or am I just extremely unlucky and I have 2 faulty boards?

I'm also not sure about the pins.h config for X max and X min pins, when I got the firmware it was 3 for X min endstop and 2 for X max endstop, but I found on the Internet that it's supposed to be reverssed; 2 for min and 3 for max respectively. I tried it both ways and it didn't help solving the X end stop problem anyways...

I attach the configuration.h and pins.h files. Please ignore the //comments in Polish.


Thank you for your time in advance,
Greg

Edited 4 time(s). Last edit at 12/04/2015 03:00PM by Grigo92.
Attachments:
open | download - Configuration.h (6.3 KB)
open | download - pins.h (5.4 KB)
Re: X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley
December 05, 2015 03:39AM
I don't see anything wrong in your config...

Do you see 5V on the signal pin header of the Ramps-X-max Endstop?
It could be a wrong value for the pullup resistor. Cold soldered too.
Or maybe it's a faulty crimp connector?

-Olaf
Re: X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley
December 05, 2015 05:46AM
Hi Olaf,

I tried 2 different megas and 2 different ramps boards and there was always a 'weird' voltage on that X max signal, it was 1.5V and ~0.1V on the other board. I heard it's what may happen when the pin is floating or is 'off'. Someone has suggested to me that I should leave the configs as they are now and try wiring this X endstop to min instead of max as it is now. I will try doing that first thing on Monday. But I guess first I have to enable min end stops in config.h and then disable pins for Y and Z min end stops in pins.h leaving X pins enabled.
If that somehow worked, that would be a weird thing to see, because I tried reconfiguring pins for max and min pins in pins.h and it didn't work... I'm referring to this config in pins.h: [prntscr.com]
Re: X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley
December 06, 2015 04:51AM
Actually you only need to switch the pinmapping in pins.h to make the x-min input be seen as the x-max input.

Two boards from the same vendor and production batch can have the same errors. Just saying...
-Olaf
Re: X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley
December 06, 2015 05:42AM
That's what I tried to do and it didn't have any effect. The X axis was acting the very same way; X end stop wasn't working at all.

That's the part of pins.h configuration where I was switching between 2 3 and 3 2 with no effect:


It looks like these max pins on the board are 'off' no matter what I do, I'll try using this very same config and wiring this X end stop to min pin on the board to see what happens. If that fails, I will try using 2 max end stops and then min end stop for X axis, just by enabling this one X min end stop and reversing the X axis direction so it still will be homing at the top of the manipulator while the X end stop is the min one.

e/
There's also a little weird thing with Y axis I forgot to mention. It triggers and stops the motor fine, but I wanted it to retract by 10mm after 1st trigger and then slowly move to the 2nd trigger and then stop so I have a more accurate homing; Z does that exactly as desribed, while Y triggers only once and immediately stops the motor.


Edited 3 time(s). Last edit at 12/06/2015 07:45AM by Grigo92.
Re: X end stop doesn't work [Ramps 1.4 + Arduino Mega 2560, Marlin] confused smiley
December 07, 2015 03:01PM
Today I tried messing up with pins.h without any progress.
I noticed that X motor works even if I physically disconnect the end stop so it doesn't matter whether the X end stop is there, if I trigger it or not - the X axis won't cooperate when homing.
I have all my end stops connected to max pins on the board. Here's my pins.h config I'm using for my Mega:

#ifndef PINS_H
#define PINS_H

#define X_MS1_PIN -1
#define X_MS2_PIN -1
#define X_MS3_PIN -1
#define Y_MS1_PIN -1
#define Y_MS2_PIN -1
#define Y_MS3_PIN -1
#define Z_MS1_PIN -1
#define Z_MS2_PIN -1
#define Z_MS3_PIN -1

#define DIGIPOTSS_PIN -1


/****************************************************************************************
* Arduino Mega pin assignment
*
****************************************************************************************/
#if MOTHERBOARD == 33 
#define KNOWN_BOARD 1

#ifndef __AVR_ATmega1280__
 #ifndef __AVR_ATmega2560__
 #error Oops!  Make sure you have 'Arduino Mega' selected from the 'Tools -> Boards' menu.
 #endif
#endif




#if MOTHERBOARD == 33 

  #define LARGE_FLASH true

  

    #define X_STEP_PIN         54
    #define X_DIR_PIN          55
    #define X_ENABLE_PIN       38
    #define X_MIN_PIN           2
    #define X_MAX_PIN           3

    #define Y_STEP_PIN         60
    #define Y_DIR_PIN          61
    #define Y_ENABLE_PIN       56
    #define Y_MIN_PIN          14
    #define Y_MAX_PIN          15

    #define Z_STEP_PIN         46
    #define Z_DIR_PIN          48
    #define Z_ENABLE_PIN       62
    #define Z_MIN_PIN          18
    #define Z_MAX_PIN          19

    #define SDPOWER            -1
    #define SDSS               53
    #define LED_PIN            13

  #define PS_ON_PIN          12

  #if defined(REPRAP_DISCOUNT_SMART_CONTROLLER) || defined(G3D_PANEL)
    #define KILL_PIN           41
  #else
    #define KILL_PIN           -1
  #endif


   #ifdef ULTRA_LCD

    #ifdef NEWPANEL
      #define LCD_PINS_RS 16
      #define LCD_PINS_ENABLE 17
      #define LCD_PINS_D4 23
      #define LCD_PINS_D5 25
      #define LCD_PINS_D6 27
      #define LCD_PINS_D7 29

      #ifdef REPRAP_DISCOUNT_SMART_CONTROLLER
        #define BEEPER 37

        #define BTN_EN1 31
        #define BTN_EN2 33
        #define BTN_ENC 35

        #define SDCARDDETECT 49
      #elif defined(LCD_I2C_PANELOLU2)
        #define BTN_EN1 47  //reverse if the encoder turns the wrong way.
        #define BTN_EN2 43
        #define BTN_ENC 32
        #define SDSS 53
        #define SDCARDDETECT -1
        #define KILL_PIN 41
      #elif defined(LCD_I2C_VIKI)
        #define BTN_EN1 22  //reverse if the encoder turns the wrong way.
        #define BTN_EN2 7
        #define BTN_ENC -1
        #define SDSS 53
        #define SDCARDDETECT 49
      #else
        //arduino pin which triggers an piezzo beeper
        #define BEEPER 33  // Beeper on AUX-4

        //buttons are directly attached using AUX-2
        #ifdef REPRAPWORLD_KEYPAD
          #define BTN_EN1 64 // encoder
          #define BTN_EN2 59 // encoder
          #define BTN_ENC 63 // enter button
          #define SHIFT_OUT 40 // shift register
          #define SHIFT_CLK 44 // shift register
          #define SHIFT_LD 42 // shift register
        #else
          #define BTN_EN1 37
          #define BTN_EN2 35
          #define BTN_ENC 31  //the click
        #endif

        #ifdef G3D_PANEL
          #define SDCARDDETECT 49
        #else
          #define SDCARDDETECT -1  // Ramps does not use this port
        #endif

      #endif

      
    #else //old style panel with shift register
      //arduino pin witch triggers an piezzo beeper
      #define BEEPER 33		//No Beeper added

      //buttons are attached to a shift register
	// Not wired this yet
      //#define SHIFT_CLK 38
      //#define SHIFT_LD 42
      //#define SHIFT_OUT 40
      //#define SHIFT_EN 17

      #define LCD_PINS_RS 16
      #define LCD_PINS_ENABLE 17
      #define LCD_PINS_D4 23
      #define LCD_PINS_D5 25
      #define LCD_PINS_D6 27
      #define LCD_PINS_D7 29
    #endif
  #endif //ULTRA_LCD

#else // RAMPS_V_1_1 or RAMPS_V_1_2 as default (MOTHERBOARD == 3)
 #endif
// SPI for Max6675 Thermocouple

#ifndef SDSUPPORT
// these pins are defined in the SD library if building with SD support
  #define MAX_SCK_PIN          52
  #define MAX_MISO_PIN         50
  #define MAX_MOSI_PIN         51
  #define MAX6675_SS       53
#else
  #define MAX6675_SS       49
#endif

#endif //MOTHERBOARD == 3 || MOTHERBOARD == 33 || MOTHERBOARD == 34 || MOTHERBOARD == 35 || MOTHERBOARD == 77



#ifndef KNOWN_BOARD
#error Unknown MOTHERBOARD value in configuration.h
#endif

//List of pins which to ignore when asked to change by gcode, 0 and 1 are RX and TX, do not mess with those!


#ifdef X_STOP_PIN
  #if X_HOME_DIR < 0
    #define X_MIN_PIN X_STOP_PIN
    #define X_MAX_PIN -1
  #else
    #define X_MIN_PIN -1
    #define X_MAX_PIN X_STOP_PIN
  #endif
#endif

#ifdef Y_STOP_PIN
  #if Y_HOME_DIR < 0
    #define Y_MIN_PIN Y_STOP_PIN
    #define Y_MAX_PIN -1
  #else
    #define Y_MIN_PIN -1
    #define Y_MAX_PIN Y_STOP_PIN
  #endif
#endif

#ifdef Z_STOP_PIN
  #if Z_HOME_DIR < 0
    #define Z_MIN_PIN Z_STOP_PIN
    #define Z_MAX_PIN -1
  #else
    #define Z_MIN_PIN -1
    #define Z_MAX_PIN Z_STOP_PIN
  #endif
#endif

#ifdef DISABLE_MAX_ENDSTOPS
#define X_MAX_PIN          -1
#define Y_MAX_PIN          -1
#define Z_MAX_PIN          -1
#endif

#ifdef DISABLE_MIN_ENDSTOPS
#define X_MIN_PIN          -1
#define Y_MIN_PIN          -1
#define Z_MIN_PIN          -1
#endif

#define SENSITIVE_PINS {0, 1, X_STEP_PIN, X_DIR_PIN, X_ENABLE_PIN, X_MIN_PIN, X_MAX_PIN, Y_STEP_PIN, Y_DIR_PIN, Y_ENABLE_PIN, Y_MIN_PIN, Y_MAX_PIN, Z_STEP_PIN, Z_DIR_PIN, Z_ENABLE_PIN, Z_MIN_PIN, Z_MAX_PIN, PS_ON_PIN, \
                                          \
                                  \
                       }
#endif

Edited 1 time(s). Last edit at 12/07/2015 03:02PM by Grigo92.
Sorry, only registered users may post in this forum.

Click here to login