News for hackers. Stuff that matters.
Re:Raspberry Pi inspired autopilot by Jeandon on Monday January 12, 2015 @10:13AM (#8874217)
Looks very nice. Is Linux actually real-time enough to run autopilot code?
Re:Raspberry Pi inspired autopilot by MegaDeKay on Monday January 12, 2015 @12:06PM (#8874969)
The second PDF in the link below compares the Raspberry Pi with the Beaglebone Black for a next gen APM. The nod went the the Beaglebone because of more GPIO, PWM support, and the two PRUs for realtime operation. The Pi B+ helps the first point, but not the other two. There is also a really interesting page in here on the latencies that are required.

BTW, this was written by Andrew Tridgell of Samba fame.

http://diydrones.com/profiles/blogs/a-peek-into-the-future-o...

Re:Raspberry Pi inspired autopilot by 2bluesc on Monday January 12, 2015 @05:36PM (#8876896)
Thanks for this. Whenever I see people running around high fiving over the Raspberry Pi, I start to formulate an argument how the BBB would almost always be vastly superior for slightly more cost.
Re:Raspberry Pi inspired autopilot by mavkhimenia on Monday January 12, 2015 @07:26PM (#8877403)
There a lot of boards that outperform BBB 10-20-30x times. But both RPi and BBB are more than enough to run an autopilot code. One of the great advantages of RPi over BBB is 1080p camera module with hardware H264 encoder as well as bigger community.
Re:Raspberry Pi inspired autopilot by lovelearning on Monday January 12, 2015 @10:26AM (#8874315)
They are using a realtime patch on Raspbian. [1]

They also say "autopilot’s code works directly on Raspberry Pi using the APM’s Linux HAL". [2]

[1]: http://www.emlid.com/raspberry-pi-real-time-kernel/ [2]: http://www.emlid.com/navio-apm/

Re:Raspberry Pi inspired autopilot by valarauca1 on Monday January 12, 2015 @11:12AM (#8874655)
A true real time system is likely over kill.

General time-sharing systems generally are accuracy to +/- 4ms. Which is acceptable for most applications, as 60fps is ~16ms per frame.

If you (ab)use Linux properly you can get most your threads to only halt on blocking for IO. So they'll get scheduled practically (not always) once that IO state is satisfied.

This requires heavy multi-threading not horrible, just isn't amazingly optimized for cache.

I control high pressure fuel systems and we don't need to use Real Time OS's (always), and generally sigh away from them when I don't.

Re:Raspberry Pi inspired autopilot by lsaferite on Monday January 12, 2015 @01:00PM (#8875343)
I would guess the PID loop benefits greatly from real-time execution. So much so that really the base control system should be on a dedicated controller with AP functionality as a secondary system driving the inputs to the PID controller.
Re:Raspberry Pi inspired autopilot by valarauca1 on Tuesday January 13, 2015 @09:22AM (#8879985)
It really depends what you are controlling. With a PID loop generally more accurate timing is the battle cry for moving them off board. As implementing a PID in a time-shared OS is rough as you don't get timing guarantees. So your Delta-T is always off. Generally by a margin of 1% which is large enough to throw off a correctly tuned system.

Faster updates are nice, but not always needed.

Re:Raspberry Pi inspired autopilot by CHY872 on Monday January 12, 2015 @10:22AM (#8874281)
Possibly not. It seems that this runs APM, which is an open source autopilot system. On their install pages, the Raspberry Pi is listed as a companion computer (presumably to be hooked to some other device that runs the code) (which this system might not do) but the Beaglebone Black (which I guess is similar to the Raspberry Pi, so might be what they do here) requires installation of realtime patches for Linux.

This works by patching the Linux kernel to make almost all of it preemptable, (replacing spinlocks with mutexes) so interrupts can be acted on more quickly.

Re:Raspberry Pi inspired autopilot by ivereninov on Monday January 12, 2015 @10:26AM (#8874314)
We run APM on Linux. The port to Raspberry Pi is our effort and it is now supported in APM upstream.
Re:Raspberry Pi inspired autopilot by 3327 on Monday January 12, 2015 @11:19AM (#8874688)
what is the % impact on endurance?
Re:Raspberry Pi inspired autopilot by VereninovIgor on Monday January 12, 2015 @01:11PM (#8875431)
Raspberry Pi A+ with Navio+ consumes about 200mA. Compared to running motors this is almost nothing.
Re:Raspberry Pi inspired autopilot by pjc50 on Monday January 12, 2015 @10:25AM (#8874302)
It's fast enough in almost all cases to work. "Realtime" is more about proving worst-case bounds on all control loops.
Re:Raspberry Pi inspired autopilot by klinquist on Monday January 12, 2015 @10:21AM (#8874271)
Typically, APM/MavLink runs on a Arduino (my Quanum CX-20 quad runs an Mega 2650). This looks like this is a Raspberry Pi shield that I suspect contains an ATmega - so it's not Linux that is doing the flight controlling.
Re:Raspberry Pi inspired autopilot by ivereninov on Monday January 12, 2015 @10:24AM (#8874295)
Actually we run APM code ported to Linux, there is no Atmega on the board. There was a lot done to make this possible including special real-time Raspbian. It flies very stable and with great timing performance.
Re:Raspberry Pi inspired autopilot by klinquist on Monday January 12, 2015 @10:26AM (#8874312)
Very interesting, thanks!
Re:Raspberry Pi inspired autopilot by asynchronous13 on Monday January 12, 2015 @11:02AM (#8874586)
Yes. Linux is plenty fast to run autopilot code. There are real-time patches for Linux kernel, but in my experience those are not necessary for decent performance.