Open Source Pan/Tilt Head: Part Four - Position Sensing

Skipping to a bit of electronics work, it was necessary to me that the pan and tilt axes always know where they are. This allows for setting and recalling presets and programming stops in the movement so that the assembly doesn’t self-destruct. Important.

Analog sensors are pretty easy to use with Arduino, so I wanted to try using a potentiometer on each axis and see if it was going to be accurate enough for my purposes. I thought about mounting the pots directly to the output shafts of the axes, but this presented three problems. The first was that the pan axis was going to be able to rotate more than a full turn, while most cheap pots turn less than 300 degrees. The second issue was that the angular resolution of a 1-turn potentiometer is fairly limited once you compensate for noise in the output - essentially presets could be recalled but the accuracy would suffer. Finally, I couldn’t come up with a solution to mount the pots on the shaft axes without increasing the size of the head. To keep the head small, the pots would have to be mounted beside the shafts and driven by some part of the drive train. They could be driven off the timing belt, but in the case the belt skipped a tooth or two, the pot position and the pan or tilt position would not agree which would lead to the head crashing and damaging itself, or worse, a camera or lens.

That left driving the potentiometers from the axes shafts with gears, and again to keep things small the driven gear (on the pot shaft) had to be small in comparison to the gear on the axis. This was convenient since a small turn of the axis would produce a significant turn of the pot, which means the angular resolution of the system would be increased. But given the gears I selected, the pots would have to turn about 6-7 times for every turn of the axis, which means I needed multi-turn potentiometers.

 
 

On the tilt axis a 5 turn potentiometer with a 10T gear driven by an 80T gear on the axis gives a maximum travel of 0.625 turns, or 225 degrees.

On the pan axis a 10 turn potentiometer with a 10T gear driven by a 76T gear on the axis gives a maximum travel of approximately 1.316 turns, or 473.76 degrees.

Hooking a potentiometer to an Arduino Uno is pretty simple - wire the +5V and GND across the resistive element, and connect the wiper to one of the analog input pins. Outside of small dead zones on either end of the wiper travel, the Arduino reads this as a value between 0 and 1023. When hooked up I observed the noise in the system to be about +/- 1 increment, meaning a value of 100 could read as 99 or 101.

The angular resolution of the system can also be estimated (not including error from backlash) knowing the gear ratio between the axis and the potentiometer shaft. The pan axis has a resolution of approximately 0.46 degrees per increment (+/- 1 degree repeatability, accounting for noise). The tilt axis has a resolution of approximately 0.22 degrees per increment (+/- 0.5 degree repeatability, accounting for noise). Resolution and repeatability can be somewhat increased by reducing travel:

  1. by choosing a potentiometer with a smaller number of maximum turns, or

  2. by decreasing the potentiometer gear ratio (using a larger gear on the pot shaft or a smaller gear on the axis).

The value of the potentiometer is not particularly important since it is operating as a variable voltage divider. I used 10K for both pots, but any number of values in the 1000s of ohms will work fine.

 
 

There are also multi-turn Hall-effect position sensors with an analog output that could work for this project. The main benefit of these is that the ‘wiper’ of the shaft is contact-less, which means they are rated for a much longer life than a traditional wiper. I’m not aware of any other benefits yet. At some point, I may try one to see how its performance compares.

Note that I had to grind a flat on the shaft of the potentiometers I used in order for the set screw to work with the 10T gear.

 
 
Next
Next

Open Source Pan/Tilt: Part Three - Camera Bracket