Friday, November 4, 2016

How I Got My Dragonboard 410C Airborne

I was recently a guest on 96Boards OpenHours to demonstrate how the Aerocore 2 for Dragonboard 410C can be used to quickly and easily build a working quadcopter.   I even powered it up and tested it out indoors live.

If you want to see what happened, check out the YouTube video. The test flight happens at around the 40-minute mark.


Drones are awesome and not that hard to set up.  You can follow along with me if you're building your own.  Once you've got your rig put together, then you can start adding software to the Dragonboard -- or Any 96Boards CE SBC -- to turn it into a self-piloting, obstacle-avoiding, object-following marvel of automation... or whatever it is you plan to do with it.

To find out more about the Aerocore 2 for Dragonboard 410C, you can read my previous post or watch this promo video

The Parts

 The first step in building your quadcopter is to make sure you have all of the hardware you'll need.  Here's what I had on-hand:



You know you work somewhere cool when you can assemble a drone from hardware lying around the office.

The Prep

To keep this post brief, I'm going to glaze over the following steps.  They're fairly straightforward and unrelated and ubiquitous in MAV deployment so there are plenty of instructions available on the web.


  1. Assemble your drone kit.
    • Do not attach the rotor blades yet. You really don’t want your drone unexpectedly taking flight in the middle of your office/house/garage.
  2. The 12V battery connector and regulator on the Aerocore can handle the main battery’s output but there is no built-in connector on the drone or the battery.  
  3. solder-highlight.png
    • You can solder some jumper wires onto one of the motor power terminals on the base plate of your drone (circled in green here)
  4. Make sure you’ve flashed your Dragonboard with Linux. Linaro’s Debian 16.09 was used for this demo.
  5. Build QGroundControl.
  6. On your dragonboard 410C install the necessary packages
    • $ sudo apt-get update && sudo apt-get install python-wxgtk3.0 python-pip python-numpy python-dev libxml2-dev libxslt-dev gstreamer1.0-tools
    • $ sudo pip install pymalink
    • $ sudo pip install mavproxy
  7. Bind your satelite DSM receiver with your radio

(UPDATE:  Since the original project was completed, something about the pymavlink pip package has changed and will no longer install dependencies correctly.  therefore, add python-lxml to your apt-get command before installing pymavlink and mavproxy)

Put It All Together

Now the fun stuff can begin!  It's time to get everything hooked up and ready to fly.

Step 1: Attach your boards

With this thing going up in the air, you won't want your hardware sliding around at all so it's good to put some thought into how your boards are mounted.  The chassis I'm using doesn't have what I'd call a universal mounting system, so I made my own.  The box for an Intel Edison turned out to be just the right size and very sturdy.  I've already been using one on the rover in my RTK project to house a Beaglebone Black.

Some zip ties, screws and risers quickly transformed the cardboard box into a mounting bracket for my Dragonboard.  A touch of shameless self-promotion and it's ready.

Board goes on brackets, Aerocore on board.  I used a bit of electrical tape to hold the receiver in place and was ready to wire it up.

Pro-Tip:

MAVs tend to have alarm buzzers, used to indicate low battery and signal loss.  This is very important when in flight, but when you're setting everything up it can be really annoying.  Thankfully, the buzzer on the Aerocore 2 has a bypass circuit. After soldering a 2-pin header on the underside of the Aerocore, directly underneath the buzzer, you can use a jumper to deactivate the alarm.  For obvious reasons, I don't recommend hard-wiring the alarm bypass.  The picture to the right should help you find the two vias to connect.


  Step 2: Connect Wiring

One benefit of using a box as a mounting bracket is that it has proved to be the ideal place to hide excess wiring.  I cut a small opening in the bottom of the box and fed all of my wires in and through.  I got my hands on a webcam and managed to squeeze its base and cable in there too.  I labeled the following image so you can see where the various connections are.

Not having previous experience with MAVs, I had no idea what order to hook the electronic speed control PWMs in.  It took me a while, but I figured it out.  I put together an infographic for the rest of the amateur MAVers so that you don't have to struggle like I did.

Step 3: Software

The final pre-flight step is to configure your software.  There are three steps:
  1. Flash PX4 firmware to the MCU
  2. Start data pipeline on the Dragonboard
  3. Calibrate on-board sensors

QGroundControl makes programming and configuring your drone a snap.  Open up the program and go to the setup tab (Selection_065.png).  Along the left-hand side will be a button labeled “Firmware”. When you click on this button and then connect the Areocore 2 MCU’s “stm console” via USB, QGC will guide you through the flash process.
microcontroller-console.png

