Coder Social home page Coder Social logo

dcmotorservo's Introduction

DCMotorServo

An Arduino Library for controlling DC motors with rotary encoders. This library is an updated version and continuation of julester23 / DCMotorServo uses PID and Encoder feedback, inspired by the adafruit / AccelStepper library.

Circuit

I used a 754410 quad half-H controller (a pin-compatible L293D). I'm sure it would be cheaper to make out of other components, but I've never done transistor matching, and I'm afraid of burning things.

Example circuit connections

L293D or 754410 pins Device
1, 9 arduino pin_pwm_output
2, 15 arduino pin_dir
7, 10 arduino pin_dir
4, 5, 12, 13 power GND
16 power 5V
8 power 12V
3, 14 motor motor pin 1
6, 11 motor motor pin 2

Hardware

Pins

Pinout for motor control uses 3 pins for output. It is somewhat wasteful, but had more flexibility. Two pins for direction control, and one for motor power (assuming PWM). Be sure to pick a PWM capable pin for pin_pwm_output.

The two input pins are for the encoder feedback.

Two directional pins allow for setting a motor brake by shorting the terminals of the motor together (set both directions HIGH, and preferably turn off the PWM)

TODO

  • implement brake feature for 3-pin mode
  • 2-pin constructor
  • implement friendlier tuning method for PID

dcmotorservo's People

Contributors

cameronbrooks11 avatar

Watchers

 avatar

dcmotorservo's Issues

Extrema Point Sensing

Add the option to specify physical extrema (end stops) using: A) physical indication (e.g. hall effect), B) electrical indication (i.e. stall current sensing), C) software indication (i.e. encoder tracking).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.