**Understanding Stepper Motors**
In this experiment, I used a multimeter to verify that red with blue and black with green form a coil. By powering these coils with a lab bench power supply, it was easy to determine which coil pair is positioned where inside the motor. While opposing coils will create the same magnetic polarity, the other two will create the reverse magnetic polarity.
**How Stepper Motors Work**
Firstly, I connected black to VCC and green to ground, creating a South Pole at 0°. This attracted a North polarized tooth, which now aligns with the South Pole. Next, blue connects to VCC and GND, resulting in a North Pole at 45°, which the South polarized teeth will follow. Then, I connected green to VCC and black to GND, creating a South Pole at 90° again, with the reverse polarized teeth following. Finally, by hooking up red to VCC and blue to ground, I created a North Pole at 100 and 35°, which the teeth will once again follow.
**Rotational Steps**
With these four steps, one tooth moved exactly to the location of the next tooth. Multiplying the 50 teeth by four steps gives us a total of 200 steps per rotation, which actually makes sense since the type label gives us a step angle of 1.8° (360° per rotation divided by the 200 steps).
**Driver Circuit**
I created a driver circuit consisting of 4-channel and 4 P-Channel Mosfets to form two H-Bridges and an Arduino to control the gate pairs. An H-Bridge can basically let current flow in either direction through the coil by turning on either the top left and bottom right Mosfets or the top right and bottom left Mosfets.
**Step Motor Advantages**
After connecting the motor and creating a bit of simple code, the four steps were repeated over and over again, which makes the rotor spin perfectly. Because I can exactly control how many steps the rotor should perform, the stepper motor is suitable for positioning applications like 3D printers. Another advantage is that when current flows through the coils in only one way, the rotor does not spin but keeps its position persistent with a so-called holding torque.
**Driver Circuit Advantages**
What I used here is so-called wave driving, in which only one coil is active. There also exists full-step driving, in which both coils are active and thus create a higher torque. Next is half-step driving, which combines all the previous driving states and thus increases the resolution from 200 steps to 400 steps per rotation. This madness then continues to one-fourth step, one-eighth step, and so on, which is also known as microstepping.
**Microstepping with A4988 IC**
In order to implement that, we don't want to use a constant voltage applied to our coils like I did it with my driver instead we need a constant current which we can vary in its strength to create the different steps. An easy solution to this problem is the A4988 microstepping IC. By connecting the setup pins as shown in the schematic, hooking up the MS pins up to 5V to enter the 1/16 step mode, connecting my 12V power source and finally the motor which does nothing yet.
**Completing the Circuit**
What is missing is a circuit that creates a variable frequency Square wave. By using a 555 timer circuit by connecting the outputs to the step pin, the motor rotates one step when other the square wave changes from low to high. Taking a look at the voltage and current of one coil, we can see that the chopped-up voltage creates variable constant current which ultimately forms a sinusoidal shape.
**Advantages of Microstepping**
Everything works fine, and the advantages of microstepping are quite obvious. Not only is the movement of the rotation much smoother, but the loudness of the motor also decreased drastically. Of course, you could also use an Arduino to control the A4988 driver I see, but for now, you already learned quite a bit about stepper motors.
**Conclusion**
I hope this video has been informative and helpful in understanding how stepper motors work. Don't forget to like, share, and subscribe! Stay creative, and I will see you next time!