Actually, the sensors and code on mine turned out to be quite trivial. The code is barely two pages of dead-simple C that took only maybe two hours to write and debug.
This is a surprise. I have a flow chart that runs for a couple of pages, let alone the coding. Even considering that what is 'trivial' to you is anything but trivial to most people, it would truly be amazing (to me) to be able to control an ATC with two pages of code.
This is the list of tasks that I envision need to be performed on my ATC. I broke it down two ways; down and dirty and commercial/industrial (OSHA). All comments from any reader are welcome.
Simplistic: swing the arm 30 degrees
drop 4"
say a prayer
swing the arm another 60degrees
rise 4"
say another prayer
Safe:
Has the carousel reached the correct tool position?
Is there actually a tool in the holder?
( we already know the claw is unoccupied because we confirmed that when it put the previous tool away)
Open the safety interlock on the claw.
Did it open?
Swing the arm 30 degrees
Did the claw close? (if it closed, then it has the tool, otherwise it cannot close)
Is the tool holder safety interlock open?
Release the tool from the toolholder (pneumatic)
Is the tool released?
engage the claw safety interlock
did the claw safety interlock engage?
lower the arm 4"
did the arm lower?
Is the mill spindle rotating?
Is the mill spindle at the correct azimuth for tool change?
lockout the mill spindle operation (can be done a number of ways)
Swing the arm 60 degrees.
Is the arm in position?
Release the drawbar safety interlock
Did the drawbar safety interlock release?
Activate the drawbar actuator
Did the drawbar actuator open?
Raise the arm 4"
Did the arm reach position?
release the drawbar actuator
Did the drawbar actuator release?
Is the drawbar safety interlock reset?
Is the drawbar height correct (i.e does it have the tool gripped correctly)
release the claw safety interlock
did the interlock release?
Swing the are back 40 degrees
has the arm reached position?
lower the arm 5"
did the arm lower?
move the arm to the park position.
allow mill spindle operation