Shop OBEX P1 Docs P2 Docs Learn Events
Trying to work with a Polu Serial motor controller — Parallax Forums

Trying to work with a Polu Serial motor controller

charleyshfcharleyshf Posts: 165
edited 2009-10-04 21:34 in Propeller 1
Hello,

I am fairly new to the Propeller and have been trying to get my prop to talk with a Polu Serial motor controller, I found an example for the basic stamp 2:
serout pin,baud,[noparse][[/noparse]$80,0,0,speed]

I have tried using simple_serial.spin as well as FullDuplexSerial.spin without any success.
With simple_serial·I tried :
dira[noparse][[/noparse]4] := 1· 'Set pin4 to output
outa[noparse][[/noparse]4] := 1 'Set pin4 to high(enables motor controller)
a·delay
SERIAL.init(-1,3,9600)
a delay
SERIAL.str(string($80,0,0,127))

The module I am trying to work with is this: http://www.pololu.com/file/download/smc02b_guide.pdf?file_id=0J36

I can get this working with my BS2, but for some reason I cannot get it to do anything with my prop.

I'd appreciate any ideas.

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-04 04:33
  • charleyshfcharleyshf Posts: 165
    edited 2009-10-04 11:47
    Thank you for the code, I was going through them and I was wondering about·how to use MotorSpeed(???) in motormdsmc.spin it's not clear to me, I can use MotorSpeed(127) which makes both motors go forward(and there's quite a delay before it does go, thinking it's maybe the motor controller), but I am trying to figure out how to make it turn left,right,etc, etc,.

    Thank you again for your help.
    ··
  • TimmooreTimmoore Posts: 1,031
    edited 2009-10-04 17:42
    You will not able to use the attached directly (in particular onebot.spin and tribot.spin) - I use a non-standard build system but botxwd.spin translates from an arcade style RC controller input i.e. forward/back, left/right to motor speed for a 2 or 4 wheels bot. onebot calls it and tribot.spin is an example config. If you dont use encoders on the wheels then nullencoder just copies from botxwd to motorspeed.
  • charleyshfcharleyshf Posts: 165
    edited 2009-10-04 18:20
    Thank You
  • charleyshfcharleyshf Posts: 165
    edited 2009-10-04 21:34
    Thanks again for the examples, but honestly I think I have quite a ways to go with learning how to use the prop & spin, So far I have been able to interface an XBee module, sonar units, some I2C devices, servos(both regular and continious rotation ones) to the prop with help from the obex.

    I know nothing about assembly.

    Something I was thinking about, when using this motor controller with the basic stamp, or even a pic, it's just slow in general, so even if I could get a robot that avoids objects using sonar, with this motor controller I would need to set the distance way up there, or maybe I just have a bad motor controller unit.

    Anyways I think it's going to be easier for me to either get a different motor controller that is controlled with either PWM or even like the HB-25's, at least with modified servos for wheels I am not having issues like this, I spent the entire weekend trying to figure out what the hec I am doing wrong, and I am still at a loss.



    ·
Sign In or Register to comment.