Showing posts with label imu. Show all posts
Showing posts with label imu. Show all posts

Sunday, September 11, 2016

Hexiwear based GPS-AHRS for Nikon hotshoe

I have been working on the GPS-AHRS hotshoe for a while. The initial complete prototype was built around the Xadow platform. It is one of those continuous iteration projects, I wish someone puts me out of misery and brings out a COTS solution that is affordable soon.


I put the idea for the GPS-AHRS on the Hexiwear platform and received a free Hexiwear dev kit to built it with, a great deal. The Hexiwear has lots of toolchains for building projects with, including the Kinetis Design Studio from NXP and ARM MBed. This makes development on this platform a breeze. It also comes with a lot of sensors : barometer, gyro, accelerometer and magnetometer are all included. It has built in BLE for communications and a 16bit OLED screen. The only missing links are GPS, Nikon camera interface and a sensor fusion algorithm to obtain Euler angles/quarternions from raw motion data.

I already have working MBed code for sensor fusion and I have successfully tested reading all the motion sensors over I2C, so this should be easy to put together in the next few days.
I also compiled the stock firmware in KDS and did some small changes to show the Magnetometer data as part of the UI. This was relatively simple simply involved attaching a listener to one of the messages already being broadcast in the RTOS and a hacked up page to display the results. The results of this code can be seen below.


Tuesday, April 5, 2016

Nikon Hotshoe IMU with Xadow Modules

Hotshoe GPS-IMU in enclosure
We take lots of oblique images from a helicopter for our high-resolution 3D modelling service - Aero3Dpro. While photogrammetry and aerotriangulation lets us establish the position and orientation of these photographs afterwards from a relatively poor initial GPS and no IMU, just after capture there is no indication how well an area is covered from different angles. This can be a pretty difficult proposition anyway, especially in the presence of narrow allies and tall buildings. However with a good initial GPS-IMU one could build a low resolution model of the city literally on the fly.

All the components that get packed into the GPS-IMU

So I set about building a system that fills this niche, a camera hotshoe mounted system with a reasonably accurate GPS and IMU. There are already a lot of existing Xadow modules which satisfy the requirements of the system. I just had to cook up a few more as described in a previous post to cater for the unique requirements for interfacing with the camera and logging the data.

  1. Xadow Barometer
  2. Xadow 9-DoF IMU (can be combined with 1 above in the new 10-DoF IMU)
  3. Xadow GPS  (the NMEA from the stock one does not agree with the Nikon so looking at a UBlox based version)
  4. Xadow OLED
  5. Xadow-M0 with MBed support
  6. SPI to Dual-UART with SC16IS752, this is necessary because the only available UART on the Xadow-M0 is consumed by the GPS. We need 2 more UART's to send data to BLE module and camera at 4800 Baud.
  7. Xadow BLE Module  
  8. Xadow SD for logging locally in case BLE connection is patchy or a non-Nikon camera is being used which does not allow geotagging over UART.
A lot can be done when all these modules come together to party, the mBed code is available here. The android app for receiving the GPS-IMU data over BLE and predicting the camera foot print is still in the works. If anyone wants to take the app development up as an excercise I can provide the source. In conclusion I must thank Kris Winer for excellent IMU test beds and sample codes which helped me get started down this path.
GPS-IMU on hotshoe mount
After all the electronics came the enclosure and hotshoe attachment system. I designed something rough in blender using a trace of the stacked PCB's and got it locally 3D printed by 3D Hubs and Andrew Karas. This mounts nicely on the hotshoe, but the openings for reset, USB and cable to camera are not neat, a more aligned box is in the works.




Monday, November 2, 2015

Making MBed and Arduino compatible Xadow Modules (in Reflow Oven)

I have designed a long chain of Xadow modules by now, including right angled side chains. These include:
  1. Xadow SD (CD4050) - Which allows using upto 32GB Micro SD Card and good read/write speeds due to the driver IC.
  2. Xadow Serial (SC16IS750) - Which adds 1 UART and 8 GPIO ports, with jumpers to allow upto 4 modules in chain.
  3. Xadow MultiSerial (SC16IS752) - Which adds 2 UART's (theres is not enough space for the GPIO's)
  4. Xadow IO (PCA0539) - Which adds upto 16 GPIO ports using I2C
