Reverse rotation of the encoder

I have an Arduino Mega 2560, Ramps 1.4 and a RepRapDiscount Smart Controller display unit. Firmware V1CNC_Ramps / 513. Why does the encoder work out everything for a turn. For example, when I rotate clockwise the number decreases and the menu cursor moves to the top. When rotating counterclockwise, the opposite is true. It is very inconvenient and confusing. Somehow you can fix it in the firmware.
#define REPRAP_DISCOUNT_SMART_CONTROLLER is selected as the display.

Yes you can reverse it everywhere or just numbers. A bit above the line you showed search for “encoder”.

Thanks a lot for the answer.
There is another question: when I increase X, the carriage moves to the right, if I decrease it to the left. The Y axis moves away from me when the value increases, and towards me when it decreases. It seems right. When I press “Home X”, X moves to the left, decreasing the values, which is also correct. But when I press “Home X” then X moves away from me to increase the value, which is wrong. Can this be fixed?

Not much wrong: instead of "I press “Home X” then X moves away from me to increase the value, which is wrong", I meant "press "Home Y", then Y moves away from me to increase the value, which is incorrect"

Does it move just a bit then stop or continue moving?

Each axis can be configured to home toward min or max.

Look for Y_HOME_DIR and check that it is -1 (meaning home toward minimum) and not 1 (home toward max)

1 Like

They drive a little and stop after each click on the menu.

Thank you all very much. It’s so simple, I feel like a fool )))

That means it thinks your endstop is triggered. Do an “M119” in any terminal and test each endstop for functionality.


M119: X, Y - triggered, Z - open.

In the firmware source code, HOME_X, HOME_Y and HOME_Z are equal to -1. But when I press “HOME X” or “HOME Y” on the control board, the axes move in the direction of increasing the value, with a small step. And the Z axis is also on the increase, but constantly until you close the contacts.

Your M119 needs to be right before you try any homing. That is the marlin firmware reporting what it thinks the state of the endstops are. So one result is not enough.

Move the machine away from all the endstops. M119 should show all of them as open.

One at a time, press and hold down an endstop while sending M119 (you can use the machine to do this, or a friend, or an awkward two hands). Make sure the correct endstop shows triggered.

If you are using the firmware from V1 (MarlinBuilder releases) then the X and Y endstops need to bw wired normally closed. If it shows triggered and it isn’t, then you have a loose wire. If it shows open and it isn’t, then you have a short. On the Z (on an MPCNC, not LR) the endstop is a touch plate and it should show open with nothing connected.

If marlin thinks an endstop is triggered and you home that axis, then it will move in the direction it thinks is away from the endstop to try to clear that endstop. If the signal is always triggered, then it will move 5mm or so away, stop, and report a homing failure.


Thank you for the information and help.
The connection of the electronics was a test on twisted wires and was not reliable. Everything works well, the Z-axis stop is normally open, and the X-axes and Y-axes are normally closed. There was a bad contact, so the firmware thought that the axes were at home.

1 Like