Shop OBEX P1 Docs P2 Docs Learn Events
Polulu Dual Serial Motor COntroller — Parallax Forums

Polulu Dual Serial Motor COntroller

ElectroHackElectroHack Posts: 13
edited 2008-12-03 03:42 in General Discussion
Has any on on this forum had any experience·Polulu's Micro Dual Serial Motor Controller?

I am trying to control 2 motors. When I power M2 up, it starts up as expected, however when I power M3, M2 goes off to the races. I scoped it, and the M2 wave widens dramatically, from the low power setting. When I shut M3 down, the M2 wave goes back to the expected size.

I can replicate this with the following

SEROUT SOUT, 32,[noparse][[/noparse]$80, 0, 5, 20]
SEROUT SOUT, 32,[noparse][[/noparse]$80, 0, 7, 20]

I am doing this on a homework board.··Is this something I'm doing wrong?

·

Comments

  • MikerocontrollerMikerocontroller Posts: 310
    edited 2008-11-30 04:06
    ·Have you tried the default settings ( 0,1,2,3) in place of 5 and 7 ?


    · These values work on my controller:


    · LeftF········ CON········· 1
    · LeftR········ CON········· 0
    · RightF······· CON········· 2
    · RightR······· CON········· 3

    Post Edited (Mikerocontroller) : 11/30/2008 4:24:25 AM GMT
  • agfaagfa Posts: 295
    edited 2008-11-30 04:30
    sounds like the exact problem i had. i wasn't driving motors though,·i was using·it to generate pwm·for· larger Hbridges, and used the same pwr supply for·both logic and motor supply.· I·placed·two .1 uf caps,·as close to the controller·as i could, one·from gnd to motor supply and another from gnd to logic supply.· that took care of it for me.

    Post Edited (agfa) : 11/30/2008 4:43:51 AM GMT
  • ElectroHackElectroHack Posts: 13
    edited 2008-11-30 04:31
    I used the ramp code, which came with the documentation for this chip. I started seeing problems when I was trying to run two motors . . .

    At one point it I went back to these settings . . . when it just stopped working completely using 2 and 3, (which Polulu says is the default for two motor operation) . My understanding as to how 5 and 7 are derived is

    <Motor Controller> * 2 + 1 - >
    for M2: 2 * 2 + 1 = 5 -> M2 turning forward
    for M3: 3 * 2 + 1 = 7 -> M3 turning forward

    Interestingly on the scope trace, if M2 is powered down, and M3 is powered up, there is noise on the M2 trace . .

    Finally, are there any drawbacks with SEROUT? Should I be using SHIFTOUT?
  • ElectroHackElectroHack Posts: 13
    edited 2008-11-30 04:34
    agfa -

    You are doing something similar to what I'm attempting - I am talking two two larger H-Bridges via optoiso's . . I'll giv e it a go and see what happens.
  • ElectroHackElectroHack Posts: 13
    edited 2008-11-30 04:35
    Mikro - I'll try your suggestion too. I'm looking for anything at this point.

    Thanks All!

    PC
  • ElectroHackElectroHack Posts: 13
    edited 2008-12-02 00:58
    Followup - I got my project working. Turns out it was me after all. And I had to unhook my motors and go back to using LED's to figure out what was wrong.

    I was powering my motors thru two bridges with optoisolators, which were hooked up to the controller (I built the bridges in case I ever wanted to run this in excess of 9 volts, also because I wanted to learn to solder)

    I was running the controller and the optoisolators from VDD. Turns out that I switched from VDD to VIN and it worked like a champ.

    VIN is 9 volts, from a tranistor battery, and the published max input for this controller is 9 volts. So I'm assuming this won't kill it. Both optos are getting around 8 milliamps, and seem to operate OK.

    Any comments?

    Thanks All
  • agfaagfa Posts: 295
    edited 2008-12-02 13:13
    glad you got it running.

    sure sounded like the same problem i had.· it seemed to stump Pololu.· i was thinking my problem was noise on the power supply generated by the controller, cuz it did it without any load.· i'll try separating the supply and switching motor supply to VIN to see if it makes a difference.
  • ElectroHackElectroHack Posts: 13
    edited 2008-12-03 01:59
    Agfa -

    My project was using a Basic Stamp homework board. (I had one laying around so why not build something?)·.
    I am driving my bridges with the controller connected to optoisolators. My motor power supply and processor power supply were separate.

    I did scope my input, in case the PWM from the controller was doing funny things to the supply, but no noise was evident. It took me a while to catch on. I did disconnect my bridges and substitute two red LED's. The LEDS·exhibited the same behavior.·I changed my resistance for the LED's from 330 Ohm to 1000 Ohm. The controller started behaving more predictably.·After six consecutive calls to change motor speed,·one LED started to flicker.

    I looked at the Stamps in Class text and they were talking about how many LED'd the stamp could drive.· Looks like VDD will drive 2 LED's but no more. I was driving the equivilant of 2 LED's and the controller. Eureka!

    Interesting, I went to the Polulu board and somebody over there had the same problem. (Was that you?)·Apparently, they sent the controller back to Polulu and they tested it·· . . . .· it worked just fine.·Polulu suggested the power supply thing! I guess that's why we have the Sandbox.

    So now I can do the fun stuff (finally) and write some code to make my creation do something.

    Thanks for your input.
    PC





    ·············
  • ElectroHackElectroHack Posts: 13
    edited 2008-12-03 03:42
    Correction ** Polulu NEVER suggested the power supply problem **
Sign In or Register to comment.