Shop OBEX P1 Docs P2 Docs Learn Events
Programming the Pololu's Micro Dual Serial Motor Controller — Parallax Forums

Programming the Pololu's Micro Dual Serial Motor Controller

Vincenzo1309Vincenzo1309 Posts: 76
edited 2009-05-25 14:28 in Learn with BlocklyProp
Dear all,

I am currently using this motor controller for my project. I have written a simple program to move a remote controlled car... the front motor controls left and right movement and the rear motor controls the forward and backward movement. Motor supply used :9V battery pack of 6 AA batteries
This simple program is to move the rear motor non-stop in one direction.

SEROUT 4, 84, [noparse][[/noparse]$80, 0, 0, 127]

Observations : when the above code is downloaded, I notice that the motor would move for few seconds and then stop. Is it because it had reached the full speed at 127 and therefore would not move anymore?

when I tried to add in the Do...Loop as illustrated below

Do
SEROUT 4, 84, [noparse][[/noparse]$80, 0, 0, 127]
Loop

Observations : the motor can move non-stop in full speed.

So does that mean that it is essential to add in the Do..Loop to make the motors turn non-stop?

Kindly advise.

Regards,

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-04-24 06:52
    From the datasheet, my impression is that it's a set it and forget it device. You can test this quite easily by taking out the loop and running your program. See if the motor controller times out after a while and stops the motor.
  • Vincenzo1309Vincenzo1309 Posts: 76
    edited 2009-04-24 08:12
    Hi SRLM,

    What do you mean by "set it and forget it" device? Do you mean when we send this command over, it will execute this command forever?
    I have tried taking out the loop, and the motor do time out after a while.
    So does that mean the Do..Loop did play a part?
  • agfaagfa Posts: 295
    edited 2009-04-25 13:16
    It is a "set it and forget it" device.· It will maintain the last command until it is reset.· Sounds like your STAMP is going into sleep mode after executing all available code and resetting the pololu.· try putting the do loop after the command.
    SEROUT 4, 84, [noparse][[/noparse]$80, 0, 0, 127]
    Do
    Loop
    
    

    ·
  • pdiefendpdiefend Posts: 27
    edited 2009-05-21 14:01
    I am also having problems with the pololu motor controller, but not in the same sense as the other problem.· I can set the motor controller and it will run until I stop it, but there are times when the controller will not respond to the stamp's serial commands.· I had the controller on a robot chassis with treads (taken from another project that was for a competition) and the Stamp was recieving commands from another stamp over a wireless serial link, which I know after a lot of testing works properly, but when the robot went to change directions, it would not until I lifted the robot off the ground and the motors would stop.· What is going on?· I have since retired this platform for the Boe-Bot to test the rest of the program (yes I modified it for servos), but I would like to bring back this chassis.

    Also when I hold the robot in the air, it responded perfectly to the commands.· Any ideas on why this is happening?
  • PrettybirdPrettybird Posts: 269
    edited 2009-05-23 02:33
    Just a guess but wireless is radio. Sensitive to grounding, large metal structure etc etc. Infrared mat be another path. I also have a polou dual H bridge but think I will try other single bridges when I get that far. I will watch this thread. Thanks.
  • Vincenzo1309Vincenzo1309 Posts: 76
    edited 2009-05-24 02:19
    Dear all,

    For my case, what exactly happened was that the electrical noise from the DC motors of my robot had impaired the motor controller. Therefore to reduce the noise, I had soldered capacitors onto the terminals of the motors. It works, regardless of whether I have put in the Do..Loop.


    Just a reference to all of you, even though you might use other motors, like servo etc....

    Regards,
    Vincent Chung
  • agfaagfa Posts: 295
    edited 2009-05-24 15:29
    Vincenzo1309 said...


    It works, regardless of whether I have put in the Do..Loop.
    Sorry for the mis-information.· Glad you got it going.

    agfa
  • Vincenzo1309Vincenzo1309 Posts: 76
    edited 2009-05-25 14:28
    No worries man!
    We learn in this forum...... there are so many unforeseen problems in electronics..
    Have a nice day! [noparse]:)[/noparse]
Sign In or Register to comment.