Difference: SteppingMotor (6 vs. 7)

Revision 72017-11-01 - uli

Line: 1 to 1
 
META TOPICPARENT name="CourseExercises"

Stepping Motor Exercises

Goal:

Line: 20 to 20
 
  • 5V (check for “5V +” and “-” on the board)

  • Gnd

  • 4 phases denominated In0..In3

Added:
>
>
If you want to be compatible with my solutions then you should hook up the phases as follows:
  • phase 1 on pin 27
  • phase 2 on pin 22
  • phase 3 on pin 18
  • phase 4 on pin 17
 The state of each of the In lines is shown on its corresponding LED. We will have to provide a sequence of pulses

to make the motor move by 4 full steps. This is what we call single phase stepping where only 1 coil is energized at a time. In this case we have

Changed:
<
<
    Step 1 Step 2 Step 3 Step 4
In 1 coil 1 + 1 0 0 0
In 2 coil 2 - 0 1 0 0
In 3 coil 1 - 0 0 1 0
In 4 coil 2 + 0 0 0 1
>
>
 We can also drive the motor by energizing both coils as follows:
Changed:
<
<
    Step 1 Step 2 Step 3 Step 4
In 0 coil1 + 1 0 0 1
In 1 coil2 - 1 1 0 0
In 2 coil1 - 0 1 1 0
In 3 coil2 + 0 0 1 1
>
>
 This way of driving the motor is called double phase stepping. It needs more power since we always have both windings energized but it will also provide a higher torque.

Last not least we can use a combination of single and double phase stepping to produce half steps. In this case the angular resolution is better by a factor of 2. The polarization table looks like this:

Changed:
<
<
    Step 1 Step 2 Step 3 Step 4 Step 5 Step 6 Step 7 Step 8
In 0 coil1 + 1 1 0 0 0 0 0 1
In 1 coil2 - 0 1 1 1 0 0 0 0
In 2 coil1 - 0 0 0 1 1 1 0 0
In 3 coil2 + 0 0 0 0 0 1 1 1
>
>
 Connect the stepping motor to the driver board and the driver board to the Raspberry Pi. The In0 .. In3 lines must be connected to GPIO pins (e.g. 17,18,27,22). Now set only the GPIO line, to which In0 is connected, to high, all the others to low and make sure that the corresponding LED lights up. Do the same thing for all the connected GPIO pins.

Exercise 2: Write a program to move the stepping motor by 2048 steps.

 
This site is powered by the TWiki collaboration platform Powered by PerlCopyright © 2008-2024 by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback