This video examines how we can drive stepper motors using C++ within Embedded Linux using the open source hardware EasyDriver board. The video begins by describing stepper motors and the effects of micro-stepping. It then discusses the EasyDriver Board (V4.4) and all of the available inputs and outputs. The board uses the Allegro A3967 which allows for full, half-, quarter and one eight micro-stepping. The video then explains C++ code that uses the GPIOs on the Beagleboard to wrap the EasyDriver with a C++ class that is easy to use by creating an object of the class for each stepper motor that is connected.
[youtube id=”gqrjtB2cmu8″ width=”800″ height=”500″]
The source code in this video is available through githhub:
1 |
git clone git://github.com/derekmolloy/beaglebone |
Finally I show an example of my code running on the Mercury Motor (SM-42BYG011-25), which is a low cost stepper motor.
How could I then control the motor from a windows PC over the network from a c#,C program?
Hi Roy, You could use C++ sockets to communicate. Derek.
Hi Derek, I would like to know where I can start programming for BLDC motor for a quadcopter in C?
thanks
I want to do without EasyDriver.
hi Derek
would it be possible to control dc motors instead of stepper motors with the easy driver board? this is for a university robotic project where the dc motors are used for movement. There is the dmc mk6 add on option for the beaglebone but due to cost and project budget restrictions i would need a cheaper solution.
thanks
Hi Babak, the cheapest option is probably a Dual H-Bridge Motor Driver chip. Choose one with a PWM input so that you can control the speed using the Beaglebone. Cheap H-Bridge Drivers will drive motors from ~5-35V at up to ~0.5A, which should cover most low-cost DC motors. Derek.
I have been trying to use the SimpleGPIO.cpp and .h files, with no success. It seems that:
on each call to “gpio_omap_mux_setup()”
it says, “failed to open OMAP_MUX: No such file or directory”
I have tried to find this “file or directory” to no avail.
I think I have the board itself setup with the stepper motor driver, but I cannot run program successfully!
uname -a
Linux beaglebone 3.8.13 #1 SMP Thu Sep 12 10:27:06 CEST 2013 armv71 GNU/Linux
Let me know if you need any additional information.
Thank you!
Tom
I am using the Beaglebone Black, which is probably the reason there is no /sys/kernel/debug/omap_mux. I also have a problem with losing Ethernet connection when the USB is disconnected. That also goes for the fact that I cannot access the Ethernet connection without having the USB connected.
If you know of a site that can answer some of my questions I would appreciate it. I have not been able to Google any site that covers this other than yours.
Thank you!
Hi!
THanks for your great tutorials, for me someof the best on the net 🙂
Just one thinkg, I believe this one tutorial is obsolete, at least not working for me. Using your exact same configuration I get the messages that Tom explained in February … problems with OMAP_MUX. Seems to be a deprecated form of working with GPIO.
Is there any workaround you can share with us?
Again thanks a lot for your effort on sharing all your knowledge ….
Pedro
Hello!
First off, great tutorial!
Second, out of curiosity, is it absolutely necessary to use a motor driver chip? Can a motor be controlled without a motor driver? Thanks for your help.
Dear Derek
I really enjoy your website, your tutorials and everything you have made available to everyone.
I have a a question regarding this topic about stepper motors:
I have a BB Black and was wondering how much I need to change in your example code for it to work — since you demonstrate the stepper on the white BB.
I’m new to these small computers and robotics and don’t wish to blow up stuff.
It is especially about addressing and setting up the right pins that I’m not sure about. Is it straight ahead the same?
Also, I plan to use the A4988 driver instead of the EasyDriver. Besides details about micro steps etc. what else should I be careful about in setting up the BB Black
Hello Derek,
I am almost a newbie in BBB and Linux, but I have some experience in electronics and programming. This is why I am having a hard time moving things around.
I am trying to get a CNC working on my BBB but in the same time keep BBB in a very flexible mood. While I mean flexible, I am thinking to have Angstrom version installed as it seems to be best documented for other purposes than CNC. On the other hand, I only found LinuxCNC and MachineKIT which seems to be a working option, but it comes along with capes and adapters and is not well documented (this is how it looks to me). On top of this, I already have my own CNC driver module that I don’t want to throw away.
So, long story short, I know MachineKit can be compiled on Angstrom but I don’t feel comfortable doing it without little guidance (remember… me = newbie?). So I think many people will appreciate a short tutorial on how to brirng all of these together (BBB, Angstrom Linux, MachineKIT (or any other software) and custom capes/pin-outs). I know some of these things are already discussed, so a topic that brings all of these togeter may be enough.
Thanks for the great work you are doing,
Catalin
How many steppers can I control with the BBB?
kashyala pahije nahiti natkaaaa
Hi Derek, I am wanting to create a CNC machine with my own GUI. Just wondering where I should start, and what costs I’m looking to face.
Sincerely Chris
Hello Derek,
The code given by you in this video. Does it work directly on BeagleBone Black as well ?? Pease reply