R2D2 dome rotation

General project help for Adafruit customers

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
telarium
 
Posts: 49
Joined: Sun Jul 31, 2011 11:28 pm

R2D2 dome rotation

Post by telarium »

I'm building a small remote controlled R2D2 powered by an Arduino and a Raspberry Pi. I have everything working how I want except for one thing: I need to be able to read the rotation and orientation of R2's dome on top.

So if you're familiar with R2D2, you know his dome can rotate pretty much a full 360 degrees on top of his body. My first idea was to use a potentiometer to read the dome's rotation value. However, due to various circumstances, I'm not going to be able to do that.

My other idea was to use some kind of magnetometer in the dome and one inside the body to determine a rotation based on a fixed orientation. Or I could use some kind of switches on the dome, but that wouldn't give me the fidelity that I want.

Are there any other suggestions of how I could accomplish this?

User avatar
adafruit_support_mike
 
Posts: 67485
Joined: Thu Feb 11, 2010 2:51 pm

Re: R2D2 dome rotation

Post by adafruit_support_mike »

There are several ways to rotation.

The simplest choice is to use a stepper motor to control the rotation. You can run that open-loop (not measuring the actual position) by counting steps one direction or the other. There are stepper motors that take 200 steps per rotation (1.8 degrees per step: https://www.adafruit.com/products/324) and you can gear the rotation down for more resolution.

If you measure the position directly it's called closed-loop control.

You can connect a rotary encoder so the head turns the knob as it moves. Each step will be the same size, and one pulse comes slightly ahead of the other so you can tell which way the knob is turning: https://learn.adafruit.com/pro-trinket-rotary-encoder

You can make a ring with evenly spaced holes, notches, or just dark stripes. Run that between an LED and a photosensor, and you'll get a series of pulses as the ring rotates. Those pulses don't tell you direction directly, but you'll know what direction you're driving the motor.

You can also get absolute position using more than one LED/sensor pair and rings with different track patterns: http://en.wikipedia.org/wiki/Rotary_encoder

User avatar
adafruit_support_bill
 
Posts: 88154
Joined: Sat Feb 07, 2009 10:11 am

Re: R2D2 dome rotation

Post by adafruit_support_bill »

Absolute rotary encoders give you an absolute position, but they are fairly expensive. If you have a stepper motor, or a gearmotor with a quadrature encoder, you can get a relative position. If you combine some 'home position' sensor with a stepper or quadrature encoder, you can deduce the absolute position once you 'home' the motor at startup.

Locked
Please be positive and constructive with your questions and comments.

Return to “General Project help”