Giter VIP home page Giter VIP logo

hierophect_circuitpython_dynamixel's Introduction

Introduction

Documentation Status

Discord

Build Status

Circuitpython driver library for the Dynamixel series of servo motors from Robotis

Dependencies

This driver depends on:

Please ensure all dependencies are available on the CircuitPython filesystem. This is easily achieved by downloading the Adafruit library and driver bundle.

Getting Started

For a full description of the Dynamixel's capabilities, please refer to the official materials:

Dynamixel servos use a single-wire, half-duplex UART mode of communication. Since most Adafruit boards are full duplex two-wire UART, a simple circuit must be created to use the servos. This can use buffer logic, as per the datasheet, or use a more crude version with a diode and resistor:

image

By pulling down the Direction Control pin while TX is in use, the RX pin will not recieve problematic data off of the TX pin. A 10k resistor worked in breadboard testing, but your results may vary.

Note that 7V or higher on the motor power line is required for the internal controller to turn on - motors will not even return temperature data at lower voltages. The communication line, however, is TTL 5V logic. Double check your connections to ensure the motor power line is not applied to the communication pin.

Usage Example

The following sketch will print the temperature of a motor addressed as 0x00 (the default) and move it between the minimum, halfway, and maximum positions. A communication control pin of D12 is used but can be swapped out with any IO pin.

import board
import busio
import digitalio
import time
import circuitpython_dynamixel

control = digitalio.DigitalInOut(board.D12)
control.direction = digitalio.Direction.OUTPUT
control.value = True
uart = busio.UART(board.TX, board.RX, baudrate=1000000)
ax12 = circuitpython_dynamixel.Dynamixel(uart,control)
ax12.set_speed(0xfe,0x100)
while True:
    print(ax12.get_temp(0x00))
    ax12.set_position(0x00,0)
    time.sleep(1)
    ax12.set_position(0x00,512)
    time.sleep(1)
    ax12.set_position(0x00,1023)
    time.sleep(1)

Contributing

Contributions are welcome! Please read our Code of Conduct before contributing to help this project stay welcoming.

Documentation

Readthedocs can be found here.

For information on building library documentation, please check out this guide.

hierophect_circuitpython_dynamixel's People

Contributors

hierophect avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 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.