Pages: [1] 2   Go Down
Author Topic: Position of a servo  (Read 3641 times)
0 Members and 1 Guest are viewing this topic.
0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hello,
Last week I asked about knowing the position of a stepper: http://arduino.cc/forum/index.php/topic,85616.0.html . Now I'm interested in servos.

I have a servo motor driving a shaft with a coupling (unknown for the moment, but doesn't matter). The shaft turn of about 90°, but not exactly.

I'd like to register the max and min position of the shaft, by moving it by hands.

Is there a way to know them with the servo or will I have to had an encoder or any position sensor?
What happens on the command pin of the servo (not the 5V, not the ground one), if I supply my motor with current, and turn the shaft?

Have a nice day
Logged

Seattle, WA USA
Offline Offline
Brattain Member
*****
Karma: 601
Posts: 48543
Seattle, WA USA
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I'd like to register the max and min position of the shaft, by moving it by hands.
Same answer as with the stepper motor. No, you can't do that.
Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Well maybe it's a little work to do but follow this thread at another site.

http://forums.parallax.com/showthread.php?84991-Propeller-Application-Proportional-feedback-from-a-Standard-Hobby-Servo-(Upda&p=582447
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset


That's a heckuva interesting thread - if such a thing really works (and skimming the thread seems to indicate "yes"), it opens up a lot of exciting possibilities with cheaper hobby servos (if the position values can be read fast enough).

Great link - thanks for posting it!

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Offline Offline
Newbie
*
Karma: 0
Posts: 49
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

the AX-12 servos (and similar) from the BIOLOID roboitis kits will give position feedback but they are not hobby servos and they are not cheap!  if you opened up a standard hobby servo you could probably read the potentiometer and use that for position.
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

With some hacking the voltage from the wiper of the servo pot can be read for position feedback. Note that you can potentially damage a servo by turning the servo horn by hand.

http://www.lynxmotion.net/viewtopic.php?f=2&t=2748
http://www.lynxmotion.net/viewtopic.php?f=31&t=3182
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

You guys (tt_tony, zoomkat) really need to read that Parallax forum thread, if you haven't done so already - that's a really swift way to get the position of the servo (by carefully controlling the current and voltage to just barely turning the servo on, then "scanning" the servo while monitoring the current) without needing to hack the potentiometer or anything; other than it being slower to utilize (and requiring a tad more circuitry and coding) - it seems almost perfect! smiley
« Last Edit: January 10, 2012, 12:41:19 am by cr0sh » Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just don't see a practical application for this current monitor to determine position. How is it better then reading a standard pot's position? Certainly it is different, cleaver, etc,  but I still don't see an application where a simpler and cheaper method would work better. I must be missing something?
Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I just don't see a practical application for this current monitor to determine position. How is it better then reading a standard pot's position? Certainly it is different, cleaver, etc,  but I still don't see an application where a simpler and cheaper method would work better. I must be missing something?

I'd say it has two benefits:

1) No need to hack the servo - in theory, it should work with most standard hobby servos (aside from continuous rotation "servos" of course without needing to open the servo up and solder wires onto the potentiometer (and with micro-servos, this might be very difficult to do). Not to mention possibly voiding a warantee on an expensive servo. Plus, if you had a servo set up for this, and it was working well, then the servo failed - you could just grab another and plug it in, without needing to hack it first.

2) It's accuracy might be better - since you don't have to deal with potential contact "noise" issues from the wiper (likely a minor thing, though); plus since you aren't loading down the servo's position sensing feedback circuit, you won't run into any issues there.

I'm sure it has some drawbacks - the main one being the extra external circuitry required, plus I would bet that not all servos would work the same (maybe the so-called "digital" servos are less tolerant?). There also might be issues with selecting the proper amount of "just enough" current for different servos. I still think it's a pretty neat hack, all the same.

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9470
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

One might also use a zxct1009 like in the open servo project to measure the current being used by the servo. probably depends on what the objecive of the exercise is.