The rest of the pre-flight work can be done over WiFi on the Dragonboard. Going wire-free will also make calibration a little easier.

Disconnect the USB cable from your Aerocore and connect the battery. Once the MCU and Dragonboard boot, SSH into the Dragonboard and enter the following command:

mavproxy.py --master=/dev/ttyMSM1 --baudrate 115200 --out xxx.xxx.xxx.xxx:14550 --aircraft MyCopter
Where xxx.xxx.xxx.xxx is the IP address of your PC.

Once the MAVlink command interface comes up on the Dragonboard, QGC should be able to connect to your drone. If it does not connect correctly, you may have to add a UDP connection to QGC’s settings.  The setup screen should look simmilar to the following screenshot:

drone_setup.png

If this is the first time your Aerocore has been configured, the cicles that appear green in this shot will be red and you will not be able to deploy your drone until they all appear green.

Configuring your drone and calibrating the sensors is very straightforward thanks to the self-explanatory interface in QGC.  Click on each item along the left-hand side in turn -- apart from “Firmware”, which you have already done -- and follow the on-screen instructions.  Once all the lights are green, you’re ready to fly.

The final, and completely optional steps are getting the camera feed from the Dragonboard to QGC, and attaching a Pre-GO GPS module.  

Adding a GPS module is very easy.  Once it’s connected, it will work right away.  Connect it to the 5-pin molex connector next to the DSM satellite receiver connector.  Power down your drone and plug the module in using the included cable, and it's ready.  I added mine last thing right before the live test flight and it worked with no set-up required.

The video streamer, like the MAVlink proxy, is a single command on the Dragonboard:


gst-launch-1.0 uvch264src initial-bitrate=1000000 average-bitrate=1000000 iframe-period=1000 \
   device=/dev/video0 name=src auto-start=true src.vidsrc ! video/x-h264,width=1920,height=1080, \
   framerate=24/1 ! h264parse ! rtph264pay ! udpsink host=xxx.xxx.xxx.xxx port=5600


With both the proxy and the video feed running on the Dragonboard, your flight screen will look something like this:

in-flight.png

If you have added a Pre-GO GPS module, your drone’s location will appear in the navigation map seen here in the inset. You can switch the primary view between the video stream and the navigation map by clicking on the inset in the bottom left-hand corner.

 

And There You Have It...

You now have yourself a working drone.

Wednesday, September 21, 2016

Improving Safety in Surface Mining with Geppetto

Image: Wikipedia
Surface mining is a modern economic necessity and, all controversy aside, it's not going anywhere soon. One day, the process of removing minerals and ore from the earth's crust may be performed by drones and remote operated machines but until that day, men and women will be working in the high-risk, hazard-wrought environment that is open-pit mining.

The industry does a great many things to mitigate the potential dangers these brave individuals face everyday.  For example, I once saw a really cool piece of surveying tech that automates some of these tasks. Two jumped out at me in particular: slope fracturing measurement and equipment wear detection.

Slope fracturing describes the stability of a slope based on the arrangement and size of the particles in it.  Mines must monitor the degree of slope fracturing in order to prevent dangerous rock slides.  What I saw was a hand-held device that would process, on-site, images of the slope using computer vision techniques and special analysis software to estimate, at a glance, some metric of stability.

Image: Wikipedia
Another important task that this device tackled was measuring the degree to which wear components of excavating machinery had deteriorated.  Operating heavy machinery is dangerous enough in ideal circumstances, but as the teeth on the scoop of an excavator begin to wear, it has to work harder to do its job.  A weak everyday metaphor of the ensuing situation is using a knife in a kitchen.  The duller your blade becomes, the more you compensate to get the job done.  Suddeny, you're pressing down with all your strength to cut through a potato, for example, when the knife slips and cuts your hand badly.  Damage to your knife blade, like chips and burrs, can cause their own problems as well.

Similarly, as the teeth of an excavator scoop wear down and its work begins to require more force, the operator will inadvertently begin to compensate.  Eventually, like the slipping knife, the machinery may experience a severe and life-threatening mechanical failure. 

Now imagine an industrial kitchen with hundreds of knives to maintain.  It would be good to be able to look at whole batches of these knives and immediately be able to tell which ones need to be sharpened or replaced.  With the replaceable teeth on mining equipment, there is a standard level of degradation permitted before they are replaced.  Without assistive technology, each tooth of each machine would have to be inspected.  The device I saw allowed an individual to audit an entire array of parts at once and tag those in need of replacement, again using an on-board camera and computer vision software.

