Updated A4988 StepperMotorDriverCircuit (markdown)

Michael Ingraham 2019-09-08 22:09:21 -04:00
parent 725f147ed3
commit b568938c02
2 changed files with 37 additions and 26 deletions

@ -0,0 +1,37 @@
Use an A4988 circuit to easily control stepper-motors like "NEMA 17" and siblings. Detailed information about the circuit can be found in the [datasheet](http://www.allegromicro.com/~/media/Files/Datasheets/A4988-Datasheet.ashx?la=en).
## Enable A4988 support
To enable this feature, add `#define USE_A4988_STEPPER` to your `user_config_override.h` file and compile your own firmware.
## Connecting the motor controller
The driverboard has several connectors: powering the controller (3.3-5.0 V), input (+/-) & output (1a/1b/2a/2b), the motor (up to 35V/2A), and to control the circuit (in order at the control side of the board):
Connector | Description
:-:|-
DIR|Direction of rotation
STEP|Initiate stepping
SLP| Sleep (not implemented)
RST| Reset (not implemented)
MS3|
MS2|Set microstep increment 1/1 to 1/16th
MS1|
EN|Enable the power supply for the motor
There are six corresponding GPIO components for this Tasmota driver. These should be configured to free GPIO pins of the device using a Template or Module:
`A4988 DIR (170)`
`A4988 STP (171)` (step)
`A4988 ENA (172)` (enable)
`A4988 MS1 (173)`
`A4988 MS2 (174)`
`A4988 MS3 (175)`
The minimal configuration for the A4988 are the `DIR` and `STEP` signals. In such a configuration the motor will be permanently powered and microstepping will be set to 1/1 (full steps).
## Use cases
The cheap auto-feeder for my cats broke. It was a fancy plastic-thingy with voice-recording-function & programmable to feed several times a day after playing back your voice (cats don't give a sh$7 for your voice - they come when they hear the food falling into the bowl). It was never precise - a concern for the amount of nutrition it gave the cats. And it was not reliable, as the torque of the internal moving mechanism was insufficient to spin the separator/proportioning wheel through the food reliably. In addition, the batteries were always drained in a day meaning very grumpy cats when we returned!
Thus the wish to install a high-torque stepper-motor (with shifting gear) was born. I could power it with mains instead of relying on a battery, control it over WiFi from my smarthome automation hub. Tasmota now offers a way to do this!
The **"TasmotaSmartCatFeeder"** circuit consists of a WeMos D1 mini, a A4988 controller, and two power supplies (5V&12V). This all fits into the housing of the feeder and costs less than 50€!
Virtually everything which has to be moved or rotated can be done now using these cheap components. It can be a window, door, shutter, cat or dog flap, a solar panel which follows the sun, a moving spotlight, PTZ-camera, or whatever.

@ -1,26 +0,0 @@
## The A4988
The A4988 circuit was developed to easily control stepper-motors like "NEMA 17" and siblings.
Detailed information about the Circuit please <a href="http://www.allegromicro.com/~/media/Files/Datasheets/A4988-Datasheet.ashx?la=en">find in the datasheet.</a><BR>
The driverboard has several connectors, for powering the controller (3.3-5.0 V), input (+/-) & output (1a/1b/2a/2b) for motor (up to 35V/2A), and to controll the circuit (in order at the controlling-side of the board:<BR>**DIR** for direction of rotation<BR>**STEP** initiating a step<BR>**SLP** for Sleep [not implemented in Tasmota]<BR>**RST** for Reset [not implemented in Tasmota]<BR>**MS3**<BR>**MS2** for setting the microstepping 1/1 to 1/16th<BR>**MS1**<BR>
**EN** for en-/disabling the powersupply for the motor).<BR>
The 6 implemented input-connectors of the A4988 can be allocated to a free GPIO of the Tasmota-device in the settings-page of the Tasmota Web-Frontend, where the pins are named:<BR>
**A4988 DIR (170)**<BR>
**A4988 STP (171)**(step)<BR>
**A4988 ENA (172)**(enable)<BR>
**A4988 MS1 (173)**<BR>
**A4988 MS2 (174)**<BR>
**A4988 MS3 (175)**<BR>
As a minimum-configuration the A4988-pins "DIR" & "STEP" should be connected by 2 wires to the Tasmota-devices GPIO's. In such a configuration the motor will be permanently powered and microstepping will be set to 1/1 (full steps).<BR>
## How to enable A4988-support?
You will have to compile your own version of Tasmota. To enable the support for the circuit in the file<BR>
**Sonoff-Tasmota/sonoff/my_user_config.h** uncomment the line:<BR>
`//USE_A4988_STEPPER`<BR>
## What might this be good for?
I was using Tasmota for quite a while, when the cheap feeding-automat for my cats broke. It was a fancy plastic-thingy whith voice-recording-function & programmable to feed several times a day after playing back your voice (cats don't give a sh$7 for your voice - they come when they hear the food falling into the bowl).<BR>It was never precise - concerning the ammount of nutrition it gave to them - and not reliable, as the torque of the moving-mechanism inside was not big enough to spin the separator-/protioning-wheel through the food reliably. Additionaly the batteries where always empty on the day after departure - grumpy cats when commin home da hooman...<BR>
Born was the wish to install a high-torque stepper-motor (with shifting gear), power it with 220V and to controll it over WiFi from my Smarthome-controller (ioBroker). But my favourite Firmware Tasmota offered no way to do this.<BR>
Now it does :-)<BR>
I took a WeMoD1 mini, a A4988 driver, 2 powersupplies (5V&12V), fiddled all this into the housing of the feeder and **BOOM!** - here is the TasmotaSmartCatFeeder at costs of less then 50€ !
Virtually everything which has to be moved or rotated can be done now using this cheap components. No matter if it might be a window, door, shutter, cat or dog flap, Solarpanel which follows the sun, mooving spotlight, PTZ-camera or whatsoever.