Asked — Edited

Rotary Encoders - Looking For Suggestions

I think I'm going to bite the bullet and get a rotary encoder for my full-size R2 dome.

Anyone have some suggestions for one that will integrate with the EZ-B easily?

I basically want the dome to be able to return to center.

Let me know.

** Edit ** I have 3 places to mount. Slip-ring center / Motor / Main Gear.



Upgrade to ARC Pro

Unleash your creativity with the power of easy robot programming using Synthiam ARC Pro


No matter how hard you try, rotary encoders are not perfect. They'll skip counts often - which means the center of your dome will begin to change as it operates.

My suggestion is to use a POT, much like we had been discussing with Dave's B9. Have you seen that thread? Using the insides of a servo to control an HBridge... So essentially turning a motor/hbridge into a custom servo. That way you can actually use the servo controls in ARC. That also means being able to know the exact number of degrees the head has moved.

The last option is to use a simple switch. So when the head moves to the center, the switch is flipped. A little microswitch would work well. Or a reed switch. You'd need to put a little dimple on the slip-ring that pushes the switch in.

If you're still set on an encoder...... the last option would be to make a custom one. A really simple method would be to use the cheapest arduino you can find. You will only need 2 pins in use. When the number of counts of the encoder reaches the "Center" position, set the pin HIGH and the EZ-B can monitor that pin. It will know when the center is reached and tell the dome to stop turning.

You could do that with the EZ-B also, but there are so many other things it is doing... You'd need to dedicate a complete EZ-B just for rotary - and that's not a good use of it's time :)


hmmm... I'll take a look at Dave's B9 thread for this.

I thought this was going to be simple! ;-)


encoders kind of... suck:) they were a neat idea to use on the PONG arcade game in 1972. I know they were adapted to robotics in the 80's... But they weren't very useful. Most people, such as nolan bushnell, tried using wheel encoders for floor mapping on Androbot - and since then many other people have tried also.

The problem is the encoder is only good for wheel speed. Because you sample the speed of both wheels, and compare. You do that over and over and hope both wheels are working at the same speed. It won't give you accurate travel distance for 2 reasons. One, being the encoder misses steps often due to many reasons. Two, wheel slippage on the surface - specifically when turning.

So if you notice now days, roboticists avoid encoders and rely on IR positioning by beacon and camera.

The only people still using encoders are the very old style robots like Parallax's and Vex robots. Those companies sell 1990's technology and therefore confuse consumers. Many consumers come across robots (for example the disappointing Parallax BeoBot) and think "that is what robots are". EZ-Robot's goal is to change peoples perspective of what robots are and challenge companies to stop selling wheel encoders and start using current technology.

Our location positioning system that we'll be releasing this summer uses a camera.

As for your requirements, the best solution would be easily converting an HBridge into a servo. It's literally very very easy. :)


Thanks Dj for the latter explanation, I too was convinced implement encoders on the wheels, but now I understand that it is not good idea. Sometimes brainwash us with current technology supposedly, but wins his reasoning certainly overwhelming. Also I like to read different things like post and locate an "location positioning system that we will be launching this summer," Yes!


FROM info about using the pot accuracy is not great its mostly 10% off,read the specs on the pot ,some you can get at 1% but cost is very high ,and you need a pot that is a 360deg without a stop

Very high accuracy lasers (lidars) at about $1100 use magnetic encoders,usdigital has a lot of info on pots verses magnetic encoders.

NOW on your dome a pot is lower cost and would work well,since not using to measure distance or speed,

CAN easy check the internet to see if i am right or wrong.


Also you put on the last gear not the motor ,or the ratio with be off,check servo pan designs where they have the pot. Couple of other thing that some dont know about pots and magnetic encoders

On pots if you take them apart they have a wiper contact that wears out or gets dirty

On magnetic encoders way the are made is a small round magnet they doesnt wear out and has a hall effect sensor to detect the gauss output of the manget that never changes.

COST of most pots are about $5 compare to magnetic encoder of $40


Did some browsing on the R2 forums. Found another user using one of these.


User-inserted image

It's been running good for the last 2 years for him. I'll give it a try. It will mount perfectly around my slip-ring and I can drill and tap the dome plate for the wiper/actuator.

$19 bucks. I'll give it a whirl.


That should work only the contacts would be hard ,second you need it in a dust proof container.

BUT a $15 or less, pot would be much more easy to use then that and a lot less work.