Both of these processes involve the physical presence of an expert to manipulate the device and interpret the data.  To put this in the context of the industrial kitchen, let's equate slope fracturing to the state of decay of food. Under this system, the chef must go through every fridge, freezer and storage room to ensure every steak is fresh, every leek is green and every expiry date hasn't passed.  Then, he has to go around testing every knife to make sure it is in good repair.  This protects the health and safety of his employees and customers.  How do we make his job easier?  What if each cook was knowledgeable enough to make the micromanagement decisions of which head of lettuce was rotten and which blade was dull?

Okay, so this is sort of already the case in kitchens, but maybe we can use technology to make this happen in the mining industry.

Here's my caveat:  I know very little about open-pit mining.  What I know is that mining engineers need to collect slope fracturing data and measure the state of degradation of wear components on mining machinery.  And I understand that this data can be used to improve safety and reduce operating costs.


Designing a Mezzanine Board


So how do we automate an early-warning system for landslides and machine wear in the context of surface mining?  So we have two computer vision tasks, one of which takes proximity as an input.  Other potentially important variables are geographic location and heading.  We also need some powerful brains to process this data.  Oh yeah, and we need to get the data from the field to an off-site computer for analysis.  Oh and let's keep costs and power consumption to a minimum, shall we?

The Big Idea

What if we could equip every excavator, bulldozer and dump truck with the means to relay slope fracturing and mechanical wear data off-site in real time, providing analysts with the means to monitor the safety of the equipment and terrain? Then they could dispatch crews to deal with these issues before they become problems.  Let's slap a little device in or on the cab of the machines at the mine, attach a few devices and antennas to it and give it the ability to perform the two tasks I described above.

It'll need two views, one facing forward and one in view of the wear components of the machine when it's at rest.  Since these are unlikely to be the same, we'll need two cameras.  It needs some method of measuring distance.  IR and ultrasonic methods do not have the range needed for the given application so something like LIDAR would be useful.  Positional and directional data are also important for both tasks so some kind of GPS and digital compass will be needed.

Beyond that, we just need a way of processing and transmitting the data for analysis.

So here's most of our hardware requirements:


  • 8MP+ camera  x2
  • LIDAR rangefinder
  • GPS
  • magnetometer
  • LTE modem
  • compute device
Hey no problem.  We're going to use my favourite tool: GEPPETTO D2O.

Compute Device

Geppetto has an ever-expanding list of connectors for COMs.  Recently, we've added 96Boards, TechNexion PICO SOMs, and the new Intel® Joule™ compute module to that list.  What we need is a CM that supports 2 HD cameras.  Coincidentally, the 96Boards mezzanine header does. Specifically, the Dragonboard 410c and HiKey support 2 MIPI CSI-2 cameras (one 4-lane and one 2-lane).  Also, 96Boards are SBCs so they come equipped with WiFi, USB ports, HDMI, and USB-OTG, and include a bunch of low-speed communication buses, such as I2C.  These specs satisfy all of our hardware needs.

Image: Garmin.com

LIDAR

Garmin sells a module called the LIDAR-Lite for a reasonable price (~$150 USD) and I'm sure there are similar products from other vendors out there.  It can communicate either over I2C or PWM and is good up to 40 m (+/- 2.5cm).  This would do nicely for our system.

GPS

Geppetto has a convenient 5-pin header for Gumstix's Pre-GO and Pre-GO PPP GPS modules, which I have discussed at length in previous posts and is easy to implement in software.  That settles that.

Magnetometer

We could use a compass to provide information as to which slope the device is analysing.  If we know where we are and we can tell which way we are facing, we should be able to discern what feature of the terrain we are looking at. Add Geppetto's 9-axis IMU and you get  a gyro and accelerometer as well.

LTE Modem

Geppetto provides a connector for NimbeLink® Skywire™ 4G LTE modems.  50 Mbps upstream is more than enough to transmit the analytical data from the board, even if you want to transmit a live video feed.


My Board: FracJaw

Well that's it.    all that remains is to slap that on a board and click "Order".  I did some playing around and this is what I came up with:


This took me about 30 minutes to come up with. It has my two CSI-2 camera headers, an I2C header for the LIDAR, an LTE modem connector, GPS, and an RTC.  And it all fits on a 13x5cm board., so about the size of your smartphone.

