@@ -18,9 +18,7 @@ should work with any similar type motor.
18
18
It has 200 steps per revolution, and can operate at at 60 RPM.
19
19
It was a step to angle ratio of 1.8 degrees per step.
20
20
21
- The key to successful stepper motor control is identifying the wires -
22
- that is which one is which. You will need to determine
23
- the A, B, C and D wires.
21
+ You will need to determine the A, B, C and D wires on the stepper motor.
24
22
With our example motor these are green, blue, black and red.
25
23
26
24
coil 2.
@@ -42,9 +40,7 @@ Good info!
42
40
43
41
[ A4988 How to Setup with A4988 Arduino, Blog by DroneBot Workshop] ( https://dronebotworkshop.com/stepper-motors-with-arduino/ )
44
42
45
- The A4988 is a very common and inexpensive stepper motor controller.
46
- Other than the controller and motor it only requires one other part,
47
- a decoupling capacitor that is mounted physically close to the controller.
43
+ The A4988 is a very common and inexpensive stepper motor controller,
48
44
With a heatsink the device can handle up to 2 amperes.
49
45
50
46
Pinout of the A4988 module:
@@ -81,38 +77,33 @@ but you should check your motor connections to be sure they are correct.
81
77
82
78
Connect 5 GPIO pins to MS1, MS2, MS3, STEP and DIR.
83
79
NOTE in this figure MS1 and MS3 are not connected.
84
-
80
+ Connect Reset to Sleep.
85
81
Connect pi Vcc 5V and GND to A4988 at VDD and GND
86
82
87
- Note that there is an additional component not shown , in this circuit.
88
- This is essential to decouple the power supply. Any value from 47uf up will suffice,
83
+ The capacitor is essential to decouple the power supply. Any value from 47uf up will suffice,
89
84
try and mount the capacitor as close to the A4988 VMOT and GND pins as possible.
90
- Connect up capacitor and Motor leads
85
+ Connect up capacitor and Motor leads.
91
86
92
87
Advisable to carry out a Current Adjustment before using motor,
93
88
see links at top of section for instructions.
94
-
95
- Connect Reset to Sleep
96
-
97
89
Also do not disconnect motor when in operation, as it will damage controller.
98
90
99
- ![ ScreenShot A4988 mircostep data] ( https://github.com/gavinlyonsrepo/RpiMotorLib/blob/master/images/Microstepping_Data.jpg )
100
-
101
- There are 5 step modes for A4988, NOTE the A4988 only goes as far as 1/16 step
102
- Above is the step-resolution of Motor step per degree,
103
-
104
- * Full mode: 200 steps is one revolution. 1.8 degree per step = 360
105
- * Half mode: 400 steps is one revolution 0.9 degree per step = 360
106
- * ... and so on.
107
-
91
+ There are 5 step modes for A4988.
108
92
93
+ | MicroStep| Step increment degrees | Steps for 1 revolution(360) |
94
+ | ------ | ------ | ------ |
95
+ | Full | 1.8 | 200 |
96
+ | Half | 0.9 | 400 |
97
+ | 1/4 | 0.45 | 800 |
98
+ | 1/8 | 0.225 | 1600 |
99
+ | 1/16 | 0.1125 | 3200 |
109
100
110
101
111
102
Software
112
103
--------------------------------------------
113
104
114
105
The library file RpiMotorLib.py contains the class which controls
115
- the motor. The class is called A4988Nema.
106
+ the motor. The class is called A4988Nema. Test file is called A4988_Nema_Test.py
116
107
117
108
The class is initialized with four arguments.
118
109
(direction_pin, step_pin, mode_pins, motor_type):
@@ -146,12 +137,17 @@ help="Write pin actions",
146
137
6 . initdelay, type=float, default=1mS, help= Intial delay after
147
138
GPIO pins initialized but before motor is moved.
148
139
140
+ Another function is called to stop the motor when the motor is moving.
141
+ motor_stop(), if you wish to stop motor before end of its run.
142
+ You can also stop with keyboard interrupt.
143
+
149
144
150
145
Example: Should do a 180 degree turn.
151
146
To run A stepper motor clockwise in Full mode for 100 steps.
152
147
for step delay of .01 second.
153
148
verbose output off , with 50mS init delay.
154
-
149
+
150
+
155
151
``` sh
156
152
157
153
0 commit comments