1. newcollector's Avatar
    Well, I have been following this thread since its inception and all I can say is I am stoked. Thank you for your spirit of cooperation, your hard work, and your passion for the task at hand. I feel like someone watching a childbirth. This is exciting!

    Posted from my CrackBerry at wapforums.crackberry.com
    11-11-11 10:48 AM
  2. peter9477's Avatar
    I know that you were joking when you mentioned a few posts back that the chip may have been soldered in backwards on some devices but... if the chip were soldered in slightly out of alignment on some PBs, it might explain why we are seeing suspected calibration problems. I checked my device again and it may, in fact, be a few degrees out of whack. Fortunately not enough to give me any problems with testing the interface though.
    I haven't measured from the land pad pattern on page 5 of the datasheet, but I'm fairly confident in saying it couldn't be more than a few degrees out of alignment before it would simply be non-functional.

    Do we have any consensus yet on whether "north" as shown by the Azimuth reading (around 0 or 360 degrees) is anywhere near magnetic north for anyone here? For me, it appears to be consistently about 45 degrees clockwise from where it should be. I haven't found a real compass to compare with yet, but I did check the local declination (should be like 15 degrees counterclockwise from true north) and compared where I'm facing with the Google Maps satellite view of my house, and the Azimuth reading definitely has me facing well east of true north, not west.
    11-11-11 11:05 AM
  3. newcollector's Avatar
    I haven't measured from the land pad pattern on page 5 of the datasheet, but I'm fairly confident in saying it couldn't be more than a few degrees out of alignment before it would simply be non-functional.

    Do we have any consensus yet on whether "north" as shown by the Azimuth reading (around 0 or 360 degrees) is anywhere near magnetic north for anyone here? For me, it appears to be consistently about 45 degrees clockwise from where it should be. I haven't found a real compass to compare with yet, but I did check the local declination (should be like 15 degrees counterclockwise from true north) and compared where I'm facing with the Google Maps satellite view of my house, and the Azimuth reading definitely has me facing well east of true north, not west.
    Why not use your phone compass to compare?
    11-11-11 11:10 AM
  4. Wolfgan's Avatar
    I know that you were joking when you mentioned a few posts back that the chip may have been soldered in backwards on some devices but... if the chip were soldered in slightly out of alignment on some PBs, it might explain why we are seeing suspected calibration problems. I checked my device again and it may, in fact, be a few degrees out of whack. Fortunately not enough to give me any problems with testing the interface though.
    Based on how I understand the working of the chip, I don't think it matters how it is soldered or located on the board, as digital compass is always a differential process that requires calibration to identify and subtract magnetism from artificial sources (How To Calibrate A Digital Compass?)

    So it makes sense that even more in mobile devices, a calibration is needed before use to "guess" which one is truly the magnetic North and not just interference. I found this design app note ww1.microchip.com/downloads/en/AppNotes/00996a.pdf and from it the Reference AN214 from Honeywell International Websites | Magnetic Sensor Products where Calibration sections may explain the requested 8 figure for calibrating the device.

    Interesting reading all around!
    BuzzStarField likes this.
    11-11-11 12:11 PM
  5. peter9477's Avatar
    Why not use your phone compass to compare?
    At the time, I hadn't thought of it. ;-) I've had the 9900 for such a short time I'm not used to it yet. I did, however, think of trying out my old HTC Dream and got some readings with it. Then I noticed the 9900 sitting there and went "duh, it has a compass too!". :-)

    Attached is a pic of the north-pointing vectors for the Dream, the 9900, and PB1, with the first two showing separate "magnetic north" and "true north" since, apparently, they both encode a model of the earth's magnetic field patterns and can take into account my GPS location to adjust for the local field direction.

    This is consistent with my eye-balled measurement that I'm about 45 degrees off to the east on the PlayBook. (The Dream and the 9900 differ by 5-15 degrees, but they both show a reasonably consistent shift between mag. and true north.)
    11-11-11 12:34 PM
  6. BuzzStarField's Avatar
    Do we have any consensus yet on whether "north" as shown by the Azimuth reading (around 0 or 360 degrees) is anywhere near magnetic north for anyone here? For me, it appears to be consistently about 45 degrees clockwise from where it should be. I haven't found a real compass to compare with yet, but I did check the local declination (should be like 15 degrees counterclockwise from true north) and compared where I'm facing with the Google Maps satellite view of my house, and the Azimuth reading definitely has me facing well east of true north, not west.
    i'm getting good enough readings from my device to allow me to proceed with prototyping and testing AR features in What's up. At this point I still think it would be wise to wait for the official API.

    I could be induced to change my mind, but only if if I got lots of reliable evidence that a simplistic rotation would suffice as "calibration". To that end. I will add a field on the magtest app so that you can enter a calibration factor. If you are sufficiently skilled, Polaris would provide a better reference point than trying to use maps or a hand-held compass to find true north. Can anyone tell me if there is a decent sky map for the PlayBook?
    Last edited by BuzzStarField; 11-11-11 at 04:52 PM.
    Mikey_T likes this.
    11-11-11 04:48 PM
  7. peter9477's Avatar
    I was trying to get some of the IRC guys to test it out and provide data. Only one reporting in so far (JohnP) but he went outside away from metal filing cabinets at work and did a full turn, with multiple readings and screenshots. He said every one was bang-on, with 2.0.
    BuzzStarField likes this.
    11-11-11 04:53 PM
  8. Rob Robertson's Avatar
    I've also been following this thread since day one (even though 75% of it might as well have been Greek for me). Just wanted to say that you guys are wizards. Keep it up!
    Mikey_T likes this.
    11-15-11 12:44 PM
  9. BuzzStarField's Avatar
    I've also been following this thread since day one (even though 75% of it might as well have been Greek for me). Just wanted to say that you guys are wizards. Keep it up!
    I hope that everyone is getting some insight into the effort that goes into making these "tiny" apps that cost the consumer a mere buck or two.

    I've done a more detailed analysis using my device and have tabulated the results so you can see the type of info I need in order to assess whether our method can be used in a gold version of my app.

    Note that the largest anomalies are toward the west and north whereas very little correction is needed for the southeast quandrant. This is a bit of a disappointment - I had expected a more evenly distributed pattern Therefore, I would conclude that raw numbers derived from the source file are uncorrected for both magnetic declination and also for local anomolies caused by the device itself.

    Calibration will involve a more nuanced approach than just a simple rotational adjustment that takes declination into account. I still hope that I can be proven wrong wrong, but I think it would be difficult to build a user-friendly calibration process that would not result in a flood of questions and complaints from my user-base. The user interface for the calibration would be too cumbersome for the average user so it looks like a public offering will have to wait until the official release of OS2 in February (or whenever).

    At the very least, I would need lots of detailed data from lots of devices so that I could do the job right. Here is an example of what I need:

    Code:
    
    True azimuth      Reported Az      Variation  
        0  (N)             20             20       
        45 (NE)              55            10              
        90 (E)              90             0
       135 (SE)             135           0
       180 (S)            180              0
       225 (SW)            238            13
       270 (W)             305              25 
       315 (NW)            345            25
    Method: I determined true azimuths using Polaris. Pointing the buttons of the device directly at Polaris gave a reading of 20 deg, turning the device around 180 deg (in the opposite direction) gave a reading of 180 degrees. Pointing the device due east gave a reading of 90 while pointing due west yielded 305 degrees -- and so on.

    As an experiment, I made a mod to the MagTest app so that values in the above table are interpolated and then applied to the raw azimuth values. The result is excellent and will provide really good data for testing my app in a realistic setting.

    As peter9477 says: "Any data's useful still... thank you!".
    11-16-11 08:24 AM
  10. marksasongko's Avatar
    I hope that everyone is getting some insight into the effort that goes into making these "tiny" apps that cost the consumer a mere buck or two.

    I've done a more detailed analysis using my device and have tabulated the results so you can see the type of info I need in order to assess whether our method can be used in a gold version of my app.

    Note that the largest anomalies are toward the west and north whereas very little correction is needed for the southeast quandrant. This is a bit of a disappointment - I had expected a more evenly distributed pattern Therefore, I would conclude that raw numbers derived from the source file are uncorrected for both magnetic declination and also for local anomolies caused by the device itself.

    Calibration will involve a more nuanced approach than just a simple rotational adjustment that takes declination into account. I still hope that I can be proven wrong wrong, but I think it would be difficult to build a user-friendly calibration process that would not result in a flood of questions and complaints from my user-base. The user interface for the calibration would be too cumbersome for the average user so it looks like a public offering will have to wait until the official release of OS2 in February (or whenever).

    At the very least, I would need lots of detailed data from lots of devices so that I could do the job right. Here is an example of what I need:

    Code:
    
    True azimuth      Reported Az      Variation  
        0  (N)             20             20       
        45 (NE)              55            10              
        90 (E)              90             0
       135 (SE)             135           0
       180 (S)            180              0
       225 (SW)            238            13
       270 (W)             305              25 
       315 (NW)            345            25
    Method: I determined true azimuths using Polaris. Pointing the buttons of the device directly at Polaris gave a reading of 20 deg, turning the device around 180 deg (in the opposite direction) gave a reading of 180 degrees. Pointing the device due east gave a reading of 90 while pointing due west yielded 305 degrees -- and so on.

    As an experiment, I made a mod to the MagTest app so that values in the above table are interpolated and then applied to the raw azimuth values. The result is excellent and will provide really good data for testing my app in a realistic setting.

    As peter9477 says: "Any data's useful still... thank you!".
    hey buzz, I googled around and found this.. hope it helps

    imu - Magnetometer
    11-16-11 09:06 AM
  11. BuzzStarField's Avatar
    hey buzz, I googled around and found this.. hope it helps

    imu - Magnetometer
    Thanks for this. Yesterday I did a lot of Google searches myself and found this piece and a lot of other stuff. I am now armed with all the math necessary to implement calibration, if I choose to do it. I have also downloaded some nifty math routines for applying declination corrections to the data.

    I really enjoy working on things like this but I have a gut feeling that I should be spending my valuable time on other stuff. I am certain that RIM has already done (or should have done) all of this work and that it will be included in the NDK 2.0. I should be able to implement it with just a few lines of code.

    Trouble is that the functionality won't be available to you until OS2 arrives in February at the earliest. But given the complexity of a properly implemented do-it-myself solution, a realistic timeline for development and testing would take me well beyond that date. So I wouldn't gain anything by taking this route.

    I think that this whole thing is a fine example of why it has been, and continues to be, so hard for developers like me to make decent apps for the various BB platforms. I hope that the move to BBX will eventually make things easier but you'll have to forgive me for being a little bit skeptical.

    I think that I am speaking on behalf of all PB developers when I say that I hope that you will continue to support our efforts in non-monetary ways. Reviews in App World are always nice to get as are comments on our Facebook pages.
    11-16-11 10:13 AM
  12. BuzzStarField's Avatar
    I think there might be a name for my addiction to coding - am I a codaholic? I said that I wouldn't work on MagTest any more and that I would get back to work on other important and very neglected stuff. Well, I failed miserably - I just couldn't put the job away...

    So what I have to offer is a new (and greatly improved) version that includes an almost workable calibration method and also a way to automatically apply magnetic declination to the values returned by the chip. The result is a remarkably accurate compass - at least on my PlayBook.

    I would really appreciate it if some of you would install the attached bar file and let me know how it works on your devices. Please refer to the README file for further information.
    11-21-11 04:01 PM
  13. Mikey_T's Avatar
    Buzz if you've got this working not bad why not submit a simple magnetic compass app to appworld? I'd pay $.99 for that right now to help pay for all your work on the issue

    Plus not everyone is going to download your star map (cool as it is!), but who doesn't want a magnetic compass ??
    Last edited by Mikey_T; 11-21-11 at 05:43 PM.
    11-21-11 05:28 PM
  14. BuzzStarField's Avatar
    Buzz if you've got this working not bad why not submit a simple magnetic compass app to appworld? I'd pay $.99 for that right now.
    If five or six people tell me the test app is working just great, I may consider it. I wouldn't feel right about charging for an app that is only of beta quality and is difficult to use. Also, the graphics would have to be awesome in order to justify charging for a simple magnetic compass. Sometimes "simple" is not so simple when it comes to making an app presentable.

    On the other hand, I notice that Compass Pro is featured this week and is in the top 5 purchased apps again. It's sort of difficult to understand why What's up is not doing better seeing that I'm selling it for for the same price as a simple non-magnetic compass.

    Such are the mysteries of App World pricing strategies.
    11-21-11 05:54 PM
  15. mister_turtle's Avatar
    As far as I can tell, it is working ok.
    BuzzStarField likes this.
    11-21-11 06:12 PM
  16. BuzzStarField's Avatar
    As far as I can tell, it is working ok.
    It looks like you may have used the preset longitude and latitude to set the declination. Unless you live in a place with identical declination as my home town (Toronto). Did you try using GPS to set the coordinates?
    11-21-11 06:19 PM
  17. mister_turtle's Avatar
    Ok. Here's another screen capture after I turned the GPS on.
    Last edited by mister_turtle; 11-25-11 at 06:38 PM.
    11-21-11 06:32 PM
  18. BuzzStarField's Avatar
    Ok. Here's another screen capture after I turned the GPS on.
    Okay, looking good. Thanks for your help.
    11-21-11 06:40 PM
  19. FF22's Avatar
    Okay, rather than look nuts on the front porch I'm doing upstairs. But what kind of movements do I have to make initially? Me turning? The playbook flat (horz) but turning (as if on a table but spinning)? Or tumbling, face up, face down and in which axis?

    I of course can only guess which way my house is really oriented.

    But be that as it may, it seemed to get most orientations but not NE. From E it would go north even though I was about midpoint. And then N and then NW but back to NE and it would again show E or N.



    Again, I may not have calibrated it right.
    11-21-11 08:22 PM
  20. BuzzStarField's Avatar

    I of course can only guess which way my house is really oriented.

    But be that as it may, it seemed to get most orientations but not NE. From E it would go north even though I was about midpoint. And then N and then NW but back to NE and it would again show E or N.

    Again, I may not have calibrated it right.
    You just have to rotate the device around all three axes. If the numbers in the calibration ellipsoid stop adjusting, then you are done. mister_turtle posted a screen shot of what they should look like. The figures in the 3 rows should be in the same ballpark although not necessarily as close as mister_turtle's numbers are.

    If you happen to have a phone with a compass, you can use it to verify the azimuth. Or you can do what I do and use What's up to locate a bright star and point MagTest at it to see if it points to the same azimuth that is indicated in the astronomy app.

    Even if you are in doubt, by all means post a screenshot so I can see what it looks like.

    And thanks so much for helping me out.


    EDIT: Do not pay too much attention to the cardinal points (north, southwest etc) because these are very rough indicators. I am most interested in the "true azimuth" which is supposed to be the fully calibrated and corrected heading.

    PS: Another worthwhile test would be to calibrate your PB and point it at an object and note the true azimuth. Then tap the ""reset calibration" button and re-calibrate the PB once more. If the true azimuth reading is the same as before, this is very good news (and proof that it is working consistently).
    Last edited by BuzzStarField; 11-21-11 at 08:50 PM.
    11-21-11 08:40 PM
  21. Mikey_T's Avatar
    On the other hand, I notice that Compass Pro is featured this week and is in the top 5 purchased apps again. It's sort of difficult to understand why What's up is not doing better seeing that I'm selling it for for the same price as a simple non-magnetic compass.

    Such are the mysteries of App World pricing strategies.
    Like I said - everyone wants a compass! I bet a lot of people who download Compass Pro don't realize it's GPS only. A nice looking Magnetic compass app would sell like hot-cakes.
    11-22-11 08:34 AM
  22. pinkert11's Avatar
    I downloaded, and love the icon. I will give it a go at lunch as I am trapped in the box right now.
    11-22-11 10:44 AM
  23. BuzzStarField's Avatar
    I downloaded, and love the icon. I will give it a go at lunch as I am trapped in the box right now.
    My designer has me seeing red lately. If he doesn't do a better job of designing a compass rose for my next app, he's fired!

    Here is the definitive way to calibrate MagTest.
    1. hit the "reset calibration" button
    2. face in the general direction of north (use raw azimuth as a guide)
    3. with the screen facing up, rotate the device 360 degrees about the centre of the screen. It's probably not necessary but just to be safe, turn the device over (screen down) and repeat the 360 degrees rotation.
    4. grasp the device in landscape orientation and rotate 360 degrees about the long axis of the device.
    5. grasp the device in portrait orientation and rotate 360 degrees about the short axis of the device.
    6. turn to face the east and repeat steps 4 and 5.
    7. if you have not already done so, input your latitude and latitude (using GPS if you can) and then calculate and apply the magnetic declination for your location.
    Last edited by BuzzStarField; 11-22-11 at 11:22 AM.
    11-22-11 11:15 AM
  24. cmcichon's Avatar
    @Buzz -

    Saw this posted today and when I read the first line, I immediately thought of your efforts here. Hopefully this will help you out!

    Want to stay ahead of the game? Try out the new version of the Native SDK for the BlackBerry PlayBook �BlackBerry Developer's Blog
    BuzzStarField likes this.
    11-22-11 12:58 PM
  25. BuzzStarField's Avatar
    @Buzz -

    Saw this posted today and when I read the first line, I immediately thought of your efforts here. Hopefully this will help you out!

    Want to stay ahead of the game? Try out the new version of the Native SDK for the BlackBerry PlayBook �BlackBerry Developer's Blog
    Downloading now and will get to work on an ActionScript Native extension right away.

    But since since Apps using the new orientation API won't be available in App World until OS2 is available next year, I will continue to work on MagTest. Might be able to release an app or two using the a real compass before OS2.
    Mikey_T likes this.
    11-22-11 01:35 PM
172 ... 4567
LINK TO POST COPIED TO CLIPBOARD