MotorShield and Stepper : troubles

Hi,
I'm a newbie and it was my first experiences with stepper. I'm also french (nobody is perfect) and my english is poor.

I have to drive a stepper with high torque to made 2 rounds when a button is pressed...

Configuration :

  • Arduino Uno R3
  • MotorShield Rev3 (2A/circuit) with Stepper Library
  • Stepper 57SH76-M (torque 1,8 Nm, 2.8 A, 4 wires)

I just add a simple button and a LED to show when it's running.

I've read the documentation i can found at Arduino reference, tutorial and many blogs but i'm a bit confused with what happened.

I've understand that it was better to power the Motorshield with an external power directly (and cut the Vin track below), but i don't want to cut the track now, just made some quick experiment before doing a irreversible action :wink:

  1. I just connect the stepper and only the USB power to Arduino.
    The motor works at low speed, below 35 rpm it's OK (low torque of course).

  2. Then a add an external power (AC-DC wall adapter) to the Arduino (doc said i can) : i could achieve 50-60 rpm, but when the stepper stop it has a sort of very little shake (it make noise like an old power and you can feel small shake if you put you finger on it)...
    Note : the L298 became hot, even if i do not make the stepper turn.

  3. If a remove the USB power (there is only the external wall adapter 6V), the Arduino seems to hang, the button do nothing and the LED (but also the small LED on motorshield for each line) blink at

First,
I do not understand. What happened ?
Perhaps the steppers has a too big torque and requirements for the Motor Shield or do i miss something (i'm new in electronics).
Do i have to cut now the Vin tracks and plug an external power of 12V ?
I think i need real instruction about power usage :wink:

Second,
The MotorShield Rev3 also lack of documentation (http://arduino.cc/en/Main/ArduinoMotorShieldR3)
I do not found anywhere an explanation i could understand of usage for the pins (4 pins for each phase), brake is not explain, PWM neither...
The sample code only call the constructor with direction pins and set PMW and brake as output... but i don't know why.
I'm really confused.

Thanks.

Below the code i used (adapted from standard sample) :

#include <Stepper.h>

// constants won't change. They're used here to
// set pin numbers:
const int buttonPin = 2; // pushbutton pin
const int ledPin = 4; // LED pin

const int pwmA = 3; // PWM Channel A
const int pwmB = 11; // PWM Channel B
const int brakeA = 9; // Brake Channel A
const int brakeB = 8; // Brake Channel B
const int dirA = 12; // Direction Channel A
const int dirB = 13; // Direction Channel B

const int STEPS = 200;

// variables will change:
int buttonState = 0; // variable for reading the pushbutton status
int rpm=30; // stepper speed (round per minute)
int stepButton=200; // stepper steps when button pressed

Stepper myStepper(STEPS, dirA, dirB); // init the stepper class

void setup() {
// initialize the LED pin as an output:
pinMode(ledPin, OUTPUT);
digitalWrite(ledPin, HIGH);

// Turn on pulse width modulation
pinMode(pwmA, OUTPUT);
digitalWrite(pwmA, HIGH);
pinMode(pwmB, OUTPUT);
digitalWrite(pwmB, HIGH);

// Turn off the brakes
pinMode(brakeA, OUTPUT);
digitalWrite(brakeA, LOW);
pinMode(brakeB, OUTPUT);
digitalWrite(brakeB, LOW);

// Set the RPM of the motor
myStepper.setSpeed(rpm);

// initialize the pushbutton pin as an input:
pinMode(buttonPin, INPUT);

Serial.begin(9600);
delay(200);
digitalWrite(ledPin, LOW);
}

void loop(){
// read the state of the pushbutton value:
buttonState = digitalRead(buttonPin);

// check if the pushbutton is pressed.
// if it is, the buttonState is HIGH:
if (buttonState == HIGH) {
digitalWrite(ledPin, HIGH);

myStepper.setSpeed(rpm);
myStepper.step(stepButton);
// turn off the brake ?
// digitalWrite(brakeA, LOW);
// digitalWrite(brakeB, LOW);
}
else {
// turn LED off:
digitalWrite(ledPin, LOW);
}
}

This won't work - the motor shield cannot supply enough current, and is designed for a higher voltage than
the stepper motor windings - its the wrong motor controller for a low-impedance bipolar stepper, these
require a chopper-drive circuit - and you really need a microstepping driver or it'll vibrate/resonate badly.

A motor rated at 2.8A is beyond the range a single chip driver can manage really, the best I've seen is
the TB6600 which has 0.4 ohms total on resistance, and seems to be available on eBay cheaply: http://www.ebay.co.uk/itm/TB6600-5A-Single-Axis-5A-CNC-Stepper-Driver-For-CNC-Milling-Machine-DIY-Max-50V-/300909044677?pt=UK_ToysGames_RadioControlled_JN&hash=item460f93a3c5

You could try driving it at a lower current (1A?) using something like an A4988 chopper driver board (Polulu
have some), but its a waste of a powerful motor.

Since these chopper drivers do automatic buck-conversion you power them at a high voltage like 24V -- 80V
and get far faster max step rates from the motor.

If you don't want fast performance its easier to buy a unipolar stepper with high-impedance windings (12V 0.5A
or some such). low-impedance bipolar motors are designed to go fast from a chopper drive circuit.

http://www.toshiba-components.com/productpages/Linear/TB6600HG.html

you could order free sample chip, but no datasheet. now you have paperweight with 25 legs?!

anyway google is lifesaver, here is the datasheet.

Thanks, i suspect such a thing (not low impedance, i do not really understand, but a non-conformity between the stepper and the controller).
I'll investigate the TB6600 and how use it with an arduino.
Thanks for the advice and the documentation.

Before getting a real stepper-driver for the big torque stepper, i just try the same circuit and same program, with another stepper :
a smaller one i get from an old scanner : 4H4018x0503, i do not have the complete specification just what is written on it : 6.8V 1.0A (200 steps).

It works better but i still got some troubles.

The stepper works at higher speed (150 rpm) with USB power only, but the circuit still do not work with only external 6V power (the LED only blinks at 1 Hz, do not understand where it came from).

I got another behavior if i plug an external 6V power + USB (if i remove USB see above) :

At rest, the stepper and the L298 get hot (but not very hot, but hotter than with only USB).
At rest, the stepper seems to have a very little shaking : if i touch the stepper i feel a very small vibration, if i touch the rotate axis also and if i press on it, the small vibration get a little higher :the stepper try to stay at its position i think, but i do not understand the brake command.
I try to activate brake when there is "running" order but it doesn't change anything.
At rest the stepper alway try to keep it position when powered by an external 6V + USB

digitalWrite(brakeA, LOW);
digitalWrite(brakeB, LOW);

Steppers don't run fast with a low voltage supply, the back-EMF chokes off the current.

For speed you use a high voltage supply, a chopper-driver, and bipolar connection. The
chopper applies whatever average voltage is needed to overcome back-EMF plus the small voltage
to overcome I-R losses in the winding. By chopping (its effectively a buck-DC-DC-converter) it
doesn't waste much power converting the supply voltage to the voltage at the motor.

I'm now waiting for my TB6600, and i have a few question (sorry i'm really a newbie).

