Accelerometer returns 0's

wjcroftwjcroft Mount Shasta, CA
This discussion was created from comments split from: Accelerometer / data / rational.

Comments

  • edited May 2015
    Hello Chip. 

    I was wondering is there a need to set some flag in the firmware or send a command for enabling the accelerometer functionality? 
    As far as I could tell from the firmware code, the accelerometer is suppose to be on by default. However, the data in the log that followed the EEG data is zero. Any idea?

    Here is some data

    %First Column = SampleIndex
    %Other Columns = EEG data in microvolts followed by Accel Data (in G) interleaved with Aux Data
    0, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    1, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    2, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    3, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    4, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    5, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    6, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    7, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    8, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    9, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    10, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    11, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    12, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    13, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    14, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    15, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    16, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    17, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    18, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    19, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    20, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    21, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    22, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    23, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    24, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    25, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    26, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00
    27, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, -187500.02, 0.00, 0.00, 0.00



  • biomurphbiomurph Brooklyn, NY
    Mike,

    There is a boolean variable that controls if the accelerometer is being used in the OpenBCI library.
    It's called 'useAccel'
    it is addressed int the 8bit code in the setup() and in the 32bit code inside a function called startFromScratch()
    OBCI.useAccel = true;

    Please check to see that this is correct in your code.

    Also, when you run the GUI at the beginning the OpenBCI Board sends out all of the register settings for the ADS IC and the Accelerometer. You can check this also with any terminal (Arduino IDE and mpide both have a terminal window) make sure that the baud rate is set to 115200, and after the terminal opens sent a '?' with no line ending. You will see the register settings scroll down the terminal screen. The accelerometer registers should look like below. If you don't see these values, there may be an issue with your accelerometer.

    LIS3DH Registers:
    0x07 0
    0x08 0
    0x09 0
    0x0A 0
    0x0B 0
    0x0C 0
    0x0D 0
    0x0E 0
    0x0F 33

    0x1F 0
    0x20 8
    0x21 0
    0x22 0
    0x23 18
    0x24 0
    0x25 0
    0x26 0
    0x27 0
    0x28 0
    0x29 0
    0x2A 0
    0x2B 0
    0x2C 0
    0x2D 0
    0x2E 0
    0x2F 20
    0x30 0
    0x31 0
    0x32 0
    0x33 0

    0x38 0
    0x39 0
    0x3A 0
    0x3B 0
    0x3C 0
    0x3D 0
    $$$
  • edited May 2015
    Hi, 

    1. The OpenBCI device is still with its original firmware, I didn't update the code, so I suppose this flag is set to true ?
    2. LIS3DH Registers:
    0x07 0
    0x08 0
    0x09 0
    0x0A 0
    0x0B 0
    0x0C 0
    0x0D 0
    0x0E 0
    0x0F 33

    0x1F 0
    0x20 8
    0x21 0
    0x22 0
    0x23 18
    0x24 0
    0x25 0
    0x26 0
    0x27 0
    0x28 0
    0x29 0
    0x2A 0
    0x2B 0
    0x2C 0
    0x2D 0
    0x2E 0
    0x2F 20
    0x30 0
    0x31 0
    0x32 0
    0x33 0

    0x38 0
    0x39 0
    0x3A 0
    0x3B 0
    0x3C 0
    0x3D 0
    $$$

    3. I get strange values now( from OpenBCI log)
    0, -187500.02, -187500.02, -187500.02, -59931.24, -187500.02, -173693.09, -121622.14, -187500.02, 0.00, 0.02, 0.01
    1, -187500.02, -187500.02, -187500.02, -59926.16, -187500.02, -173689.52, -121616.58, -187500.02, 0.00, 0.00, 0.00
    2, -187500.02, -187500.02, -187500.02, -59920.75, -187500.02, -173685.66, -121610.79, -187500.02, 0.00, 0.00, 0.00
    3, -187500.02, -187500.02, -187500.02, -59917.40, -187500.02, -173683.69, -121606.83, -187500.02, 0.00, 0.00, 0.00
    4, -187500.02, -187500.02, -187500.02, -59914.16, -187500.02, -173681.86, -121603.12, -187500.02, 0.00, 0.00, 0.00
    5, -187500.02, -187500.02, -187500.02, -59912.06, -187500.02, -173681.20, -121600.51, -187500.02, 0.00, 0.00, 0.00
    6, -187500.02, -187500.02, -187500.02, -59907.03, -187500.02, -173677.50, -121594.85, -187500.02, 0.01, 0.02, 0.01
    7, -187500.02, -187500.02, -187500.02, -59900.82, -187500.02, -173672.64, -121587.92, -187500.02, 0.00, 0.00, 0.00
    8, -187500.02, -187500.02, -187500.02, -59897.78, -187500.02, -173670.83, -121584.16, -187500.02, 0.00, 0.00, 0.00
    9, -187500.02, -187500.02, -187500.02, -59899.32, -187500.02, -173673.81, -121585.28, -187500.02, 0.00, 0.00, 0.00
    10, -187500.02, -187500.02, -187500.02, -59895.61, -187500.02, -173671.63, -121581.05, -187500.02, 0.00, 0.00, 0.00
    11, -187500.02, -187500.02, -187500.02, -59889.57, -187500.02, -173667.14, -121574.69, -187500.02, 0.00, 0.00, 0.00
    12, -187500.02, -187500.02, -187500.02, -59884.43, -187500.02, -173663.58, -121569.21, -187500.02, 0.00, 0.00, 0.00
    13, -187500.02, -187500.02, -187500.02, -59882.36, -187500.02, -173662.92, -121566.59, -187500.02, 0.00, 0.00, 0.00
    14, -187500.02, -187500.02, -187500.02, -59880.68, -187500.02, -173662.67, -121564.48, -187500.02, 0.00, 0.00, 0.00
    15, -187500.02, -187500.02, -187500.02, -59874.82, -187500.02, -173658.19, -121557.99, -187500.02, 0.00, 0.00, 0.00
    16, -187500.02, -187500.02, -187500.02, -59869.05, -187500.02, -173653.88, -121551.73, -187500.02, 0.01, 0.01, 0.02
    17, -187500.02, -187500.02, -187500.02, -59865.61, -187500.02, -173651.75, -121547.66, -187500.02, 0.00, 0.00, 0.00
    18, -187500.02, -187500.02, -187500.02, -59865.08, -187500.02, -173652.63, -121546.57, -187500.02, 0.00, 0.00, 0.00
    19, -187500.02, -187500.02, -187500.02, -59861.41, -187500.02, -173650.30, -121542.41, -187500.02, 0.00, 0.00, 0.00
    20, -187500.02, -187500.02, -187500.02, -59855.29, -187500.02, -173645.75, -121535.88, -187500.02, 0.00, 0.00, 0.00
    21, -187500.02, -187500.02, -187500.02, -59850.86, -187500.02, -173642.83, -121531.05, -187500.02, 0.00, 0.00, 0.00
    22, -187500.02, -187500.02, -187500.02, -59847.96, -187500.02, -173641.31, -121527.59, -187500.02, 0.00, 0.00, 0.00
    23, -187500.02, -187500.02, -187500.02, -59842.73, -187500.02, -173637.55, -121521.83, -187500.02, 0.00, 0.00, 0.00
    24, -187500.02, -187500.02, -187500.02, -59835.98, -187500.02, -173632.02, -121514.41, -187500.02, 0.00, 0.00, 0.00
    25, -187500.02, -187500.02, -187500.02, -59834.32, -187500.02, -173631.66, -121512.15, -187500.02, 0.00, 0.00, 0.00
    26, -187500.02, -187500.02, -187500.02, -59832.58, -187500.02, -173631.42, -121510.05, -187500.02, 0.00, 0.02, 0.01
    27
  • biomurphbiomurph Brooklyn, NY
    Hi Mike,

    Well, that looks like the data acquisition is happening.
    The accelerometer sample rate appears to be 25Hz (every 10 ADS samples, there is data)
    It also seems like the values are off. 
    OpenBCI Processing GUI calculates Gs based on the raw accelerometer value.

    The register settings do look legit. 
    Which board are you using, 8bit or 32bit?
  • I'm using 8bit board. I just downloaded to the board a fresh firmware and made sure that  "OBCI.useAccel" is set to true. 
    I get the same results. Very strange, the accelerometer is not sensitive at all to movements. I noticed that chip checked it awhile ago, I wonder if someone here checked/verified it recently?


  • edited May 2015
    Hello, 
    I'm using 8bit OpenBCI and I'm trying to make sense of the accelerometer data that I receive. I have been struggling with it for several days now in vain. 
    I'd like to know if one of you could please confirm that OpenBCI's accelerometer works as expected? It would be much appreciated if one of you could check the log when OpenBCI board is fixed on the table without any movement and report on the values that are recorded in your OpenBCI's log.
    I get really strange data even if the accelerometer is fixed on the table without any movements at all. I did see chip post regarding this sensor but I get very different results than what he has described.

    Thanks, 
    Mike


  • wjcroftwjcroft Mount Shasta, CA
    @Mike , hi. I made a new thread with all the "accelerometer returns 0's" posts. Joel @biomurph will probably post some more comments here.
  • biomurphbiomurph Brooklyn, NY
    here is an example of a saved data file that contains legit accelerometer data

    %OpenBCI Raw EEG Data
    %
    %Sample Rate = 250.0 Hz
    %First Column = SampleIndex
    %Other Columns = EEG data in microvolts followed by Accel Data (in G) interleaved with Aux Data
    0, -6574.03, 0.00, -2912.59, 0.00, 12290.02, 0.00, -157506.41, 0.00, 0.02, -0.01, 0.48
    1, -6574.18, 0.00, -2912.75, 0.00, 12291.09, 0.00, -157506.08, 0.00, 0.00, 0.00, 0.00
    2, -6572.98, 0.00, -2913.26, 0.00, 12290.24, 0.00, -157504.16, 0.00, 0.05, -0.01, 0.97
    3, -6573.38, 0.00, -2913.24, 0.00, 12291.92, 0.00, -157503.95, 0.00, 0.00, 0.00, 0.00
    4, -6573.63, 0.00, -2913.08, 0.00, 12293.88, 0.00, -157503.86, 0.00, 0.00, 0.00, 0.00
    5, -6574.88, 0.00, -2913.28, 0.00, 12296.21, 0.00, -157504.83, 0.00, 0.00, 0.00, 0.00
    6, -6574.25, 0.00, -2913.89, 0.00, 12296.01, 0.00, -157503.50, 0.00, 0.00, 0.00, 0.00
    7, -6574.16, 0.00, -2913.75, 0.00, 12297.06, 0.00, -157502.88, 0.00, 0.05, -0.01, 0.98
    8, -6574.45, 0.00, -2912.95, 0.00, 12299.29, 0.00, -157502.88, 0.00, 0.00, 0.00, 0.00
    9, -6571.73, 0.00, -2912.70, 0.00, 12297.79, 0.00, -157499.69, 0.00, 0.00, 0.00, 0.00
    10, -6572.15, 0.00, -2913.19, 0.00, 12298.76, 0.00, -157499.53, 0.00, 0.00, 0.00, 0.00
    11, -6574.45, 0.00, -2913.53, 0.00, 12301.91, 0.00, -157501.31, 0.00, 0.00, 0.00, 0.00
    12, -6574.52, 0.00, -2913.35, 0.00, 12303.85, 0.00, -157501.14, 0.00, 0.04, -0.01, 0.98


    Note that EEG channels 2, 4, 6, 8 are turned OFF.
    Accelerometer values are the last three comma separated numbers. X, Y, Z.
    This was recorded with the board sitting flat on the table, so the 0.98 in the Z direction shows the force of gravity.

    @Mike, I can see that your accelerometer is showing that it is alive and set correctly by the register map, but your returned values are not looking good. I will run another test here. I think I have an older version of the GUI in my computer.
  • Is it with 8 bit or 32bit board? I will give another run and see what are the results. This is so strange!
  • Btw, what the sampling rate that you used? It looks like it is higher than 25 Hz?
  • biomurphbiomurph Brooklyn, NY
    it looks like I'm sampling at 50Hz in the data shown above.
    I used an 8bit board to generate that data.

  • Could that be the reason for the problem that I'm having?
  • biomurphbiomurph Brooklyn, NY
    edited May 2015
    I don't think so.
    Available sample rates are (in Hz)
    1, 10, 25, 50, 100, 200, 400, 1250, 1600, 5000
    suppose it would be easy to check a different sample rate.

    Find the following code in Arduino: 

    case 'b':
            if(use_SD) stampSD(ACTIVATE);
            OBCI.enable_accel(RATE_50HZ);      // fire up the accelerometer
            startRunning(OUTPUT_BINARY);       // turn on the fire hose
            break;

    Or use any of the defined sample rates below

    ALSO NOTE:
    I had to make a bug fix to the OpenBCI_8 Arduino library, so that you can change the sample rate go to the github and download it
    and then reprogram your OpenBCI board


    RATE_1HZ 0x10  //(b00010000) // 1Hz sample rate in normal or low-power mode
    RATE_10HZ 0x20  //(b00100000) // 10Hz sample rate in normal or low-power mode
    RATE_25HZ 0x30  //(b00110000) // 25Hz sample rate in normal or low-power mode
    RATE_50HZ 0x40  //(b01000000) // 50Hz sample rate in normal or low-power mode
    RATE_100HZ 0x50  //(b01010000) // 100Hz sample rate in normal or low-power mode
    RATE_200HZ 0x60  //(b01100000) // 200Hz sample rate in normal or low-power mode
    RATE_400HZ 0x70  //(b01110000) // 400Hz sample rate in normal or low-power mode
    RATE_1600HZ_LP        0x80  //(b10000000) // 1600Hz sample rate in low-power mode
    RATE_1250HZ_N 0x90  //(b10010000) // 1250Hz sample rate in normal mode
    RATE_5000HZ_LP        0x90  //(b10010000) // 5000Hz sample rate in low-power mode
Sign In or Register to comment.