All Projects → laurb9 → Stepperdriver

laurb9 / Stepperdriver

Licence: mit
Arduino library for A4988, DRV8825, DRV8834, DRV8880 and generic two-pin (DIR/STEP) stepper motor drivers

Labels

Projects that are alternatives of or similar to Stepperdriver

Hid Relay
Arduino project to convert wired USB HID device to Bluetooth (pipes USB HID reports out through a Bluetooth HID module)
Stars: ✭ 325 (-12.16%)
Mutual labels:  arduino
Sim7000 Lte Shield
LTE CAT-M/NB-IoT Arduino-compatible shield with GNSS and temperature sensor. Library supports SIMCom 2G/3G/4G LTE/CAT-M/NB-IoT
Stars: ✭ 340 (-8.11%)
Mutual labels:  arduino
Logic analyzer
Implementation of a SUMP compatible logic analyzer for the Arduino
Stars: ✭ 356 (-3.78%)
Mutual labels:  arduino
Heatpump
Arduino library to control Mitsubishi Heat Pumps via connector cn105
Stars: ✭ 327 (-11.62%)
Mutual labels:  arduino
Platform Espressif32
Espressif 32: development platform for PlatformIO
Stars: ✭ 333 (-10%)
Mutual labels:  arduino
Qrcode
QR code generation library in C, optimized for low-power devices, such as Arduino.
Stars: ✭ 351 (-5.14%)
Mutual labels:  arduino
Tonuino
Die DIY Musikbox (nicht nur) für Kinder
Stars: ✭ 320 (-13.51%)
Mutual labels:  arduino
Scarab Osd
MWOSD - UAV HUD
Stars: ✭ 366 (-1.08%)
Mutual labels:  arduino
F32c
A 32-bit RISC-V / MIPS ISA retargetable CPU core & SoC, 1.63 DMIPS/MHz
Stars: ✭ 338 (-8.65%)
Mutual labels:  arduino
Radiolib
Universal wireless communication library for Arduino
Stars: ✭ 350 (-5.41%)
Mutual labels:  arduino
Espui
A simple web user interface library for ESP32 and ESP8266
Stars: ✭ 330 (-10.81%)
Mutual labels:  arduino
Espixelstick
Firmware for the ESPixelStick
Stars: ✭ 332 (-10.27%)
Mutual labels:  arduino
Sonoff Homeassistant
Firmware for ESP8266 based itead Sonoff switches for use with HomeAssistant
Stars: ✭ 354 (-4.32%)
Mutual labels:  arduino
Mars Rover
3D printed Curiosity/Perseverance inspired Rover
Stars: ✭ 327 (-11.62%)
Mutual labels:  arduino
Ardublockly
Visual programming for Arduino. Based on blockly, implements Arduino code generation and facilitates program uploading.
Stars: ✭ 363 (-1.89%)
Mutual labels:  arduino
Ds3232rtc
Arduino Library for Maxim Integrated DS3232 and DS3231 Real-Time Clocks
Stars: ✭ 320 (-13.51%)
Mutual labels:  arduino
Microcore
An optimized Arduino hardware package for ATtiny13
Stars: ✭ 348 (-5.95%)
Mutual labels:  arduino
Openiothub
💖A free IoT (Internet of Things) platform and private cloud. [一个免费的物联网和私有云平台,支持内网穿透]
Stars: ✭ 371 (+0.27%)
Mutual labels:  arduino
Peeqo Robot
The world's first robot to interact through GIFs...'nuf said
Stars: ✭ 365 (-1.35%)
Mutual labels:  arduino
Freedomotic
Open IoT Framework
Stars: ✭ 354 (-4.32%)
Mutual labels:  arduino

arduino-library-badge Actions Status Actions Status

StepperDriver

A4988, DRV8825, DRV8834, DRV8880 and generic two-pin stepper motor driver library. Features:

  • Constant speed mode (low rpms)
  • Linear (accelerated) speed mode, with separate acceleration and deceleration settings.
  • Non-blocking mode (yields back to caller after each pulse)
  • Early brake / increase runtime in non-blocking mode

Hardware currently supported:

  • DRV8834 Low-Voltage Stepper Motor Driver up to 1:32
  • A4988 Stepper Motor Driver up to 1:16
  • DRV8825 up to 1:32
  • DRV8880 up to 1:16, with current/torque control
  • any other 2-pin stepper via DIR and STEP pins, microstepping up to 1:128 externally set

Microstepping

The library can set microstepping and generate the signals for each of the support driver boards.

High RPM plus high microstep combinations may not work correctly on slower MCUs, there is a maximum speed achieveable for each board, especially with acceleration on multiple motors at the same time.

Motors

  • 4-wire bipolar stepper motor or
  • some 6-wire unipolar in 4-wire configuration (leaving centers out) or
  • 28BYJ-48 (commonly available) with a small modification (search for "convert 28byj-48 to 4-wire").

Connections

Minimal configuration from Pololu DRV8834 page:

Wiring

This is suggested wiring for running the examples unmodified. All the pins below can be changed.

  • Arduino to driver board:

    • DIR - D8
    • STEP - D9
    • GND - Arduino GND
    • GND - Motor power GND
    • VMOT - Motor power (check driver-specific voltage range)
    • A4988/DRV8825 microstep control
      • MS1/MODE0 - D10
      • MS2/MODE1 - D11
      • MS3/MODE2 - D12
    • DRV8834/DRV8880 microstep control
      • M0 - D10
      • M1 - D11
    • ~SLEEP (optional) D13
  • driver board to motor (this varies from motor to motor, check motor coils schematic).

  • 100uF capacitor between GND - VMOT

  • Make sure to set the max current on the driver board to the motor limit (see below).

  • Have a motor power supply that can deliver that current.

  • Make sure the motor power supply voltage is within the range supported by the driver board.

Set Max Current

The max current is set via the potentiometer on board. Turn it while measuring voltage at the passthrough next to it. The formula is V = I5R where I=max current, R=current sense resistor installed onboard

  • DRV8834 or DRV8825 Pololu boards, R=0.1 and V = 0.5 * max current(A). For example, for 1A you will set it to 0.5V.

For latest info, see the Pololu board information pages.

Code

See the BasicStepperDriver example for a generic driver that should work with any board supporting the DIR/STEP indexing mode.

The Microstepping example works with a DRV8834 board.

For example, to show what is possible, here is the ClockStepper example that moves a stepper motor like the seconds hand of a watch:

#include <Arduino.h>
#include "A4988.h"

// using a 200-step motor (most common)
#define MOTOR_STEPS 200
// configure the pins connected
#define DIR 8
#define STEP 9
#define MS1 10
#define MS2 11
#define MS3 12
A4988 stepper(MOTOR_STEPS, DIR, STEP, MS1, MS2, MS3);

void setup() {
    // Set target motor RPM to 1RPM and microstepping to 1 (full step mode)
    stepper.begin(1, 1);
}

void loop() {
    // Tell motor to rotate 360 degrees. That's it.
    stepper.rotate(360);
}

Hardware

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].