Voting resources, early voting, and poll worker information - VOTE. ... Adafruit is open and shipping.
0

Strange motor behavior
Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.

Strange motor behavior

by Tex Funk on Thu May 15, 2008 9:10 pm

I'm trying to get the sample code for DC motors working with my motors, but I'm getting some strange behavior; regardless of what I do, the motor starts turning in one direction and keeps going that way. It also doesn't seem to work at speeds lower than 230 or so. I suspect this has to do with the cheap motors I got; anybody have any ideas?

The code I'm using currently:
Code: Select all | TOGGLE FULL SIZE
#include <AFMotor.h>

AF_DCMotor motor(2, MOTOR12_64KHZ); // create motor #2, 64KHz pwm

void setup() {
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("Motor test!");
 
  motor.setSpeed(230);     // set the speed to 200/255
}

void loop() {
  Serial.print("tick");
 
  motor.run(FORWARD);      // turn it on going forward
  delay(1000);
 
    Serial.print("tack");
  motor.run(RELEASE);      // stopped
  delay(1000);

  Serial.print("tock");
  motor.run(BACKWARD);     // the other way
  delay(1000);
 

}


Checking the voltage on the motor outs it does seem to be staying consistent.
Tex Funk
 
Posts: 9
Joined: Mon May 12, 2008 9:22 pm

by Tex Funk on Thu May 15, 2008 9:42 pm

Well, it started working. Any thoughts why that might be?
Tex Funk
 
Posts: 9
Joined: Mon May 12, 2008 9:22 pm

by Tex Funk on Fri May 16, 2008 10:28 am

And, somewhat later, it completely stopped working. The input voltage seems fine, I'm just not getting any output. This came shortly after I commented the releases out, and I'm using the off-brand H-bridge (the SN754410). I'm running two motors off a single AC adaptor, but it's possible it's a relatively high amperage AC adaptor: could I have blown the h-bridge chip up? I had the motors on M1 and M2.
Tex Funk
 
Posts: 9
Joined: Mon May 12, 2008 9:22 pm

by Tex Funk on Sat May 17, 2008 11:52 am

To answer my own questions: it wasn't working because of a short on the proto shield I was stacking on top of it; I took that off and it worked fine. Also, the H-Bridge chip definitely wasn't blown, because if that had happened, I would have seen it, smelled it, and it would have looked like this:
Image
Oops.
Tex Funk
 
Posts: 9
Joined: Mon May 12, 2008 9:22 pm

by adafruit on Sun May 18, 2008 12:58 pm

yes that is most certainly what a blown chip will look like! :P

adafruit
 
Posts: 12151
Joined: Thu Apr 06, 2006 4:21 pm
Location: nyc

by Jokerman on Thu May 22, 2008 6:10 pm

The driver IC looks foobar - its definitely let its silicon goodness free :-)

-=mike=-
Jokerman
 
Posts: 1
Joined: Thu May 22, 2008 6:07 pm
Location: UK

Please be positive and constructive with your questions and comments.