Hello! I'm working on a motion detector turret for paintball. I really need some help with some parts of the program. Any help would be really appreciated!
To give you some information first:
I am using 3 Nema 17 stepper motors to control elevation, rotation of the base, and the trigger. For my microcontroller, I am using an Arduino Mega. And for my 12 motion detectors, I am using the standard HC-SR501.
How I plan to set it up is to place one motion detector on each side of a dodecagon (this will be the stationary base). On top of that, there will be a 6-inch bearing that spins due to the rotation stepper. Then I will have the other two steppers controlling the elevation and trigger of the paintball gun.
For the program when a motion detector detects motion I need the gun to rotate the base to that zone and the paintball gun will fire two shots at two different elevations then wait for the next motion detector to go off.
What I need help with is figuring out how to code it so the program will keep track of the position of the gun and can figure out how far it needs to go to reach the next zone that is triggered. And if possible determine the shortest way by going both CW and CCW.
If I need to I can attach a rotary encoder, but a potentiometer will not work because the gun needs to be able to spin past 360 degrees.
Thanks for any help,
...TGM