Realtime integration with Simulink

Hello all,

I have been working on programming a realtime embedded system using the Beagrlbone Black. I have been working with MathWorks simulink. Simulink uses the A8 processors for PWM. Simulink utilizes a "realtime" OS which was working as close as one could hope to real time. We found our first issue when we added a PWM block and we began to see delays. We are working with MathWorks to develop a device driver block for the PRU's. I contacted Jason, the Guru of BBB, and he encouraged me to share with the community. Jason has a introduction to the PRU's at https://beagleboard.org/static/PumpingStationOne20140628_Real-timeProgrammingWithBeagleBonePRUs.pptx.pdf.

I will seek additional help and update you all here. While we are working on the device driver blocks we found a temporary work around using Triggered Subsystems to reduce the overhead from the PWM. Anyone let me know if you need the details. When talking with Jason we had the following discussion, he was very helpful and got back to me within an hour.

Good evening,

I have been spending the last few months working with the BBB on a project using simulink. It doesn't appear that the PWM blocks are using the PRU, if simulink can access PWM through the A8 then with the proper changes in the code could it theoretically also utilize the PRU for PWM?

I have searched through the discussion board thoroughly, I have not seen any information about programming the PRU with simulink. I am in communication with MatWorks to develop a device driver block. Please advise, is it correct that once the PRU is activated it can be controlled in the same manner that simulink currently accesses the PWM through the A8? The Simulink embedded coder is C.

Thank you,
Louis

Mobile by AT&T.

...

There are many ways to do PWM with the PRUs. We have a standard firmware load for one PRU on Blue for PWM functionality that is configured using shared memory. These are implemented on the PRUs with manual bit-banging and are hard-real-time. The PRUs themselves can also access the PWM hardware modules using direct register writes---StarterWare is written for the ARM, but will work on the PRUs as a PWM peripheral programming example.

...