need help please. bigger motor not working.

Hey folks. I have a very simple project going. I'm using a stepper motor to pull a cable that actuates a small lever to press a mechanical button on an aerosol can. basic operation is: push a button, stepper actuates and then waits a second to check the button status again.

I'm using an adafruit motor shield. Using Stepper Motors | Adafruit Motor Shield V2 | Adafruit Learning System

with an Uno. The uno is on a 12v wall wart, the adafruit has it's own 12v wall power. I do not have the jumper attached, so the boards are each on their own power.

I have this motor working: Stepper motor - NEMA-17 size - 200 steps/rev, 12V 350mA : ID 324 : $14.00 : Adafruit Industries, Unique & fun DIY electronics and kits

but the torque is not strong enough.

This is the code:

/* 
This is a test sketch for the Adafruit assembled Motor Shield for Arduino v2
It won't work with v1.x motor shields! Only for the v2's with built in PWM
control

For use with the Adafruit Motor Shield v2 
----> http://www.adafruit.com/products/1438
*/


#include <Wire.h>
#include <Adafruit_MotorShield.h>

// Create the motor shield object with the default I2C address
Adafruit_MotorShield AFMS = Adafruit_MotorShield(); 
// Or, create it with a different I2C address (say for stacking)
// Adafruit_MotorShield AFMS = Adafruit_MotorShield(0x61); 

// Connect a stepper motor with 200 steps per revolution (1.8 degree)
// to motor port #2 (M3 and M4)
Adafruit_StepperMotor *myMotor = AFMS.getStepper(200, 1);

const int ledPin =  13;      // the number of the LED pin
const int buttonPin = 2;     // the number of the pushbutton pin
// variables will change:
int buttonState = 0;         // variable for reading the pushbutton status


void setup() {
  //Serial.begin(9600);           // set up Serial library at 9600 bps
  //Serial.println("Stepper test!");

  AFMS.begin();  // create with the default frequency 1.6KHz
  //AFMS.begin(1000);  // OR with a different frequency, say 1KHz
  
  myMotor->setSpeed(70);  // 10 rpm   

     // initialize the LED pin as an output:
     
  pinMode(ledPin, OUTPUT);
  // initialize the pushbutton pin as an input:
  pinMode(buttonPin, INPUT);
}

void loop() {
  buttonState = digitalRead(buttonPin);

  // check if the pushbutton is pressed. If it is, the buttonState is HIGH:
  if (buttonState == HIGH) {
    // turn LED on:
    digitalWrite(ledPin, HIGH);
 
  myMotor->step(100, FORWARD, SINGLE); 
  myMotor->step(100, BACKWARD, SINGLE);
  delay(1000);
 } else {
  // turn LED off:
    digitalWrite(ledPin, LOW);
   //do nothing with motor
  }
  
}

works great. push the button, servo actuates. Just not strong enough to pull the lever, so I got this motor: 12V, 1.7A, 416 oz-in Geared Bipolar Stepper Motor - RobotShop

but it doesn't work. Same code, same wiring. Motor is rated at 12v and 1.2 amps, adapter is 12v and 1a. I'm assuming the amps are the problem.

What currently happens is, everything lights up correctly once the board is plugged in. then, when you press the button, the motor moves a little bit, the power light starts blinking very, very slowly, and the motor moves a tiny, tiny bit forever until I reset the arduino or unplug it.

help? I'm shooting in the dark here and have no one locally to help. can't find the answers on the interwebs because i dont know what to search for.

thanks.

You can not drive a stepping motor with the same code you drive a normal D.C. motor.

You do not feed a stepping motor with PWM. You turn the coils on and off in a specific sequence depending on what sort of stepping motor you have. There are two types of stepping motor, unipolar
http://www.thebox.myzen.co.uk/Workshop/Motors_3.html

And bipolar
http://www.thebox.myzen.co.uk/Workshop/Motors_4.html

In the Arduino world you usually use a library or hardware driver to provide the pattern of pulses you need.

Your new motor looks like it has a rating of 2.6V @ 1.7A, that is what is written on the motor, so to drive this you need a switching regulator driver. The specification of 12V probably refers to the driver supply. You set the driver to deliver a specific amount of current and for maximum torque you need a power supply capable of delivering at least two amps.

Also the faster a stepping motor goes the less torque it has so you need to drive it slowly to maximise the torque.

The code is written for a stepper. It uses a library written for the motor shield. The lower power motor I was using before runs perfectly with that code. Did you look at the link for th e new motor? If specifically says to use 12v, they even suggest 24.

Yes but with a regulating stepping motor driver. Otherwise the numbers written on your new motor do not make any sense.

the adafruit motor shield has motor drivers on it. If you look at the link I posted, they specifically have it setup to drive two steppers, with example code.

the adafruit motor shield has motor drivers on it

Yes but these are not the types of drive you need. You need a switching regulator type of drive. I told you this in my last reply.

Your power supply is also not up to it. Measure the voltage you get across the coils when connected up but stationary.

Grumpy_Mike:
Yes but these are not the types of drive you need. You need a switching regulator type of drive. I told you this in my last reply.

Your power supply is also not up to it. Measure the voltage you get across the coils when connected up but stationary.

as I said before, the code and wiring and the adafruit motor shield all work with the smaller motor. Perfectly. they also work with different code and the arduino motor shield.

However, when I use the larger motor, the motor behaves erratically. I upgraded to a wall adapter rated at 12v and 2.5a for the motor shield, still using 12v 1a power for the arduino itself. Once again, it works perfectly with the smaller motor, but with the larger motor, it works for a moment, and then starts behaving erratically.

I could really use an ELI5 explanation about this. I can't get the larger motor to work, I can't find the info I need online to explain it, I have no help locally, and if someone could help me out with this without copping an attitude, that would be great. Thanks.

As Mike has tried to explain, you need a current limiting stepper motor driver for the "bigger" motor, and it is essential to set the current limit correctly. The Adafruit driver is NOT a current limiting stepper motor driver. It is intended for brushed DC motors, but also works with a small selection of low current, high impedance stepper motors.

Choose a driver from this page, rated for 1.7 A continuous current or higher. Be sure to carefully read and follow Pololu's instructions for wiring, and for setting the current limit. For maximum speed and torque, use a high motor power supply voltage (e.g. 24 to 36 V).

jremington:
As Mike has tried to explain, you need a current limiting stepper motor driver for the "bigger" motor, and it is essential to set the current limit correctly. The Adafruit driver is NOT a current limiting stepper motor driver. It is intended for brushed DC motors, but also works with a small selection of low current, high impedance stepper motors.

Choose a driver from this page, rated for 1.7 A continuous current or higher. Be sure to carefully read and follow Pololu's instructions for wiring, and for setting the current limit. For maximum speed and torque, use a high motor power supply voltage (e.g. 24 to 36 V).

ok thanks.

FWIW, I got it working with one of these VMA333: TB6560 3A STEPPER MOTOR DRIVER BOARD – Velleman – Wholesaler and developer of electronics

and a 24v 2a power supply. motor is rated at 1.68a, so I set the current limiting on the VMA333 to 1.6 (other option was 1.9) and everything works. have it set so that when you press a force sensor, the motor goes forward halfway and back halfway. My code is a little hacky, but it works. I don't have the control finesse I need, like I need to make it move forward more quickly and can't figure out how to do that with my code, so I have some work to do, but everything is working.