Hi,
I am wanting to make an air gun (a bit like one of those tee-shirt cannons that shoot packages, but this will be small ping-pong ball size packets) to shoot packets of 'pro-biotics' into a lake or river. I have already been working on the air-gun mechanism but I still need to work on the code for the aiming system. The air-gun will be mounted on a pan and tilt turret type mechanism.
I have attached an image to show an example of the layout of where the packets would go.
I would really appreciate some help on how to write the code for both calculating the shots to get the accuracy I am after as well as to create an interface so the user can programme the target positioning.
The pan tilt unit will use stepper motors for the pan and tilt and there will be a solenoid for the trigger of the air gun. The gun will use the same size 'shot' each time in regard to the amount of air and pressure the gun uses, so close shots would need to go higher on an upward arc that would then come back down nearer to the gun, whereas further away shots will arc out to their target. Explanation in the pic for that also.
I have not found anything like this sort of programming. I have seen autonomous paint-ball guns that find a target, but this is different so I am a bit stuck.
since the river is moving, the pattern will not be anything like what you laid out.
If the river were to run laminar, and if you figure out how to lay one row across, the pattern will look more line an angle. So, you could just run one pattern straight across and it will look like a long angle.
If you look at the actual flows, the water in the center will flow much faster and just a bit down stream the center will be much further away.
This means that if you deposit a pattern straight across the center of the river will have a much more diluted amount and the places near the shores will have a higher concentration.
As for your numbers, I think that the calculus to plot the trajectories is much more complicated than just going out and running a few tests.
I thing that if you manually set the placement of the nearest drop and the furthest, you should be able to create a simple formula to set each placement between those.
if your weight and pressure and product size are uniform you should be able to place a package into a basketball hoop area.
elevation above the river will need to be calculated.
distance from the edge of the river
the closets target and the furthest target, etc.
The gun will use the same size 'shot' each time in regard to the amount of air and pressure the gun uses, so close shots would need to go higher on an upward arc that would then come back down nearer to the gun, whereas further away shots will arc out to their target
Thanks for the comments. There is some assumed knowledge that I did not share because when you are close to a project it sometimes slips your mind.
Although this is a river system, sometimes it does not flow and it is basically a lagoon behind a weir.
I agree with the comments that if it were flowing then the laminar flow would alter things a lot, but it is best to imagine this as a still body of water or a lake. It is also not a particularly windy site so I am happy to ignore wind as well.
I am starting to think it will be much easier to view it as a series of arcs. Each arc will have the same range, and then it is only the angle of pan between each shot that needs to change to determine the distance each packet along the arc. Then the angle of the tilt will determine the distance between arcs.