Skip to content

Commit d7c4ba7

Browse files
version 3.0
1 parent 050553e commit d7c4ba7

30 files changed

+638
-435
lines changed

Documentation/28BYJ.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ Software
8080
--------------------------------------------
8181

8282
The library file RpiMotorLib.py contains the class which controls
83-
the motor.
83+
the motor. The test file in the test folder is called BYJ_Motor_Test.py.
8484

8585
When initialize class pass a name and motor type
8686
The class is called BYJMotor
@@ -130,7 +130,7 @@ to initialize.
130130
verbose output off , in half step mode, with an init start delay of 50mS
131131

132132
The second function is called to stop the motor when the motor is moving.
133-
motor_stop()
133+
motor_stop(), if you wish to stop motor before end of its run. You can also stop with keyboard interrupt.
134134

135135
```sh
136136

Documentation/Nema11A3967Easy.md

+26-19
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ should work with any similar type motor.
1818
It has 200 steps per revolution, and can operate at at 60 RPM.
1919
It was a step to angle ratio of 1.8 degrees per step.
2020

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.
2422
With our example motor these are green, blue, black and red.
2523

2624
coil 2.
@@ -70,11 +68,20 @@ MS1/MS2 : These digital inputs control the microstepping mode. Connect to RPI GP
7068
Possible settings are (MS1/MS2) : full step (0,0), half step (1,0), 1/4 step (0,1), and 1/8 step
7169
(1,1).
7270

73-
Enable, Reset, PFD and Sleep pins can be left unconnected. They are not supported in this library at present.
7471

72+
Enable, Reset, PFD and Sleep pins can be left unconnected.
73+
They are not supported in this library at present.
74+
The User can control them externally with GPIO.
7575

76-
![ScreenShot motor pinout](https://raw.githubusercontent.com/gavinlyonsrepo/RpiMotorLib/master/images/a3967pinout.jpg)
76+
RST (reset) : This normally high input signal will disable all output drivers when pulled low.
77+
SLP (sleep) : This normally high input signal will minimize power consumption the output drivers when pulled low.
78+
ENABLE : This normally low input signal will disable all outputs when pulled high.
79+
PFD : This one is complicated - please see the datasheet for more information.
80+
81+
82+
Also do NOT disconnect motor when in operation, as it will damage controller.
7783

84+
![ScreenShot motor pinout](https://raw.githubusercontent.com/gavinlyonsrepo/RpiMotorLib/master/images/a3967pinout.jpg)
7885

7986
In addition there are two bridges/jumpers on the Easy driver SJ1 and SJ2.
8087
SJ1 is jumper APWR and can be left alone, see datasheet for details.
@@ -84,34 +91,31 @@ to work with RPI, note diagram for location of SJ2 in bottom left.
8491

8592
![ScreenShot motor pinout](https://raw.githubusercontent.com/gavinlyonsrepo/RpiMotorLib/master/images/a3967jumper.jpg)
8693

87-
Also do NOT disconnect motor when in operation, as it will damage controller.
94+
There are 4 step modes for A3967.
8895

89-
![ScreenShot mircostep data](https://github.com/gavinlyonsrepo/RpiMotorLib/blob/master/images/Microstepping_Data.jpg)
96+
| MicroStep| Step increment degrees | Steps for 1 revolution(360) |
97+
| ------ | ------ | ------ |
98+
| Full | 1.8 | 200 |
99+
| Half | 0.9 | 400 |
100+
| 1/4 | 0.45 | 800 |
101+
| 1/8 | 0.225 | 1600 |
90102

91-
Microstep Resolution Truth Table.
103+
Microstep Resolution Truth Table.
92104

93-
94105
| MS1 | MS2 | Resolution |
95106
| --- | --- | --- |
96107
| L | L | Full step |
97108
| H | L | Half step |
98109
| L | H | Quarter step |
99110
| H | H | Eighth step |
100111

101-
There are 4 step modes for A3967, NOTE the A3967 only goes as far as 1/8 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-
108-
109112

110113
Software
111114
--------------------------------------------
112115

113116
The library file RpiMotorLib.py contains the class which controls
114-
the motor. The class is called A3967EasyNema.
117+
the motor. The class is called A3967EasyNema.
118+
The test file is called A3967_Nema_Test.py.
115119

116120
init method 3 inputs.
117121
1. direction type=int , help=GPIO pin connected to DIR pin of IC
@@ -134,11 +138,14 @@ Microstep Resolution pins MS1-MS2 of IC
134138
6. initdelay, type=float, default=1mS, help= Initial delay after
135139
GPIO pins initialized but before motor is moved.
136140

141+
Another function is called to stop the motor when the motor is moving.
142+
motor_stop(), if you wish to stop motor before end of its run.
143+
You can also stop with keyboard interrupt.
144+
137145
Example:
138146

139147
```sh
140148

