PDA

View Full Version : Discussion servo controlling question from a newb


tecnocris
Mar 06, 2006, 11:10 AM
Sorry if this is a stupid question, but I'm having trouble finding a beginners guide to servo's and I have a fairly specific question. I need to be able to control a servo not on the fly, but a pre-programed set of movements....ie: 5 degrees to the left, then 10 degrees back, then 10 degrees, then 20 degrees and so forth, I need it to be able to move it on a pre-programed course and not by my controll. So does anyone have any suggestions? I'm new at this so sorry if this is a stupid question.

376782
Mar 06, 2006, 11:27 AM
Most servos operate over a range of 90 degrees for a pulse width which varies from 1.0 msec to 2.0 msec (positive going, 5V amplitude).These pulses are sent to the servo approximately 50 to 60 times per second. Neutral would be 1.5 msec.

In order for you to control the servo position via some computer type of control I would suggest you need to make up some kind of interface that can communicate with a programable PIC. This is somewhat out of my league but if you are getting in to this type of controls I expect you either are familiar with them or will have to become familiar with them.

You may also want to explore what is available for robots as they seem to be gaining popularity. There is now a magazine available exclusively for robotics and they have several devices that use RC type of equipment.

Good Luck

Dave

tecnocris
Mar 06, 2006, 11:37 AM
yeah, I found this http://www.seetron.com/ssc.htm which is supposed to control a servo from a computer, but i'm not sure where to go from there...I suppose I might be out of my league, Plus I was kinda looking for some way to do it and not have to have a computer hooked up to it permanently, I suppose just kinda program it and then leave it be.

Tophinater
Mar 06, 2006, 11:41 AM
I just wrote a program for my BS2 last night that was doing almost exactly what you are asking for. I think the simplest way would be just to get a microcontroller. You can get them for fairly cheap now like this basic atom for example http://cgi.ebay.com/OEM-Basic-Atom-Module-4-Postage-Stamp-Size_W0QQitemZ7596898104QQcategoryZ4661QQssPageNam eZWDVWQQrdZ1QQcmdZViewItem

hargard
Mar 06, 2006, 11:51 AM
The Picaxe chip is well suited to this as it has servo output commands.
Its real easy to learn and use.
This way you can adjust it at ant time you want
http://www.rev-ed.co.uk/picaxe/
All the manuals are online so have a look :)
Regards Hargard RoV builder

tecnocris
Mar 06, 2006, 12:07 PM
I just wrote a program for my BS2 last night that was doing almost exactly what you are asking for. I think the simplest way would be just to get a microcontroller. You can get them for fairly cheap now like this basic atom for example http://cgi.ebay.com/OEM-Basic-Atom-Module-4-Postage-Stamp-Size_W0QQitemZ7596898104QQcategoryZ4661QQssPageNam eZWDVWQQrdZ1QQcmdZViewItem

are these hard to program? the last time I did programming was freshmen year of college when I took a visual basic class, but that was a long time ago and the coolest thing I made in that class was a calculator.

Tophinater
Mar 06, 2006, 01:41 PM
Im a 3rd year mechanical engineer major. The only programming expiriance I have had was a VB class probably much like yours and a hardware class with ABEL programming Xilinx chips. PBASIC is very much like VB but even more simple. Personally I am horrible at programming and a newb to electronics in general and I was writing programs to control a servo with in an hour. And if I can do it, then believe me you can to.

Gary Warner
Mar 06, 2006, 02:28 PM
yeah, I found this http://www.seetron.com/ssc.htm which is supposed to control a servo from a computer, but i'm not sure where to go from there...I suppose I might be out of my league, Plus I was kinda looking for some way to do it and not have to have a computer hooked up to it permanently, I suppose just kinda program it and then leave it be.

I thought about this a bit. See if this suits your needs.

PIC Ic, three switches, 1"x1" board.

2 program modes and a run mode.

