2 Motor Shields, 4 Steppers, power issues

Adafruit Ethernet, Motor, Proto, Wave, Datalogger, GPS Shields - etc!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
RogBear62
 
Posts: 7
Joined: Mon Oct 13, 2014 12:32 am

2 Motor Shields, 4 Steppers, power issues

Post by RogBear62 »

I am having inadvertent issues testing my steppers. Sometimes they run as they are supposed to, and other times they run for about a quarter of a second, and then the power dies. Then they will repeat in a continuous on/off cycle.

When they do work, I have noticed that the power still seems to die when my code does a 2 second delay. Even the power indicator on my power supply goes out - not just the motor shields LED. When I remove one shield, and only run 2 steppers, I notice no issues - the power stays on as I believe it should.

I am using a 12 volt 5 amp power supply. I have tried switching it out, and switching out the arduino. I have reversed the stacking of the shields.

I tried to upload a video showing this problem with this post, but I got an error, so I guess it doesn't allow that.

Below is my very basic code, only slightly modified from the sample code.

Any ideas? Thanks!

Code: Select all

#include <Wire.h>
#include <Adafruit_MotorShield.h>
#include "utility/Adafruit_PWMServoDriver.h"

Adafruit_MotorShield AFMSbot(0x61); // Rightmost jumper closed
Adafruit_MotorShield AFMStop(0x60); // Default address, no jumpers

// On the top shield, connect two steppers, each with 200 steps
Adafruit_StepperMotor *myStepper2 = AFMStop.getStepper(200, 1);
Adafruit_StepperMotor *myStepper3 = AFMStop.getStepper(200, 2);

// On the bottom shield connect a stepper to port M3/M4 with 200 steps
Adafruit_StepperMotor *myStepper1 = AFMSbot.getStepper(200, 1);
Adafruit_StepperMotor *myStepper4 = AFMSbot.getStepper(200, 2);



void setup() {
  while (!Serial);
  Serial.begin(9600);           // set up Serial library at 9600 bps
  Serial.println("MMMMotor party!");

  AFMSbot.begin(); // Start the bottom shield
  AFMStop.begin(); // Start the top shield
   
}

int i;
void loop() {
  
  
  for (i=0; i<600; i++) {

    myStepper1->onestep(FORWARD, DOUBLE);
    myStepper2->onestep(FORWARD, DOUBLE);
    myStepper3->onestep(FORWARD, DOUBLE);
    myStepper4->onestep(FORWARD, DOUBLE);
    delay(3);
 }
 delay(2000);
 
 for (i=600; i>0; i--) {

    myStepper1->onestep(BACKWARD, DOUBLE);
    myStepper2->onestep(BACKWARD, DOUBLE);
    myStepper3->onestep(BACKWARD, DOUBLE);
    myStepper4->onestep(BACKWARD, DOUBLE);
    delay(3);
 }
 delay(2000);
return; 

  
  for (i=0; i<255; i++) {

    myStepper1->onestep(FORWARD, DOUBLE);
    myStepper2->onestep(BACKWARD, INTERLEAVE);
    myStepper3->onestep(FORWARD, MICROSTEP);
    delay(3);
 }
 
  for (i=255; i!=0; i--) {

    myStepper1->onestep(BACKWARD, DOUBLE);
    myStepper2->onestep(FORWARD, INTERLEAVE);
    myStepper3->onestep(BACKWARD, MICROSTEP);
    delay(3);
 }
}

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by adafruit_support_bill »

What motors are you using?

User avatar
RogBear62
 
Posts: 7
Joined: Mon Oct 13, 2014 12:32 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by RogBear62 »

I am using the Adafruit stepper motors.

Also, don't know if this is relevant, but I usually power the motors first, then the Arduino. This is so the motors can start in a known orientation. If I power the Arduino first, the code runs, and nothing is in sync. I power the Arduino with the USB cable plugged into an iPhone type power supply.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by adafruit_support_bill »

Please post some photos showing your soldering and connections to the shields.

User avatar
RogBear62
 
Posts: 7
Joined: Mon Oct 13, 2014 12:32 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by RogBear62 »

Do I have to upload one image at a time? I tried to zip them up, but when the upload got to 100% everything disappeared, and it didn't seem to post. I have also trying to just upload one jpeg image by itself but after adding the file, I got an error "the image file you tried to upload is invalid". It is a .jpg file, and it looks fine on my computer. What kind of file does your system want?

For clarification, I am selecting the "Choose File" button below, and then "Add The File". Then when I "Submit" the post I got the error on the single JPG.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by adafruit_support_bill »

You can use the choose file and add the file buttons. There is a 1 meg limit. If you resize to about 800x600 you should have no problems.

User avatar
RogBear62
 
Posts: 7
Joined: Mon Oct 13, 2014 12:32 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by RogBear62 »

Separated
Separated
IMG_0820_small.jpg (317.46 KiB) Viewed 324 times
IMG_0822_small.jpg
IMG_0822_small.jpg (226.08 KiB) Viewed 324 times
IMG_0823_small.jpg
IMG_0823_small.jpg (240.74 KiB) Viewed 324 times

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by adafruit_support_bill »

From what I can see, the soldering and connections look OK. The symptoms sound like a power supply overload condition. If you run with just 2 motors at a time, does it run for longer?

User avatar
RogBear62
 
Posts: 7
Joined: Mon Oct 13, 2014 12:32 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by RogBear62 »

Everything has worked fine when I just use one motor shield. I have tried two different power supplies.

I have uploaded a few videos to youtube, I think in this case a video really is worth a million words. The first one shows "normal" operation, with the exception of the power flickers:
https://youtu.be/IMawD1zTWX4

The next one is a very brief video showing what happens when it is NOT working: (same script)
https://youtu.be/DTF5gKoDe9Y

The third one is bizarre. The motors seem to be saying "I think I can" as with each power cycle they go a little further, until they finally start to go their full distance. I've only seen this happen once, and it was just luck that I got it on video.
https://youtu.be/vE3lzobLRts

Does any of this point to what might be wrong? Thanks for your help.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by adafruit_support_bill »

The light going out on the power supply indicates that it is a power supply problem. Most likely some sort of overload condition. Those motors will draw approximately 700mA each when powered at 12v. So for 4 motors you would need at least 2.8 amps.

Is the power supply getting hot?

User avatar
RogBear62
 
Posts: 7
Joined: Mon Oct 13, 2014 12:32 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by RogBear62 »

Here's one more video. (You'll like this one.)

https://youtu.be/d45GGe6nTgo

As you can see, you were absolutely correct! Even though the 2 power supplies I obtained (from another source) clearly stated 12v, 5A, they obviously could not handle 2.4 amps. Lesson learned. I'm going to buy some Adafruit power supplies now.

Thank you for your help in identifying my issue.

User avatar
adafruit_support_bill
 
Posts: 88093
Joined: Sat Feb 07, 2009 10:11 am

Re: 2 Motor Shields, 4 Steppers, power issues

Post by adafruit_support_bill »

Much better. Good to see that it is working for you now. Thanks for the follow-up. :)

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino Shields from Adafruit”