Homing in opposite direction

As the title states, my machine homes in the wrong direction.

when controlling the machine manually with the LCD controller every thing moves in the correct direction as it should. If I try to home the X or Y axis the machine goes away from the endstops.

I edited the section in marlin firmware:

// 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

now If i make the 1= MAX instead of -1=MIN they will home in correct direction but then the endstops wont work. if the set as -1=MIN the endstops work but then its homing in wrong direction again.

I have tried swapping the motor cable around and then going in to the firmware and changing it to inverted direction so that the LCD controller is corresponding with the correct direction the machine is moving when doing it manually but even after doing this when attempting to home it just results in the same wrong direction homing issue. I don’t understand what would be causing this occurrence.

Check the endstop status with M119. Maybe they are triggered (the firmware default is to wire them NC) and they are trying to get away from the endstops. The endstop logic is pretty solid.

I’ll try and get it hooked up to a pc to check them

The things is they never touch the endstops to know to get away from them. they just automatically go away from them.

Why does changing the direction of the HOME-DIR change the endstop from working?

after saying it out loud I realize what your saying is that its thinking its hitting it, so i reversed the settings in the firmware to see if it fixs it, ill report back.

Its easier for me currently to do it this way then too hook it up to pc since the cnc machine is in the garage.

But how do you flash it, but not able to check with M119? It doesn’t matter, I am just curious.

You can also try stuff like hold down the endstops and see what it does. But having the actual print from the M119 skips a lot of places that could be wrong and it just tells you what Marlin thinks it is. In my experience, unless you have strange firmware configs, if the axis moves the right way and M119 shows the right thing, there is no way the homing won’t work.

1 Like

its definitely a endstop issue. I changed the settings

// Mechanical endstop with COM to ground and NC to Signal uses “false” here (most common setup).
#define X_MIN_ENDSTOP_INVERTING true
#define Y_MIN_ENDSTOP_INVERTING true
#define Z_MIN_ENDSTOP_INVERTING false
#define X_MAX_ENDSTOP_INVERTING true
#define Y_MAX_ENDSTOP_INVERTING true
#define Z_MAX_ENDSTOP_INVERTING false
#define Z_MIN_PROBE_ENDSTOP_INVERTING true

so when I set them to true it goes in the correct direction accept it only goes maybe 10mm and stops, I assume the endstops are showing triggered. If i click the endstops in the stepper motors will go away from the endstops because they know they are hitting the endstops.

Im using the ramps 1.4 shield on top of a arduino mega 2560 so I can just pull off the bottom arduino mega and flash it and replace it with out having to take the machine wires on and off every time.

so i figured out regardless if they are set to true or false, its not going to work. I have the endstops hooked up correctly, positive to positive, negative to Negative and S to signal.

when I push the endstop in the LED on the endstop turns on, every things right its just a setting I cant figure out.

V1 firmware is configured for NC switches by default. Those 3 wire boards may not provide the correct response, which is why output from M119 is important.

The way it works is: A pullup resistor is enabled in the firmware (You probably want to DISABLE this with the 3 position stops.) so that if there is nothing at all connected to the S wire, the logic will read as HIGH. This is the “triggered” reading by default. The switch connects the S wire to ground, so the logic level reads LOW. When you press the switch, it disconnects ground, and the logic reads HIGH.

Those switches switch between ground and +5V depending on if the switch is pressed, but I don’t remember which is the default, and which is with the switch pressed. It may be backwards.

Regardless, ONE of those ways (inverted true or false) will be correct, and the other will be wrong, but we want to know what the firmware THINKS it is in its normal state.

Homing WILL work.

1 Like

ok so I got my daughters laptop and took it to garage to check it with M119

with the firmware endstop settings at inverted “false”

all of them come back as open state and when I push the endstop in and type M119 they come back as triggered. If i release the endstop they go back to open.

if I try to home it, it will still go in the wrong direction, if i click a endstop it does stop that motor but its going the wrong way.