As i see on documentation i'll have to :

  • external power it (I've a 12V or 24V external power supply available).

  • plug 6 pins from Arduino :

  • 2 enable pins (simple pin to activate/deactivate : why 2 pins, each one to enable each coil ?

  • 2 dir pins : i do not really understand dir+ dir-, do i have to enable dir+ and disable dir- to turn the stepper + ?

  • 2 clk pins : stepper lib will clock those pins according to 01, 11, 10, 00 patern

  • plug 4 pins to the stepper : the same wait i do it with my small MotorShield

Then i need to configure the TB6600 :

  • excitation (M1,M2,M3) for full step or 1/2 step, or 1/4 step... : how do i choose, or do i've to prefer microstep
  • the output current mode : my stepper indicate 2.8A per phase @ 3.2V, do i have to choose 2.5A mode ?

Meanwhile,
I continue exploring with the classic Motorshield.
I replug the big stepper (57SH76-4AM) and run it at 50 rpm, and disable the enable pins after each command.
of course i do not have any small vibration at rest and i could do some test.
Of cours the torque is probably very low and far away from what is capable this stepper.

Thanks

I enclosed TB6600 Module Schematic, and hope it will answer your most of questions if not all.

TB6600_Module_Schematic.pdf (11.5 KB)

I just got a TB6600 going. I connected the three negative pins and the enable plus pin to the ground pin on the Arduino. The direction plus pin must be changed when the pulse pin is low. I use a loop to set the pulse pin high, delay, set the plus pin low, delay.

void turn(int steps)
{
int i;
for (i=0; i<steps; i++)
{
digitalWrite(pin_pulse, HIGH);
delay(1);
digitalWrite(pin_pulse, LOW);
delay(1);
}