Build a Timed Servo with Basic Knowledge | PF

  • Thread starter Thread starter Zenox
  • Start date Start date
  • Tags Tags
    Servo
Click For Summary

Discussion Overview

The discussion revolves around building a timed servo mechanism that moves between -25 to 25 degrees over a duration of 1 to 2 seconds, with participants exploring various approaches to achieve this using microcontrollers and other components. The scope includes programming, hardware design, and potential alternatives to servo motors.

Discussion Character

  • Exploratory
  • Technical explanation
  • Debate/contested

Main Points Raised

  • Dion expresses interest in creating a timed servo and seeks guidance on programming a microcontroller, along with a simple schematic.
  • One participant suggests considering a DC motor with relays as an alternative to a servo motor, proposing the use of limit switches to control movement.
  • Another participant recommends the Picaxe range of microcontrollers, detailing how to use servo commands and providing example code for controlling the servo's movement.
  • A different participant proposes the Basic Stamp II as a suitable microcontroller, highlighting its ease of use for controlling servos and availability in kits with instructional materials.
  • Another contributor shares pricing information for Basic Stamps and Picaxe chips, suggesting that cost could influence the choice of components.
  • Dion acknowledges the responses and expresses gratitude for the suggestions, indicating a willingness to explore the provided options.

Areas of Agreement / Disagreement

Participants present multiple competing views on the best approach to achieve the timed servo mechanism, with no consensus reached on a single method or component choice.

Contextual Notes

Participants discuss various microcontroller options and their respective capabilities, but the conversation does not resolve which is definitively better for Dion's project. The discussion also includes pricing considerations, which may influence decision-making.

Zenox
Messages
2
Reaction score
0
Hey PF.

I just joined, and I got a question. I want to make this 'timed' servo, making it go from -25 to 25 degrees angle spread over 1 or 2 seconds, and then go back and repeat. I know this might be difficult, but if you can help me, please do!

I think I'll have to program a microcontroller for this. Since I haven't done this before, I would like a link to a good tutorial. I can do some coding/scripting, so that will be OK...

Also, if possible, just a little quick scheme... I don't need a PCB design yet, just the scheme :D

Regards

-Dion
 
Engineering news on Phys.org
Zenox said:
Hey PF.

I just joined, and I got a question. I want to make this 'timed' servo, making it go from -25 to 25 degrees angle spread over 1 or 2 seconds, and then go back and repeat. I know this might be difficult, but if you can help me, please do!

I think I'll have to program a microcontroller for this. Since I haven't done this before, I would like a link to a good tutorial. I can do some coding/scripting, so that will be OK...

Also, if possible, just a little quick scheme... I don't need a PCB design yet, just the scheme :D

Regards

-Dion

Welcome to the PF, Dion. There are several ways you can do this. Are you sure you need a servo motor? Could you just use a DC motor and relays to control direction?

You can also just control it from your PC, and script something on the PC to talk to a USB or serial motor control widget. I think National Instruments has some things that you could use:

http://search.ni.com/nisearch/app/main/p/q/motor/

Omega also has some motor resources:

http://www.omega.com/search/esearch...ort=rank&search=MOTOR&submit=Search&ori=motor

If a DC motor would work for you (or a geared-down DC motor), you could just put limit switches on the system to stop the drive at the end of each travel.
 
Good to hear you are willing to try a Micro to do this.

You might like to try the Picaxe range.
All the chips can do servo commands.
There is a summary of other commands in this link:

https://www.physicsforums.com/showthread.php?t=331073

The Servo command can run in the background while you do other things.

So, you might send a command for the servo to take a certain position and the background command will keep sending the right pulses to keep it there.
You then do a delay of perhaps 100 mS, then tell the servo to go somewhere else. These delays are the way you control the speed of movement.

The command for the 100 mS delay is
pause 100

The command for the servo is like this:
servo 4,75 ‘ initialise servo
main: servopos 4,75 ‘ move servo to one end
pause 2000 ‘ wait 2 seconds
servopos 4,225 ‘ move servo to other end
pause 2000 ‘ wait 2 seconds
goto main ‘ loop back to start

This is an example from the Picaxe manual 2 which is included in the following download.

You can get the programming editor for this at:
http://www.rev-ed.co.uk/picaxe/
It is a 38 MB download but updates are smaller.
 
The Basic Stamp II would also be a good choice for this. If you buy Parallax's "What is a microcontroller?" you get a basic stamp, servo, some components, and a book that tells you exactly how to do this. You can find these at your local Radio Shack too.
 
I would use the basic stamp. When I got one the first thing I did was use it to control servos, they made it very easy to do. Radio shack has the stamps as a kit with a few other parts including a servo. They also include a book that gives you some sample code, programming cable, and software. There is a step command in Basic that allows you to program it to move a servo from one position or another slowly or quickly.
 
These are some prices on Basic Stamps
BS1... $29
BS2...$49
BS2E...$54
BS2P...$79

Here are some prices on Picaxe chips
8M...$2.65
14M...$3.45
18M...$3.75
20M...$3.45
18X... $7.95
28X1...$9.95
40X1...$9.95

I can understand people suggesting what they have used themselves, but you would need a good reason to ignore the message in those prices.
 
Sorry for the very late responce...

Thanks for all your tips! I will sure try everything that's needed! Thanks a lot!

-Dion
 

Similar threads

  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 3 ·
Replies
3
Views
2K
  • · Replies 4 ·
Replies
4
Views
3K
Replies
20
Views
3K
Replies
2
Views
2K
  • · Replies 14 ·
Replies
14
Views
2K
  • · Replies 4 ·
Replies
4
Views
2K
  • · Replies 14 ·
Replies
14
Views
6K