Troubles having problems

I have my machine put together and all end stop switches are showing triggered while sitting and OPEN when pushed using the M119 command. When using the console when i tell X left or right it is correct, also the same with the Y axes. When i tell it to home it goes the wrong direction towards the top right corner. Also when homing the switches do not stop the motors. When homing it just jumps about 10mm and stops. Using a ramps 1.4 board.

The V1 firmware expects switches to be wired normally closed. You have your switches wired normally open. While which pin on the switch serves what purpose may change, you will have three pin something like this. You need to wire to the common and NC pins.

When i tell it to home it goes the wrong direction

First, make sure your movements are really opposite. With the control board off, place your router in the middle of your spoil board. Power up the control board, and send this g-code line:

G0 X-100 Y-100 F400

If it moves to the top right, then you have your steppers wired backwards. You can reverse any plug on the stepper wiring to reverse its direction.

If it moves to the lower left, then post back and we will figure out what is going on. You may have your coordinate system wrong.

OK, i checked the switches and i do have them wired to the Common and the NC pins. Now when sitting they read as OPEN and read TRIGGERED when pressed. I ran the command G0 X-100 Y-100 F400 and the tool mount does in fact go the right way to the left bottom corner. And it is working when it hits the end stops and has them triggered. I thought they were supposed to be triggered or closed and then go to open when you hit the switch? in case a wire or connection comes loose. The Z axes goes upward on the homing command, not sure if that is right? I appreciate the help.

This is wrong. Does it go up just a little bit, or does it continue up? If it goes up just a little bit, then it is being triggered. If not, then you need to do the same check for Z that I gave you for X and Y:

G0 Z-20 F200

The router should go down with this command. If it goes up, reverse the plug to the stepper motor.

This all assumes you are running the right firmware and have not made any changes.

The switches are wired normally closed. So the circuit is closed when they are not pressed. Our Marlin has been configured to see a closed circuit as “open” in M119 and an open circuit as “triggered” (those terms are very old and a bit confusing).

M119 should show “triggered” when the switch is pressed and “open” when it isn’t.

Also remember that our configuration only cares about the endstops when homing.

Would be great if marlin could report a NC switch as ‘closed’ instead of open. Then ‘open’ or ‘triggered’ when pressed open. This isn’t the first -
Or 8th- time this particular quirk has confused people.

Ran the command for Z and i had to reverse my stepper, it now goes the right way and works. I am running the Marlin 515D 2.1.1 for ramps board. I did change my stepper motor directions for X and Y in the software because i have one way plugs and could not flip them, i assume this would still work the same, if not i would rewire. I think now i need to tell the software what size of work area i have. Not sure as how to do that.

1 Like

The way almost everyone uses the MPCNC, bed size is not used. The size just needs to be bigger than the work area of your machine. If you want to set it, edit these two lines in configuration.h:

// The size of the printable area
#define X_BED_SIZE 600 // 200
#define Y_BED_SIZE 600 // 200

The only impact of these values being smaller than the working area is that homing from beyond the specified range will fail. Since almost everyone redefines the machine coordinates relative to the stock to run a job, these values will not be honored for soft stops.

I want to thank you guys for the help. Things seem to be working now, i finally understand about the end stops from Neilp answer, although it still is weird. Would stop a lot of people asking the same thing over and over if they would change the way it reads. Plotted out a 50mm X 50mm square with a pen and the measurements seem to be good, the squareness is spot on also. Now to try and do the crown test. Again thank you all for the help, I’m sure ill be back with some questions, but don’t want to make a nuisance of myself. :grinning:

2 Likes


Crown test looks good, Thanks again Guys. :slightly_smiling_face:

4 Likes

I would prefer something that describes the state of the endstop, from a software perspective. “Triggered” makes sense, but “at end” or “pressed” might make more sense. “Open” is harder to replace. “not triggered”, or “clear” or something.

I can check if the circuit is closed or open with a multimeter. M119 is the only way to tell what the firmware thinks about the state of the endstops. I need to know if Marlin thinks the endstop is clear or not.

1 Like

Why couldn’t it just say closed or open. When you run the M119 it would say “Closed” and when they are pressed they would say “OPEN” or visa versa as to which way they are wired? That way no confusion ? But I’m not a programmer and it might not could be that way for a reason. LOL I agree on the word TRIGGERED could mean either way. But as long as you know what a closed or open circuit is closed and open would work for me. When it changes from closed to open or the other way we know it is getting triggered.

2 Likes

Well, we configure Marlin to expect a “normally closed” circuit. But the default is to have the switch wired “normally open”. If you are trying to test the configuration in the firmware, you want that configuration considered in the M119.

But also, bytes are cheap. Even the smallest microcontroller could manage to print “Switch: Pressed. Circuit: OPEN”. Which would make it much clearer for everyone.

Good? GOOD?

It’s near perfect! Good job

Did you measure diagonals? I found my build was incredibly easy to get square to within 1/32” without any real work.

1 Like

I measured when putting it together, came out about the same. I also measured the diagonals, was a welder for 18 years and QC for about 8. Measure 3 times and cut once. LOL



Practicing waiting for my router to come in.

4 Likes