So like two weeks ago I realized why my 3D printer convulsed like a possessed child. Turns out the limit switch on the axis across the device stopped working (X? I always get them confused). To excise the daemons from the machine, these were ordered. Besides thinking both sides had the fancy connectors, which I may fix, these required using a 11/32nd bit to drill out the circuit board where the screw holes should be. Eventually I’ll get around to figuring out what all of the ports do on the printer’s control board…I may have found the port adjacent ot the connector will reset the controller. Given how bad some of the prints have gone that might be a good idea for me to hook up.

Connecting

Now to remember how I checked the limit switch to begin with. Searching through my slack history did not show many results sadly, even though I sent it to my wife. Right, StackOverflow to the resuce. Except the baud is wrong, so you get gibberish. So by process of elimination the following do not work:

  • 19200 - Nothing usable
  • 38400 - Nothing usable
  • 57600 - Line breaks are correct
  • 115200 - Nothing usable
  • 250000 - Nothing usable

So after some searching it looks like one can set the speed of the serial port via the stty command *nix. For OSX based systems you would you use something like stty -f /dev/tty.usbserial-AL03600M 115200 then connect via screen /dev/tty.usbserial-AL03600M 115200. The new lines are still messed up, but I can live with that. For an extra bonus you can use stty -f /dev/tty.usbserial-AL03600M -a to get details about the configuration of the port.

You may exit the screen terminal with the key sequence ctrl-a + ctrl-\. If you kill the process in some other manner you can use lsof | grep usbserial then screen -x $PID to get back into the session.

Checking the sensor

To check the status type in M119. This will print something like:

Reporting endstop status x_min: TRIGGERED x_max: open y_min: open y_max: open z_min: open z_max: open ok

You can open and close the switch. I found it easiest to queue the command, then while hold the switch press enter. The new limit switches work well and make troubleshoot really easy. The LED let’s me know the limit switch hardware itself works, while the command forces the secret of the switch out of th control board. Once I tightened the nuts holding the board it worked like a charm.