PWM: only a finite number of pulses? Controlling stepper motor

206 views
Skip to first unread message

plla...@gmail.com

unread,
Oct 17, 2014, 9:26:26 PM10/17/14
to beagl...@googlegroups.com

I'm wanting to use the BeagleBone Black to generate a FINITE number of pulses, in order to control a stepper motor. For the controller I have, an A4988, each pulse is one step on the motor. How can I use the PWM on the BBB to send, say, 5 pulses, and no more or less than 5? Or I can use a GPIO. Whichever works.

I have the Adafruit BBIO library installed. I have thought of doing this in a simple, stupid way - just using python's time.wait() and toggling a GPIO pin, however many times I'd like. But this seems very inaccurate, timing-wise, and moreover inelegant; is there a way to do this better? I'm also investigating events -- i.e., count the numberof pulses that have occured using another GPIO, then stop the PWM when the number of pulses I want has been counted.


Any ideas?

Peter Gregory

unread,
Oct 20, 2014, 2:15:33 PM10/20/14
to beagl...@googlegroups.com
You will need to use a GPIO pin and manually toggle it.
If you need precise speed control, you can task a PRU unit to toggle the pins with precise timing.

fak...@googlemail.com

unread,
Oct 27, 2014, 4:34:13 AM10/27/14
to beagl...@googlegroups.com, plla...@gmail.com
You could use the SPI interface

karlka...@gmail.com

unread,
Oct 27, 2014, 5:14:08 AM10/27/14
to beagl...@googlegroups.com, plla...@gmail.com
May be you can ask these guys here: http://www.halaser.eu/e1701m.php

They're offering an industrial motor controller based on an BBB and should have solved this problem.


Am Samstag, 18. Oktober 2014 03:26:26 UTC+2 schrieb plla...@gmail.com:

cncb...@gmail.com

unread,
Nov 25, 2014, 7:17:38 AM11/25/14
to beagl...@googlegroups.com, plla...@gmail.com

see Linuxcnc.org  and the beaglbone variant Machinekit does exactly that  

David Armstrong

unread,
Dec 1, 2014, 9:23:55 AM12/1/14
to beagl...@googlegroups.com
what is the end product you want ? cnc ? 3d printer ?
Linuxcnc does all this and is proven and reliable and works on a beaglebone black ( machinekit)

i am a moderator for Linuxcnc , and have worked with steppers for a lot of years , so give me some more information and see how it fits or not to your project needs it all depends on what else you want the BBB to do , as you only have limited resources 

A4988 is a standard stepper driver and works no differently than any other , 

if Linuxcnc is too much of bruteforce etc , see Derricks video here , it works very well 


Shout if i can be of help 

Dave 

see 
Linuxcnc.org 

Machinekit see 
google group machinekit 






--
For more options, visit http://beagleboard.org/discuss
---
You received this message because you are subscribed to a topic in the Google Groups "BeagleBoard" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/beagleboard/hEql7u7kAlc/unsubscribe.
To unsubscribe from this group and all its topics, send an email to beagleboard...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages