# Motor with accurate feedback

Hello all,

I want to create a movable object that is suspended on a 1 meter long line (something like a miniature elevator). I'm going to use a motor at the top of the set-up, and from what I have read, I'll probably need a (absolute?) rotary encoder too. The elevator object at the end isn't heavy (about 100 grams), and it doesn't need to be very fast (about 15 centimeters per second). However, I need it to be very precise even after the object is raised and lowered many times (preferably about 1 millimeter precision). I'm going to use an Arduino Uno.

I'm guessing I need a pretty precise rotary encoder, but when I searched online, those 128-position encoders are really expensive (I was hoping to get the encoder and the motor for less than twice the price of my Uno). Is the rotary encoder the best part to use, or should I be looking at something else?

If I really need a rotary encoder, could you provide me with some links to specific models of the rotary encoder? I'm really not sure how precise my rotary encoder or any other feedback mechanism must be in order for me to achieve the 1 millimeter accuracy I want. Edit: My main question is whether rotary encoders are the most suitable for this task, and whether I really need those 128-position expensive rotary encoders.

Edit: The elevator should have at least ten stops which might not be equidistant from each other so touch switches at the top and bottom end won't work.

Any suggestions?

Thanks!

I'm really not sure how precise my rotary encoder or any other feedback mechanism must be in order for me to achieve the 1 millimeter accuracy I want.

Arithmetic often helps

Thanks, but my main problem is trying to find out if a rotary encoder is the best to do the job, and whether I really need those expensive 128 position encoders.

You'll probably find that your arithmetic involves the irrational number pi.

How about using a simple end stop and a switch, so that the device is mechanically parked and then the motor is powered down? If you only want to move between two fixed end positions, you could do that quite easily without involving any electronics at all.

Thanks PeterH for the reply. But I want at least ten stops so I can't just use the end switch.

But I want at least ten stops so I can't just use the end switch.

Then add some maths!. Using limit switches at the top and bottom allows you to know where it is twice each cycle. After that a shaft encoder is more than enough to do the rest.

Mark

A method I would consider using is an encoder strip running along the travel of the elevator. An opto interupter could read the steps of travel and another could read 'stops'. Something like image below. - Scotty

If you know in advance where your stops need to be then you could still tackle that electro-mechanically rather than electronically, if you want. For example supposing you were suspending your load on a chain, you could choose the chain pitch such that the distance between floors was a whole number of links, choose a pulley wheel so that the number of links was a complete revolution of the pulley, and design your drive mechanism so that it moved the pulley a whole number of revolutions. Of you could create a mechanical stop capable of stopping the mechanism at any stop, and enable it as the load reaches the destination stop so that the load is automatically parked at the right point.

There have been some really elegant Lego Mindstorm projects using this sort of approach. You can achieve the same thing using microcontrollers and positional encoders and feedback mechanisms and so on, and nothing wrong with that if that's the approach that interests you, but simple electrical/mechanical solutions are possible too.

The rotary encoder is over the top here since you already know which direction you are moving. I would rather use an optocoupler sensor and a disc with a lot of small holes in it connected to the motor shaft via some gears to give the desired resolution. Still there are issues with that too. For example. the measurement of lift position is indirect as it depends on the wire characteristics, possible slip etc. What you really want is a direct measurement of the position of the lift and there are some solutions to that in the thread already.

Thanks for the replies!

The way I'm understanding it, an opto-interrupter and an optocoupler are the same thing, and if I have two opto-interrupters with a 90° phase difference in the encoder strip running along the whole line (like Scotty's suggestion), it would be essentially a cheap way to build my own optical rotary encoder. And each opto-interrupter (like this one: http://www.farnell.com/datasheets/1519843.pdf) is about \$1-\$2 so I can perhaps do this for a really cheap price!

If I wanted to conceal the ugly zebra strip I could also make I could also make it into a circular disk and house it with my motor at the top.

There have been some really elegant Lego Mindstorm projects using this sort of approach. You can achieve the same thing using microcontrollers and positional encoders and feedback mechanisms and so on, and nothing wrong with that if that's the approach that interests you, but simple electrical/mechanical solutions are possible too.

This reminds me of those Lego NXT motors... I've played with them before and they can tell me the number of degrees that they have rotated... So I can actually read how much they have rotated and control the motor? Also, the motor can be easily set to variable speed so I can make a smooth start and end of the elevator motion... Come to think of it, it really does what I want to do. Do you think its good enough for my elevator (to give me the 1 millimeter precision)?

The way I'm understanding it, an opto-interrupter and an optocoupler are the same thing

No, an optocoupler is usually contained in a light-tight package.

No, an optocoupler is usually contained in a light-tight package.

Thanks, I see... so a optocoupler looks like any IC chip from the outside (Understanding Optocouplers - YouTube), so I would want an opto-interrupter, not an optocoupler.

Can anyone tell me if there's anything wrong with using an NXT motor instead? It seems to be too cheap for all the functions I want (measure the number of degrees turned in order to precisely stop at each floor, and have variable speed to make smooth start and smooth end).

The problem you'll have with any measurement taken at the motor is that it will not take into account other parts of the system, such as slippage of the cord on the pulley, stretching of the cord etc.