Maker Faire New York 2013 Electronics Stage: Embedded Linux Meets FPGA Capes

Maker Faire New York 2013 Electronics Stage: Embedded Linux Meets FPGA Capes

Hi, this is Wayne again with a topic “Maker Faire New York 2013 Electronics Stage: Embedded Linux Meets FPGA Capes”.
My name is andy gickling, i’m an electronics engineer out of st paul minnesota. I work for an industrial laser systems, company called lasix industries. I’Ve had a unique set of experience coming from that company. Thank them very much um and what i’ve come to make fair for is this robot that i built it’s called the beagle. It’S called the bee bot. It serves beers at the pool and i’m gon na tell you about it. It integrates a beaglebone black with a fpga cape, so i want to start it’s it’s unbelievable. What sort of maker times we live in um, obviously everybody’s here, it’s a great thing: the open source movements going on it’s pretty dramatic everything i learned pretty much was online. I studied electronics in school and picked up software after the fact. So i encourage you guys to not hesitate.

Maker Faire New York 2013 Electronics Stage: Embedded Linux Meets FPGA Capes

Just grab the stuff, the hardware is cheap and there isn’t enough makers around. I’M glad you all made it so. Bee bot is an open source drink serving robot freezing free beer.

Maker Faire New York 2013 Electronics Stage: Embedded Linux Meets FPGA Capes

I put all the source code on on on github we’ll get to that a little bit later, but it features a beaglebone black mini linux, computer, which i think there’s a number of presentations today that actually talk about that and there’s. I think they have a whole wing dedicated to raspberry, pi and stuff like that, but it’s a mini linux computer with an fpga cape and when you combine those two things together, there’s some really really cool possibilities that normally would not be available if you’re, just using A microcontroller i made bebop because one day my friend at the pool was you know, kind of laying there in the sun and we ran out of beer and then uh she’s like. Why can’t she just send a robot upstairs to get a sport, beer and uh sure i was like okay? Well, let’s do it so that started. That was about six months ago, um yeah and i love linux and i had owned a beaglebone black at the time and i needed to just invent some project to work on linux because it’s such a fun platform. So i started thinking about what a robot needs. It needs a lot of i o needs, computation, power drives and servos are a must and ideally low power consumption. So i can’t just get a full windows. You know intel core i7 computer on this robot.

It’S not realistic. Unless you’re nasa, you go check out the nasa robot that does have that um. Okay, before you guys, kill me for this slide. I love arduino um, but there are some limitations.

I learned a lot of things on arduino, actually uh. You can do like 80 of all do-it-yourself projects i feel like could be accomplished with an arduino, but for robotics applications and some you know some things that we’re going to talk about. There’S some limitations, there’s typically no operating system um i mean they have them, but it’s just not as uh there’s, not a lot of drivers, it’s not as robust as what we’re about to talk about memory is kind of small some limited.

I o things like that. You really need an operating system to develop a robotics platform because things need to multi-task, so i have multiple threads that get spawned on my on my beaglebone black application, one handles the um, the motion, control and other handles the voice, control and other candles, the um, The there’s actually a real-time clock and gps, and things like that. So i found this awesome picture on the internet and i was like got ta put this on there, because that’s what an operating system does it provides drivers and lets you integrate things together.

Much more simply than just writing straight c top to bottom and obviously linux. You might have heard of it’s everywhere and there’s so many uh resources online that you can just get for free if you just go online and search for embedded linux, specifically surrounding the raspberry pi and the beaglebone black platform, um, it’s developed by linus terribles. As you know – and you probably wouldn’t know this – but most server farms heavily linux, uh, embedded electronics, like your cell phone android cell phones, are all linux operating systems and um desktop computers like ubuntu, also run linux beaglebone black.

I think there was actually somebody just talking about it. I’M not gon na spend too much time on this, but it’s 45 buy one for your kids and just let them have at it. It’S brilliant. I mean i thought for sure i burnt it out like four or five times. It’S just bomb. Proof too, i’m so impressed with this platform.

Maker Faire New York 2013 Electronics Stage: Embedded Linux Meets FPGA Capes

