Ok, arduino it is.
I have no idea how to program or control an arduino, so you're on your own with that.
The stock PB control scheme is a little complicated, but the
basic platter/carousel motion works like this:
- Toolchange.ngc
- Do a bunch of stuff we don't need to worry about now, then
- call M10
- M10
- Determines how many pockets (steps) are needed to move from the current pocket to the destination
- Determines which direction to turn the carousel to get to the desired pocket
- Write the number of steps to move down in a parameter
- If CCW, call M11 and pass the number of steps as an argument (#P)
- If CW, call M12 with same P argument
- M11 (or M12) - Turn on a 'dumb' motor FWD (or REV)
- While motor is turning, a sensor is triggered by a flag at each pocket
- This sensor is connected to a digital input in LCNC
- The M11 subroutine keeps track of how many pulses it sees from the pocket sensor
- When the correct number of pocket pulses has been reached, turn off the motor
- Write the new (destination) pocket number to a 'current pocket' parameter
This works because a geneva wheel permits the motor to overrun or underrun quite a bit while the pocket is locked in place by the mechanism. Each time it's locked in an index position LCNC has time to read the pocket pulse from the sensor, M11 (or M12) has time to do the math and stop the motor. If it rotates a little more than necessary that's fine - the pocket is still in position.
If you want to use an arduino and still use the stock PB control scheme then you may need to duplicate the motion of a geneva wheel. That is, the arduino receives a 'ON/FWD' command and then:
- Rotates the stepper the number of pulses between pocket centers
- Stops the motor for a half second (or some time) while the pocket pulse is read by LCNC and M11 does the math
- If the ON/FWD command is not turned off by the end of dwell period, rotate another pocket and dwell
- Repeat until the ON/FWD command is turned off during the pause.
If you can program an arduino to do this you should be in good shape to move to some bench testing.
I suggest you get your prototype set up:
- a microswitch or proximity sensor and install a flag (screw, bent sheetmetal, whatever) on each pocket.
- A momentary switch for ON/FWD and another for ON/REV
- Arduino
- Programmed to move the correct number of steps between pockets
- example: 8 pockets, 1.8 degree stepper, no gearbox (for testing), 10x microsteps
- 200 x 10 = 2000 steps/rev
- 2000/8 pockets = 250 steps/pocket
- Programmed to dwell a second after each pocket even if the ON switch is held down
- Stepper drive
Once you get that working, the next step will be to install a home sensor and a second flag (or a longer flag) on whatever pocket you want to be considered "home" or pocket #1.
Make sense?