Jump to content
I2Cdevlib Forums

Leaderboard

Popular Content

Showing content with the highest reputation on 02/16/2019 in all areas

  1. This might sound like a very silly question, so I apologize if this is something very simple but just cannot get my head around it. I am trying to understand what the data provides in terms of real time information, for example, the MPU-6050:Gyroscope - is a 16 bit data register with a range from (0 <-> 65535)There is a selection of ranges (±250, ±500, ±1000, and ±2000°/sec)If the range is set to ±250°/sec, is the reading 360/65535 = 0.0054 resolution?What does °/sec mean, if the sensor does not move and reads zero and then turned quickly does it mean it will be reading the angle at the set range? For example, if the range was set to ±2000°/sec and it was moved 200° would the read move from 0 to (2/65535 *200) and keep sending this value once the sensor stopped moving?Accelerometer - is a 16 bit data register with a range from (0 <-> 65535)There is a selection of ranges (±2g, ±4g, ±8g and ±16g)If the sensor is not moving, completely flat the reading will be 0?If the sensor is shocked at 2g will the max reading be 65535 (if set of 2g, with a resolution of 2/65535)If the sensor is shocked at 16g will the max reading be 65535 (if set of 16g, with a resolution of 16/65535))
    1 point
  2. Dear luisrodenas, May I know what is the motivation for the division by 8 and 4 in the calibration function? ax_offset=-mean_ax/8; ay_offset=-mean_ay/8; az_offset=(16384-mean_az)/8; gx_offset=-mean_gx/4; gy_offset=-mean_gy/4; gz_offset=-mean_gz/4; Moreover in calibration function, unlike accelerometer offset value why the (gyro offset - mean gyro value) is divided by 2 instead of 1 which is giro_deadzone? if (abs(mean_gx)<=giro_deadzone) ready++; else gx_offset=gx_offset-mean_gx/(giro_deadzone+1); if (abs(mean_gy)<=giro_deadzone) ready++; else gy_offset=gy_offset-mean_gy/(giro_deadzone+1); if (abs(mean_gz)<=giro_deadzone) ready++; else gz_offset=gz_offset-mean_gz/(giro_deadzone+1); I would be really thankful if I get the reasons for using different divisor value. Thank you.
    1 point
  3. Dear luisrodenas, May I know what is the motivation for the division by 8 and 4 in the calibration function? ax_offset=-mean_ax/8; ay_offset=-mean_ay/8; az_offset=(16384-mean_az)/8; gx_offset=-mean_gx/4; gy_offset=-mean_gy/4; gz_offset=-mean_gz/4; Moreover in calibration function, unlike accelerometer offset value why the (gyro offset - mean gyro value) is divided by 2 instead of 1 which is giro_deadzone? if (abs(mean_gx)<=giro_deadzone) ready++; else gx_offset=gx_offset-mean_gx/(giro_deadzone+1); if (abs(mean_gy)<=giro_deadzone) ready++; else gy_offset=gy_offset-mean_gy/(giro_deadzone+1); if (abs(mean_gz)<=giro_deadzone) ready++; else gz_offset=gz_offset-mean_gz/(giro_deadzone+1); I would be really thankful if I get the reasons of using different divisor value. Thank you.
    1 point
  4. Hi guys, First of all, many thanks to luisrodenas for sharing this work! And to all who contributed on the thread along this years. Studying the code, I have stumbled on a doubt that many here have posted without a definitive answer, which was asked also in many other sources that refers to this calibration code. What is the motivation for the division by 8 and 4 in the calibration function? ax_offset=-mean_ax/8; ay_offset=-mean_ay/8; az_offset=(16384-mean_az)/8; gx_offset=-mean_gx/4; gy_offset=-mean_gy/4; gz_offset=-mean_gz/4; I have searched a lot but couldn't figure it out. Was it based on trial and error? Also, when we use the setOffset functions, what those really do in the sensor? accelgyro.setXAccelOffset(ax_offset); accelgyro.setYAccelOffset(ay_offset); accelgyro.setZAccelOffset(az_offset); accelgyro.setXGyroOffset(gx_offset); accelgyro.setYGyroOffset(gy_offset); accelgyro.setZGyroOffset(gz_offset); For example, if I took the ax_offset, ay_offset, az_offset, gx_offset, gy_offset, and gz_offset values, and subtract from raw data taken from the sensor (without any offset configuration), would that have the same effect? I am looking forward to experiment it myself, but I still don't have access to the resources yet. Many thanks
    1 point
  5. Just wondering if anyone knows why we are diviing by 8 and 4 in the cailbration function void calibration(){ ax_offset=-mean_ax/8; ay_offset=-mean_ay/8; az_offset=(16384-mean_az)/8; ???
    1 point
  6. Why are we dividing by 8 and 4 before setting the offsets? Where is that documented? Or is just a step to prevent wide changes in the offset and help the optimization converge?
    1 point
×
×
  • Create New...