Shop OBEX P1 Docs P2 Docs Learn Events
Propeller to Sabortooth 2X25 help please — Parallax Forums

Propeller to Sabortooth 2X25 help please

wkinnewkinne Posts: 6
edited 2009-09-18 22:10 in Propeller 1
I am new to the board here, I just received my Viewport ULT + Prop Proto USB a couple of days ago and just fired it up. I have a Sabertooth 2X25 and hope to drive 4 wheelchair motors with two of them once I learn the basics. I would love a simple schematic of exactly how to wire my Sabortooth to the Propeller board, and just enough spin code (with tons of remarks) to turn the motors both ways at variable speeds. I have downloaded some of the objects for this from Parallax's website but it is still Greek to me. I am a hands on kinda guy and would learn fast with a little head start. I am building a very large Robot and am very excited about my new Propeller with its 8 cogs. I used to program in Turbo Pascal and went to Electronics school way too long ago, so I feel I have the basics. I just need a little jump start.

Thanks,
wkinne

Comments

  • TimmooreTimmoore Posts: 1,031
    edited 2009-09-18 21:10
    I would config the sabertooth to use RC input and then use this object http://obex.parallax.com/objects/467/. You will need 4 outputs from the prop, to each RC input of the sabertooths. Put a 1K resistor inline between the prop pin and the RC input. You want to look at the Servo control in the demo program. RC is servo control. PWM(0, 1500) is stop, PWM(0, 1000) is fast one way and PWM(0,2000) is fast the other way where 0 is the prop pin. Just repeat for all 4 pins.
  • John AbshierJohn Abshier Posts: 1,116
    edited 2009-09-18 21:25
    CON
      _clkmode = xtal1 + pll16x
      _xinfreq = 5_000_000
      MtrCtl   = 0                  ' Motor control pin
    { wire up motors and battery per instructions
      wire ground on prop board to 0 volts on Saber
      wire MtrCtl pin to S1 on Saber (perhaps with a 1kOhm resistor for safety)
      set 9600 baud on Saber per manual }
    OBJ
         Sio  : "Simple_Serial"        
    VAR                                     '
    Pub Main
      Sio.Init(-1, MtrCtl, 9600)
      Sio.tx(1)                     ' Motor 1 full reverse
      Sio.tx(128)                   ' Motor 2 full reverse
      waitcnt(clkfreq * 5 + cnt)    ' wait 5 seconds
      sio.tx(32)                    ' Motor 1 half reverse
      sio.tx(160)                   ' Motor 2 half reverse
      waitcnt(clkfreq * 5 + cnt)    ' wait 5 seconds
      sio.tx(64)                    ' Motor 1 stop
      sio.tx(192)                   ' Motor 2 stop
      waitcnt(clkfreq * 5 + cnt)    ' wait 5 seconds
      sio.tx(127)                   ' Motor 1 full forward
      sio.tx(255)                   ' Motor 2 full forward
      waitcnt(clkfreq * 5 + cnt)    ' wait 5 seconds
      sio.tx(0)                     ' Both motors stop
    '  WARNING  rapid changes in power with large motors/driven objects with large inertia
    '  may cause damage.  I don't know if the above changes in power are too much too fast WARNING
    '  I do not know if the Sabortooth will see 3.3 Volts as high, most but not all five volt devices do.
    

    John Abshier
  • wkinnewkinne Posts: 6
    edited 2009-09-18 21:41
    WOW I am not used to getting help, yet alone so fast! Thanks guys, very much!

    OK, so you are saying one I/O pin from the Propeller will run one motor, 4 pins, 4 motors, right?

    I love the test code and the object (which I had already down loaded) I do have a couple questions if you guys don't mind.

    The test code I understand, thanks! The object I have no idea how I enter the PWM(0,1500), when I look at the code I see PWM asking for 3 inputs, pin number, on time, off time. What am I missing.

    Also can other objects send this info to that object? I assume that is already written into the code to be passed that kind of variable?

    Thanks again guys, this looks easier than I ever dreamed.

    wkinne
  • wkinnewkinne Posts: 6
    edited 2009-09-18 22:10
    Ah, the demo, opps, OK I see the PWM.Servo(0,1500) which would be no movement. So 1250 would be 1/2 speed in one direction and 1750 would be half in the other. Sorry for being a total newb, but how do I use this? Will the demo run on its own? It looks to me like it needs the main program to run? How do I load both? Or don't I?


    I think I have enough info to get started, Sweet!


    OK, I'm slow but I am remembering things lol, I see the demo calls he PWM object, I am starting to see the light LOL

    Thanks again.

    wkinne

    Post Edited (wkinne) : 9/18/2009 10:54:04 PM GMT
Sign In or Register to comment.