this is what I have so far written down as to the overall design
******************
physically:
physically, the gun body is a block of aluminum, roughly 1 inch square and 3.25 inches long
the barrel threads into the front, and the pneumatic cylinder threads into the back, likely through a reducer bushing, so I can thread both ends the same, and that way the reducer can be removed to facilitate cleaning
the solenoid valves that actuate the cylinder will likely be on either side of it, as close as possible to the ports to reduce the dead volume between the valves and the cylinder. the piping will pass through quick exhaust valves to both ports of the cylinder for quicker cycle times.
gun fires from closed bolt position
I haven't figured out the feed tube exactly yet, but the trailing edge of it will be 1.5 inches from the front of the gun body, so the back will line up with the bolt in it's rearward position. I'm not sure if it will come out straight vertically, straight from the side, or have a bend and attach either at the side or the top.
*************************************
functionally:
gun has the following inputs:
microswitch being used as the trigger and a toggle or slide switch in series with it used as a safety
a slide or rotary switch used as a fire mode selection switch (semi, burst, full)
2 optical interrupter sensors
one to determine bolt position
and another to determine when a ball has been fed into the chamber
(possibly) a potentiometer attached to one of the analog inputs to be used as a rate of fire control (or, this could be stored in the eeprom)
(possibly) 3 inputs (select, up, down) for a simplified keypad to allow user input to control firing rate, burst shots (2 per pull, 3, 4, etc),and anything else we cook up. if this is implemented, the potentiometer is not needed
it has the following outputs:
3 digital outputs linked to MOSFETS or some other transistor (amplifiers essentially) that will drive the 3 solenoid valves that operate the gun (a solid state relay or something else might work here, more research is needed)
outputs to a few leds to show operating status (thes can be directly driven from the output, nothing fancy needed here)
power on
firing mode indicator (can use a 2 color led for this, one for semi, one for burst, both for auto or some other combiniation)
ready indicator (showing gun is ready to fire)
(possibly) (unknown numbner of pins required, more research) lcd display to show a menu of some sort if a keypad for input is implemented. display can show operating statistics and parameters.
*********************************
and finally, a sort of pseudocode for the microcontroller
just to note, there is a lot missing and the structure isn't right yet, but it's a start
necessary values
2 bits for bolt position and direction
2 to 4 bits? for shots remaining in burst mode ( 2 bits probably all that is necessary, not
much point in more than a 4 shot burst)
1 bit for last trigger status (the applications of it still need work, not quite right,might
need debouncing? (can I just use a capacitor for a hardware solution to that?? will I even
need debouncing at the low clock rates?)
initialize pins for I/O as needed.
perform tests?
enter main loop
main:
check to see if gun is in the middle of firing
'what portion of firing are we in?
if the firing solenoid valves is active, check the timer to see if the necessary FIRING
DWELL has been reached, if so, turn FIRING VALVE OFF. otherwise, continue
if a bolt solenoid valve is active check the timer for minimum BOLT DWELL, then check for
input from the opto sensor for bolt position. if it has triggered the sensor, SHUT OFF VALVE,
and continue
if bolt is in rear position and valve is off, check ball feed opto sensor for value, if
ball detected, FIRE FORWARD BOLT VALVE.
if bolt is in forward position and valve is off, check for trigger input. if trigger is
pressed, go to following blocK:
'check firing mode
if single shot, or burst,
check to see that last trigger status is OFF (have we released the trigger?)
if burst, set shots remaining to burst number (hardcoded, or eeprom later perhaps)
fire gun, set last trigger status to ON
else (else meaning gun is in full auto)
if we've waited long enough since last firing to make proper full auto firing rate
(eeprom value)
fire gun, set last trigger status to ON
endif
goto main