Coder Social home page Coder Social logo

blakematis / rpimotorlib Goto Github PK

View Code? Open in Web Editor NEW

This project forked from gavinlyonsrepo/rpimotorlib

0.0 2.0 0.0 1.53 MB

RpiMotorLib : Raspberry Pi Motor Library : A python 3 library for various motors and servos to connect to a raspberry pi

Python 100.00%

rpimotorlib's Introduction

ScreenShot dcmotor ScreenShot Nema ScreenShot L298N ScreenShot A4988

Overview

  • Name: RpiMotorLib
  • Title: Raspberry pi motor library.
  • Description: A python 3 library for various motors and servos to connect to a raspberry pi. There are three categories in library. Stepper motors , Dc Motors and Servos. The following is a list of tested parts
  1. Stepper motor

    • Unipolar 28BYJ-48 Stepper motor controlled by ULN2003 driver module
    • Bipolar Nema 11 Stepper motor controlled by L298N H-Bridge Motor controller module.
    • Bipolar Nema 11 Stepper motor controlled by A4988 Stepper Motor Driver Carrier
    • Bipolar Nema 11 Stepper motor controlled by DRV8825 Stepper Motor Driver Carrier
    • Bipolar Nema 11 Stepper motor controlled by A3967 Stepper Motor Driver "easy driver version 4.4"
  2. DC motors

    • DC brushed motor controlled by L298N Motor controller module.
    • DC brushed motor controlled by a transistor.
    • DC brushed motor controlled by L9110S Motor controller module.
    • DC brushed motor controlled by DV8833 Motor controller module.
  3. Servo

    • Servo controlled by RPi.GPIO module PWM.
    • Servo controlled by pigpio library module PWM.

The end user can import this library into their projects and then control the components with short snippets of code. The library is modular so user can just import the section they need.

Table of contents

Installation

Make sure that python3 and pip3 have been installed on your machine, then:

sudo pip3 install rpimotorlib

Usage

Program is a python 3 package. (3.4.2)

In addition to library files a small script is installed to display version and help information.

Run the help script by typing RpiMotorScriptLib.py -[options]

Options list :

Option Description
-h Print help information and exit
-v Print version information and exit

To learn how to use the Library in programs. Go to features section below

Files

rpiMotorLib files are listed below:

File Path Description
RPiMotorLib/RpiMotorLib.py stepper motor python library file
RPiMotorLib/rpiservolib.py servo python library RPi.GPIO PWM file
RPiMotorLib/rpi_pservo_lib.py servo python library pigpio PWM file
RPiMotorLib/rpi_dc_lib.py DC python motor library file
RPiMotorLib/RpiMotorScriptLib.py small script with meta data about library
documentation/*.md 11 markdown library documentation files
test/*Test.py 10 python test files
/usr/share/doc/RpiMotorLib/README.md This help file

Dependencies

  1. RPi.GPIO 0.6.3

A module to control Raspberry Pi GPIO channels

This package provides a class to control the GPIO on a Raspberry Pi.

This should already installed on most Raspberry Pis.

Rpi.GPIO pypi page

  1. pigpio 1.60-1

This Dependency is Optional, it is currently only used in one of the two servo control options. See Features section below for details on why you would chose this. pigpio is a library for the Raspberry which allows control of the General Purpose Input Outputs (GPIO). See homepage for installation and setup instructions.

Homepage

Features

The library was tested and built on a raspberry pi 3 model b, Raspbian, jessie 8.0 and python 3.4.2

I have created separate help files in documentation folder to learn how to use library :

  1. Servos:

NOTE: There are two different options for controlling the servo. When using Rpi_GPIO option you may notice twitching at certain delays and stepsizes. This is the result of the implementation of the RPIO PWM software timing. If the application requires precise control the user can pick the pigpio library which uses hardware based timing. The disadvantage being they must install another dependency.

Servo RPi.GPIO PWM

Servo pigpio PWM

  1. Stepper Motors:

28BYJ stepper motor ULN2003

Nema 11 stepper motor L298N

Nema 11 stepper motor A4988

Nema 11 stepper motor DRV8825

Nema 11 stepper motor A3967

  1. DC Motors:

L298N DC Motor

Transistor DC Motor

L9110S DC Motor

DRV8833 DC Motor

Test files used during development are in test folder of repo. Example snippets are also available in documentation files

See Also

A lot of this code will work on similar components/modules but has not been tested due to parts lacking.

For example:

The A4988/DRV8825 code may work with other pololu modules. See this link for list of alternatives and drop-in replacements for this module. pololu product 1182.

The Servo code should on most standard servos.

Most 4 pin bipolar stepper motors should work in place of Nema 11.

To Do

Add and test more components.

Communication

If you should find a bug or you have any other query, please send a report. Pull requests, components, suggestions for improvements and new features welcome.

History

CHANGELOG.md is at repository in documentation section.

Copyright

Copyright (C) 2018 Gavin Lyons This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public license published by the Free Software Foundation, see LICENSE.md in documentation section for more details.

rpimotorlib's People

Contributors

gavinlyonsrepo avatar

Watchers

James Cloos avatar Blake Matis avatar

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.