It’S a gigahertz processor, it’s a whole computer and you can see my robot over there. It’S got video it talks. It does all these things usb, even and it all comes out of the box when you have linux, essentially there’s just this whole body of drivers. Sometimes it’s a little prickly, sometimes it’s very hard to to learn initially, but the more you spend on it. I mean you’ll be really surprised at what it’s possible.

My company actually uses embedded linux called yakto as an industrial platform for this very, very high speed, laser controller that we made all free software, so we’re not paying anybody royalties on the software because we didn’t modify the kernel and it’s all pretty good stuff. Okay, so dramatic change here, the the presentation is about what you can do when you integrate fpgas with these embedded linux platforms and a linux computer is only so good at so many things. It’S good at high level computation, but an fpga and reality is what people use to interface with hardware. It talks to the low-level components and it actually has the uh the protocol interfacing on it.

It’S a reprogrammable circuit. It’S it’s! Unlike anything, you might have seen. It’S not sequential logic.

You can arbitrarily route, i o in and out of any pin on an fpga from software so rather than having your breadboard uh we’ll get to that on the next slide, rather than having your breadboard, be all these components you you just write. The software you don’t like it, you redo it now all the pins are different and the i os are different. You might have spi on this set of pins and then you just change it over here.

So it’s a very, very powerful platform, they’re pretty new technology. As well, this is kind of a block diagram that you can’t read. I’M sure that is essentially showing you that you have all these blocks and you can just take them in and out arbitrarily reprogram your device and it’s pretty cool trying to get around that sure.

If you’ve ever bread boarded before this is what ends up happening and then you’re like. Oh, why do my clock signals? Look junky over here and just things happen. Fpgas work completely around those problems.

You’Re able to just program your circuitry onto one chip achieve very high clock rates and things like that. So most companies use uh, for example, embedded linux or a computation platform to run an application, and then they let the application shovel data down to the registers of an fpga and then the fpga shovels the data out the door. So, on a robot, you have all these integrated hardware components they might use uart or spi, or even more sophisticated protocols like pci express and things like that. Fpgas are capable of doing all those things, but many of the things a microcontroller or a mini computer can’t do so. I’M going to talk about a couple of applications where that’s specifically useful here is a picture of the block diagram of the beaglebone robot. There’S a.net gui sends data via zigbee and then the data hits the fpga and the fpga shovels that over to the mini linux, computer beaglebone, black and then the beaglebone black has a high speed. Spi data link shovels the data back down to the fpga. Once it’s been parsed, you guys can come see this in a lot more detail, and i can tell you more about it. I don’t want to run out of time so i’ll just keep going, but essentially what we’ll talk about is a couple applications where fpga is perfect for a robotics application design example one.

I was just talking to this uh undergraduate at mit about how he hated the fact that his previous robot project used arduino interrupt lines to count a encoder quadrature signal. An encoder quadrature signal is essentially a signal that calls down two wires and each pulse represents a certain amount of rotation of something or linear motion as well. It’S kind of like a tachometer for your car, but a lot more sophisticated than that.

As soon as the count stops, you know exactly what angular position you’ve left the wheel at, for example. Unfortunately, when you, when you want to use like a 4000 line, count wheel running at 30, rpm signal rates get really high and now, if you’re, using an arduino with interrupts, it’s just constantly trying to count the wheels. It’S not processing your data anymore, so arduinos and and and things are not ideal for such an application.

Fpgas can be programmed to just count the clock rate and, and then, as soon as the software needs to know about what the count is they want to hey. How fast is the wheel going, they can ask for it. It’S a much more efficient design approach.

Another common thing, the the proliferous pid controller – many of you – may have used the microcontroller to pid control, something it’s the engineering 101 thing that everybody learns about. Well. Opencourse.Com has a pid controller block that you can just download, stick in and put your variables in and then it will control your variable for you and that’s in the fabric of the fpga. So you don’t waste any compute cycles calculating that that control loop, the fpga, takes care of it for you. Another great example is hobby. Servo motion is typically a pulse train. That looks like the slide here. I hope it’s full screen. Oh, it’s not darn.

Um. 1.5. Millisecond on time defines zero degrees on most hobby servos and then one millisecond on time is the limit of throw one direction and two milliseconds is the limit of throw the other direction and then those pulses go uh at 20 milliseconds.

