Shop OBEX P1 Docs P2 Docs Learn Events
Servo controller help please — Parallax Forums

Servo controller help please

StickySticky Posts: 42
edited 2009-12-09 15:22 in Propeller 1
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[noparse][[/noparse]led] := 1
outa[noparse][[/noparse]led] := 1
PUB LedOff

dira[noparse][[/noparse]led] := 1
outa[noparse][[/noparse]led] := 0
2048 x 1536 - 1M

Comments

  • mynet43mynet43 Posts: 644
    edited 2009-12-09 04:18
    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
  • StefanL38StefanL38 Posts: 2,292
    edited 2009-12-09 05:19
    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
  • hover1hover1 Posts: 1,929
    edited 2009-12-09 11:56
    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
  • StickySticky Posts: 42
    edited 2009-12-09 13:17
    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 StablerGraham Stabler Posts: 2,510
    edited 2009-12-09 15:22
    You can also put code inline with your post using tags (but take spaces out of square bracket)

    [noparse][[/noparse]code ]
    your code
    [noparse][[/noparse]/code ]

    like this:

    repeat
      !outa[noparse][[/noparse]10]
    
    
Sign In or Register to comment.