dtex / tharp

An inverse kinematics solver for robots, optimized for Johnny-Five.
MIT License
27 stars 7 forks source link

Stepper motors and Johnny five #3

Open harrysayers opened 5 years ago

harrysayers commented 5 years ago

I've looked hard and far and this is by far the best library for inverse kinematics with Johnny-five. I'm currently building a robotic arm with the use of Johnny five, however, I'm using stepper motors (NEMA 17) instead of Servo motors. I can't see any documentation for using Tharp with stepper motors. Is it possible to use Tharp with stepper motors? if so could I have some indication on how to use it? any help is appreciated.

Thanks very much, Harry

dtex commented 5 years ago

Here's the scoop: Stepper support in Johnny-Five is too basic. This was a function of firmata's own limited stepper support so there wasn't much that could be done without a rewrite of firmata which opened up it's own bag dependencies.

So far I've:

Currently I am:

After that, all I have left after that is to update Tharp. I'd say it should be done by this summer.

harrysayers commented 5 years ago

Thanks very much for your reply. Great, sounds good. As I'm needing inverse kinematics much sooner than the summer, Would you know anyway or know some resources which would point me in the right direction of implementing inverse kinematics with johnny five and stepper motors.

Thanks for your help, Harry

dtex commented 5 years ago

The firmata stuff is ready to go and is already in the published firmata.js (you'll need a custom build of the sketch from http://configurablefirmata.com), so you can use that to control the stepper. Link to docs.

The IK solvers in Tharp should work, but you will need to map from angle to the absolute position on the stepper in a new @@render function on the stepper instance. You can look at Johnny-Five's servo class to see a @@render method being implemented.