Skip to content

Commit

Permalink
version 3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
gavinlyonsrepo committed Apr 18, 2021
1 parent 050553e commit d7c4ba7
Show file tree
Hide file tree
Showing 30 changed files with 638 additions and 435 deletions.
4 changes: 2 additions & 2 deletions Documentation/28BYJ.md
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ Software
--------------------------------------------

The library file RpiMotorLib.py contains the class which controls
the motor.
the motor. The test file in the test folder is called BYJ_Motor_Test.py.

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

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

```sh

Expand Down
45 changes: 26 additions & 19 deletions Documentation/Nema11A3967Easy.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ should work with any similar type motor.
It has 200 steps per revolution, and can operate at at 60 RPM.
It was a step to angle ratio of 1.8 degrees per step.

The key to successful stepper motor control is identifying the wires -
that is which one is which. You will need to determine
the A, B, C and D wires.
You will need to determine the A, B, C and D wires.
With our example motor these are green, blue, black and red.

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

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

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

![ScreenShot motor pinout](https://raw.githubusercontent.com/gavinlyonsrepo/RpiMotorLib/master/images/a3967pinout.jpg)
RST (reset) : This normally high input signal will disable all output drivers when pulled low.
SLP (sleep) : This normally high input signal will minimize power consumption the output drivers when pulled low.
ENABLE : This normally low input signal will disable all outputs when pulled high.
PFD : This one is complicated - please see the datasheet for more information.


Also do NOT disconnect motor when in operation, as it will damage controller.

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

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

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

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

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

Microstep Resolution Truth Table.
Microstep Resolution Truth Table.


| MS1 | MS2 | Resolution |
| --- | --- | --- |
| L | L | Full step |
| H | L | Half step |
| L | H | Quarter step |
| H | H | Eighth step |

There are 4 step modes for A3967, NOTE the A3967 only goes as far as 1/8 step
Above is the step-resolution of Motor step per degree,

* Full mode: 200 steps is one revolution. 1.8 degree per step = 360
* Half mode: 400 steps is one revolution 0.9 degree per step = 360
* ... and so on.



Software
--------------------------------------------

The library file RpiMotorLib.py contains the class which controls
the motor. The class is called A3967EasyNema.
the motor. The class is called A3967EasyNema.
The test file is called A3967_Nema_Test.py.

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

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

Example:

```sh


import RPi.GPIO as GPIO


Expand Down
44 changes: 20 additions & 24 deletions Documentation/Nema11A4988.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,7 @@ should work with any similar type motor.
It has 200 steps per revolution, and can operate at at 60 RPM.
It was a step to angle ratio of 1.8 degrees per step.

The key to successful stepper motor control is identifying the wires -
that is which one is which. You will need to determine
the A, B, C and D wires.
You will need to determine the A, B, C and D wires on the stepper motor.
With our example motor these are green, blue, black and red.

coil 2.
Expand All @@ -42,9 +40,7 @@ Good info!

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

The A4988 is a very common and inexpensive stepper motor controller.
Other than the controller and motor it only requires one other part,
a decoupling capacitor that is mounted physically close to the controller.
The A4988 is a very common and inexpensive stepper motor controller,
With a heatsink the device can handle up to 2 amperes.

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

Connect 5 GPIO pins to MS1, MS2, MS3, STEP and DIR.
NOTE in this figure MS1 and MS3 are not connected.

Connect Reset to Sleep.
Connect pi Vcc 5V and GND to A4988 at VDD and GND

Note that there is an additional component not shown , in this circuit.
This is essential to decouple the power supply. Any value from 47uf up will suffice,
The capacitor is essential to decouple the power supply. Any value from 47uf up will suffice,
try and mount the capacitor as close to the A4988 VMOT and GND pins as possible.
Connect up capacitor and Motor leads
Connect up capacitor and Motor leads.

Advisable to carry out a Current Adjustment before using motor,
see links at top of section for instructions.

Connect Reset to Sleep

Also do not disconnect motor when in operation, as it will damage controller.

