Can I control several servos via BS2 simultaneously, like with servo controller?
hellobazov
Posts: 5
Thank you!
Comments
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/servo/List/0/SortField/4/ProductID/595/Default.aspx
http://www.parallax.com/StoreSearchResults/tabid/768/txtSearch/servo/List/0/SortField/4/ProductID/481/Default.aspx
"Control" can be interpreted in many ways.
Those are all running the same routine, in succession, in a loop.
Anything more "dynamic"?
Could each be set to a different position, given some user or sensor input, leaving the others unchanged?
A Stamp can easily control 3 servos while doing some useful i/o operations:
http://www.youtube.com/watch?v=J5GMOAIQbJ4
http://www.youtube.com/watch?v=-Z8lTSX4PHs
Four or more requires some tight programming and less i/o stuff.
The main timing issue is that servos require a control pulse about once every 20ms. If this is missing, the servo turns off until it sees the next control pulse. This on / off cycling causes jerky movement, so you want to avoid it. Stamp programs using servos thus work in 20ms cycles using PULSOUT statements to provide the control pulses and PAUSE statements to fill out the 20ms cycles. The control pulses usually range from 1ms to 2ms, but could be as long as 2.5ms plus a few hundred microseconds for the PULSOUT statement. Figure 3ms for one servo.
For 3 servos, you'd need to allow for 9ms. That leaves about 11ms for other things. There'll be some calculations or sensor reading that will take up some of this and the rest will be absorbed by a PAUSE statement. Often when some of the servos are not moving, they're allowed to turn off. They won't hold position if under tension, but the friction of the gears is often enough so that they won't slip, certainly in the case of wheel servos not on a steep incline. A robot arm may or may not tolerate this depending on how it's made and how much load is present on it.