I have tried various suppliers to gather all the components, various PCB manufacturers as well as solder stencils from OSHStencils. Here is the breakdown of my experience so far in prototyping some very small single boards using SMD only components.
Chain of Xadow modules - GPS, Oled, 9-DOF IMU, Barometer, Dual-I2C Uart (Bluetooth), Xadow-M0, Xadow-SD (Left to Right)

PCB Manufacture:

DirtyPCB - They use SeeedStudio for manufacture and fulfilment, but get bulk discounts and I love the Gerber preview option, no extra charge black PCB's and option to get extra PCB's in a batch. I have got gold finished PCB's from them as well these look rather good.

SeeedStudio - My first test PCB's were made here.They also provide an assembly service and a library of commonly used parts. In most cases I have managed to get 80% of the PCB assembled in China with 20% hand soldered at home, mainly crystals and main IC's.

OSHPark - This is the made in the USA solution to Hobbyist PCB's. They produce PCB's in a signature purple colour, which I guess is a soldermask colour no serious industrial PCB maker wants. The ENIG finish PCB's look rather good. The preview function is also handy. However the DRU for checking PCB's is a bit strict in terms of clearance at the board edges, vias are not automatically tented and signals require greater separation leading to a low density PCB overall.

I am yet to try PCBPool and local Australian and New Zealand options, but they are beyond the budget of hobbyists. Once I start manufacturing my designs I shall surely give them a go. Local hackerspace recommended #hackvana and I had a great chat with them as well.

Component Sourcing:

AliExpress - Components are a bit hit and miss, had the wrong ones sent at one point. All the ones tested work.

EBay - Probably same sellers as AliExpress. Similar performance, no bad shipments so far.

Element14 - Next day delivery is amazing for quick prototyping. The part search system has improved a lot and they even have an Eagle library for most of the common parts.

Samples from TI, Maxim and ON Semi - Nothing is as good as free stuff delivered express. All parts are detailed with CAD models (albeit in .bxl).

Stencil:

OSHStencil - The holes are a bit too big, probably because I did not shrink the solder mask enough. Great otherwise.
Homecut - Cut on a Trotec laser Speedy 100 from Mylar and Kapton. The laser has a bi
t too much power, so pads need to be shrunk even more.

Overall it has been a great learning experience and I have probably spent more on research than I would have spent buying a hotshoe IMU like the solmeta off the shelf. However in the end the product does exactly what I would like it to do. Next step - find a suitable 3D printer on 3D Hubs and get an enclosure built, also complete the MBed code to make it all work.

Sunday, February 14, 2010

I wanted a UART but I got GPIO

Time finally came to hookup IMU to Gumstix. I carefully soldered a couple of ribbon cables and put on a scope at the RXD and TXD pins to see if I could run a loopback test. The Gumstix UART page is suitably vague and confusing. Fine I can do some guesswork and deal with ambiguities. I soldered both the HWUART and the BTUART since that's where the ambiguity lies. I tried to send some data to the serial using cat. Lo and behold it did not work. So I put both receive and transmit pins in GPIO mode and manually toggled the state using:

 while(true);do echo "GPIO out set" > /proc/gpio/GPIO43;sleep 1;echo "GPIO out clear" > /proc/gpio/GPIO43;sleep 1;done

My soldering is rock solid (I have gotten better) and I got a 1 second pulse on the cable soldered to the the supposedly unused HWUART. More fiddling is needed before I can get the 3rd UART I need.

Saturday, February 13, 2010

3DM-GX2 to Linux via Serial

The 3DM-GX2 is not a naive 6-axis IMU. It performs onboard Kalman filtering and stabilization and can sample very fast. The serial interface operates at 115200 baud and offers various data sampling modes with commands. I decided to test Euler Angle output, with nominal static test resolution of ± 0.5°. Getting the serial port functioning properly was a bit of a challenge on Linux, especially via a virtual machine - had to keep on connecting and disconnecting the USB/Serial converter (PL2303).



The unit takes a byte command and outputs a sequence with the command repeated, roll, pitch and yaw coded in floating point radians, a system time stamp and a checksum. The standard API for windows includes all the command parsing sections except the serial communication bits. As usual to test the stability of the unit I did a static run. The attitude stability is indeed 1° peak-to-peak. The graphs show some high frequency noise, the flight control needs to perform some smoothing and rounding to deal with that.

Here is the version of the Linux sample ported from the 3DM-GX1 Linux sample provided by Microstrain.