Prints are mirrored in X-axis and inverted in Y-axis direction My custom 3D printer prints everything inverted. I guess this is a homing problem as the motor moves in correct direction.
In Pronterface,

if I press -Y — bed moves forward (towards the Y endstop)
if I press +Y — bed moves backward (away from Y endstop)
if I press -X — hotend moves left (towards the X endstop)
if I press +X — hotend moves right (away from the X endstop)

on RAMPS 1.4:

X endstop is connected on the 1st pin
Y endstop is connected on the 3rd pin
Z endstop is connected on the 5th pin

(Pin 2, 4 &amp; 6 are not used (are these for MAX_ENDSTOP ?))
Below is my Marlin config
#define X_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Y_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define Z_MIN_ENDSTOP_INVERTING true // Set to true to invert the logic of the endstop.
#define X_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Y_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MAX_ENDSTOP_INVERTING false // Set to true to invert the logic of the endstop.
#define Z_MIN_PROBE_ENDSTOP_INVERTING false // Set to true to invert the logic of the probe.

#define X_HOME_DIR -1
#define Y_HOME_DIR -1
#define Z_HOME_DIR -1

#define INVERT_X_DIR false
#define INVERT_Y_DIR false
#define INVERT_Z_DIR false

I have attached 3 photographs.

Shows the Home position of hotend. Y Motor on back and Y endstop at front.



Shows inverted print.



Pronterface screenshot (shows actual G-code file)


I tried flipping the motor cables, but that inverts the motor direction
I also tried INVERT_Y_DIR true, but no luck.
Please help me. What am I doing wrong?
For most Cartesian printers, the homing position is at the front-left corner of the build plate. End-stop switches can be at either end of each axis (and even both), but the firmware must be configured accordingly.
A common arrangement is to have end-stop switches at X-min, Y-min and Z-min positions. You will see this on pretty much all budget printers, but things may be different on high-end machines. For the Y-axis on a cartesian machine, this mean placing the end-stop switch at the rear of the printer. A CoreXY machine on the other hand has the Y-min sensor on the front left corner.
So, unless your intentions were otherwise, you have simply got the Y-axis end-stop switch in the wrong position. For your design, it should be at the back of the printer, triggered by the bed in it's most backwards position. You will also need to reverse the direction of the Y-axis stepper motor, do that +Y moves the bed towards the operator (like you have it now).
If you want to have the end-stop switch at the front of the printer for some reason, you will need to re-configure the firmware accordingly - it is an Y-max sensor in that position!