npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

j5-delta

v1.0.1

Published

Johnny-Five component for controlling delta robots, based on tapsterbot.

Downloads

3

Readme

J5-Delta

Delta Robot Component for Johnny-Five

Delta Robots

Usage

var five = require("johnny-five");
var Deltabot = require('j5-delta');
var board = new five.Board();

board.on("ready", function() {
  var delta = new Deltabot({
    pins: [ 9, 10, 11 ],
    type: 'tapster'
  });

  delta.moveTo([20, -20, -150]);
  // other commands
});

Constructor Parameters

| Property | Type | Value/Description | Default | Required | | --- | --- | --- | --- | --- | | pins | Array | An array of three pins id's with servos attached | | yes | | startAt | Number | Any number between 0-180. Degrees to initialize the servos at. | 5 | no | | tapDepth | Number | The depth at which to plunge the end effector for a tap or draw. | -160 | no | | servoSpeed | Number | Number of seconds it takes your servo to move 60 degrees, used to calculate movement time | 0.40 | no | | dimensions | Object | Collection of dimensions describing the geometry of the delta robot you want to control. | | no | | type | String | The name of a known delta robot configuration. If you don't specify this, you should specify dimensions. Valid values: 'tapster', 'junky'

Dimensions

Delta Dimensions

| Variable | Description | | --- | --- | --- | | f | base length | | e | end effector length | | rf | bicep length | | re | forearm length |

If you have a custom delta robot you will need to make a few measurements of the geometry and pass it in. Normally, these measurements should be in millimeters. If your design is open source or commonly available, please consider sending a pull request to add it as a named configuration to configurations.js!

Example initializing with custom dimensions:

var delta = new Deltabot({
	pins: [ 9, 10, 11 ],
	dimensions: {
		f: 163,
		e: 80.25,
		rf: 128.75,
		re: 155
    }
});

API

home()

Move all of the servos to their home position as specififed by startAt at Deltabot initialization.

deltabot.home();

moveTo(coords, [callback])

Move the end effector to the specified X, Y and Z coordinates. Callback is triggered when the movement is done.

deltabot.moveTo([20, -20, -140]);

Note on coordinate system: The coordinate system origin (0,0,0) starts a point directly centered between the three motor axes. Therefore, the Z coordinate of the end effector will always be below that and negative.

getPosition([angles])

Get the current position of the end effector through a forward kinematic calculation. If you do not specify the angles, it will use the last known servo angles.

Note: The position returned by getPosition() will most likely differ from what you passed in to moveTo(). This is due to the limited range of motion on a hobby servo. The position returned by getPosition() is closer to the true position.

deltabot.moveTo([20, -20, -140]);
deltabot.getPosition(); // [ 0, 19.61168100866987, -20.1826220029087, -140.14643590955427 ]

getServoAngles()

Get the current positions of each of the three servo motors in degrees.

deltabot.moveTo([45, -32, -150]);
deltabot.getServoAngles(); // [ 22, 17, 56 ]

tap(x, y, [callback])

Tap at the specified X and Y coordinates, plunging to a depth specified by the tapDepth option.

deltabot.tap(40, 75);

draw(coords, [callback])

Draw by dragging the end effector at tapDepth between all of the X,Y coordinates in the coords paramter.

// Draw a 40mm box starting at position 10,10
deltabot.draw([
  [10,10],
  [50,10],
  [50,50],
  [50,10],
  [10,10]
]);