http://www.openservo.com/Schematic3

http://www.openservo.com/Datasheets?action=AttachFile&do=get&target=zxct1009.pdf
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

I just don't see a practical application for this current monitor to determine position. How is it better then reading a standard pot's position? Certainly it is different, cleaver, etc,  but I still don't see an application where a simpler and cheaper method would work better. I must be missing something?

I'd say it has two benefits:

1) No need to hack the servo - in theory, it should work with most standard hobby servos (aside from continuous rotation "servos" of course without needing to open the servo up and solder wires onto the potentiometer (and with micro-servos, this might be very difficult to do). Not to mention possibly voiding a warantee on an expensive servo. Plus, if you had a servo set up for this, and it was working well, then the servo failed - you could just grab another and plug it in, without needing to hack it first.

I didn't mean to a servo's internal pot, just an external normal standard pot if I wanted to measure a rotational angle position. A servo has maybe 180 degree travel, a pot has 270 degrees or so. What does using a servo to read a mechanical angle position have over using a standard linear pot? Actually a optical quadrature encoder is my favorite device for measuring angle rotation.

2) It's accuracy might be better - since you don't have to deal with potential contact "noise" issues from the wiper (likely a minor thing, though); plus since you aren't loading down the servo's position sensing feedback circuit, you won't run into any issues there.

Well I suspect that using either a standard pot, or this method using analog readback of the current via a analog input pin will have simiar accuracy and resolution as the A/D converter would be the limiting factor. I suspect the simple standard pot would be much simpler to read and equal or better in accuracy.

I'm sure it has some drawbacks - the main one being the extra external circuitry required, plus I would bet that not all servos would work the same (maybe the so-called "digital" servos are less tolerant?). There also might be issues with selecting the proper amount of "just enough" current for different servos. I still think it's a pretty neat hack, all the same.

Yea, it's a cleaver hack, I haven't read the code. I just don't know what problem this solution is trying to solve. Cleaver, yes, useful, I don't think so.  smiley-wink
smiley
« Last Edit: January 11, 2012, 01:33:40 am by retrolefty » Logged

0
Offline Offline
Newbie
*
Karma: 0
Posts: 22
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
I didn't mean to a servo's internal pot, just an external normal standard pot if I wanted to measure a rotational angle position. A servo has maybe 180 degree travel, a pot has 270 degrees or so. What does using a servo to read a mechanical angle position have over using a standard linear pot? Actually a optical quadrature encoder is my favorite device for measuring angle rotation.
I almost agree with you BUT, external pot means that I'll have to mechanicaly link the servo to the pot. And I don't want to do that. I don't want to do anything that involves my shaky hands.   smiley-grin

Note: I bought a servo GWS 136L STD: 80N.cm 0.33/60°
Very powerful for my application. In fact,.. too powerfull
I now understand:
Quote
Note that you can potentially damage a servo by turning the servo horn by hand
it was so hard (too hard) to turn with my hands.
I think that at last I will do my own servo motor with my own pot, motor,..
That way I'll have all my desire except good looking.

Thanks

Logged

Phoenix, Arizona USA
Offline Offline
Faraday Member
**
Karma: 39
Posts: 5557
Where's the beer?
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

I didn't mean to a servo's internal pot, just an external normal standard pot if I wanted to measure a rotational angle position. A servo has maybe 180 degree travel, a pot has 270 degrees or so. What does using a servo to read a mechanical angle position have over using a standard linear pot? Actually a optical quadrature encoder is my favorite device for measuring angle rotation.

Yes, using an external pot would probably be better, but if you're wanting a compact device (or lower weight), that may not be an option; using a "true digital" servo with a serial bus would be the best option, but those are rather expensive. This hack solves for both of those situations, without needing to open up the servo to access the internal pot (which is the "standard" hack).

As far as a quadrature encoder is concerned - I'm not sure how you get an angel out of a quadrature encoder (direction and pulses, yes - but an angle?).

