I'm trying to let the stepper motors (nema17) perform a homing function and turn to a specific angle.
Obviously there's way too much sound and vibration (see video) and the motors feel like they are strugling
Here is the link to the video: Loud vibrating nema 17 stepper while turning with hall effect homing function - YouTube
Thank you in advance
// Define connections
#define HALL_SENSOR 10
#define DIR 2
#define STEP 3
// Direction Variable
boolean setdir = LOW;
void homefunction() {
//Set motor speed pulse duration
int pd = 4000;
//Move motor until home position reached
while (digitalRead (HALL_SENSOR) ==1) {
digitalWrite(DIR, setdir);
digitalWrite(STEP, HIGH);
delayMicroseconds(pd);
digitalWrite(STEP, LOW);
delayMicroseconds(pd);}
}
void setup() {
//setup the stepper controller pins as Outputs
pinMode(DIR, OUTPUT);
pinMode(STEP, OUTPUT);
//setup the hall effect switche as an Input
pinMode(HALL_SENSOR, INPUT);
// home the motor
homefunction();
}
void loop(){
//step(true,600);
// delay(50);
// step(false,600);
// delay(50000);
}
I have just spent a week or so playing with some steppers. A comment I would make is that generally they run smoothly when they are run properly. but are noisier at low speed than at higher speed.
For a while I had the connections from the driver to the motor incorrectly wired and it would not run at all at high speeds or run with energetic thumping noises very slow speeds (< 5 steps/sec) and the motor really felt like it was not happy.
Also if you run half step mode it will be quieter than full step which is in turn quieter than wave step patterns.
They only rotate as fast as you send pulses. There is an upper limit after which the motor rotation can't keep up with the pulses and 'locks up'.