Hello everyone,
I'm trying to control a 3 phase stepper motor with an Arduino Uno, but it randomly changes directions while turning.
I'm using Moons stepping motor type 24HC2016-03, a 3 phase driver (3DM80S) from Cloudray and an Arduino Uno.
That is sadly the only datasheet i could find from the motor.
The information about the driver can be found here: Cloudray 3DM580S 3 Phase Stepper Motor Driver – Cloudray Laser. I can't attach the datasheet because of my account age, I'm sorry for that.
I tried connectiong the motor via the common cathode methode.

Here is the schematic:
And thats my code:
const int stepPin = 8;
const int dirPin = 9;
const int enablePin = 10;
const int spinDelay = 1000;
void setup()
{
Serial.begin(9600);
pinMode(stepPin, OUTPUT);
pinMode(dirPin, OUTPUT);
pinMode(enablePin, OUTPUT);
}
void loop()
{
Serial.println("Spinning one!");
digitalWrite(enablePin, LOW);
digitalWrite(dirPin, HIGH);
for (int x = 0; x < 100; x++)
{
digitalWrite(stepPin, HIGH);
delayMicroseconds(spinDelay);
digitalWrite(stepPin, LOW);
delayMicroseconds(spinDelay);
}
delay(1000);
}
The code should turn the motorshaft in one direction then stop for a second and then resume the rotation, but sometimes in changes directions while doing that. The driver is connected to a 25V 1A supply. I'm not quite sure how i configure the microsteps and the current via the dip switches. The second problem i have, are the connections from the u,v,w pins to the motor phases. How do i connect those the right way?
Thank you in advance.

