PDA

View Full Version : Servo controller help please



Sticky
12-09-2009, 10:33 AM
I'm just starting with the propeller chip and I wonder if I can get some help. I'm trying to use the older model of the servo controller and I can't get it to work. I've included a picture of the breadboard setup and servo controller and servo. The controller and servo work with a BOE so I know they are good. I'm using the servo controller object and the basic stamp object. I'm sure it's a simple thing that I've missed. Thanks for the help.

Code, (I couldn't upload it.)

var
byte j,k

con
_clkmode = xtal1 + pll16x
_xinfreq = 5_000_000
led = 0
photo_cell = 15
tx_pin = 30
rx_pin = 31
COMPIN = 15 'Pin used for communication with the PSC
PSC_BAUD = 0 'Baud rate (0 - 2400, 1 - 38400)


obj
bs2 : "bs2_functions_1_3_5.spin"
PSC : "ServoControllerSerial"
pub main

'it's not working??? wth

bs2.start (rx_pin,tx_pin)
PSC.START(COMPIN, PSC_BAUD)
bs2.pause (1000)
J := 4
REPEAT UNTIL J == 0
ledon
PSC.SETPOS (1,9,500)
bs2.pause (1000)
PSC.SETPOS (1,9,1000)
bs2.pause (1000)
PSC.SETPOS (1,9,750)
ledoff
BS2.PAUSE(2000)
J --
J := 5
REPEAT UNTIL J == 0
ledon
BS2.PAUSE (250)
ledoff
BS2.PAUSE (250)
J --


PUB LedOn

dira[led] := 1
outa[led] := 1
PUB LedOff

dira[led] := 1
outa[led] := 0

mynet43
12-09-2009, 11:18 AM
Hi!

I'm not that familiar with the BS2 code, so I didn't look at that.

I did look at your picture. I may be mistaken, but it looks like you only have two wires going to the servo, the ground and control lines. If this is the case, then the servo has no power to drive the motor.

I may be way off but I thought I'd mention it.

Good hunting!

Jim

StefanL38
12-09-2009, 12:19 PM
Hello Sticky,

to analyse what is going on we need your COMPLETE code as attached ZIP-archive.

You can upload code if you follow the screenshots of the attached picture

indention is critical from your post there is no indention to see.
So you really have to upload your COMPLETE project

best regards

Stefan

hover1
12-09-2009, 06:56 PM
Judging by the photo, it looks like you are not supplying power to the servo controller. It need a regulated 5 volts on the red wire from the breadboard. It looks like you have the servo power
connected, but that does not supply power to the controller itself. Hope that's clear.

Jim

Sticky
12-09-2009, 08:17 PM
Thanks all for the help Jim(s). That was the problem - no power to the + pin on the servo board. It works!
And now I know how to get code to the forum thanks Stefan.

Graham Stabler
12-09-2009, 10:22 PM
You can also put code inline with your post using tags (but take spaces out of square bracket)



your code
[/code ]

like this:

[code]

repeat
!outa[10]