digital servo control
either the search button doesnt work very well, or nobody talks about digital servos :P
i have a project that reads an accelerometer and compass, and calculates some simple
algorithms, outputting them to 4 servos. this is all done with BS2px24.
its something like this:
read accelerometer
read compass
output to servo 1,2,3,4 (pulsout from 1250 to 2500 values)
pause for less than 20ms, since the readings and multiple outputs take up a fair bit of time
basically, does anyone know how to control digital servos while still doing a big load of
calculations? or do i have to get a servo controller?
details:
i used to use analog servos, and it worked fine, then i switched to digital servos and now
it doesnt work at all.
i researched a bit and saw that digital servos have on/off cycles that are evenly spaced,
instead of on/pause until around 20ms cycles for analog servos.
i switched from futaba s3110 to s3154
nowwwww i cant even control it, not even a twitch from it (but the servo works, when connected
direcltly to a receiver)
i tried using pulsouts from 1250 to 2500, 100-1000
i tried the PWM command, though im not really sure how it works
PWM 12, 64, 255
update: using pulsout works, but only if i'm controlling one servo at a time, im not sure what the logic is,
when i use a simple program, it works fine, when the coding takes up more time, my servos go crazy,
they spin left right left right with no attention to the instruction given. i assume it has something to do
with the computation time, but i cant put a finger on it.
is there a way to PWM the controllers, and have it stay in that position until you next move it, without
buying a servo controller? (also would the parallax servo controller work for digital servos?)
Post Edited (jawnlooi) : 12/11/2006 12:30:04 PM GMT
i have a project that reads an accelerometer and compass, and calculates some simple
algorithms, outputting them to 4 servos. this is all done with BS2px24.
its something like this:
read accelerometer
read compass
output to servo 1,2,3,4 (pulsout from 1250 to 2500 values)
pause for less than 20ms, since the readings and multiple outputs take up a fair bit of time
basically, does anyone know how to control digital servos while still doing a big load of
calculations? or do i have to get a servo controller?
details:
i used to use analog servos, and it worked fine, then i switched to digital servos and now
it doesnt work at all.
i researched a bit and saw that digital servos have on/off cycles that are evenly spaced,
instead of on/pause until around 20ms cycles for analog servos.
i switched from futaba s3110 to s3154
nowwwww i cant even control it, not even a twitch from it (but the servo works, when connected
direcltly to a receiver)
i tried using pulsouts from 1250 to 2500, 100-1000
i tried the PWM command, though im not really sure how it works
PWM 12, 64, 255
update: using pulsout works, but only if i'm controlling one servo at a time, im not sure what the logic is,
when i use a simple program, it works fine, when the coding takes up more time, my servos go crazy,
they spin left right left right with no attention to the instruction given. i assume it has something to do
with the computation time, but i cant put a finger on it.
is there a way to PWM the controllers, and have it stay in that position until you next move it, without
buying a servo controller? (also would the parallax servo controller work for digital servos?)
Post Edited (jawnlooi) : 12/11/2006 12:30:04 PM GMT
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
they seem to be compatible, but only if i can control the amount of lows, whereas with the analog i could just leave as much space as i wanted.
[noparse][[/noparse]link]http://www.futaba-rc.com/servos/digitalservos.pdf[noparse][[/noparse]/link]
check out the bottom left images, does PWMPAL output the digital servo signal? as far as i see in the manual, it only shows that you can send
out a specific on-off cycle, not a 20ms spread PWM
(am i making sense?)
The article you posted describes what goes on internally in the servo, not how it appears to the outside world. To the R/C receiver or microcontroller, these servos are completely compatible with analog servos. They are constructed that way deliberately so the manufacturer can provide higher performance at lower cost (fewer parts).
To help you, we would need more information about your program, your circuit, and your power supply. It may be that the higher peak power requirements of the digital servos are causing problems. The behavior you describe doesn't make sense with regards to the rate of servo pulses.
Visit search.parallax.com
Click "advanced search"
Enter your search terrms
Enter "forums.parallax.com" in the field labeled "return results from the site or domain"
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
When the going gets weird, the weird turn pro. -- HST
i am thinking that my program generates an "equal area" output, as opposed to a proportional output, which would be better suited to the digital servo. have a look at the images at the bottom of [noparse][[/noparse]link]http://www.awce.com/pak5.htm[noparse][[/noparse]/link].
i will post·my code when i get back home later today. can the PWMPAL generate a proportional output? if so i'd quickly go get one (my project deadline is veryyyyyy soon). my mircoprocessor is probably overloaded (i hope its this simple).
2. The "Servo Control Signal" is not true PWM -- it's a 1 mSec to 2mSec high pulse, repeated every 20 mSec. I don't know what documentation you've seen, but both Analog and Digital Servo's use this control signal. Because there's LOTS of RC equipment out there that generates that signal. In other words, WHERE in the 20 mSec the 'pulse' is doesn't matter.
3. The big difference between an Analog and Digital servo is internal -- Digital servo's are 'refreshed' internally much more often than the internal refresh of an Anaolog servo. AND Digital Servo's can pull a lot more current than an Analog servo.
4. Therefore, the problem you are having seems to be related more to power than to PWM or PULSOUT. Especially when you say you can control ONE Digital Servo at a time -- classic symptom of a power limitation.
5. So, what are you using to power this thing?
2) in the PDF www.futaba-rc.com/servos/digitalservos.pdf here, there is a picture of a
20ms 'servo control signal', is the 'digital' waveform supposed to be the truw PWM?
4) i can control all 4 servos at a time, if i dont spend time in between the program reading my compass
and my accelerometer modules. (ie, if its just a simple "for i=1to100" pulsout kind of loop)
5) my microcontroller and sensors are powered by a 9v batter, while the servos are powered by a
RC receiver. i snipped off the white signal and connected it to my p12,13,14,15. (yes its common grounded [noparse]:)[/noparse])
i do doubt that its a power issue, but then again im really good at this haha.
thanks for all your help peoples
(should i just buy the PWMPAL and see if the problem is from the PWM pulse? does PWMPAL generate a
true pwm pulse?)
A Digital servo uses the SAME control signal as an Analog Servo. That control signal is a 1 to 2 mSec pulse, repeated every 20 mSec. The three-conductor wire your BS2 uses to talk to it uses the SAME control signal as an Analog Servo.
You don't NEED "true" PWM, nor would having "true" PWM help in this case.
If the timing problem you mentioned above is true, then it DOES look like the process of reading your Compass, or Accelerator modules, is delaying your refresh. The Parallax Servo Controller (PSC) WOULD help you off-load the servo refresh from the BS2.
But PLEASE quit suggesting the true PWM, or buying the PWMPal, will help this problem. The answer to that is "No", the PWMPal will not help you solve this problem. The PSC might.
allanlane, thanks for your input, i will try the PSC or a similar co-processor (any 4 servo controller?)