Servo Woes
djh82uk
Posts: 193
Heya Guys
I picked up a servo to play with, got it wired up and it works, did not have any 4.7k resistors so used 2 x 2.2k and one 300R in series.
I cannot get the servo to do anything than jidder back and for (tiny movements)
this is the servo I have Linky
I am using this code
I picked up a servo to play with, got it wired up and it works, did not have any 4.7k resistors so used 2 x 2.2k and one 300R in series.
I cannot get the servo to do anything than jidder back and for (tiny movements)
this is the servo I have Linky
I am using this code
Somebody said...
CON
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000 'Note Clock Speed for your setup!!
SpeedServo = 4
DirectionServo = 9
OBJ
SERVO : "Servo32"
PUB Servo32_DEMO | temp
'Preset Servo's you want to use to center position
SERVO.Set(SpeedServo,1500)
SERVO.Set(DirectionServo,1500)
'Note: Servo pins that will be used must be preset before running "SERVO.Start".
' This is because the I/O direction is set here and is only executed
' at the beginning of "SERVO.Start". Servo pins that aren't used will remain
' in their original direction state.
SERVO.Start 'Start Servo handler
repeat
SERVO.Set(SpeedServo,1500)
'SERVO.Set(DirectionServo,1500)
waitcnt(clkfreq + cnt)
'SERVO.Set(SpeedServo,1000)
'SERVO.Set(DirectionServo,1000)
waitcnt(clkfreq + cnt)
SERVO.Set(SpeedServo,1500)
'SERVO.Set(DirectionServo,1500)
waitcnt(clkfreq + cnt)
SERVO.Set(SpeedServo,1000)
'SERVO.Set(DirectionServo,2000)
waitcnt(clkfreq + cnt)
Comments
2) The WAITCNTs provide for a 1 second delay. That's not enough time for the servo to finish moving if it has far to go.
3) You don't need precisely a 4.7K resistor. Anything in the range 470 ohm to 4.7K should work fine. You're trying to limit the "fault current" into the Propeller pin to something under 20ma if you accidentally connect the pin to a voltage over 3.3V or something other than what the Propeller is trying to output. This shouldn't happen with a servo since a servo has an input connection only, but accidents can happen.
Post Edited (Mike Green) : 6/24/2007 2:05:04 PM GMT
Do I need to find out the servo's operating range, if so how can I do that?
I thought the waitcnt was effectivley the 1.5ms pause (neutral)?
Im confused [noparse]:([/noparse]
DJH
Is a one second delay. This should be enough time for a fairly decent sized movement at least.
Post your code as a file then the indentation etc can be seen.
Graham
"waitcnt(clkfreq + cnt)" always causes a 1 second delay. "waitcnt(clkfreq/10 + cnt)" gives a 1/10 sec delay. "waitcnt(clkfreq*5 + cnt)" gives a 5 second delay.
I am not used to using waitcnt in that way, I always have to do waitcnt (clqfreq / 10000) to get a 1 second delays.
DJH
this is all the info I have:
Fastrax FTX3000 Universal Servo
Standard fitting.
For all steering etc.
Compatible with Futaba etc.
Inexpensive replacement servo ideally suited to aircraft or multi-channel cars where multiple servos are required, and you are looking for reasonable performance without paying the earth.
Spec Check:
* Speed: 0.20 sec/60°
* Torque: 4.0kg/cm
* Weight: 44.62g/15.74oz
Part # Description Price (RRP)
FTX3000 E-Std Servo £6.99
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
The same happen to me until I used a 6 VDC wall brick from Lynxmotion.
I am using the demo board and is not very easy to connect power to the servos.
Including a setup I am using.
Now if I start the protoboard, sometimes the motor will rotate a good 90 degrees or so, then just start juddering..
I have a 1A variable psu that I will try, which will be useful as it measure the current draw at the same, time.
Thanks
DJh
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
when jiddering it does not seem to be at it's outer limit
DJH
You are in your first post.
Graham
Thanks for your help
DJH
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
DJH
then *pause* again. This doesn't sound like juddering to me.
Anyway, I'm now happily using 5 1.2V NiMH batteries with my Prop bot, and they do seem to last
forever. And no unexpected resets.
I'd add an LED and make your prop blink the LED at startup; this way you will *always* know when the
prop resets.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Paul Baker
Propeller Applications Engineer
Parallax, Inc.
I can get it to rotate about 90 degrees
is that about their limit?
Also am I able to control speed?
Does anyone have any spin code examples for controlling 1 servo, im currently using servo32 from the object exchange, but there is a lot to it and so is difficult to understand, (making it harder to figure out what bits to play with)
DJH
I think there's a 4 servo control object in the object exchange that's written in Spin. You can also look at BoeBotBasic which has a routine for controlling 3 servos that's written in Spin.