Assignment
add an output device to a microcontroller board and program it to do something
#vid
I didn't think it became such a challenge just to make a stepper motor rotate..
There are 2 points,
one is that I couldn't write the program to the board and it took days to find out it was because of soldering error.
(I checked the connection with a tester very carefully but couldn't find that. After soldering again, it worked, so now I can guess it was because of soldering.)
Another one is that I used a stepper I bought here in Tokyo, which is different from one on the tutorial, then needed to learn the mechanism of stepper motors in order to make it work.
This was, different from the first point, interesting to me. It took a while to make it work but I understood how a stepper works through this.
Mill and solder the board
I used this hello.stepper.44 board Neil uploaded on the class page.
About J2(Jumper pins) for power, the power is according to the regulator and your stepper. Check the maximum input voltage of them on their datasheet or digikey page.
The maximum input voltage of the regulator is 30V, but your stepper, I guess, need to be worked with about 6 ~ 9V power supply. (It is definitely different between each product. Check the datasheet.)
If the colors of the J3 pins are different from your stepper's leads, this is what I'm going to explain about below.
Unipolar type stepper motors have common lead(s) which need to be connected to a power supply (DC).
Your stepper's datasheet may have these kind of image below, then the middle leads of the veritcal set and the horizontal set are the common.
(FYI, I learned these sets are called 'stators'.)
▲ This case, 1C and 2C are common.
▲ This case, 1(ORG) is common.
Find the order of the leads to send pulses to
You need to send pulse to leads of your stepper in a correct order like this below.
With connecting common leads to DC, connect GND to each of the rest of the lead. Your stepper will rotate for a given degree.
When you connect GND to each lead in a given order, the stepper rotaes in a same direction. This is how a stepper rotates.
And the order seems to be
1. the left lead of the horizontal stator
2. the left lead of the vertical stator
3. the right lead of the horizontal stator
4. the right lead of the veritcal stator
(If you don't understand what stator means, see Find its commons lead(s) above.)
▲ This case, 1 > 2 > 1 > 2
▲ This case, 2 > 3 > 4 > 5
▲ This is my stepper. The black and the blue are common, I tested the order which was green(2) > yellow(1) > red(2) > white(1)
. Counterclockwise rotation.
▲ When connecting GND in an order of white(1) > red(2) > yellow(1) > green(2), it rotaes clockwise.
Find which pin is corresponding to each lead of your stepper