141-
142149
import RPi.GPIO as GPIO
143150

144151

Documentation/Nema11A4988.md

+20-24
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,7 @@ should work with any similar type motor.
1818
It has 200 steps per revolution, and can operate at at 60 RPM.
1919
It was a step to angle ratio of 1.8 degrees per step.
2020

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.
2422
With our example motor these are green, blue, black and red.
2523

2624
coil 2.
@@ -42,9 +40,7 @@ Good info!
4240

4341
[A4988 How to Setup with A4988 Arduino, Blog by DroneBot Workshop](https://dronebotworkshop.com/stepper-motors-with-arduino/)
4442

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,
4844
With a heatsink the device can handle up to 2 amperes.
4945

5046
Pinout of the A4988 module:
@@ -81,38 +77,33 @@ but you should check your motor connections to be sure they are correct.
8177

8278
Connect 5 GPIO pins to MS1, MS2, MS3, STEP and DIR.
8379
NOTE in this figure MS1 and MS3 are not connected.
84-
80+
Connect Reset to Sleep.
8581
Connect pi Vcc 5V and GND to A4988 at VDD and GND
8682

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,
8984
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.
9186

9287
Advisable to carry out a Current Adjustment before using motor,
9388
see links at top of section for instructions.
94-
95-
Connect Reset to Sleep
96-
9789
Also do not disconnect motor when in operation, as it will damage controller.
9890

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.
10892

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 |
109100

110101

111102
Software
112103
--------------------------------------------
113104

114105
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
116107

117108
The class is initialized with four arguments.
118109
(direction_pin, step_pin, mode_pins, motor_type):
@@ -146,12 +137,17 @@ help="Write pin actions",
146137
6. initdelay, type=float, default=1mS, help= Intial delay after
147138
GPIO pins initialized but before motor is moved.
148139

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+
149144

150145
Example: Should do a 180 degree turn.
151146
To run A stepper motor clockwise in Full mode for 100 steps.
152147
for step delay of .01 second.
153148
verbose output off , with 50mS init delay.
154-
149+
150+
155151
```sh
156152

157153

Documentation/Nema11DRV8825.md

+14-20
Original file line numberDiff line numberDiff line change
@@ -22,11 +22,7 @@ Info.
2222

2323

2424
The DRV8825 is a very common and inexpensive stepper motor controller,
25-
designed by pololu.
26-
Other than the controller and motor it only requires one other part,
27-
a decoupling capacitor that is mounted physically close to the controller.
28-
With a heatsink the device can handle up to 1.5 amps per coil.
29-
Six different step resolutions: full-step, half-step, 1/4-step, 1/8-step, 1/16-step, and 1/32-step
25+
designed by pololu.With a heatsink the device can handle up to 1.5 amps per coil.
3026

3127
Pinout of the DRV8825 module:
3228

@@ -58,31 +54,29 @@ that is common on several bipolar motors
5854
but you should check your motor connections to be sure they are correct.
5955

6056
Connect 5 GPIO pins to MS0, MS1, MS2, STEP and DIR.
61-
NOTE in this figure MS pins are not connected.
62-
6357
Connect pi gnd to DRV8825 at GND.
6458
Connect Reset and sleep together and to pi 5V.
59+
Connect up capacitor and Motor leads.
6560

66-
Note that there is an additional component not shown , in this circuit.
67-
This is essential to decouple the power supply. Any value from 47uf up will suffice,
61+
The capacitor is essential to decouple the power supply. Any value from 47uf up will suffice,
6862
try and mount the capacitor as close to the DRV8825 VMOT and GND pins as possible.
69-
Connect up capacitor and Motor leads
70-
7163
Advisable to carry out a DRV8825 Current Adjustment before using motor see info links at top of section.
7264

7365
Also do not disconnect motor when in operation, as it will damage controller.
74-
7566
It is also possible and valid to connect up the DRV8825 in another alternative minimal wiring type as per A4988 section
7667
see first info links at top of section bottom of page.
7768

78-
![ScreenShot DRV8825 mircostep data](https://github.com/gavinlyonsrepo/RpiMotorLib/blob/master/images/Microstepping_Data.jpg)
69+
There are 6 step modes for DRV8825,
70+
Six different step resolutions: full-step, half-step, 1/4-step, 1/8-step, 1/16-step, and 1/32-step
7971

80-
There are 6 step modes for DRV8825, NOTE the DRV8825 only goes as far as 1/32 step
81-
Above is the step-resolution of Motor step per degree,
82-
83-
* Full mode: 200 steps is one revolution. 1.8 degree per step = 360
84-
* Half mode: 400 steps is one revolution 0.9 degree per step = 360
85-
* ... and so on.
72+
| MicroStep| Step increment degrees | Steps for 1 revolution(360) |
73+
| ------ | ------ | ------ |
74+
| Full | 1.8 | 200 |
75+
| Half | 0.9 | 400 |
76+
| 1/4 | 0.45 | 800 |
77+
| 1/8 | 0.225 | 1600 |
78+
| 1/16 | 0.1125 | 3200 |
79+
| 1/32 | 0.05625 | 6400 |
8680

8781
Resolution truth table used in code.
8882

@@ -96,7 +90,7 @@ The library file RpiMotorLib.py contains the class which controls
9690
the motor. The class is called A4988Nema. This class handles both A4988
9791
and Drv8825. The only difference from a user POV is when you instantiate
9892
the class the user passes the motor type and also user can now use
99-
1/32 microstep for DRV8825.
93+
1/32 microstep for DRV8825. The test file is called DRV8825_Nema_Test.py
10094

10195
See for more details [A4988 software Section](Nema11A4988.md)
10296

Documentation/Nema11L298N.md

+6-3
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Same software as 28BYJ-48 but with
111111
minor change in class definition for verbose output.
112112

113113
The library file RpiMotorLib.py has a class which controls the motor with one
114-
main function.
114+
main function. The test file in the test folder is called L298_Step_Test.py.
115115

116116
When initializing the class pass a name and motor type.
117117
The class is called BYJMotor.
@@ -124,7 +124,7 @@ BYJMotor(name, motor_type)
124124
to calculate degree in verbose output two options currently
125125
Nema and 28BYJ. Set to Nema for this component
126126

127-
The function is called motor_run- moves stepper motor based on 7 inputs.
127+
The first function is called motor_run- moves stepper motor based on 7 inputs.
128128
motor_run(GPIOPins, wait, steps, counterclockwise, verbose, steptype, initdelay)
129129

130130
(1) GpioPins, type=list of ints 4 long, help="list of
@@ -154,7 +154,10 @@ help="Turn stepper counterclockwise"
154154
(7) initdelay, type=float, default=1mS, help= Intial delay after
155155
GPIO pins initialized but before motor is moved, gives time for GPIO
156156
to initialize.
157-
157+
158+
he second function is called to stop the motor when the motor is moving.
159+
motor_stop(), if you wish to stop motor before end of its run. You can also stop with keyboard interrupt.
160+
158161
Example: To run A stepper motor connected to GPIO pins 18, 23, 24, 25
159162
(18-IN1 23-IN2 24-IN3, 25-IN4)
160163
for step delay of 0.1 second for 50 step control signal sequence, in clockwise direction,

Documentation/Nema11TB6612FNG.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ Same software as 28BYJ-48 but with
107107
minor change in class definition for verbose output.
108108

109109
The library file RpiMotorLib.py has a class which controls the motor with one
110-
main function.
110+
main function. The test file in the test folder is called TB6612FNG_Nema_Test.py
111111

112112
When initializing the class pass a name and motor type.
113113
The class is called BYJMotor.
@@ -120,7 +120,7 @@ BYJMotor(name, motor_type)
120120
to calculate degree in verbose output two options currently
121121
Nema and 28BYJ. NB **Set to Nema for this component**
122122

123-
The function is called motor_run- moves stepper motor based on 7 inputs.
123+
The 1st function is called motor_run- moves stepper motor based on 7 inputs.
124124
motor_run(GPIOPins, wait, steps, counterclockwise, verbose, steptype, initdelay)
125125

126126
(1) GpioPins, type=list of ints 4 long, help="list of
@@ -150,6 +150,8 @@ help="Turn stepper counterclockwise"
150150
GPIO pins initialized but before motor is moved, gives time for GPIO
151151
to initialize.
152152

153+
The second function is called to stop the motor when the motor is moving.
154+
motor_stop(), if you wish to stop motor before end of its run. You can also stop with keyboard interrupt.
153155

154156
Example:
155157

0 commit comments

Comments
 (0)