Step-motor controller for CNC-like devices (or 3D printers) using the PRU (Programmable Realtime Unit) of the Beaglebone Black to create precisely timed and fast stepper-pulses for acceleration and travel. (And with fast, we're talking up to 1Mhz fast. For 8 motors in parallel. In a controlled move (G1). So this is not a limit in real-world applications).
Works with a cape designed by the author (the BUMPS cape), but also provides relatively easy adaption to new hardware (currently: support for CRAMPS). See hardware subdirectory.
This was one of my very early tests:
The {accl-,decel-}eration and travel motion profile is entirely created within the PRU from parameters sent by the host CPU decoupled via a ring-buffer. The BeagleBone main CPU prepares the data, such as parsing the G-Code and doing travel planning, while all the real-time critical parts are done in the PRU. The host CPU typically needs less than 1% CPU-time doing everything else (and there is no need for a real-time kernel).
The main machine-control
program is parsing G-Code, extracting axes moves and
enqueues them to the realtime unit. It can receive G-Code from a file or
socket (you can just telnet to it for an interactive session, how
cool is that?).
For detailed system configuration and building the machine-control
binary, see
INSTALL.md.
Before you can use beagleg and get meaningful outputs on the GPIO pins, two things are required on a fresh Beaglebone installation (we recommend the IoT image).
To enable the PRU the way we use it, we need to /boot/uEnv.txt
and
enable the correct uboot_overlay_pru
line.
We need to disable the line containing PRU-RPROC
(add a #
in front) and
enable the line containing the PRU-UIO
(remove #
in front).
###pru_uio (4.14.x-ti, 4.19.x-ti & mainline/bone kernel)
uboot_overlay_pru=/lib/firmware/AM335X-PRU-UIO-00A0.dtbo
Reboot.
The GPIO pins used for each hardware This is how you initialize the pins if you use the BUMPS board:
/opt/source/bb.org-overlays/tools/beaglebone-universal-io/config-pin -f hardware/BUMPS/bumps.pins
See the Hardware page for more boards.
To control a machine with G-Code, use the machine-control
binary.
This either takes a filename or a TCP port to listen on.