PDA

View Full Version : Pololu Micro Dual Serial Motor Controller...



ChaosNOrder
02-09-2010, 09:36 AM
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,[$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 0 TO 127
SEROUT 2,84,[$80,0,0,speed]
PAUSE 20
NEXT
FOR speed = 127 TO 0
SEROUT 2,84,[$80,0,1,speed]
PAUSE 20
NEXT

dandreae
02-09-2010, 09:32 PM
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·

ChaosNOrder
02-10-2010, 04:14 AM
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

JD
02-10-2010, 04:42 AM
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 (http://www.parallax.com)

Don Key
02-17-2010, 12:47 PM
How about using a pot to tweak the pause value real-time?