beagleboard / librobotcontrol

Robotics Focused library for embedded Linux computers. Mirror of https://git.beagleboard.org/beagleboard/librobotcontrol
https://beagleboard.org/librobotcontrol
MIT License
196 stars 158 forks source link

Add support for 2 stepper motors #158

Open jadonk opened 5 years ago

jadonk commented 5 years ago

Is your feature request related to a problem? Please describe. Sometimes open-loop control is easier, therefore many projects would like to use stepper motors for wheel control. A simple tank-like robot or other style 2-wheel rover could easily be controlled with 2 stepper motors. 4-wire (bipolar) stepper motors would be easiest via control by 2 motor outputs.

Describe the solution you'd like Ideally, I'd like to hand all the step generation off to the PRUs and have an API that is initialized with 2 motor outputs and then given a number of steps to execute in any direction.

Describe alternatives you've considered A simpler approach could just be a wrapper API for the existing motor drive functions.

Additional context I did a quick proof of concept with BeagleBone Blue and a 4-wire stepper. https://beagleboard.org/p/jkridner/bipolar-stepper-motor-with-beaglebone-blue-e4950e

I also did a quick hack in JavaScript. https://gist.github.com/jadonk/7b2d335364b5474d566463d9b45360fa