7724Views4Replies

# How can we know about the position of DC motor!stepper motor is avoided in this case!? Answered

I need to know the exact position of the motor!
what kind of feedback techniques can be used in this case?
and any limit switch possibility is there?

like the motor crossed certain position and then the switch on that position is turned on/off!
just wild guess

Tags:

## Discussions

There are a number of ways to measure the angle, or change in angle, of a rotating shaft, and you kind of have to choose one that is appropriate for your application.

I think the most important consideration is the range of angle through which your shaft turns.   Is it less than one  turn?  Or is it a small number of turns greater than one?  Or is it essentially infinite; i.e. the shaft can just turn and turn all day long?

The other consideration is probably going to be analog or digital; i.e. what kind of output signal do you want, and I think that's going to be basically a choice between potentiometers (analog) and rotary encoders (digital).

Potentiometers:
If the range of angle you need is less than one turn, then a single turn potentiometer
http://en.wikipedia.org/wiki/Potentiometer
would work for this, but you have to be careful not to run up against the physical stops inside the potentiometer, because this can break the potentiometer if you do.  Those mass-produced servos, used for many radio-controlled toys,
typically use a single-turn pot to sense the position of their output shaft.
As Bwrussel points out, you can also use a multi-turn potentiometer to sense the angle of a shaft, but you still have to keep the angle of the shaft within a finite range, or else it breaks the multi-turn pot.

Note that is is possible to build a single turn potentiometer without stops, but these are rare.  Such a pot would just "roll over" when you turned it past its maximum angle.  You might be able to build your own by somehow taking the physical stops out of a single-turn pot, although there would be a small "dead space", a region of angle where the wiper of the pot is not touching the resistive track it slides on.

Rotary Encoders:
If you want an angle sensor that can just turn and turn, then a rotary encoder would work well for this.
http://en.wikipedia.org/wiki/Rotary_encoder

Also note there are two kinds of rotary encoder.  The kind that sense absolute angle have this complicated pattern (gray code), basically dividing the whole circle into 2n unique binary numbers.  E.g. an 8-bit encoder of this kind would divide the circle into 256 wedges, and the angular  width of each wedge would be 1/256th of a circle or (360/256)degrees.  Also an 8-bit encoder has 8 little optical pick-ups, one for each bit.

The other kind of rotary encoder is the incremental rotary encoder.  This encoder has an encoder wheel that is just a series of slots, and it uses just 2 optical pick-ups.  This kind of rotary encoder is much easier to build, and thus cheaper, with the only disadvantage being that it does not measure the absolute position of the shaft.  Instead you have to infer that information by knowing what angle you started at, and then counting the number of slots that have gone by.  The old style computer mice, the kind with a ball in them, use rotary encoders of this kind.

What is the motor moving? It's fairly simple to use limiting switches, like on garage doors. What type of limiting switch you use depends on the system. It could be as simple as momentary switches at either end of travel.

I had to solve this problem for my projector screen project and ended up using a 10-turn potentiometer tied directly to the output of the motor. Using an Arduino I could measure the position and number of turns of the shaft through the analog input on the Arduino. This only works if your motor stays within the 10-turn range of the pot.

If you only want position within one turn but the motor needs to turn more than once (Like a clock, you only need to know the hands position on the circle, not how many times it went around.) you could build a potentiometer of sorts. At each position you need to measure, say every 1/8 of a full turn, place a different value resistor. As the motor spins around a brush contacts the different points giving a different value for each position. An Arduino could be programed to shut off the motor when a certain value was returned.
They also make unlimited turn pots but I don't know how they work and limiting switch pots but I bet those are expensive.

I'm sure others have different, probably better, insights, this is just what I've picked up in my projects.

For a basic DC motor a rotary encoder would probably be better then a pot. Much like a stepper motor the encoder will click through 1 segment ever XX degrees.

Yes you will need a limit switch to define a starting point. Have the stepper motor spin over till it hits the switch. The switch then stops the motor and can zero out any tracking of the motor. In a stepper you move the motor in steps. Each step represents a certain number of degrees the shaft turns. You motor should have a label on it telling you how many degrees per step the more has. If the motor moves 2 degree each step then you can program your controller to keep track of that movement.

If this is a belt system and you know that, for example, every 4 steps moves the belt 1mm then you can do some simple math in your program to keep track of how far the belt has moved.