Primo with Mega-5X Autosquare on Ramps 1.4

OK, so I have a new Primo build that is acting very strange when running Mega-5X Autosquare on a RAMPS 1.4 board. I have the motors wired so that no step direction invert mask is needed. Jogging is no problem. Y+ moves front to back, X+ moves left to right, Z+ moves spindle up. Once I try to home, the systems places a nice warm deuce on the spoil board. If the $5=1 and switches are wired for NC, the Z axis just goes up and down a few mm and then stops… If the $5=0 and switches wired for NO, the Z axis goes up when homing, but activates the switch and keeps going… Both instances have UGS reporting the switches when they are manually depressed.

I did an individual X home with $5=0 and the switches wired for NO. The homing direction mask is set to put XY home at lower left. Again, jogging is fine, but when I send the command $HX, the X1 truck moves about an inch and stops. The X2 truck keeps on trucking until it starts to skip the belt. Added note. I had this behavior and then unplugged the X1 and X2 limit switches from the board and it did not stop like this… it kept going normally until I had to stop it to keep it from crashing

I have the switches wired according to the image provided with the firmware i.e. X1-X2-Y1-Y2-Zmin

WTF am I doing wrong? I really would like to take advantage of the auto squaring gantries…

Firmware version being used:

1 Like

To use normally closed switches with mega-5x, changed the following in config.h:
#define INVERT_CONTROL_PIN_MASK CONTROL_MASK // Default disabled. Uncomment to disable.

Thanks for replying. I seem to be having a problem with limits regardless if it’s NO or NC… besides, would not changing the bit on $5 have this same affect?

It seems like when I tried the $5 command, it didn’t help and I had to change the firmware to get it to work properly for me. You can set up the ? command to show the value of the limit switches. That might be a good place to start to confirm they are being read correctly.

Yeah, i have done the reporting and they are showing correctly when activated… This is why it’s so confusing…

I was having similar issues until I hooked up a low pass RC filter on my input lines. Not sure if this is something already built in to ramps boards or not as I am not using one. I am using external TB6600 drivers and everything is connected directly to my arduino mega 2560. But as soon as I put the resistor and capacitor on there everything worked as it should. I think the motors kicking on to start the homing movement induced some current in the limit signal lines and they immediately read like they are triggered. This probably doesn’t happen with NO wiring configuration but I’m not sure as I haven’t tried that. But with NC it was the problem for me. I used 100nF capacitor wired from line to ground and 4.7K resistor from line to 5v as as additional pull-up resistor. Wiring diagrams can be found on GitHub.