First program mode: Use the end switches to position the servo where you want it. Press center switch and that position is now stored. Repeat the position adjust and store routine as needed for the different angles in the order they will be used.

Second program mode: In this mode, the PIC begins to send out the positions (angles) in order that they were recorded, one at a time. But you will press the center switch to 'step' through the order. The PIC reads the time it takes between the steps and records this time.

Run mode: the PIC will replay the different positions in the order programmed and with the time between steps as was programmed. It could have the option to stop at the end of the playback, loop back to the beginning, reverse the order when the end is reached and have the option to reverse play once or continually.

Would something like this work?

Gary
--

Malc C
Mar 06, 2006, 02:57 PM
Gary,

Taking your suggestion further, how about creating a fully programmable interface in addition to the above that will work with this software (http://www.brookshiresoftware.com/vsa_overview.htm) - I too would be interested in a means of controlling loads of servos, an ideal robotics project.

tecnocris
Mar 06, 2006, 03:17 PM
I thought about this a bit. See if this suits your needs.

PIC Ic, three switches, 1"x1" board.

2 program modes and a run mode.

First program mode: Use the end switches to position the servo where you want it. Press center switch and that position is now stored. Repeat the position adjust and store routine as needed for the different angles in the order they will be used.

Second program mode: In this mode, the PIC begins to send out the positions (angles) in order that they were recorded, one at a time. But you will press the center switch to 'step' through the order. The PIC reads the time it takes between the steps and records this time.

Run mode: the PIC will replay the different positions in the order programmed and with the time between steps as was programmed. It could have the option to stop at the end of the playback, loop back to the beginning, reverse the order when the end is reached and have the option to reverse play once or continually.

Would something like this work?

Gary
--

YES, this is exactly what I need, see i'm trying to build somthing like this http://elm-chan.org/works/vlp/report_e.html with servo's positioned in an X/Y pattern to control the path of the laser beam, but I'm not trying to make extremely complex drawings on the wall, just control where the beam points.

Malc C
Mar 06, 2006, 03:17 PM
Gary, looking around there tends to be loads of servo controllers, most of which are based around the Scott Edwards Serial Servo Control protocol - I found a document that provides the format on how this protocol works.. http://www.technobots.co.uk/Technical/Microcontrollers/3800-100.pdf

The disadvantage is that, like most serial servo controllers send the data to each servo at a time. Although this happens quickly, it would not look right for something like a robot arm, because first the shoulder servo would move, then the elbow then the wrist etc etc... If I understand that software correctly, it can send data to the SSC to move more than one servo at a time?

Malc C
Mar 06, 2006, 03:25 PM
see i'm trying to build somthing like this http://elm-chan.org/works/vlp/report_e.html

Ahh Lasers facinate me having seen a show at the London Lazerium (sp) back in the late 1970's

I have one question.. will servos be fast enough to move the mirrors to "draw" the images... it shows an image at 19 fps, which I assume means that the laser is repeating the pattern 19 times a second.. maybe this is why they use armatures between a magnetic coil to move the mirrors fast enough ??

tecnocris
Mar 06, 2006, 03:30 PM
your right, I dont think servo's would be fast enough, but i'm not trying to draw pictures, I'm just trying to create a laser beam "show", kind of like what you'd see at a club. I could use a beam pointed at a disco ball, but I need to be able to program it to point where I want it to when I want it to. I believe servo's would be fast enough for that.

Malc C
Mar 06, 2006, 03:59 PM
If you wanted to simply deflect the beam to produce "disco" effects, then I think digital servos might be quick enough to produce some really interesting effects

Gary Warner
Mar 06, 2006, 04:17 PM
For laser drawing, a voice-coil mirror movement is usually used. Kind of looks like the tiny little magnetic servos we use for sub-ounce airplanes.

I robbed two out of an older Pioneer Laser Disc player. These things are worth their weight in gold. Find an old player on eBay and you'll also get some cool grating lenses, prisms, mirrors, the two movable mirrors and a NeNo Laser tube with power supply.

Gary
--