Motor Speed Control using BeagleBone PRU

Greg Raven created this motor speed controller based on a Texas Instruments demonstration project.  His implementation uses RemoteProc and RPMsg framework to connect the PRUs (Programmable Real-time Units) to Linux userspace.  The PRUs are 32-bit RISC processors which offload real-time tasks from Linux running on the ARM processor.
The system implements a Proportional Integral Derivative (PID) controller. The controlled parameter is the rotational speed of a DC motor. The DC motor is fitted with a quadrature encoder which provides both RPM and directional data.
The quadrature encoder outputs are connected to the P8 header on the BeagleBone.  The DC motor is controlled with a Pulse Width Modulation (PWM) signal from a pin on the P9 header.  The PWM peripheral resides on PRU1.  The quadrature decoder peripheral is located outside the PRU and is accessed via the internal bus.
The PID loop is a controlled by a userspace program.  The program communicates with the PRU via character devices instantiated with the RemoteProc messaging driver.
A web server runs on the BeagleBone and allows a web browser to graph the control loop behavior.screenshot-from-2016-12-30-21-02-13


The source code is shared on GitHub:


The project details are shared on

The main documentation file [PDF]:

Motor Speed Control Using Beaglebone PRU

Screenshot from 2016-12-30 23-50-35.png