I'm trying to find the E-Compass software, and the application notes that are claimed to be provided with it, including AN4676, AN4681, AN4684, AN4685, AN4696, AN4697, AN4698, AN4699, AN4700, AN4706, and AN4709.
The page for the E-Compass software seems to direct me only to the newer sensor fusion toolkit which is not what's described in e.g. "Software for Tilt-Compensated eCompass with Magnetic Calibration" ( http://cache.freescale.com/files/sensors/doc/fact_sheet/eCompassFS.pdf ) and in particular does not include those app notes.
Hi,
I am also using the same FXOS chip for getting the eCompass heading.
did you solve your problem, i am also facing the same issue. I am getting RAW values from accelerometer x,y,z & magnetic x, y, z data. I am able to convert the rotation, pitch & roll.
But i need the eCompass 0 - 360 degree heading values. how to apply the formula using RAW values. I am not using any Gyro only accel & mag values are getting from the fxos chip.
did you got or have any reference c code for getting or calculating the 0, 90, 180, 270 & 360 angle calculation.
regards,
anil
Hi Eric & Anil:
I am just starting to look for an e-Compass solution, and I am finding the same problems that both of you are having. From my first observation, any working, useful, platform-independent C-code that extracts X,Y,Z from these chips and creates a useful readable compass heading is either being hidden intentionally, does not exist in reality, is confidential to big-names such as Samsung, Apple, Ford Motors, etc. (who probably spent lots of R&D to create an e-Compass solution), or is "left to the student as an exercise". Frankly speaking I am totally disappointed in this industry, that seems to be more driven by "drones and games and hobbiests" and not by "industrial applications". I have looked at InvenSense, Bosch, STMicro, NXP, and others who claim to have "tilt-compensated" e-Compass, and I have reached the conclusion that although these device may be "capable" of tilt-compensation, such readily available software solutions do not actually exist. Perhaps someone can prove me wrong, but until then, I chalk this industry at the top of the "marketing hype".
I'm surprised that any reader of this community hasn't figured out that this stuff is available at http://www.nxp.com/sensorfusion. It's been there for years, and I routinely point people to it. Tilt-Compensated eCompass is a standard component in our open source sensor fusion library. There are two versions: Version 5.00 targets a slightly older toolchain based on CodeWarrior, KDS and Processor Expert. Version 5.00 is downloaded and installed via a separate installer found at the URL above. Version 7.00 supports KDS, IAR, and Allolic and sits on top of the MCUXpresso SDK (formerly KSDK). 7.00 is delivered as part of the SDK for FRDM-K64F and FRDM-K22F, which can be built at Welcome to MCUXpresso | MCUXpresso Config Tools (make sure you check the FreeRTOS and ISSDK options when you build the SDK) . Both include extensive documentation, full source code and pre-built projects for specific NXP boards. If you need to port to other hardware, I suggest starting with Version 7.00. It was re-architected with that in mind, and contains a number of additional features on top of Version 5.00.
Regards,
Mike
"platform-independent C-code" is one reason the question comes up.
Nothing in your reply sounded like "platform-independent C-code" was an option?
Perhaps that is the "full source code" is available after we remove the abstractions of abstractions from these tools in the infinitely nested header files? To be fair I have not looked at 7.00 and am going on past experience at the code I have looked at from the older tools.
When App Notes are published the code should be available for them and remain available for them.
I can often find App Notes and related code published by Motorola decade(s) ago easier than I can find for modern Freescale/NXP. :-(
Bob,
Version 7.00 is as platform independent as we could make it. But at the end of the day, any application like this is going to have drivers that interface with hardware. Change the hardware and you have to replace the drivers. There's just no way around it.
I share some of your thoughts with regard to general Freescale/NXP documentation, which is why the sensor fusion app notes, datasheet and user guide are all bundled with the software. We've put a huge amount of work into this package because the topic is complex, and we're trying to make it as easy to digest as possible. But you have to download it for any of that to be useful to you! :smileyhappy: Please see my last posting at the bottom of https://community.nxp.com/thread/444092 to learn where to look within the SDK structure for the sensor fusion code.
Mike
"But at the end of the day, any application like this is going to have drivers that interface with hardware."
Conceptually that is backwards to me, seems like the software package is driving the hardware selection process, not that it is always a bad thing.
Yes obviously there is hardware and software interface in any embedded related chip.
I come to a vendor looking to buy hardware do design into my product.
What I want to see if how easy will it be to use said hardware.
That I have to install anything to decide to go with Vendor-A or Vendor-B is an issue to simply see how to use a chip.
The fact that you even mention 'drivers' to me raises red flags, of something being overly complicated for deciding which chip to use.
This is where the Application Notes are valuable, as I'm sure you know.
That there is a package of everything in one place is A Good Thing. I do understand just how complicated Sensor Fusion can be, I've spent far to much time with my eyes glazed over looking at Kalman Filter constants et.al.
Hello Eric,
The webpage for eCompass software is:
http://www.freescale.com/ecompass
The homepage for Sensor Fusion:
http://www.freescale.com/sensorfusion
-Josh
Yes, I found that page, which was how I got the PDF I mentioned, but as far as I can tell, none of the links from that page lead me to downloading the actual eCompass software package (including the app notes), while at least one of the links instead takes me to the sensor fusion download.
Possibly I'm just dense, but I can't find it, so if it's possible to download it, I need the exact URL or the exact sequence of clicks to get to the correct download.
Thanks!
Eric
Hello Eric,
What are you referring to when you said "eCompass Software Package"?
The download link is under the Downloads tab, its name is "XTRINSIC_FUSION_LIB_KINMCU", which is an executable file that will install a copy of our eCompass library for our Kinetis MCUs.
The magnetic calibration algorithm can be found under any of the Sources folder, its name is "magnetic.c", its path should be:
INSTALLATION_PATH\Codewarrior\FRDM_KL46Z\Sources\magnetic.c
Unfortunately the application notes you're referring to are no longer available and the eCompass Factsheet is out of date, we're sorry for the inconveniences. However all the required documentation can be found in the "docs" folder in the "installation path".
Hope it helps.
-Josh
Note that it would be useful if software packages like this, which contain platform-independent source code, could be provided in a platform-neutral distribution format, such as a ZIP file, rather than in a Windows-specific self-extracting archive. There probably aren't many people who don't have some form of access to a system running Windows, but for some of us it's not very convenient. I'm using Kinetis Design Studio on Linux, which works quite well (thanks for providing the Linux verison!).
Thanks!
Eric
Apparently I was confused due to the app notes described not being included in that download. It looks like there are equivalents for some, but as far as I can tell, not for AN4698 "CPU, Flash and RAM Benchmarks" or AN4681 "Implementing a Virtual Gyro Using Accelerometer and Magnetometer Sensors". I also couldn't find the "Simulated accelerometer and magnetometer driver provided for immediate verification on target processor before interfacing to real sensors" listed in the datasheet, and it also doesn't compile to "under 10KB total code size" when I compile it with KDS. This led me to think that I didn't have the right download, and that there was some simpler eCompass package as compared to the full sensor fusion package.
I'm particularly disappointed in not being able to get AN4681, which sounded quite interesting and potentially useful.
Thanks!
Eric