Search This Blog

Saturday, July 28, 2018

MEMS is the word

Projects / Project Swiftlet 

This is the area that I need a bit of bottom-up engineering to see what is available.


I like to do a price sort for figuring out the parts for my projects.

The block diagram of FXOS8700 (below). While I wasn't specifically looking for magnetic sensors, they might come in handy as it can provide compass bearing. The datasheet claims that 0.1 µT/LSB, with a 0.3uT-1.5µT of noise depending on sampling time. The part can work with 3.3V VDD/VIO and comes in 0.5mm QFN part.


The 3-axis offers some flexibilities on what orientation the sensor is mounted. Based on the sensor data, the head orientation and motion could be determined.


A few "throwies" of rare earth magnets could be used to mark way points or points of interest, but they have to be used sparingly as there can be only so much user feedback. I'll need to work out the math or experiment later on to figure out the effective distances. $2 for 100 magnets, I am in!

I did some reading about magnets. The closer their poles are, the less likely to detect them from a distance. One option is to stack multiple magnets together. This would help me find out what would kind of ratio would work by trial & error.


NXP/Freescale has a few app notes for their sensors:

  • AN4246 "Calibrating an eCompass in the Presence of Hard and Soft-Iron Interference"
  • AN4247 "Layout Recommendation for PCBs Using a magnetometer Sensor"
  • AN4248 "Implementing a Tilt-Compensated eCompass using Accelerometer and Magnetometer Sensors"
  • AN4249 "Accuracy of Angle Estimation in eCompass and 3-D Pointer Applications"
  • AN4459 "Using the Xtrinsic FXOS8700CQ Auto-Calibration Function" + Software

    "On target platforms with limited processing power (wrist watches for example) it may not be possible to run a compensation engine for an eCompass as depicted in Freescale application notes AN4246 and AN4248. For such platforms, FXOS8700CQ provides an auto-calibration function that calculates the hard-iron estimate (calibration) and automatically subtracts it (compensation) from the current magnetic-field readings. This way FXOS8700CQ provides magnetic X/Y/Z data with hard-iron compensation already applied to it."

    Nice!!! Less chances of me getting the wrong math. This looks like it is a good part to use.
There is also Freescale Sensors Breakout Boards Designs – HOME if you just want to grab a breakout board design and order PCB from OSH. They also have Eagle CAD library. There are differences between the recommended foot from datasheet and their Eagle library. As always, Trust but Verify! I have learnt that painful lessons too many times already.

Here are the reference material for the sensors:
Thanks to Joey Gouly mentioning about the Freedom board, I found out about Freescale's sensor fusion library in the download area for the same FXOS8700 accelerometer and KL26.

Accelerometer only (roll, pitch and tilt)
Accelerometer plus magnetometer (eCompass)
Accelerometer plus gyro (gaming)
Accelerometer plus magnetometer plus gyroscope sensors
Includes Freescale’s award-winning magnetic compensation software
Probably a good starting point for the library for compensation, eCompass (why not?) and the tilt sensor data for my device - stairs/hole detection.

Here is some good news. The code is already open source!

Description: CodeWarrior template programs for KL25Z, KL26Z, KL46Z, K20D50M and K64F for full sensor fusion release. FRDM_KL46Z is a reduced eCompass implementation.
Author: FSL
License: BSD-3-Clause

Note: The KL26 is similar enough to be used as a development platform for the KL16. Thus I'll be using the Teensy for the initial development work. I am trying to port ChibiOS/RT KL25 to the KL16.

Good to be using supported device this time around.

Layout:

Make the magnetometer placement the first step when outlining a new PCB layout. The ideal location for the magnetometer is to be as far away as possible from all sources of hard and soft interference and from high current traces. The best locations are often to be found on an edge or at a corner of the PCB.

Other electromagnetic components found on smartphones are loudspeakers, vibrators, hearing aid coils, batteries and near field communication (NFC) antennas. These will create permanent hard iron, induced soft iron and current-sourced magnetic fields and should also be placed as far as possible from the magnetometer.

I'll need to place the sensor towards the front away from the speakers/vibrating motors and on the opposite side of the power supply. Probably should look into Nylon screws/mounting hardware around that area.


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.