Hey guys, I'm make a stepper motor project with a 6 wire Unipolar stepper motor:1.8 degrees, 4V, and 0.9A. Every works fine with a wiring. instead of a driver I put 4 transistors in my project, each of them goes to the coils of the stepper motor. Their is two other wires connected to the middle coils to positive. My stepper motor works fine like it can change direction and change speed but I'm wondering, I need help with the microsteps for a Unipolar stepper motor 6 wires, like the easy and simple step is the full step, but I'm wondering, half, quarter, eighth and sixteenth steps. Just a reminder, I'm not using a driver to control it. I'm using transistors to connect the wires, the arduino board turns on and off four digital pins to each wire, to make it more sense I'm showing the schematic of it, I am posting part of the code to the stepper motor too, help with this please.
Code:
Step = step % 4;
if (Step == 0) {
A = 255;
B = 0;
C = 0;
D = 0;
analogWrite(6, A);
analogWrite(9, B);
analogWrite(10, C);
analogWrite(11, D);
delay(1);
}
if (Step == 1) {
A = 0;
B = 255;
C = 0;
D = 0;
analogWrite(6, A);
analogWrite(9, B);
analogWrite(10, C);
analogWrite(11, D);
delay(1);
}
if (Step == 2) {
A = 0;
B = 0;
C = 0;
D = 255;
analogWrite(6, A);
analogWrite(9, B);
analogWrite(10, C);
analogWrite(11, D);
delay(1);
}
if (Step == 3) {
A = 0;
B = 0;
C = 255;
D = 0;
analogWrite(6, A);
analogWrite(9, B);
analogWrite(10, C);
analogWrite(11, D);
delay(1);
}
To help more my stepper motor turns on and off like this.
arduino:
step1:
6:1
9:0
10:0
11:0
step2:
6:0
9:1
10:0
11:0
step3:
6:0
9:0
10:0
11:1
step4:
6:0
9:0
10:1
11:0
