servo rotation with basic stamp
mikesam
Posts: 1
I am a first time user of the Basic Stamp and have been working with the BOE kit..I'm up to the section on servos and have a application that calls for having the servo go from 9 o'clock (AM)·to 3 o'clock (PM)·. I have not found a command that tells the servo to go to 9 o'clock..There only appear to be 3 positions that are allowed: 10 o'clock, noon and 2 o'clock..
How do I get the servo to start at 9 am and then wind up at 3pm?
Thanks
Mike
How do I get the servo to start at 9 am and then wind up at 3pm?
Thanks
Mike
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
In terms of timing, a pulse width of approximately 1 millisecond will turn the servo fully left, 1.5 milliseconds will centre it, and·2 milliseconds will turn it fully right.· If each command is 2 microseconds, then this equates to a value of 500, 750 and 1500 respectively as previously mentioned.·
To get your servo to turn from full left to full right, first apply a 1 ms pulse for approximately 200 ms.· This causes the servo to turn fully left and allows enough time for it to complete the movement.· Then, apply a·2 ms pulse for a period of 400 ms.· This will turn the servo fully right.
It's possible that your servo doesn't have a full 180 degree range of motion.· It might be limited to say, 120 degrees or so.· If it is, you won't be able to achieve the "9:00" or "3:00" position·no matter what you do, and forcing it to go beyond its limits may damage it (and anything else that might be attached to it).· It might be safer·start with pulse widths of 1.2 ms for fully left, to 1.8 ms for fully right. This limits the range of the servo, but the trade off is that you get finer resolution.·
Once you've got the hang of controlling the range and resolution, you can then adjust the timing until the servo just reaches its limit of travel.