This is my first post here,
I'm working with a unipolar stepper motor and Arduino motor shield.
I have got it turning alright but it rumbles a bit, and if I attach something on top of it, it vibrates quite a bit. The motor emits a low rumble noise as well
So it kinda strikes me that something is wrong. I hope somebody could let me know what the problem may be at least that is causing that vibration.
This isn't my first stepper, but I am trying to figure out how to use this particular one. Its got 6 leads, I'm using A, A', B, B' to run it.
Its 57bygh420 Unipolar Motor
Here is the code I'm using.
NOTE: I'm not the author of this code.
int delaylegnth = 30;
int f = 255;
void setup() {
Serial.begin(9600);
//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(){
Serial.print(78);
digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH B
digitalWrite(12, HIGH); //Sets direction of CH A
analogWrite(3, f); //Moves CH A
delay(delaylegnth);
digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH B
digitalWrite(13, LOW); //Sets direction of CH B
analogWrite(11, f); //Moves CH B
delay(delaylegnth);
digitalWrite(9, LOW); //ENABLE CH A
digitalWrite(8, HIGH); //DISABLE CH B
digitalWrite(12, LOW); //Sets direction of CH A
analogWrite(3, f); //Moves CH A
delay(delaylegnth);
digitalWrite(9, HIGH); //DISABLE CH A
digitalWrite(8, LOW); //ENABLE CH B
digitalWrite(13, HIGH); //Sets direction of CH B
analogWrite(11, f); //Moves CH B
delay(delaylegnth);
}