Movement control suggestions needed for Star Wars Turret model

Hi All, i need suggestions for part of a project.

I’m building a model of a Star Wars Turbo Laser turret, the kind seen blasting at Luke along the trench run, it uses a Raspberry Pi and camera to do face detection and tracking. I have face detection, barrel tilting, blaster recoil, LED flashing, and sounds all working happily, but the rotation of the turret is giving me some grief.

Mechanically it works with the whole thing sitting on a lazy susan style rotating bearing, and initially i used a standard servo, which worked, but only gave me about 180deg of movement. But i need 360deg, or full multiple rotation capability. I have a large gear integrated into the lazy susan bearing, and another gear on the servo spline.

I tried a continuous rotation servo, but they can only be told to go left or right, not by a specific amount, plus it was way too fast. Using the Adafruit servo library i can slow it to 0.1x speed, but even thats too fast. If i go down to 0.05x speed, it doesn’t have the torque needed to rotate the turret which weighs about 1kg. (its 3d printed and about 25x25x25cm).

My current thought is a stepper motor since i have a couple spare from a scrapped 3d printer, but since i need specific angle control, with 0deg being its normal “forward position”, and moving from that when tracking faces, i’m not sure it will work. At least with a servo i can say “move to 90deg, move to 10deg” etc. I cant do that with a stepper.



1 Like

You can do that with a sepper - just convert degrees of rotation into a number of steps. But the difference with a stepper is that it has no ‘zero’ position. So the direction is always relative to the starting position, which could be anywhere.

The answer (which is what the 3D printer would have used) is to identify a zero position using a limit switch. At startup you rotate the turret until the limit switch is triggered, and that becomes your zero position from which your direction is calculated using stepper steps. For 360 degree rotation a mechanical limit switch would have to be mounted so the turret can rotate past it, but for a magnetic (Hall effect) switch or an opto-interrupter that is not an issue. In all cases you should approach the limit switch from a predefined direction because there will be some hysteresis.
Arduino - Stepper Motor and Limit Switch | Arduino Tutorial (