Using the NARO servo
HShanko
Posts: 402
Back when the QuickStart board was made available I also ordered a few other parts. One was the Parallax sold Naro sub-micro servo. But other than a one-page sheet listing several servos, I don't see any other documentation.
I'm a newbie on servos, so have no idea what other circuitry is required to control this part. Is there a schematic for a Prop 1 to drive it?
I note it has a 3-wire header for the interface, but does not seem to have any 'Pin 1' marking. Or does it matter?
And is there any thing on the OBEX for this tiny servo?
I'm a newbie on servos, so have no idea what other circuitry is required to control this part. Is there a schematic for a Prop 1 to drive it?
I note it has a 3-wire header for the interface, but does not seem to have any 'Pin 1' marking. Or does it matter?
And is there any thing on the OBEX for this tiny servo?
Comments
To drive a Servo motor all that the Prop has to do is send a PWM signal to the signal wire of a servo. This can be easily done using the Servo_32 object; http://obex.parallax.com/objects/51/. The length of the pulse defines which position the servo is at, in a range usually from -90 degrees to +90degrees.
Because servos run at a higher voltage then the propeller its important that you add a 4.7k resistor in series with the signal line.
I now have my homework and reading assignment all in one.
A resistor in series with the signal line? I have no idea what is in that small-bodied servo, but I imagined a power driver so some sort would be required between the Prop and servo. OK, lots for me to get acquained with. Thanks again.
BTW, a (Futaba-compatible) servo's wires are color-coded: black = Gnd; red = Vcc, white = signal.
-Phil
The servo has its own power driver. That's one reason they're so popular in hobby robotics.
Phil listed the colors for Futaba servos. Other brands might varry a bit in color but the middle wire is always Vcc, ground is either black or brown and the signal is usually white or yellow.
Look in the "demo" folder for a demo of the servo driver Thirc mentioned.
Servos are and easy way of getting a microcontroller to move things in the real world. You're in for a treat!
-Phil
I have no plans except to learn something of servos. Probably will use a QS board. Hopefully the servo doesn't require too much current from the USB port. May be a while before more questions.
TestServo.spin
CON
servo = 8
invHigh = 0 'inverted because of hex inverting buffer
invLow = 1 'inverted because of hex inverting buffer
VAR
byte position
long servoMultiplyer
long milliSecond
long period
long pulseWidth
PUB pwm
position := 30
servoMultiplyer := (0.0000055556*clkfreq) 'cycles/degree came from half a millisecond divided by 90 degrees because the servo has a range of 180 degrees over 1 whole millisecond
milliSecond := (clkfreq/1000) 'cycles/milisecond
period := (clkfreq/50) 'cycles/period
dira[servo] := 1
outA[servo] := invLow
repeat
pulseWidth := ((1.5*milliSecond) + (position*servoMultiplyer))
outA[servo] := invHigh
waitcnt(pulseWidth + cnt)
outA[servo] := invLow
waitcnt((period - pulseWidth) + cnt)
Any help would be greatly appreciated. I am trying to get degree control of the servo and so far my success has been limited to specific values of the multiplier "1.5" for the pulseWidth. For some reason 1 and 2 work really well but nothing else. I would love to look at this on an oscilloscope but mine is currently not working. I think there may be an error in the waveform this program is using but since I don't have access to an oscilloscope I thought someone may see something I am not.
John Abshier
After looking at Servo32v7, I can see changing it to an inverted signal is beyond my present abilities.
Maybe it wouldn't be too hard for someone else.
-- Gordon
Why complicate matters. As John A. said, why not use Servov7.spin?
Thanks,
Chaz
Chaz,
All your servos and ESC's should be powered with a supply separate from the Propeller, (of course with common grounds).
The outputs from the propeller can directly control the servos and ECS's, even though it's only 3.3 Volts, most, if not all servos and ESC's will work from this voltage. No need for buffering.
The ESC's are not drawing current from the Propeller. They are drawing the current from the battery connected to it. The propeller is just providing the appropriate (3.3 Volt) signal to tell it how much power to apply to it's outputs,(motors).
Same with the servos. They are powered from a separate source, and the signal is from the Propeller.
A simple resistor will do this, but if you need true isolation and full protection you can use an opto-isolator. You have the option of wiring it for an inverting or non-inverting signal.
An inverting buffer offers no more protection than a non-inverting buffer, which is also available. You might as well use a non-inverting buffer if doing so will simplify the software.
-- Gordon
Sorry for that.
Don't worry, I don't feel it was hijacked.
There was too much happening in the past weeks.
Hopefully I will soon get something working.
I've been following what's been posted here. Helpful for me beginning in a new area.
Though this page is for the Parallax Standard servo, the information applies equally well to the GWS Naro servo:
http://sites.google.com/site/parallaxinretailstores/home/parallax-standard-servo
The diagram shows connecting to a QuickStart. The example uses the Servo32v7.spin object, which is on the Obex, but for your convenience is already in the download for the QuickStart code.
The Naro that Parallax sells uses the Futaba connector and color coding, as Phil points out. Pin 1 is white, or signal, and is physically denoted on the connector with the little notch.
There are some examples for the BASIC Stamp (and maybe Propeller) that show a series resistor inline on the signal pin, but such a resistor, if used, is intended to prevent damage to the controller should the servo be damaged and draw excessive current through the signal line. This is very rare, if it ever happens at all, and shouldn't be an issue with any modern servo.
-- Gordon
Gotta be careful here as powering the servo through the QuickStart connected to USB can pose a danger to the USB port (though your PCs ports are probably protected, why take the risk).
The KickStart example I mentioned above shows how the servo should be connected, using a separate battery supply.
Note that the Arduino example does indeed draw power through the USB connection. This is permissible because the Arduino incorporates a resettable polyfuse that trips if current demand through the USB exceeds 500 mA. That's the typical current cap for USB 2.0.
-- Gordon
To be able to see it really working, I added a repeat before the first SERVO.Set and a repeat(800000) after the last SERVO.Set instruction. That let the signal slew from 2ms to 1 ms to 1.5 ms and repeat. Else the 'show' was over before I could scope what's happening. I also substituted instead of the last SERVO.Set a SERVO.SetRamp to smooth out the 'snap action' that was occuring in the original source.
(gripe) Unfortunately, using Parallels/Windows on my iMac, something has gone really bad. It takes like almost an hour for me to get the PropTool launched; the HD is constantly cycling the head, doing what I don't have the slightest idea. And I have to quit Parallels/Windows to use the iMac side after that. So is might painful to get much done without getting very impatient. Thus, to access the PropTool again means I have to go through that long launch each time. Makes me feel like someone took my iMac away and stranded me on 'PC Island' when the PC is an ancient PC running in molasses. (/gripe)
I feel the same way ... beyond my abilities. But must be doable! Can anyone help? I would like to us my inverter, and would really like to not add another IC inverter just to be able to use Servo32v7. Maybe the Author: Beau Schwabe can help?
Why the inverters? Are they already on the board? As has been mentioned a couple of times in this thread, a resistor is enough to make sure the servo doesn't draw too much current on the signal line.
I usually use servos with just a wire between the servo and Prop pin.
Servos don't draw current on the signal line. The link I used above shows a QuickStart driving 32 servo with direct wire connections. No resistors or anything else. If you are worried about current draw (which you don't need to be in this case) you can use a resistor on the line as mentioned previously.
The demo I mentioned uses all 32 Prop I/O pins.
I often use a separate power supply for the servos as I did in the 32 servo example (the center wire powers the servo). When using a separate power supply make sure the two supplies share a common ground connection.