I've saved my board design and made it public in the community tab.  Or you can jump directly to it here.

Monday, September 19, 2016

A New Board and New COM Connector in Geppetto: TechNexion PICO-IMX6

Some of you may be wondering why I haven't posted any updates with respect to my RTK project.  Well, truth be told, it's been pretty busy here at Gumstix.  The release of Intel's new 64-bit IoT compute module at IDF, and our recent induction as manufacturing partner with 96Boards, gave me a steady flow of work.  And now we've released a new development board for the TechNexion PICO-IMX6 COM.


NXP's i.MX6 SoC has a fantastic selection of features - from 1080p HDMI to Gigabit ethernet, PCI express to image processing - and TechNexion has done a fantastic job of breaking out these features in a compact, low-profile compute module, complete with on-board WiFi and Bluetooth, an Edison-compatible low-speed header and two high-speed expansion headers.

Gumstix has put together a board with a long list of features to help you get going with TechNexion's PICO-IMX6 COMs.  Here's a list of its key features:

  • HDMI connector
  • Dual USB 2.0
  • USB OTG
  • microSD
  • Gigabyte Ethernet
  • MIPI DSI and CSI2 connectors
  • Audio in/out
  • NewHaven 4.3" cap-touch LCD connector

These and several more features, packed onto an 11x8cm PCB, make this board developer-ready for all kinds of projects such as handhelds, home automation control, tiny workstations or home theatre applications.  It's available now in the Gumstix Store

If you like the Gumstix PICO-IMX6 expansion board but it's missing something, or you just don't need this header or that display for your application, Its Geppetto design is available on the "Designed by Gumstix" tab in GeppettoD2O.  You can re-position, remove and add board modules to match up with your needs.


Wednesday, August 24, 2016

Make Your Own 96Boards CE Mezzanine Board


www.96boards.org
96Boards is really gaining some traction in the embedded world. Its open specification, software support, and community make it an appealing platform for hardware developers, programmers and makers alike.  Part of the specification for the Consumer Edition boards is a mezzanine connector.  This allows users to expand the hardware capabilities of their 96Boards-compiant SBC.  So where do these mezzanine boards come from?


Commercial Mezzanine Boards

Several expansion boards already exist and are available for purchase from online vendors such as ARROW.  These boards are meticulously crafted by hand by a team of engineers and can take a considerable amount of time from conception to market and may not be ideal for your needs.  It would be good to be able to design your own board to meet your project specifications.  For example Gumstix has released the AeroCore 2 for Dragonboard 410C.  But what if you need additional sensors or another UART port or two?  Soldering in wires and adding breadboards is one way of doing this, but it's messy and cumbersome... Especially for drone applications.

Enter Geppetto D2O

What if I told you that you could just take the board, stretch it out and drop in some new hardware?  That would be nice, wouldn't it?  Well, when you import a design into your workspace from our existing ones, that's exactly what you can do.  And, of course, you can always start a design from scratch.

Geppetto D2O (Design to Order) allows you to design or customise an expansion board with a familiar-feeling drag-and-drop interface.  A long list of modules can be placed wherever you need them on your design and
connecting them to the other modules on your board is easy with Geppetto's context menu system.

The Geppetto workspace
Gumstix will even build and test your board for you, ensuring that your design is mechanically sound and ready to go.  A $1999 set-up fee and a few weeks later and your design is in your hands.

Aside from Gumstix's own Overo and DuoVero COMs, connectors for many 3rd party COMs and some on-board SOCs and microcontrollers are available as well.  Alongside the release of the new AeroCore 2 board, which, by the way, was itself designed in Geppetto, we have added a 96Boards-compliant mezzanine connector to the Geppetto module library.

It has never been easier to create your own expansion boards.  If you're looking for the shortest path to market or just want to design your "ultimate IoT development board," make sure you check this out.

Making the AeroCore 2 for 96Boards

Like I said earlier, the Aerocore 2 for Dragonboard 410C was designed in Geppetto by our engineers. All of the hardware on the board comes from the modules in Geppetto's library and the process is easily reproduced.  In fact, I think I'll just walk you through it right now.  How about I make my own version of the design from scratch?  It won't take long.






Step 1: Go to Geppetto

Geppetto is entirely online.  There is no need to install any software, configure settings, or hassle with any of the plethora of problems that CAD software can cause.  If your browser works, Geppetto works.

When Geppetto finishes loading, which only takes a few seconds, your workspace comes up.  This is where you design your board.  There are a few tutorial videos if you want a detailed look at the Geppetto interface.  For now I'm going to focus on building my own AeroCore 2 for 96Boards.







