Go Down

Topic: STEPPER MOTOR SHIELD Rev3 - Vibration (Read 3821 times) previous topic - next topic

camillekerbaul

Aug 09, 2013, 10:06 pm Last Edit: Aug 09, 2013, 10:17 pm by camillekerbaul Reason: 1
I'am using the arduino stepper motor shield rev 3 to control a stepper motor Portescap 17h118D10B.
I am using this sample code :

Quote
// Include the Stepper Library
#include <Stepper.h>

// Map our pins to constants to make things easier to keep track of
const int pwmA = 3;
const int pwmB = 11;
const int brakeA = 9;
const int brakeB = 8;
const int dirA = 12;
const int dirB = 13;

// The amount of steps for a full revolution of your motor.
// 360 / stepAngle
const int STEPS = 48;

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

void setup() {
 // Set the RPM of the motor
 myStepper.setSpeed(30);

 // 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);

 // Log some shit
 Serial.begin(9600);
}

void loop() {
 // Move the motor X amount of steps
 myStepper.step(STEPS);
 Serial.println(STEPS);
 // Pause
 delay(2000);

 // Move the motor X amount of steps the other way
 myStepper.step(-STEPS);
 Serial.println(-STEPS);
 // Pause
 delay(2000);
}


My issue is that with this board my stepper motor vibrates a lot and overheats.
I also tried to control it with the BC4E20EU Quad 0.15 to 2.0 Amp Bipolar Current Regulating Motor Controller and the result is really much more satisfying.

http://www.stepperboard.com/mm5/merchant.mvc?Screen=PROD&Store_Code=PDNCONS&Product_Code=AR-BC4E20EU

My feeling is that the stepper motor shield Rev3 is not controlling my stepper in microstep mode.
With the adafruit motor shield and AFstepper library (http://learn.adafruit.com/adafruit-motor-shield/af-stepper-class) it is possible to choose the "style".

Quote
step(steps, direction, style)Step the motor.

Parameters:
steps - the number of steps to turn
direction - the direction of rotation (FORWARD or BACKWARD)
style - the style of stepping:
Valid values for 'style' are:
SINGLE - One coil is energized at a time.
DOUBLE - Two coils are energized at a time for more torque.
INTERLEAVE - Alternate between single and double to create a half-step in between.  This can result in smoother operation, but because of the extra half-step, the speed is reduced by half too.
MICROSTEP - Adjacent coils are ramped up and down to create a number of 'micro-steps' between each full step.  This results in finer resolution and smoother rotation, but with a loss in torque.


My question is : Is the stepper shield Rev 3 also controlling the stepper in microstep mode ? If not, is there a way to do that ?

I found in the stepper.h file thiese lines :

Quote
The sequence of control signals for 4 control wires is as follows:

 Step C0 C1 C2 C3
    1  1  0  1  0
    2  0  1  1  0
    3  0  1  0  1
    4  1  0  0  1

 The sequence of controls signals for 2 control wires is as follows
 (columns C1 and C2 from above):

 Step C0 C1
    1  0  1
    2  1  1
    3  1  0
    4  0  0

MAS3

Are you sure you connected the motor correct ?
Maybe you got one coil reversed ?
Have a look at "blink without delay".
Did you connect the grounds ?
Je kunt hier ook in het Nederlands terecht: http://arduino.cc/forum/index.php/board,77.0.html

camillekerbaul

http://media.digikey.com/pdf/Data%20Sheets/Portescap%20Danaher%20PDFs/H3%20Wiring%20Diagram.pdf

I pluged it as follow :
B - : red
B + : grey
A - : yellow
A + : black

camillekerbaul

Here is a video illustrating the vibrations :

http://www.youtube.com/watch?v=KBE3h_hRWxg&feature=youtu.be

camillekerbaul

I tried to enter manually a microsteps. Here is my code :

At 1/8 micro-stepping we will se that the current in each phase is actually a SIN and a COS. Each phase is 90 degree from each other.





But... it doesn't work...

Quote
/*************************************************************
Motor Shield Stepper Demo
by Randy Sarafan

For more information see:
http://www.instructables.com/id/Arduino-Motor-Shield-Tutorial/

*************************************************************/

int delaylegnth = 3;

void setup() {
 
  //establish motor direction toggle pins
  pinMode(12, OUTPUT); //CH A -- HIGH = forwards and LOW = backwards???
  pinMode(13, OUTPUT); //CH B -- HIGH = forwards and LOW = backwards???
 
  //establish motor brake pins
  pinMode(9, OUTPUT); //brake (disable) CH A
  pinMode(8, OUTPUT); //brake (disable) CH B


 
 
}

void loop(){

  digitalWrite(9, HIGH);  //DISABLE CH A                               0B
  digitalWrite(8, LOW); //ENABLE CH B
  digitalWrite(13, HIGH);   //Sets direction of CH B
  analogWrite(11,255);   //Moves CH B
    delay(delaylegnth);
 
 
 
  digitalWrite(9, LOW);  //ENABLE CH A                               AB
  digitalWrite(8, LOW); //DISABLE CH B
  digitalWrite(12, HIGH);   //Sets direction of CH A
  digitalWrite(13, HIGH);
  analogWrite(3, 51);   //Moves CH A
  analogWrite(11,250);
    delay(delaylegnth);
 
  digitalWrite(9, LOW);  //ENABLE CH A                               AB
  digitalWrite(8, LOW); //DISABLE CH B
  digitalWrite(12, HIGH);   //Sets direction of CH A
  digitalWrite(13, HIGH);
  analogWrite(3, 97);   //Moves CH A
  analogWrite(11,235);
   delay(delaylegnth);
   
  digitalWrite(9, LOW);  //ENABLE CH A                               AB
  digitalWrite(8, LOW); //DISABLE CH B
  digitalWrite(12, HIGH);   //Sets direction of CH A
  digitalWrite(13, HIGH);
  analogWrite(3, 142);   //Moves CH A
  analogWrite(11,212);
    delay(delaylegnth);
   
.
.
.
 
  digitalWrite(9, HIGH);  //DISABLE CH A                     0  B
  digitalWrite(8, LOW); //ENABLE CH B
  digitalWrite(13, HIGH);   //Sets direction of CH B
  analogWrite(3,255);   //Moves CH B
  delay(delaylegnth);
}

Go Up