To control a stepper motor, your device has to create a pulse signal (pulse train).
That signal will decide how many steps the motor takes and how fast it takes those steps.
There are several ways to generate that signal: using timers, bitbang and others.
What I'm trying here is to let the real-time units of the BeagleBone generate the pulses.
The goal is to generate the control signals for stepper motors on a BeagleBone.
The PRU subsystem has to generate the pulses, with as little as possible involvement from the main controller.
I'd like to provide an API that accepts direction and steps. Then add options that refine the motor rotation profile.
The solution should work on Linux.
The reason for this exercise is not to make the best motor controller out there. I want to get better at PRU programming and this helps.
- generate a linear speed pulse train. - done
- refine to add ramp up, speed and ramp down.
- add support for several outputs, each following their own instructions.
- add support for gathering a batch of commands, then activate them. - done
- add support for a command queue, where you can send additional commands while the motor is running. - done
The ARM controller will manage SPI communication, enable and reset signals.
The PRU will manage the pulse train and direction signals.
- BeagleBone (any I guess. Certainly the popular ones)
- Adafruit Nema 12 V stepper motor, 200 steps
I selected the motor and driver because I have them. I used them on several controllers before.
If something doesn't work hardware-wise, I can rebuild previous projects and compare the failing setup here with a known working one.
- A BB supported Linux. I used the latest Debian Image, Stretch IoT (without graphical desktop) for BeagleBone and PocketBeagle: Debian 9.5 2018-10-07
- Code Composer Studio and GCC Cross-platform compiler
First steps in the next post. Create a PRU program that will generate X amount of pulses. Any frequeny that I can make work.