tuskiomi
Posts: 9
Joined: Wed Jan 21, 2015 2:43 am

Raspberry pi 3 RTOSes

Tue Jan 16, 2018 1:17 am

Hello, Has anyone gotten an RTOS working on the raspberry pi 3? I'm trying to make a flight system for a hexacopter, and I need the Real time precision that comes with an RTOS to make accurate calculations.

Heater
Posts: 8633
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspberry pi 3 RTOSes

Tue Jan 16, 2018 9:11 am

What are your real-time deadlines exactly? It's meaningless to state real-time without specifying that.

If you happen to be using a four core Pi you can isolate one or more cores from any Linux kernel scheduling activity and dedicate it to doing nothing but your real time task.

With these techniques I can eliminate all kernel action on a core except an interrupt that fires off every few ms and eats only 5us of time.

There is a discussion of these techniques here : viewtopic.php?f=63&t=200793&start=25#p1252388 and in the rest of that thread.

tuskiomi
Posts: 9
Joined: Wed Jan 21, 2015 2:43 am

Re: Raspberry pi 3 RTOSes

Tue Jan 16, 2018 7:17 pm

I need real time precision on PWM output (if the Pi does not have an internal PWM controller) I need real time monitoring on pwm input from the radio. I need real time, deterministic timing in my loop function so my delay functions can be held more or less constant.

User avatar
joan
Posts: 12982
Joined: Thu Jul 05, 2012 5:09 pm
Location: UK

Re: Raspberry pi 3 RTOSes

Tue Jan 16, 2018 7:32 pm

The term real-time doesn't mean much. You need to specify the real-time constraints. Have you looked at the Pi specs?

tuskiomi
Posts: 9
Joined: Wed Jan 21, 2015 2:43 am

Re: Raspberry pi 3 RTOSes

Tue Jan 16, 2018 10:33 pm

joan wrote:
Tue Jan 16, 2018 7:32 pm
The term real-time doesn't mean much. You need to specify the real-time constraints. Have you looked at the Pi specs?
Of course, I own a good number of them.

There's a good reason that you can't get any flight system running Linux certified

Heater
Posts: 8633
Joined: Tue Jul 17, 2012 3:02 pm

Re: Raspberry pi 3 RTOSes

Wed Jan 17, 2018 8:18 am

More or less what?

Real-time performance is possible on a pi running Raspbian. For some definition of "real-time". Discussion I linked to above.

Personally if I were messing with a lot of PWM and other high speed real-time signals I would consider using a separate MCU to do that. In particular the 8 core, 32 bit Propeller MCU from Parallax Inc. A perfect device for such real-time, deterministic timing. Very easy to program in C or the SPIN language from Parallax. Or even the assembly language is very easy on that device. Heck the Propeller has been used to control Quad copters all my itself!

I'm sure main high speed control loop can then be run at, say, 100Hz on the Raspberry Pi under Raspbian, with real-time guarantees. Provided you run it on a specific core that is isolated from the Linux kernel scheduler. See discussion above.

Meanwhile, lesser tasks can be run in regular Linux processes/threads. Communications for example, or any user interface.

Return to “Other”

Who is online

Users browsing this forum: No registered users and 5 guests