Shop OBEX P1 Docs P2 Docs Learn Events
Pololu Micro Dual Serial Motor Controller... — Parallax Forums

Pololu Micro Dual Serial Motor Controller...

ChaosNOrderChaosNOrder Posts: 2
edited 2010-02-17 05:47 in BASIC Stamp
I'm working with the bs2 with the pololu..(refer to sub.) and with the code im working with I'm getting poor performance. Its ramping up and down to quickly to see much of any movement. I'm using a tamiya(sp) gearbox and motor set from a bulldozer set. That's all i know as far as motor specs. Can anyone suggest how to get the motors to run continuously or until an interrupt from from ping.


' {$STAMP BS2}
' {$PBASIC 2.5}

speed VAR Byte

HIGH 2
LOW 1
HIGH 1
PAUSE 100
FOR speed = 0 TO 127
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 0 TO 127
SEROUT 2,84,[noparse][[/noparse]$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[noparse][[/noparse]$80,0,1,speed]
PAUSE 20
NEXT

Comments

  • dandreaedandreae Posts: 1,375
    edited 2010-02-09 14:32
    I noticed that in your second to last SEROUT command that you have a "0" instead of a·"1" like they do in the sample code.



    Dave

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Dave Andreae

    Parallax Tech Support·
  • ChaosNOrderChaosNOrder Posts: 2
    edited 2010-02-09 21:14
    I must have saved the file after some tweaking. Changing back doesn't give desired results. I'm just lost in the serial codeing. If i saw code for it to run two motors continuously until interrupted by ping or ir. The ramping is confusing me to. I don't want to be confined to servos for movement but until I figure this one out I'm stuck. Anyone have any ideas? Thanks
  • JDJD Posts: 570
    edited 2010-02-09 21:42
    ChaosNOrder,

    It looks like the syntax is correct;·However, you could increase the PAUSE to give more time between each SEROUT command. For example, instead of PAUSE 20 (1/50th a second) put PAUSE 500 for 1/2 second. That should give you more time to see the ramping operation. Another option is give the value for PAUSE to a variable and make the PAUSE changeable,·until you get the speed that works best.

    If you want, you can also post the entire code (attachment manager)·and we can offer some suggestions ti incorporate the PING))) sensor.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Respectfully,


    Joshua Donelson
    www.parallax.com
  • Don KeyDon Key Posts: 1
    edited 2010-02-17 05:47
    How about using a pot to tweak the pause value real-time?
Sign In or Register to comment.