Part 1 told how to make your computer output commands to the 3 stepper motors controlling the X,Y,Z axes of the mill so that you could jog them around under computer control.
This post deals with getting input from the switches on the mill to your computer.
I am interested in getting input from 4 switches on the mill. First, the Emergency Stop button on the front panel is great to have operational!
(The mill does not have limit switches on the other side of the axes, so you will have to configure you software to use “soft limits” with respect to the home position of the mill.)
These switches are connected to ground, but when they are activated, they open, which will allow the control line to (potentially) raise to 5V (active) assuming you have it configured with a “pull-up” resistor to 5 volts. My break out board had a jumper that I just moved from “pull-down” to “pull-up” to automaticlly apply a pull-up resistor to these lines.
Get the E-stop working first in hardware and software. Always nice to be able to push it when your mill is driving an axis through a home switch due to a software misconfiguration or wiring mistake. [FYI – once you hit the big red button, you have to rotate it clockwise to get it to ‘un-pop”.]
See Part 1 for a description of the B,C,A, 1-32 coordinates of the 96 way connector. We will be adding 4 wires for the X,Y,Z home switches and E-Stop.
A25 - (E-)STOP. [red wire] to Parallel pin 13.
(I believe this line (only) has a pull-up on the Baldor board
as it moves to 5v when pushed even without a pull-up resistor configured. But having another pull-up on the break out board for it did not seam to hurt.)
The three home switches are wired as follows:
C26 - Home 0 (X axis). [blue wire] Parallel pin 10
B24 - Home 1 (Y axis). [green wire] Parallel pin 11
C23 - Home 2 (Z axis). [white wire] Parallel pin 12
NOTE: The X axis home switch is on the “reverse” side (max coordinate, not zero coordinate), so you will have to set your software to do a “reverse home” on the X axis, otherwise it will just try to home the table all the way to the right and never hit the home switch.
Now that we have those wired up, the only thing remaining is the spindle motor control (and possible RPM sensing). Part 3 of this series shows how to turn the spindle on and off using an output pin on the breakout board. It also has an embedded video showing the limit switches and E-Stop in operation.