Well I suspect that using either a standard pot, or this method using analog readback of the current via a analog input pin will have simiar accuracy and resolution as the A/D converter would be the limiting factor. I suspect the simple standard pot would be much simpler to read and equal or better in accuracy.

If you can go with an external pot, probably; but this hack is nice in that it allows you to reduce the number wires from the servo (though I think more ports are involved on the microcontroller side - not sure?), and no need to alter the servo to get it to work. As far as accuracy is concerned, you may be correct (especially if using a precision potentiometer); the real question is what the difference in accuracy would be between this method, and splicing into the internal potentiometer of the servo...

Yea, it's a cleaver hack, I haven't read the code. I just don't know what problem this solution is trying to solve. Cleaver, yes, useful, I don't think so.

No hacking of the servo required (for internal pot connections), fewer wires from the servo, a compact (and lightweight) setup (closer to a hacked pot servo). Imagine trying to build a bipedal robot using 18 standard servos (because you can't afford the fancy serial bus servos); you need and want servo position information (for posing the robot for "moves", for instance). You could a) Use a bunch of mechanical linkages and external pots, increasing the weight and mechanical complexity, decreasing the run time, and have a bunch of wires from the extra pots running everywhere, b) Hack each servo (18) and hope none of the them break (because you'll have to hack the new one); you'll still have a bunch of extra wires to take care of, or c) Use this method, which eliminates the extra wires, and doesn't add any extra weight or mechanical complexity.

It's only real drawbacks are speed of measuring (which the author already noted could be improved) and the extra circuitry needed for the measurement system. Depending on the needs of your system, the benefits can clearly outweigh the drawbacks. True it can only measure in the range of the servo, and it might not be as accurate; if those are necessary design needs, then use what's appropriate. I do think, though, that this current measurement technique is an interesting one that should be kept in the back of everyone's mind, as it may be the proper solution for a future problem (but certainly not every problem).

smiley
Logged

I will not respond to Arduino help PM's from random forum users; if you have such a question, start a new topic thread.

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 361
Posts: 17263
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
As far as a quadrature encoder is concerned - I'm not sure how you get an angel out of a quadrature encoder (direction and pulses, yes - but an angle?).

 An encoder does so many fixed pulses per revoltion. Just count steps and divide by that factor and you get angle (degrees) moved. If then one has a starting reference either external to the encoder, or use an encoder that includes an index pulse output signal, once per revolution, one can also keep track of absolute angle position, not just degrees traved.

Back to this servo 'trick'. It seem to me if you wire it up as shown you can't then also use it as a output servo where the micro can command it to move. So it just becomes an angle sensor, so what is it's advantage over the other methods used to sense angular motion? Again I may be missing something by not being able to see it used in other real world applications. The video I watch just showed him turning the 'sensor' servo manually and his code would cause another normal servo to track along with the sensor servo. That in itself would be much simpler and cheaper just using a standard linear pot wired to a analog input pin?

Lefty
« Last Edit: January 11, 2012, 07:15:11 pm by retrolefty » Logged

Offline Offline
Full Member
***
Karma: 2
Posts: 200
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

There are actually 2 pages to that thread. Lawson (I think that was the name) came up with a simpler circuit and did some testing on being able to read the servo when holding a load and when the servo was moving. A little work is needed to go thru the thread.

I've been dismembering some servos the last few months and converting them into continuous ones. I like the Hitec cheapy (311) . It and most of the other lower cost hitecs have a sensor pot that is easy to hack. Removing the plastic stop inside it makes it continuous but there is only about 200 deg of
a readable info but allows a way to find home on it. I put 4 holes in the first driven gear and have a QRD1113(4) ROS to sense the rotation. I'm in the process of making a tiny24 to do the work of interfacing and driving the existing hardware with some nice features.


Logged

Pages: [1] 2   Go Up
Jump to: