Society of Robots - Robot Forum

General Misc => Misc => Topic started by: ogcyborg on August 31, 2009, 03:01:22 PM

Title: Servo control with button
Post by: ogcyborg on August 31, 2009, 03:01:22 PM
Hi,

I am totally new at this stuff.  I would like to have a servo rotate 90 degrees with a button push, then when pushed again, it will return to it's original position.  How do I do this? I know there are controller boards and software.

I did purchase a servo controller that will do this, I plug in a batter pack and the servo, turn the dial and the servo operates how I want but it is not a button just a potentiometer.  I purchased a small board, a 555 timer chip, a 5k potentiometer, resistor, capacitor, to try to build the simple controller (for learning).

Any help or advice would be great.

Thanks,
Brian
Title: Re: Servo control with button
Post by: SmAsH on August 31, 2009, 03:38:08 PM
this is a very simple task, what controller are you using, and what language?
Title: Re: Servo control with button
Post by: ogcyborg on September 01, 2009, 11:18:30 AM
It is a brand new Futaba Digital Servo S3152 (FUTM0311)

As far as software I don't have any in particular.  However, I am a programmer so i can program in C, C++, and many more.  I'm so new to this so I don't know.  I've seen a lot of stuff but don't know if I need stuff like the Anduit or PIC, etc.

I was reading online doing a google search on serve controller that the white wire receives a pulse of some duration and that is what controls it.  I don't know if I can do this with a 555 chip and hardware or if I need both.

Thank you for your help :-)
Title: Re: Servo control with button
Post by: Admin on September 01, 2009, 01:25:46 PM
I'd recommend ditching the 555 and learning microcontrollers :P

(start with the $50 Robot)
Title: Re: Servo control with button
Post by: ogcyborg on September 02, 2009, 10:16:33 AM
Thanks, I'm reading the $50 robot now.  I mainly use a Mac on OS X, do you know if I can just Xcode or GCC without something like WinAVR or does WinAVR give me all the libraries I need?

Thanks for the help  ;D
Title: Re: Servo control with button
Post by: GearMotion on September 02, 2009, 10:36:29 AM
You could use the Arduino IDE for code development as it runs on a Mac: http://arduino.googlecode.com/files/arduino-0017.dmg (http://arduino.googlecode.com/files/arduino-0017.dmg)

And then use an Arduino, a BareBonesBoard (http://www.circuitgizmos.com/products/cgbbb/cgbbb.shtml (http://www.circuitgizmos.com/products/cgbbb/cgbbb.shtml)) or the SOR parts kit (http://www.circuitgizmos.com/products/cgsorkit1/cgsorkit1.shtml (http://www.circuitgizmos.com/products/cgsorkit1/cgsorkit1.shtml)) for an AVR with a bootloader in it (compatible with the Arduino IDE) for programming. You might also need a USB to TTL serial cable.
Title: Re: Servo control with button
Post by: Finnik on September 02, 2009, 11:05:29 AM
You should be able to code and program on OS X if you've got the right software and packages, although I don't have any experience with OS X. I run Ubuntu Linux as my main operating system and after installing the right packages all is a breeze. Just try searching Google for "avr programming on OS X" or the like.
The libraries that come with WinAVR can also be downloaded and used separately.
Title: Re: Servo control with button
Post by: ogcyborg on September 03, 2009, 08:34:17 AM
I have Ubuntu running on my Power Mac so I can use that too.  I'll have to check out both options.  If I'm successful on the OS X stuff, is that worth posting my results? Or has it been covered a lot?

Thanks  8)
Title: Re: Servo control with button
Post by: GearMotion on September 03, 2009, 09:47:34 AM
You SHOULD share. Even make a tutorial for others. It will be appreciated.
Title: Re: Servo control with button
Post by: Soeren on September 03, 2009, 06:31:38 PM
Hi,

I am totally new at this stuff.  I would like to have a servo rotate 90 degrees with a button push, then when pushed again, it will return to it's original position.  How do I do this? I know there are controller boards and software.
I see now, that I missed that you wanted only one button when I drew this: http://That.Homepage.dk/PDF/Pushbutton_Servo_Control.pdf (http://That.Homepage.dk/PDF/Pushbutton_Servo_Control.pdf), which is with separate buttons for each position.
Could be modified of course.

If you allready were programming controllers and had the equipment, I'd recommend a PIC10F22xx for the job, but if you just want the job done, this is quicker.


Another way would be to modify the controller you allready have.