Propeller Application: Proportional feedback from a Standard Hobby Servo (Upda
Beau Schwabe
Posts: 6,568
Here is an interesting application that allows you to accurately sense the position of a standard Hobby Servo without modifying the servo.
Note: This could also be accomplished with a BS1,BS2, SX, etc.
With a simple modification to the schematic... using PNP transistor acting as a switch across the 470 Ohm resistor, you can also "drive"
the servo you are sensing.
One application might be for a robot to "learn" or record a sequence of movements simply by positioning the servo where you want it to be,
so at a later time your robot would replay the "learned" motion.
Have fun!
Note: This could also be accomplished with a BS1,BS2, SX, etc.
With a simple modification to the schematic... using PNP transistor acting as a switch across the 470 Ohm resistor, you can also "drive"
the servo you are sensing.
One application might be for a robot to "learn" or record a sequence of movements simply by positioning the servo where you want it to be,
so at a later time your robot would replay the "learned" motion.
Have fun!
Comments
Very nice Beau.
The first thing that came to my mind is controlling a device inside a sealed container, or what not. You get the idea.
Great stuff.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- - - PLJack - - -
Perfection in design is not achieved when there is nothing left to add.
It is achieved when there is nothing left to take away.
I don't know why I haven't seen this sort of thing before, the idea came to me a few nights ago and I thought I would try something out.... and it worked!!
The scanning algorithm needs a little improvement (I'll try to work on that), but it does get the idea across.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
That video says it all. Good job!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chip Gracey
Parallax, Inc.
Really cool!!!
-Parsko
It opens a whole new area to exploiting servos as sensors.
I am sure the Japanese folks that have been selling Parallax servos are happy.
They can tweak their product line to enhance this function.
BTW, is this only a limited to a Standard Servo?
What happens with the full rotation Servos [noparse][[/noparse]I do realize that you don't have the same kind of feedback]?
Are they usefull in a similar fashion [noparse][[/noparse]as a sensor]?
I also see where you could make a steering wheel for a BOEbot with it. Lots of ideas.
I guess that is why Parallax is special - innovation is just everywhere.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
Thank you!
Parsko and Kramer,
The idea was for a standard servo, a 360 or continuous rotation servo would work I guess.
And yes, there is a bit of lag... mostly because of the scanning, but with a better "algorithm"
this can be improved upon. What it boils down to right now, is that you can't move the sense
servo very fast and expect the following servo to keep up.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Who says you have to have knowledge to use it?
I've killed a fly with my bare mind.
I think you are probably right, but you could drive a continuous serve with it.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
"When all think alike, no one is thinking very much.' - Walter Lippmann (1889-1974)
······································································ Warm regards,····· G. Herzog [noparse][[/noparse]·黃鶴 ]·in Taiwan
The first picture I've attached shows the drive circuit I'm using. Vservo is the power input, GND is the ground. Signal is where the servo signal is provided, and Mode controls how much power the servo is supplied with and senses the voltage of the servo.
The spin file attached is some crude code for the primitive functions needed to move a servo and find where it currently is.
I've built up a first prototype on a Propeller proto board with 5x copies of this circuit and a MAX3232. I've also got a PCB layout for this in case we ever need a second one.
Marty
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Post Edited (Lawson) : 9/27/2007 10:38:27 PM GMT
Excellent!· I'm glad that this is working for you.· Can you post pictures or video of your application in action?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Would I need an encoder of some kind? Are there any motors with encoders sold for hobby applications?
- I havn't found any, but maybe I'm not searching right, so I would appreciate any suggestions.
The background is, that I would like to build a panorama camera with the propeller.
I have already built one with Lego-Mindstorms:
http://www.secondpage.de/tutorials/mindstorms/vr1_en.html
(works nice but I'd like to build something smaller and less fragile to carry around in the mountains...)
- the mindstorms servos actually do have an encoder inside, I am hoping there is something similar to attach to the propeller.
Thank You,
Clemens
·
This application was never really meant for a continuous rotation servo.
To determine the position of a continuous rotation servo would require an·encoder of some sort.
·
Now, with that just said,·some would argue that·a standard servo·would also require an encoder to
determine position.· However, the application at hand, sort of proves this theory wrong.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
·
The only real possibility of damage would be from stripping out the servo gears.
Moving them slowly is fine but quick abrupt movements can easily strip out the nylon servo gears.
·
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
It would be nice if we could order entire forum...with regular updates for offline work. The issue of searching has also been discussed in depth... but finding the discussions is another matter.
if you go here, there is a more flexible search engine, which you can bookmark.
http://search.parallax.com/search?ie=&q="Parallax+Forums+>+Public+Forums+>+Propeller+chip+>"+&site=parallax&filter=p&output=xml_no_dtd&client=parallax&btnG=Google+Search&access=p&lr=&ip=212.87.43.129&proxystylesheet=parallax&oe=&proxycustom=<ADVANCED/>
Every once in a while there is a slight lull in the forum activity. That is a good opportunity to review what has happened in the past.
What you will find is that most of your questions have been asked before... many times by one of the forum's current experts.
To get a handle on it all, set your browser to show 100 topics per page... then go to one of the last pages listed by the "forum page listing" . Then just work your way backwards by selecting progressively lower numbered pages.
Reading the Forum backwards is even more fun than reading it forwards.
Rich
If you look at the driver circuits on the Prototype it's pretty easy to see the three revisions of my "sculptural" circuit layout.
@Beau: In this case I'm not too worried about breaking plastic gears. Anyway the standard size servos have a really tough plastic gears. Smaller mini and micro servos can have problems with gear breakage though.
In this case I'm more worried about fatigue with a plastic output shaft. Because of this, I am using a metal gear servo, a Futaba s3305. It's a convenient compromise of cost, power, and weight.
Later,
Marty
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
I have modified a servo for continuous rotation for use in the "Worlds Slowest Coil Winder." What is the simplest way to add an encoder... using Parallax parts?
Rich
How about this...
http://www.parallax.com/detail.asp?product_id=721-00001-721-00002
...with this?...
http://www.parallax.com/detail.asp?product_id=28107
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Graham
Many thanks...
I feel like a kid in a candy store[noparse]:)[/noparse]
Rich
Your welcome!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
The prototype board has been running in the system for several months now. It picked up an extra function along the way. It now also times the delay from when the Q-switch on the laser triggers to when a laser pulse leaves the laser, and generates a logic signal for the data system. Short delays indicate that the laser's pulse was good, while long delays indicate that the pulse was bad. This extra function was tacked on with a daughter board that's only supported by it's connector. Not something likely to survive long when this system starts flying. So I went ahead and revised my PCB and built up two final controllers.
Attached is a picture of the final product. A co-worker has some pictures of it in the system. I'll post those pictures when I get copies.
I learned two things from this whole project. First, always check the hole size of component footprints from the component library. Second, I really should have used resistor and transistor packs for this thing irrespective of the massive mess it would've made of the layout.
Marty
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Post Edited (Lawson) : 10/24/2008 9:48:28 PM GMT
That's great! I'm glad to see your project coming together.
I would love to see some video of the servo's "learning"·their position in a real application.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Any chance it could fry the motor driver in the servo circuit?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
A wise man told me; "All electronics are made to work by magic smoke.
Don't ever let it out as it's·very difficult·to get it back in."
I don't think so, since you are essentially lessening the current to the Servo from what it was originally designed to handle… it would be the equivalent of connecting a weak battery to the servo.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
Not much to see really. The LED goes full on when the servo is moving, the LED is then totally dark when the controller is confirming the position and the servo hums slightly, Then I get a response packet and the LED resumes it's usual slight glow.
Hopefully I'll get some pictures of it installed in the Lidar with the laser lighting up the optics [noparse]:)[/noparse] In the meantime I'll post a archive of my ugly code below. This is my first project that uses assembly, and my assembly routine talks directly to the serial port cog. The integration of the extra function was painless. (all the components worked the first time just as planned!) After having my first experience in assembly on the SX I rather like Propeller assembly.
Marty
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
For anyone who's interested I've attached my updated code. "direct_servo" in the "probe_servo_02.spin" is the function that does all the magic
Marty
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Lunch cures all problems! have you had lunch?
Post Edited (Lawson) : 1/3/2009 12:58:45 AM GMT
Excellent work!
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.