Step 2: Add the Connector

Grab the mezzanine connector for 96Boards from the "COM Connectors" tab in the column to the right.  It snaps to the bottom edge of the board.  This makes sure that the USB and HDMI ports on the host board are accessible.  The default board size is a little small for the module and can be resized as you would a window on your desktop.  Once the connector fits on the board you will notice that the board outline and the connector module are  both red.  That is because there are unmet reqirements.





Step 3: Satisfy Requirements

Almost every module that you place on the board will either require or provide certain signals and
buses.  The only exceptions to this rule are mechanical elements, such as mounting holes.
When you hover over a module, its requirements are displayed in a menu that pops up beside the module.  If you click on it, a list of modules that will satisfy that reqirement will appear in the library. Once you've placed a compatible module on the board, you can connect the modules by clicking on them in turn.  As soon as the requires are satisfied, the board and modules turn green.

Yes, it's a big game of "red light, green light." My kids love that one.  Make everything green and the board will work.  So far, all we can do is boot the board with a 16V battery for power.  Time to add some features.

Step 4: A Microcontroller

Some boards require a microcontroller to, say, manage sensor output or control some servos.  In the case of the AeroCore 2,  an ARM Cortex-M4 MC does more than that.  It actually runs a PX4 compatible autopilot software suite for drone control.

The COM connections for 96Boards are mounted on the underside of the board so modules can be placed within its shadow, as long as they don't overlap with the green footprint.  So in order to save space, I'm going to squeeze the M4 in there.  I can rotate the module by right-clicking it and selecting "rotate" from the context menu.  Double-clicking modules also rotates them.

The M4 requres 3.3V so we need to add a regulator in order to power it from the battery.  The regulator could also take 5V from the host board, but we'll be multiplexing that source with the battery later.





Step 5: The Meat

Now that the compute devices are placed, it's time to add the sensors, headers and connectors that make up the AeroCore 2.  If you watch the animation to the left, you can see the board come to life.  With each module added, all of the requires are provided and all of the modules turn green.  This only took me about 30 minutes to do, and with a little extra time and patience, I could re-arrange the board to match the design for the AeroCore 2 for Dragonboard exactly.  The only thing my design lacks is the LTE modem.  That one we added in after the Geppetto design was completed, squeezing it in over other module footprints.
You can see from the pictures below that my design (below) is pretty good, compared to the original design (above).
The Gumstix Aerocore 2 for Dragonboard 410C

My Aerocore 2 for 96Boards


But don't take my word for it, get started now! Go to geppetto.gumstix.com and start designing your own board for free.

Tuesday, August 16, 2016

Big News From the Intel Developer Forum

The Big News


Intel just announced a new compute module for IoT, pro makers, hardware startups.  It's a big deal and Gumstix brought Geppetto to the party.
The Intel Developers Forum is in full swing in San Fransisco and during the keynote demonstration, the Intel® Joule™ module was introduced to the world.  This thing is a powerhouse!  It boasts a quad-core x86-64 processor at 1.7GHz, 4GB RAM, and up to 16GB on-board storage.  this, plus UEFI-capable bios, 1080p HDMI, two-lane PCI Express 2.0, and USB 3.0 and 2.0 give this tiny 20x40mm compute module the power of your massive desktop workstation.  In fact, you can see the Gumstix Workstation for Intel® Joule™ in action at our booth at the IDF!

Gumstix and Geppetto there for Intel® Joule™


That's right! We are there!  A connector module for Intel®'s new compute module is already available for your Geppetto board design and we are demonstrating it for you right at ground zero.  We have already designed six boards for the Intel® Joule™ and have brought some of them with us to show you.  Now, I won't be there but I and my partners in crime will be introducing Geppetto and the Intel® Joule™ module connector to booth visitors via telepresence.

All six of our boards are available in our store.  Take a look at the current selection:
The Gumstix boards for the Intel® Joule™ module 



If You're There, Come Visit Us.  If You're Not There, Come Visit Us


We want to show you what Geppetto can do.  The boards we brought with us were Designed by Gumstix in Geppetto and you can design your own right there in a few minutes.  The whole team is there to help you out and answer your questions.  If you don't happen to be there, go check out geppetto.gumstix.com and give it a shot yourself.



Intel, the Intel logo and Intel Joule are trademarks of Intel Corporation or its subsidiaries in the U.S. and/or other countries.