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.
The main documentation file [PDF]: