Endstop

2»

Comments

  • What I mean is the report happens after Endstops::update() is called, but there are many places that do so for example the display update will also call this. But it must be called while moving and testing if move is ok, which is only done if a flag in motions is set. Moves send with G1 should honor this if  ALWAYS_CHECK_ENDSTOPS 1, but since it seems not to work for you, I will test it with my printer once I get to play with firmware. Currently I'm busy with other stuff so I can maybe test it tomorrow. Then I know if there is a new bug that prevents it from being used or if you have a bad configuration.
  • OK thanks. if you can serve I send you my configuration file. I configured with the online tool so I think I can exclude configuration errors. the only change made by hand is the line 416 of reperier.h #define start_step_whith_high 0.! everything else is standard.
  • Ok, I tested with dev version also 1.0.2 should behave the same way. Everything worked as expected.  Before and after homing I could not pass the end stops. So the firmware is doing what is expected here.

    Now there is one case where it would not work while homing is working, but that would require quite some misunderstanding, but nothing I haven't seen before. You can tweak homing to use the min endstop also you home to max direction. Later then min endstop is tested for max direction and vice versa and for performance and other reasons we only test end stops in move direction. So lets test for x. If you look from the front to the printer the min endstop is on the left and right is max endstop. Homing direction for min (left) is -1.

    Y front is y min and back is y max.

    With inverting motor directions and homing directions you can mess up that homing does the wrong thing and succeeds, so maybe that is the problem. The only other thing is that I only have one endstop per axis, but I do not really think that this matters.
  • ok ... so ... talking in front of the printer: x axis runs parallel to me, left xmin and right xmax, y axis is perpendicular to me, more distant from me I have ymin and closer to me I have ymax, for the zeta axis I have a high zmin and a low zmax. The homing is at the farthest point from me on the left and the z on the top. if you want to try to change the limit switches but anyway when it is moving the printer does not stop crushing any of the six limit switches. tell me exactly how to position the limit switches and I do it.
  • I reversed the endstop y, as suggested. I clearly had to reinvent the y-engine direction (which was previously inverted). Now the situation is this: no engine with reversed direction, looking at the printer the home is on the left and near me. I do homing is ok (as before ... although I do not like having the z covered by the x axis while doing homing ... anyway). I execute the command g01 x150 y150 f200 ... I press the endstop ymax (the one furthest away from me) and nothing happens. I press the endstop xmax (on my right) and stop both axes !!! I re-run the homing and relaunch the same command g01 x150 and y150 ... this time I press xmax first ... and it does not stop ... I press ymax and stop both axes ... ... what's not Do you still like it?
  • if Muhammad does not go to the mountain ... the mountain goes to Muhammad ????????????!! I put myself in your condition ... only three endstops ... xmin ymin and zmin ... I run homing ... everything is ok! with the axes at x150 and y150 I execute the command g01 y0 ... i press ymin and it works; I go back to x150 and y150 I execute the command g01 x0 ... I press Xmin and it works ... I go back to x150 and y150 ... I execute the command g01 x0 y0 ... I press ymin and nothing happens ... I press xmin and yes stop everything! can you do this test too?
  • First from your description y was inverted, so it is good to have corrected that. Otherwise everything would be mirrored in print. Printers use a right handed coordinate system.

    My printer had home for y max so nothing is covered and it still worked. I guess the problem here was more the wrong definition of min and max.

    Also congratulations to your first successful tests. The key point might be what is go back. Did you move by hand or with G1? Or does nothing happen mean it moved but did not stop. I can at least run as often as I want against a end stop. But you need to consider that firmware thinks move finished regarding new position. So at x150 run G1 X0 and stop directly makes firmware think it is at x=0 also you are still at maybe x 140. Send M114 to see what firmware thinks where it is.
  • ok, I think we can not understand each other! This evening (night) I will try to make a movie so that the problem is clear. I'll send you the link youtoube ok?
  • Yes, youtube is ok. Can even be embedded here.
  • Ok ... this is the link
  • This video is only for 3 min endstop ... but for max endstop is the same!!
  • Ok, see what you mean and replayed it on my stacker where I can reach the endstops and it worked. First stopped y min move then x hit stopped x move. So firmware is ok with that regard.

    Can you post your homing configuration and end stop configuration.
    Also check M119 output for the x and y end stop when triggered with that configuration so I can compare. ALso I do not know what it must be somehow in the configuration.
  • // ################ Endstop configuration #####################

    #define MULTI_ZENDSTOP_HOMING 0
    #define ENDSTOP_PULLUP_X_MIN true
    #define ENDSTOP_X_MIN_INVERTING false
    #define MIN_HARDWARE_ENDSTOP_X true
    #define ENDSTOP_PULLUP_Y_MIN true
    #define ENDSTOP_Y_MIN_INVERTING false
    #define MIN_HARDWARE_ENDSTOP_Y true
    #define ENDSTOP_PULLUP_Z_MIN true
    #define ENDSTOP_Z_MIN_INVERTING true
    #define MIN_HARDWARE_ENDSTOP_Z true
    #define ENDSTOP_PULLUP_Z2_MINMAX true
    #define ENDSTOP_Z2_MINMAX_INVERTING false
    #define MINMAX_HARDWARE_ENDSTOP_Z2 false
    #define ENDSTOP_PULLUP_X_MAX true
    #define ENDSTOP_X_MAX_INVERTING false
    #define MAX_HARDWARE_ENDSTOP_X false
    #define ENDSTOP_PULLUP_Y_MAX true
    #define ENDSTOP_Y_MAX_INVERTING false
    #define MAX_HARDWARE_ENDSTOP_Y false
    #define ENDSTOP_PULLUP_Z_MAX true
    #define ENDSTOP_Z_MAX_INVERTING false
    #define MAX_HARDWARE_ENDSTOP_Z false
    #define ENDSTOP_PULLUP_X2_MIN true
    #define ENDSTOP_PULLUP_Y2_MIN true
    #define ENDSTOP_PULLUP_Z2_MINMAX true
    #define ENDSTOP_PULLUP_X2_MAX true
    #define ENDSTOP_PULLUP_Y2_MAX true
    #define ENDSTOP_X2_MIN_INVERTING false
    #define ENDSTOP_Y2_MIN_INVERTING false
    #define ENDSTOP_X2_MAX_INVERTING false
    #define ENDSTOP_Y2_MAX_INVERTING false
    #define MIN_HARDWARE_ENDSTOP_X2 false
    #define MIN_HARDWARE_ENDSTOP_Y2 false
    #define MAX_HARDWARE_ENDSTOP_X2 false
    #define MAX_HARDWARE_ENDSTOP_Y2 false
    #define X2_MIN_PIN -1
    #define X2_MAX_PIN -1
    #define Y2_MIN_PIN -1
    #define Y2_MAX_PIN -1
    #define Z2_MINMAX_PIN -1



    #define max_software_endstop_r true

    #define min_software_endstop_x false
    #define min_software_endstop_y false
    #define min_software_endstop_z false
    #define max_software_endstop_x true
    #define max_software_endstop_y true
    #define max_software_endstop_z true
    #define DOOR_PIN -1
    #define DOOR_PULLUP 1
    #define DOOR_INVERTING 0
    #define ENDSTOP_X_BACK_MOVE 5
    #define ENDSTOP_Y_BACK_MOVE 5
    #define ENDSTOP_Z_BACK_MOVE 2
    #define ENDSTOP_X_RETEST_REDUCTION_FACTOR 3
    #define ENDSTOP_Y_RETEST_REDUCTION_FACTOR 3
    #define ENDSTOP_Z_RETEST_REDUCTION_FACTOR 3
    #define ENDSTOP_X_BACK_ON_HOME 2
    #define ENDSTOP_Y_BACK_ON_HOME 2
    #define ENDSTOP_Z_BACK_ON_HOME 0
    #define ALWAYS_CHECK_ENDSTOPS 1
    #define MOVE_X_WHEN_HOMED 0
    #define MOVE_Y_WHEN_HOMED 0
    #define MOVE_Z_WHEN_HOMED 0

  • // ################# XYZ movements ###################

    #define X_ENABLE_ON 1
    #define Y_ENABLE_ON 1
    #define Z_ENABLE_ON 1
    #define DISABLE_X 0
    #define DISABLE_Y 0
    #define DISABLE_Z 0
    #define DISABLE_E 0
    #define INVERT_X_DIR 0
    #define INVERT_X2_DIR 0
    #define INVERT_Y_DIR 0
    #define INVERT_Y2_DIR 0
    #define INVERT_Z_DIR 1
    #define INVERT_Z2_DIR 0
    #define INVERT_Z3_DIR 0
    #define INVERT_Z4_DIR 0
    #define X_HOME_DIR -1
    #define Y_HOME_DIR -1
    #define Z_HOME_DIR -1
    #define X_MAX_LENGTH 200
    #define Y_MAX_LENGTH 200
    #define Z_MAX_LENGTH 150
    #define X_MIN_POS 0
    #define Y_MIN_POS 0
    #define Z_MIN_POS 0
    #define PARK_POSITION_X 0
    #define PARK_POSITION_Y 10
    #define PARK_POSITION_Z_RAISE 10


    #define DISTORTION_CORRECTION 0
    #define DISTORTION_CORRECTION_POINTS 5
    #define DISTORTION_LIMIT_TO 2
    #define DISTORTION_CORRECTION_R 100
    #define DISTORTION_PERMANENT 0
    #define DISTORTION_UPDATE_FREQUENCY 15
    #define DISTORTION_START_DEGRADE 0.5
    #define DISTORTION_END_HEIGHT 1
    #define DISTORTION_EXTRAPOLATE_CORNERS 0
    #define DISTORTION_XMIN 10
    #define DISTORTION_YMIN 10
    #define DISTORTION_XMAX 190
    #define DISTORTION_YMAX 190
  • for the output of M119 i have checked and the signals match
  • consider that I put myself in the same condition as yours ... so I disabled the endstop-max
  • Did you find anything wrong with the configuration? could it be an eeprom problem?
  • I tried to load version 1.0.3dev; I tried to change eeprom set several times ... nothing.
  • I have looked at it and it looks good. Should have stopped y min move like it did for me. In eeprom only a negative steps per mm value might invalidate the settings. But then homing would also not work I think. So at the moment I have no idea why x works and y does not work. I assume Y also does not work on other moves like pure y move to y min. Or does it work then?
  • tonight I do a little 'tests just moving y, now I start to get confused ideas, after so many tests! better redo it !! if you have any test that you want me to let me know. the idea that I made myself reading the code is that something is wrong with the management of the flags!
  • These are the same flags also used by homing. In fact homing is just a single axis move until endstop is triggered so it sets the test endstop flags even if normally not tested. With this regard a pure y move is like homing since you always test. Just do not klick only fast. Hold the end stop for a second at least to be sure it is triggered.
  • So, I did the test. if with the printer it stops in position x100y100 i do the command G01 Y10 F300 the endstop_miny works. from the same position I execute a G01 Y200 F300 l endstopmaxy works (I have reactivated in the parameters also the endstop max!). so the wiring, the endstops and everything else works individually. the fact that it does not work with an interpolated command can only be a software bug ... maybe in my configuration there is something that overwrites the endstop reading ... I do not know ... but surely the problem is software . can you try inverting the enable and step signals as in my configuration? I have external drivers remember? and for this I have to invert the signals, so I do not want in that specific case to be brought to 0 (or to 1) the enable pin ... but being in my case already inverted no engine is disabled! you can try?
  • Inverting them is not the problem. That code is completely independent.
    Just to be sure, you have 

    #define DRIVE_SYSTEM 0

    at least the video looked you would need that. I ask because end stop handling differs with the printer type and I want to look at the right spot.

  • Reading the code I see no real error. So here something to debug. Key files are motion.h and .cpp.
    Testing is done in Motion.h in checkEndstops. If endstop y is detected here

    #else  // Multi endstop homing

                    if(isYNegativeMove() && Endstops::yMin())

                        setYMoveFinished();

                    else if(isYPositiveMove() && Endstops::yMax())

                        setYMoveFinished();

    #endif

    You see setYMoveFinished is called:


        inline void setYMoveFinished() {
    #if DRIVE_SYSTEM==XY_GANTRY || DRIVE_SYSTEM==YX_GANTRY
            dir &= ~48;
            dir &= ~32;
        }

    Modify this into

        inline void setYMoveFinished() {
    #if DRIVE_SYSTEM==XY_GANTRY || DRIVE_SYSTEM==YX_GANTRY
            dir &= ~48;
            dir &= ~32;
    #endif
    Com::printFLN(PSTR("Y Hit"));
        }

    That gives you a message when moves detect y hit.

    Check endstop is called in Motion.cpp around line 2707

        cur->checkEndstops();

    a bit later you see

    #if CPU_ARCH == ARCH_AVR

            if(cur->isYMove())

    #endif

                if((cur->error[Y_AXIS] -= cur->delta[Y_AXIS]) < 0) {

                    cur->startYStep();

                    cur->error[Y_AXIS] += cur_errupd;

                }

    which moves y if required.

        inline bool isYMove() {

            return (dir & YSTEP);

        }

    YSTEP is 32 so that flag is not set.

    Ok, I see here one case that is not covered. If you have a due based board it will continue until all axes are stopped. Do you have a due based board? I tested on a avr based one.
  • Yes ! Arduino Due (original) and radds.
  • So, have you found the bug? ????
  • I hope so. I have updated the 1.0.4 dev version. So please test if it now works as expected. Have removed the avr test so all printers now do the test.
  • Finally! Thank you very much for the support and for the time you dedicated me! Now everything works! Both the min and the max. if you want to do other tests i am available! But in the firmware where i find the version number?in which file?  
    The problem was in the flags at the end?
  • The problem was what I shows in analysis:

    #if CPU_ARCH == ARCH_AVR

            if(cur->isYMove())

    #endif

                if((cur->error[Y_AXIS] -= cur->delta[Y_AXIS]) < 0) {

                    cur->startYStep();

                    cur->error[Y_AXIS] += cur_errupd;

                }


    the #if / #end was too much. Somehow I thought I could omit this as delta would be 0, but it is not zero so it then moved until all directions triggered end stop. That was all.

Sign In or Register to comment.