Hi Arduinocomunity,
i would like to introduce myself before presenting my problem. My Name is FrankSteel i am 32 years of age, a mechanical engineer and new to arduino.
I searched on google for a solution for my problem but i could not find what i was looking for, thats the reason why i am starting a new topic.
I would like to run in total 15 stepper motors (nema17) simultaneously, 5 at speed x and direction y, 5 at speed y and direction y and 5 at speed y and direction x. I plan to use 6 drivers tb6600, that max. 3 motors are on 1 driver.
The part of my code, which is not working is displayed below:
Triggerd by pushing S1 the while loop is entered. if the limit switch is not active the stepper drivers are supposed to run by changeing the pulse signal of the driver.
while (digitalRead(S1) == HIGH) //Hochfahren
{
if (digitalRead(S3) == HIGH) //Endschalter oben
{ digitalWrite(Ena, HIGH);//Motor1 Ausschalten
digitalWrite(Ena2, HIGH);//Motor2 Ausschalten
digitalWrite(Ena3, HIGH);//Motor2 Ausschalten
Serial.println("Endschalter Oben");
break;
}
else {
//Antrieb 1
digitalWrite(Ena, LOW);
digitalWrite(Ena2, LOW);
digitalWrite(Ena3, LOW);
digitalWrite(Dir, HIGH);
digitalWrite(Dir2, HIGH);
digitalWrite(Dir3, LOW);
digitalWrite(Pul, HIGH);
delayMicroseconds(800); // Schneller Lauf
digitalWrite(Pul, LOW); // Step low
digitalWrite(Pul2, HIGH);
delayMicroseconds(800); // Schneller Lauf
digitalWrite(Pul2, LOW); // Step low
digitalWrite(Pul3, HIGH);
delayMicroseconds(800); // Schneller Lauf
digitalWrite(Pul3, LOW);
digitalRead(S1);
Serial.println("Rechts");
if (digitalRead(S1) == LOW)
{ Serial.println("Abbruch");
break;
}
What is happening is shown in the video:
For some reason i cant get, the one stepper motor attached is slower then the other, despite the fact that they have the same set up on the driver.
Does anyone have a solution at hand?