We are building a t-shirt cannon as an off season project to teach the new members how to weld, program, and do other aspects of the club. We are having trouble figuring out a way to attach the barrel to the frame.
What would be the best way to attach the barrel so that it only has one degree of freedom, up and down?
You are looking for a single pivot axis–best bet is probably going to be to build a bracket that goes around the barrel, with either an attached axle on both sides (think an old cannon, say early 1800s style) or a hole (or two on the same axis) above or below the barrel. Then you need something on the robot frame that can accept either the axle attached to the barrel or whatever goes through the holes in the bracket.
I bet I know what your next question is going to be, too: How to actuate it. Depending on design, a chain/sprocket or belt/pulley or gearing setup will work, with the driven gear attached to the bracket at the axis of rotation, or use a leadscrew or pneumatic cylinder (leadscrew is probably better) attached to the bracket somewhat on one side of the pivot.
Where is the air storage going? Does it need to move with the barrel or is it a flexible connection?
The first version of our t-shirt cannon had the barrel and “small” dump tank that were rigidly connected and rotated together in one axis to change elevation. If you do something like this and counter-balance the tank you can change elevation with a sprocket/pulley and a variety of KOP motors, I believe we used a Globe but something like the AndyMark PG27 Gearmotor would work fine.
You could purchase four 1/2" shaft pillow blocks (I found low load ones on mcmaster for $4 per), two 1/2" clevis pins, and 2 cottar pins. Have the pillow blocks mounted in pairs on opposite sides of the robot and put a hole on opposite sides of where you want the barrel attached. Put the clevis pins through the holes on the pillow blocks and the holes in the barrel structure, then put cottar pins through the clevis pins to retain them.
Then follow one of EricH’s suggestions for driving it up and down around the axis defined by the 2 clevis pins.