![ScreenShot A4988 mircostep data](https://github.com/gavinlyonsrepo/RpiMotorLib/blob/master/images/Microstepping_Data.jpg)

There are 5 step modes for A4988, NOTE the A4988 only goes as far as 1/16 step
Above is the step-resolution of Motor step per degree,

* Full mode: 200 steps is one revolution. 1.8 degree per step = 360
* Half mode: 400 steps is one revolution 0.9 degree per step = 360
* ... and so on.

There are 5 step modes for A4988.

| MicroStep| Step increment degrees | Steps for 1 revolution(360) |
| ------ | ------ | ------ |
| Full | 1.8 | 200 |
| Half | 0.9 | 400 |
| 1/4 | 0.45 | 800 |
| 1/8 | 0.225 | 1600 |
| 1/16 | 0.1125 | 3200 |


Software
--------------------------------------------

The library file RpiMotorLib.py contains the class which controls
the motor. The class is called A4988Nema.
the motor. The class is called A4988Nema. Test file is called A4988_Nema_Test.py

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

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


Example: Should do a 180 degree turn.
To run A stepper motor clockwise in Full mode for 100 steps.
for step delay of .01 second.
verbose output off , with 50mS init delay.



```sh


Expand Down
34 changes: 14 additions & 20 deletions Documentation/Nema11DRV8825.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,7 @@ Info.


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

Pinout of the DRV8825 module:

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

Connect 5 GPIO pins to MS0, MS1, MS2, STEP and DIR.
NOTE in this figure MS pins are not connected.

Connect pi gnd to DRV8825 at GND.
Connect Reset and sleep together and to pi 5V.
Connect up capacitor and Motor leads.

Note that there is an additional component not shown , in this circuit.
This is essential to decouple the power supply. Any value from 47uf up will suffice,
The capacitor is essential to decouple the power supply. Any value from 47uf up will suffice,
try and mount the capacitor as close to the DRV8825 VMOT and GND pins as possible.
Connect up capacitor and Motor leads

Advisable to carry out a DRV8825 Current Adjustment before using motor see info links at top of section.

Also do not disconnect motor when in operation, as it will damage controller.

It is also possible and valid to connect up the DRV8825 in another alternative minimal wiring type as per A4988 section
see first info links at top of section bottom of page.

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

There are 6 step modes for DRV8825, NOTE the DRV8825 only goes as far as 1/32 step
Above is the step-resolution of Motor step per degree,

* Full mode: 200 steps is one revolution. 1.8 degree per step = 360
* Half mode: 400 steps is one revolution 0.9 degree per step = 360
* ... and so on.
| MicroStep| Step increment degrees | Steps for 1 revolution(360) |
| ------ | ------ | ------ |
| Full | 1.8 | 200 |
| Half | 0.9 | 400 |
| 1/4 | 0.45 | 800 |
| 1/8 | 0.225 | 1600 |
| 1/16 | 0.1125 | 3200 |
| 1/32 | 0.05625 | 6400 |

Resolution truth table used in code.

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

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

Expand Down
9 changes: 6 additions & 3 deletions Documentation/Nema11L298N.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Same software as 28BYJ-48 but with
minor change in class definition for verbose output.

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

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

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

(1) GpioPins, type=list of ints 4 long, help="list of
Expand Down Expand Up @@ -154,7 +154,10 @@ help="Turn stepper counterclockwise"
(7) initdelay, type=float, default=1mS, help= Intial delay after
GPIO pins initialized but before motor is moved, gives time for GPIO
to initialize.


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

Example: To run A stepper motor connected to GPIO pins 18, 23, 24, 25
(18-IN1 23-IN2 24-IN3, 25-IN4)
for step delay of 0.1 second for 50 step control signal sequence, in clockwise direction,
Expand Down
6 changes: 4 additions & 2 deletions Documentation/Nema11TB6612FNG.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ Same software as 28BYJ-48 but with
minor change in class definition for verbose output.

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

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

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

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

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

Example:

Expand Down
Loading

0 comments on commit d7c4ba7

Please sign in to comment.