Continue to Site

Welcome to EDAboard.com

Welcome to our site! EDAboard.com is an international Electronics Discussion Forum focused on EDA software, circuits, schematics, books, theory, papers, asic, pld, 8051, DSP, Network, RF, Analog Design, PCB, Service Manuals... and a whole lot more! To participate you need to register. Registration is free. Click here to register now.

Servo motor "learn-do" operation

Status
Not open for further replies.

neazoi

Advanced Member level 6
Joined
Jan 5, 2008
Messages
4,114
Helped
13
Reputation
26
Reaction score
15
Trophy points
1,318
Location
Greece
Activity points
36,874
Hello,
Controlling a servo motor is easy with a microcontroller and there are many examples out there.
What I need to do is a little bit odd.

Assumming that there is already a mechanical system that is composed of servos and other mechanical parts, is there any way of programming what I want the system to do, by just moving the servos with my hands?
Then the system can repeat the movements that I have programmed it to do by the servos movement.

Is there any project/product out there, that could do this?
 

Hi,

If I understand you correctly, all you need to do is use a pot either rotary or slider tyes to mimic your hand movement which is read by the micros adc port and then adjusts the servos m/s ratio accordingly.

Once you have got that working you could use a joystick to give a more realistic feeling.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Is this what you are referring to:



If so, I have a few example implementation of this concept.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
You could well be right and that is an interesting approach.

I read the original question a little differently and assumed the poster (OP) actually wanted to turn the servo arms manually and capture the movements in such a way that the record could be used to program a micro. That might be possible, but it would involve hacking into each servo to capture the position information. I do't think it would be possible by trying to capture some sort of signal data from the servo lead.

Here is a link to what a hobbyist found in a typical, cheap servo. The main chip is made by Agamen. The link I have to the datasheet for the AA51880 is not working today, so I did a screen print to capture the important stuff to this reply:



Note the sense resistor (VR1) near the servo motor. That is one place where the OP might test to get information about the manually controlled positions. If one were to take that approach, I suspect it would have to be done power off. With power applied to the servo, manually moving the servo arms could damage the servos, depending on the type of servo being used. For any servo, current draw would be quite high, if held out of position.

So, I think bigdogguru has the best solution, even if that is not what the OP intended.

John

Edit: The four asterisks should be the word, "****." For some reason, the site relplaces my word with the asterisks. I hope it is not considered profane.
Edit#2 : H_ac_k is apparently not allowed. So I changed to "test."
 
Last edited by a moderator:
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
bigdogguru's approach is very close to what I mean. But eliminating the potentiometers and having the micro "read" from the servos is exactly what I mean.
The servos will have the power disconnected and they would behave as (pulse) generators at the moment of reading.
It gives so much flexibility, you just make your machine learn what you want to do without bother with complex programming.
Imagine a home robot vacuum cleaner or grass cutting machine where it repeats the movements you have it preprogrammed it to do, not by some kind of neural networking process but by a repeating process. Just move your cutting machine once on your garden and then it follows the same pattern again.
 

There are actually a few commercial software packages that claim to do exactly your description.

They are of course NOT CHEAP.

I may have some links to open source attempts at the same concept. If I find them, I post them for you.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Thanks a lot, I will be waiting if you find any. It would be interesting to other members too
 

bigdogguru's approach is very close to what I mean. But eliminating the potentiometers and having the micro "read" from the servos is exactly what I mean.

I don't see how that can be done. In the demonstration video, I am almost certain the potentiometer or more likely a function controlled by it (i.e., pulse width) is being read.

The servos will have the power disconnected and they would behave as (pulse) generators at the moment of reading.

Servos do not give a pulse when manually moved without power. At least newer ones don't.

John
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
I don't see how that can be done. In the demonstration video, I am almost certain the potentiometer or more likely a function controlled by it (i.e., pulse width) is being read.



Servos do not give a pulse when manually moved without power. At least newer ones don't.

John


You right John.

However, I believe they use encoders to get around that issue. It's basically the same technique as the use of a joystick, except they are recording the encoder data rather that the joystick data.
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Encoders attached to the servo would certainly work.

Perhaps this is a invalid assumption, but I assumed we were discussing cheap analog servos for which the pulsewidth:positon relationship may vary slightly from servo to servo. Substituting identical servos will almost always cause a small trim change. Thus, the approach used in the video of actually driving each servo and determining what pulse width was actually needed would have an advantage.

John

Edit: It just occurred to me that there may be a simple solution, depending on how complex the OP's needs are. Many RC set-ups have a "failsafe" feature. One simply puts the controls using the transmitter into the desired positions, presses failsafe, and those positions are memorized by the receiver. If signal is lost, it then defaults to those control inputs. One might be able to read those positions (I can on a JR9303 -- many computer radios allow that function). Then those positions could be used to program the micro. That would be a very tedious procedure if coordinated or complex actions were needed. But if only a few positions were needed, it might be feasible.
 
Last edited:

Encoders attached to the servo would certainly work.

Perhaps this is a invalid assumption, but I assumed we were discussing cheap analog servos for which the pulsewidth:positon relationship may vary slightly from servo to servo. Substituting identical servos will almost always cause a small trim change. Thus, the approach used in the video of actually driving each servo and determining what pulse width was actually needed would have an advantage.

John


Yes I was referring to these analogue servos that do not include any circuit inside, just the coils magnet mechanism. These can be found in VCRs CDroms and other such home equipment.
 

Are you sure they are servos and not stepper motors or just regular motors with limit switches?

John
 
  • Like
Reactions: neazoi

    neazoi

    Points: 2
    Helpful Answer Positive Rating
Are you sure they are servos and not stepper motors or just regular motors with limit switches?

John

Yes that is my fault. Apologise for the confusion. I did not know the difference between them, I thought they were the same type. They are stepped motors.
So I refer to stepped motors actually. Micro-precise movenemts is not an issue.
 

Here's one idea of how to find initial position of a servo:



I know I have some more documents related to this idea, just have to find them.
 

Attachments

  • ServoTrackingVideo.zip
    557.1 KB · Views: 145
Last edited:

Status
Not open for further replies.

Part and Inventory Search

Welcome to EDABoard.com

Sponsor

Back
Top