Shop OBEX P1 Docs P2 Docs Learn Events
motor control pwm + code — Parallax Forums

motor control pwm + code

tehmoordartehmoordar Posts: 52
edited 2005-03-23 15:11 in BASIC Stamp
Hi,
I have connected my motors on the robot-- now I want to run them simultaneously--like asking my robot to turn right or left and go forward.
I·have configured motor controll to 2 motor mode by my following command
' {$STAMP BS2}
' {$PBASIC 2.5}


SEROUT 2, 84, [noparse][[/noparse]$80,2,2]


Then In my following code these motors should run simultaneously but these are not runing (only one responds) what is wrong with my following code

' {$STAMP BS2}
' {$PBASIC 2.5}
speed VAR Byte
HIGH 2
LOW 3
HIGH 3
PAUSE 100
FOR speed = 0 TO 127

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

what am I doing wrong above
Thankyou

Comments

  • dandreaedandreae Posts: 1,375
    edited 2005-03-21 23:31
    I don't believe you can make I/O pin 3 a high and a low at the same time as you have in your code.



    Dave


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

    Tech Support
    dandreae@parallax.com
    www.parallax.com



    Post Edited (Dave Andreae (Parallax)) : 3/22/2005 4:51:50 PM GMT
  • tehmoordartehmoordar Posts: 52
    edited 2005-03-22 00:11
    Hi,
    even if I make it only high --it does not run both my motors-- to run both my motors togather what should I do?
    like my serout command "SEROUT 2,84,[noparse][[/noparse]$80,0,1,speed] "
    do I need to change some thing

    Thankyou
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-22 00:53
    ·· Without knowing which Motor Controller you're using, we can't determine which commands do what, or know what the Controller is expecting.· Please list the device model.



    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • tehmoordartehmoordar Posts: 52
    edited 2005-03-22 14:41
    HI,
    I am using Pololu micro dual serial motor controller--
    Thankyou
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2005-03-23 04:02
    ·· Okay, I have one of those...Never used it though...Let me dig it out and see what I can do.· But just out of curiosity, did you try the sample code toward the end?

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Parallax Tech Support
    csavage@parallax.com
  • tehmoordartehmoordar Posts: 52
    edited 2005-03-23 15:09
    yes, thankyou for the help I have figured out my problem -- there were two things-- number one these micro controller all though designed for 2amps and two motors but its micro chip gets very very hot and activating its thermal safety and resulting in its jerky movements.
    second I have to give serout command seprately for both motors.
    Thankyou
  • tehmoordartehmoordar Posts: 52
    edited 2005-03-23 15:11
    HI ,
    after reading above-- can you give me idea--as how to use themal heat sink on such a little chip
    Thankyou
Sign In or Register to comment.