I ran the M119 code again while it was in the process of homing and all of the endstops come back as open so it dosnt make sense for it to be going the wrong way. Even in repiter host when I move it manually it goes the correct direction left is left, right is right etc… so it really dosnt make sense for it to be homing in the opposite direction.

I have all the homing directions in the firmware set to MIN endstops if I set the to MAX endsops it homes in the correct direction but then the endstops dont work LOL.

Let’s start with something a little more basic.

Where do you expect it to home to?

The MPCNC machines have Y increase as the tool goes away from you, and X increase as the tool moves you your right. In the corner closest to your left hand should be the home position. Marlin should be configured with the homing directions for X and Y as “-1” – This is the default for V1 firmware if left entirely in stock form.

1 Like

Correct the bottom left corner is where I’m wanting it to go. The home directions are both -1 (stock settings) for X and Y that’s why I don’t understand why it’s going the opposite direction.

I ordered some new endstops that don’t have the module attached to them. Hopefully simplifying the endstops will make the problem go away.

Did you adjust settings in RH to make it do that? But no, this was a problem before RH.

It is very strange. Is this dual endstop version or serial?

1 Like

yeah i did invert it in RH to make it move in correct direction. yeah its the dual endstop firmware. I think maybe this endstops are just junk, well know for sure tomorrow when the regular mechanical endstops come in.

Un-do that, because the homing sequence doesn’t know that you’ve done that, so it’s moving to what the firmware thinks is the correct directions. New endstops won’t change that, because if the firmware thinks that left is right, it’s not going to work out.

The easiest way is usually to just reverse the motor plugs. If you have keyed connectors (Like the JST XH) then you may have to adjust the firmware.

If you move the machine using the “MOVE AXIS” menu, does it move in the correct directions, or only through RH? If the LCD doesn’t move it correctly, then it’s not going to work.

Or, connect through a dumb serial connection (Like putty) and send commands to see if it moves correctly.

Unless I missed sometyhing, the end stops should only need connected to Signal & ground on the Pin labeled NG & ground.

#1 hit on Google for “Repetier host reverse direction” is a post on their forum detailing exactly what you’re seeing here. The immediate answer underneath that is to correct the directions in firmware instead.

Un-do the change in Repetier, power down your board, and reverse the X and Y motor connectors, and it will work.

You missed that he’s using the 3 wire circuit board endstops. (These aren’t the best choice for the CNC, since there’s more to go wrong from dust/chip contamination, but should work just fine.)

Ok. That explains everything. As Dan said. Undo that and either reverse the connectors or reverse the direction in firmware.

the problem was wayyyyyy before using RH i only used RH to see the M119 command.

if I change the direction in the firmware it still caused the issue, but I think I might have figured it out.

So I noticed on the LCD controller moving the dial to the right is negative (it brings the numbers in to the negative digits. Moving the LCD controller to the left moves it in to the positive numbers. well this dosnt really make sense because every thing is set to minimum so it should be moving to the bottom left corner.

Basically what I’m asking is there a way to reverse the direction of the LCD control knob itself? Its got to be what the issue is because reversing the firmware will fix the motors moving with the LCD knob correctly but then messes up the homing direction. If i swap the motor plug over it fixes homing issue but then cause LCD knob to move in opposite direction of the bots actual movement. regardless of what settings I change the firmware motor direction or just switching the plug around it will cause either homing in wrong direction or the bot not moving in correct direction of the LCD controller knob. It has to be the LCD controller knob causing the issues since according to the controller going left is positive and going right is negative.

I went thru the firmware settings. I changed this section:

/
// This option reverses the encoder direction everywhere.
//
// Set this option if CLOCKWISE causes values to DECREASE
//
#define REVERSE_ENCODER_DIRECTION

I UNMAKRED “#define REVERSE_ENCODER_DIRECTION” and it fixed the issue. I have been using ramps boards for over 7 years and never had this issue before. I purchased my LCD controller almost 10 years ago when 3D printing first started taking off and this could be why, an obsolete controller module.

at least I know I’m not crazy now :wink: