Search Results - MEL PICBASIC Forum


Search:

Type: Posts; User: richard; Keyword(s):

Search: Search took 0.01 seconds.

  1. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    not sure how effective that will be , it would probably need to be calibrated every time you relocate it (or maybe even rotate it) . don't forget its own orientation is its only reference point . ...
  2. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    I must add , the vector does not point north . it indicates the [ direction and magnitude ] of the magnet field relative to the device orientation.
    the link I posted is for accelerometers but...
  3. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    if the device is held so that the xy plane is perfectly!!!! level then the xy angle is magnetic north (sort of). if the device is tilted then the xy angle needs to compensated for that tilt . the...
  4. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    maybe this will help

    http://www.starlino.com/imu_guide.html
  5. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    turns out that the premise of using this chip alone as a compass is basically flawed. it can't do its own tilt compensation because the earths magnetic field is not necessarily parallel to the earth...
  6. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    I bought one to play with

    after looking at the raw data I came up with this , works ok if device is held level , tilt compensation is elusive at this stage



    ...
  7. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    from the pbp manual
  8. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    your prg as provided does nothing with the "Z" reading

    the term you have designated as azimuth is derived from azimuth = x ATN -y ie an " x " and a " y " reading , these readings are a...
  9. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    looks like you are converting azimuth to degrees twice
    once here

    'Calculate Azimuth

    GOSUB GetAzimuth

    'Calculated Heading in Degrees

    brads = azimuth 'get angle
  10. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    your degree calc is incorrect


    degr = brads*360/256 this will overflow a word var causing errors


    degr = brads */ 360

    is the better way
  11. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    to get the azimuth result in degrees

    azimuth = ( x ATN -y) */ 360
  12. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    this should fix the i2c errors

    '****************************************************************
    '* Name : COMPASS_818.BAS *
    '* Author : [select...
  13. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    the i2c read uses the word var readingx the byte var x is the "scaled" result from that reading

    if you can't work that out post your code so we can see what your doing {in code tags }
  14. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    you can do a similar thing with y axis too ,
    my routine will give the same result as the scale offset method its just much quicker and simpler.

    don't forget the ATN result is in radians so deg =...
  15. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    thanks for confirming that henrik ,saves me the trouble .
    I worked that out with the windows7 calculator (in programmer mode) it makes it easy to visualise some solutions , another feature sadly...
  16. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    it works on paper , i'm curious to compile it and see what happens , i'm feeling a cast from word to byte and only a 4 bit r-shift might allow the loss of the sign bit to be ignorable . if it works...
  17. Replies
    57
    Views
    84,451

    Re: HMC5883L Magnetometer chip Possibilities.

    am I wrong or would right shifting the reading 4 give the same answer without all the math
    x var byte
    reading var word
    x= reading>>4
Results 1 to 17 of 17