Fast Feedback Control with Beagle Bone?


Does anyone know if there is any trick to build a really fast feedback
control system using this board? The idea is to run a control loop
like the following that executes every 10 microseconds and takes fewer
than 10 microseconds to run:
- sample an ADC input
- perform a calculation (in floating point)
- write the result to a PWM output

For instance, is it possible to prevent the OS and its normal
processes from using the VFP or Neon unit, so that the unit can
instead be employed ONLY to run independent code (from looking at the
processor manual, it seems there is no C6x included)?

Thanks in advance for your response. The Beagle Bone looks super-cool!


PS. An appealing alternative would involve runing some OS on the
Beagle Bone (other than linux or Android) that only runs *one* thread/
process, which is the control thread/process that never gets

Four or five years ago I managed to get 5us using RTAI (real time
patch) for Linux. My control loop code was a kernel module. I used a
600MHz PC at that time. Could be possible...

BeagleBone CPU comes with 2x 200MHz PRUs (programmable real-time
units). You create code in ASM, TI provide the assembler and you can
dump the executable image onto the PRU from your Linux program. Aside
from memory access, most instructions from the 40 instruction set
complete in one cycle (5ns) for completely predictable real-time
independent performance. The units have high-speed access to dedicated
GPIO and can interface with other chip elements such as ADC.


Mind you there's no hardware multiply so how quickly you'd be able to
perform your desired calculation is another matter.

am335x PRU has 32-bit hardware multiplier that can perform multiply in single cycle.


Any volunteers to write PRU yuv2rgb routines for omapfbplay, mplayer2 and gstreamer?



I highly doubt that would be a good idea, given it’s only a dual-core 200 MHz processor; from reading the specs, it seems its designed for real-time control tasks (FIR fliter, PID control loop, etc.) and not for multimedia.

That's great to hear. I had been going off documentation from the old
iterations of the unit.

Not half bad for a bit of number crunching now then, whereas the
previous version was not really meant to replace the DSP, more for
data formatting and quick response.

Since it can hardware multiply in one cycle then there's chance for
DSP like functionality and the two PRUs can work together but it would
indeed be unreasonable to expect the performance of previous dedicated

Are there any confirmations on how quickly the PRU GPIO pins can
change state electrically? If it's fast enough, with a bit of external
hardware you could look to implement a software camera interface, you
would unlikely get full interface performance but should be able to
achieve something on the level of a USB 2.0 camera feed but with more
performance consistency. - up to date
documentation, it's officially called the PRUSSv2 to differentiate
from older PRU

Hi everyone,

I just wanted to thank you for your informative replies. The graphics
acceleration module also looks interesting. However, I think I will
get to my goal much more quickly if I use the DSP on the Beagle Board
xM. It seems to be much more powerful, and there is a compiler
available for it. Perhaps some years down the road I will update my
design to operate also with the PRUSSv2.