Pic of the other R2's users setup ->

Dome plate on top. Wiper is on the left (underside) User-inserted image

Dome plate removed. User-inserted image


dont want anything to get in the way of the wiper contact,i see dust on that type wont be a problem But other larger dirt or something hitting the wiper will cause problems,since it works by pressure.


This will be in the R2 body, under a plate, and the dome on top. No worries for dirt and such. He's a clean R2. ;-)


ok,not a great idea but its your design.

I am more of a prefectionist ,since i design very high accuracy test equipment and has to be 100% with no faults or doesnt pass the inspection. (ISO 9001)

SAME thing with my robots.


Also i see sparkfun has a nice plunger wiper contact for it too.


Not attempting a lunar landing here. :D

I'll give it a try and see if it works. Sometimes simple is better.

If it doesn't work I'll try something else. :D

My factory is ISO6969 only.


Lumpy, I think that will work if there is enough pressure from the dome weight - for sure :)

Then you can connect the hotpot pins to a servo PCB. So, replace the servo's POT with your pot. Then, connect the HBridge trigger wires to the servo PCB.

Finally, connect the power, gnd and servo signal to the EZ-B

now you can use the head as a regular servo :D

Very cool!


Dome weighs about 15lbs. I have the adjustable wiper on order. It does 1-3 Newton pressure adjustable.

I'm not quite following the whole servo pot / h-bridge setup. I'll keep reading your post over and over. It'll sink in sooner or later. ;)

Any pics of this servo / h-bridge setup?

Hoping it will work with my Syren10?

** Found other thread where you posted some links/ threads, slowly getting it **


Hi Lumpy,

Saw your post in my other thread where we were discussing this same thing. Yes, I am using Andy's large gear for my waist. You said that you were sorry to restart this thread but don't worry! I'd love to help and share what I've done and how I did it. I had the same question and needed to stop rotation at certain points for the waist and radar on my B9. I also came up with a pretty good way to ramp the start-up and slow-down of the DC motor that's running through am H-Bridge.

There was so much discussed in those threads that I'm not sure if it can or should all be covered here. Also it was spread across a few different threads and many group members added ideas and helped me to get the desired results. I'll try to gather some links and edit them into your thread here. ......

Robotmaker keep insisting I should get a magnetic encoder, saying it has unlimited turns and it's more accurate. Sometimes he's hard to understand but I think he was trying to tell me that it worked the same as a wiper pot (like I linked to) and would last longer. Unlike the optical encoders that were commonly used in the old days. The optical ones are the ones I think DJ is referencing to above and says not to use.

In the meantime I'll try to cover some important points:

As mentioned I wanted to control speed, ramping and horizontal positioning of DC motors and H-bridges. I ended up using multi-turn pots for feedback to an ADC port on the EZB. They can turn 10 full turns (if centered that would be 5 one way and 5 the other) unlike common 1 turn pots. On my large waist gear I have one multi-turn pot mounted inline with the motor and it only needs about 3 turns one way and 3 the other to let the waist rotate a full 180 degrees. If you want to rotate a full 360 then perhaps Robotmakers suggestion of a magnetic encoder would be the way to go. Those have no stops at all. Actually I wish I had tried the magnetic pots just to see how they worked but I don't know what type of readings they would return to EZB. On a side note; once I did rotate past the limits of a one turn pot and I it actually caught fire. I had flames shooting out of it. eek

I bought the mulct-turn pots from the Robot Shop. They sell two brands; one for about $30 USD and one for about $6. I got the cheaper one and it seems to work properly. I really don't want or need real accrete poisoning. As long as I can get B9 to center relativity close to center. Look here for where I bought the pots:

Here's a couple pics of how I built both the waist and radar:

User-inserted image

User-inserted image

User-inserted image

Getting it all to work was all in the EZ Code. I have a movement script setup that accepts variable values sent from other scripts. Those value numbers are the GetACD() value returned from the inline pot. Best way to see it is to look at my project. Here it is:


You'll be looking at the main movement scripts: Move Waist Waist Center Radar Center Move Radar

A couple Call Scripts are: Waist Rutine 1 Radar Rutine 1 Look in the INT Script Look in the Speech Recognition in the "Start Animation" script

Hope this helps. Let me know if I can help more. I'll try to bring all the threads together I mentioned above later. Dave Mo


Awesome thanks Dave!