So it’s a very common thing: um you can use an arduino, for example, to to use a pwm channel to do that. But again it’s not terribly efficient. Sometimes you have resolution problems. It’S typically only a 256 bit register that defines the pulse time, for example, and you have to use up one of the timers on the microcontroller on an fpga.

None of these are problems you make a block. That is a pulse generator. You set how long it’s supposed to be on and off for, and it just blasts for you and the best part is say you need 20 of them. Well, fpga just put 20 on them and if you have 20 pins available, they are all available to be your pulse generation. It’S very, very good for fpga, i’m sorry for uh servo motion control. I have a bunch of that on the robot as well.

So if you want to see it in action, come talk to me. Another big problem that everybody faces uh when they use an fpga, is a lot of people get miffed by how you i know i was uh map data from user space down into the fpga register land and essentially that’s a very common problem. I was very miffed. Initially too, but there’s a million ways to solve that problem.

A very simple one is an spi data block. Transfer. You specify a number of bits. You put you, you tell yourself what each section of bits means and then you spawn a thread in user space that just transfers it via spi from linux, straight down to your your uh targeted registers, and then those go out the door and those set all the Variables and things on your fpga can’t go into too much detail on spi, unfortunately, but it’s a very, very effective on the on my robot.

It’S like a six megahertz spi link, so you can really push data down very effectively, so some other more abstract integration possibilities to wrap it up here are um. A really common thing is the internet of things. Smart devices they all benefit from uh ethernet based internet ready computers, but then to interface that with hardware you can effectively use fpgas to take it to the next level. Um there’s actually a gentleman that’s helping on the valent fx project over here he’s making an open hardware vision instead of opencv by intel, there’s openhv by jonathan fiat, he’s a professor in france and it’s really sweet.

It has all these algorithms and fpga land that allows you to uh, do computer vision on fpga fabric and they can get information from that as well. Also high speed data interfaces are very hard to integrate with microcontrollers fpgis. Allow that to sata pcie gpmc is general purpose memory controller. Those are very, very fast and beaglebone black has one as well, so you can use those links as well so where’s the technology going.

I i would encourage you guys to look into the technology, mostly because everything’s going the soc route system on a chip you put all of the hardware. Your application needs on a chip and altera and xylanx have a new family of ics. That just came out that have arm cortex processors and fpga fabric on the same die. This is a picture of a development kit.

You can buy from arm i’m sorry from aero electronics. I took a seminar on it. It’S remarkable you make the linux operating system run on the cores, and then the peripherals that you put into the fpga around it can be mapped into the linux device tree very very easily. They have instructions for how to do the whole thing so kind of like in your cell phone. Everything is an soc.

All the devices are on one chip. An easy way to get started is read this book pong pichu, it’s spartan, xilinx, 3 fpga prototyping by verilog. Examples: that’s how i learned it’s a very, very, very well written book um.

Also, you can check out my source code to do everything that i just described in this article. For my beer serving robot, all you got to do is go to github and search bebot. Fpga and you’ll find me um and also look into a raspberry pi look into beaglebone black again. These computation platforms are like forty five dollars.

It’S amazing how easily you can get a light bulb to blank and you know show other people what you’ve achieved, because it’s just all over the internet, in fact youtube is a awesome place to check out videos on how to do stuff. I learned a lot of stuff about the beaglebone black from a gentleman named derek molloy out of uh, the university of like uh somewhere in ireland on youtube. Also we’re trying to get this mark.

One fpga cape that goes on an arduino, a raspberry pi and a beaglebone black we’re trying to do a kickstarter or something so if you’re interested in that come get on the emailing list and if i have time in conclusion, um, it’s really really cool hardware. It’S really cool software and it’s the whole top to bottom um, environment, where industry is already there, but i don’t feel like the diy community has really embraced it because there’s kind of a learning curve. I wrote all this software and i did all this stuff so that people could learn it very easily.

Just go download my software there’s not a ton of documentation yet, but there’s going to be and everything’s online guys. It’S all google just go to google you’ll find anything you want about anything. I just talked about thanks for your time. .