Just grabbed your project file to browse.


Consider how a servo works. It has a POT that rotates with the output of a servo. Each position of the output shaft is a different voltage on the POT.

  1. Your Microcontroller (i.e. EZ-B) sends a signal to the servo PCB with desired output shaft position

  2. The job of the PCB within the servo is to keep the shaft within the specified position from the controller. Now remember, the POT and the SHAFT are connected - so the voltage on the POT determines the position of the SHAFT. So the PCB tries to keep the POT at the specified position by referencing the voltage.

So, if you replace the motor of the servo with an HBridge, you now have a large powerful motor. If you replace the POT within the servo with your HotPot, you now have a way for the servo to measure positioning.

With that above "Very very very very very very very simple" modification, you now have made a very awesome and powerful servo. It will only require soldering a total of 5 wires.

  1. HBridge Trigger A
  2. HBridge Trigger B
  3. HotPot Pin #1
  4. HotPot Pin #2
  5. HotPot Pin #3

That's it :)

*Note: the POT within the servo is not 10% off, as stated by RobotMaker. Please ignore his comment. If a POT was 10% incorrect, a servo would be hilariously jerky and always have bizarre positioning. Additionally, every volume control in your home would be different volumes every time you touch it. 10% is a large number and fabricated by RobotMaker.


I'm all in. I will sacrifice a servo to the EZ-B gods this weekend.


YES thats a good setup DAVE,,its easy to check the accuracy of a magnetic encoder verses any type of pot design including hotpot

SO many dont check the specs is the problem ,all pots are at 5% and 10% on magnet encoder it better then 1% ,but mostly they are for speed and distance because thats where the accuracy is needed.

ON a pan design it not needed ,only using to adjust the degree -180 to +180 ,thats why a pot will do just fine

On the neato xv-11 that used at one optical encoder then the change to a magnetic encoders for high accuracy distance and speed .

NOW on optical encoders are better in certain ways,depending on the CPR higher the CPR better the accuracy is and can be a lot better then magnetic encoders some as high as 2000 counts and more plus they mostly are quadrature with meens there are 2 optical sensors at 90 angle to each other for checking speed forward or backward ,where on magnetic encoders cant on some.

I know my tech stuff is hard for most guy here.



I'm following a little better now. In all my years of R/C I've never really torn a servo apart.

Took some quick pics (Maybe others are more visual like me).

I see the pot and motor wires now.

User-inserted image

User-inserted image

I get the pot replacement side of things. You have me stumped (I know I'm dumb) on the trigger A / B and how that would translate to the H-bridge side of things. In particular I'm hoping it will work with the Syren10 I have already.

Obviously the servo motor connections would be +/- reversible. My Syren10 has 0v (Neg) and a S1 (Signal) for input. How would that work or would I need a different setup?

I guess Robotmaker is right, my Electronics 30 education just isn't up to par with the rest of ya. ;)


i desin my own gear boxes and the most common is futaba s3003 servo to use,since its the only one that has a schematic.

LUMPY make shore you use 5k type of pot ,hotpot or regular pot and set the center of the pot to 0 deg witch is robot head looking forward.

If USING gears like DAVE did witch is the correct way to goyou need a 1-1 ratio witch meens each tooth gear needs to be both have the same teeth.


The HBridge should have 2 triggers per channel.:) You may need to read the HBridge tutorial to find out how they work.

Essentially, the motor wires of the servo PCB connect to the HBridge trigger wires


Hi DJ,

I guess I'm only familiar with the 4 wire H-Bridges. 4 Inputs with PWM.

Here is a pic from the manual of the Syren10 hooked up to a potentiometer.

User-inserted image

Does this help for my situation?


A 4 Wire H-Bridge has two channels. Therefore, two wires per channel... Totaling 4 wires. :)

So you're only driving one motor, right? So a 4 wire HBridge is made for 2 motors.

That Syren example is not what we're speaking about. You'll need to erase that Syren Pot example and re-read my previous posts to get back on track :)


ONE is called CCW and other is called CW,BUT some h-bridges have pwm and cont and brake per channel.

IF your servo board has 2 chips its easy to find the h-bridge control lines,second chip near the motor is the h-bridge chip mostly has v+ gnd ,2 motor wires and 2 control lines ,so you only need 3 wire control lines and gnd


SOR website on your servo board shows a easy way on how to hook it up. need to locate the link.