kriswiner / EM7180_SENtral_sensor_hub

(Affordable) Ultimate Sensor Fusion Solution
https://www.tindie.com/products/onehorse/ultimate-sensor-fusion-solution/
96 stars 37 forks source link

EM7180+BMP280, Rotation along one axis results in significant rotation along other 2 axes as well. #5

Open mohit5037 opened 8 years ago

mohit5037 commented 8 years ago

Hi Kris,

I bought this EM7180 a few days back. I read in its datasheet that you don't need to calibrate magneto in it and I have uploaded your code which has pre-written function for calibration of accelero and gyro but still rotation along any of the axes causes significant rotation along other axes.

I don't know what to send you as a proof but if you haven't seen this before I can send you the video of this process.

I am taking quaternions from hardware (Sentral) and then rendering a 3-D object in matlab. I am displaying quaternions as well as angles in matlab.

Pls see the below video. https://youtu.be/1iKlh5R45As

In this video I am making pitch to go from 0 to 90 but as you can see yaw and roll along changes very significantly.

Here are the logs: Scanning... I2C device found at address 0x28 ! done

EM7180 ROM Version: 0xE69 Should be: 0xE609 EM7180 RAM Version: 0x17435 EM7180 ProductID: 0x80 Should be: 0x80 EM7180 RevisionID: 0x2 Should be: 0x02 A barometer is installed A temperature sensor is installed EEPROM detected on the sensor bus! EEPROM uploaded config file! EM7180 in initialized state! EEPROM upload successful! Beginning Parameter Adjustments Magnetometer Default Full Scale Range: +/-1000uT Accelerometer Default Full Scale Range: +/-4g Gyroscope Default Full Scale Range: +/-2000dps Magnetometer New Full Scale Range: +/-1000uT Accelerometer New Full Scale Range: +/-8g Gyroscope New Full Scale Range: +/-2000dps EM7180 run status = normal mode EM7180 new quaternion result EM7180 new mag result EM7180 new accel result EM7180 new gyro result EM7180 sensor status = 0 Actual MagRate = 100 Hz Actual AccelRate = 200 Hz Actual GyroRate = 200 Hz Actual BaroRate = 50 Hz quat 0.00 0.00 0.57 0.82 quat 0.00 0.00 0.57 0.82 quat 0.00 0.00 0.57 0.82 quat 0.00 0.00 0.57 0.82 quat 0.00 0.00 0.57 0.82 quat 0.00 0.00 0.57 0.82 quat 0.00 0.00 0.57 0.82

Please correct me if I am doing something wrong here.

kriswiner commented 8 years ago

The device has an auto calibration function but you have to wave it around in a figure eight pattern for it to work. Once it is calibrated you can save the calibration as warm start parameters on the on-board EEPROM. This sketch has the coding to do that written for the EM7180+MPU9250; you will have to modify your EM7180+BMX055 sketch accordingly.

https://github.com/kriswiner/EM7180_SENtral_sensor_hub/tree/master/WarmStart

mohit5037 commented 8 years ago

Hi Kris,

Thanks for the early response. I have EM7810 + MPU9250 + BMP280 sensor with me.

I tried running the code you sent above. Given the following params:

passThrough = false; warmStart = 0;

It does not stop for the magnetometer calibration for me to wave pattern eight. If I make passthrough = True then it stops for calibration but then I am not able to save those params in EEProm by entering 1 because you are reading that input inside of the first "if" block in loop function which belongs to passthrough = false;

kriswiner commented 8 years ago

Use the passthru = false (run in master mode, and move the magnetometer in a figure eight motion until the device is calibrated. The mag calibration is automatic; it doesn't wait for you to do anything it is calibrating all the time. Butif you wave it around to sample the response surface it can adjust the biases, etc. Once the mag reading is correct for your area, or the Madgwick and SENtral Euler angles are about the same and the heading changes by 90 degrees when the sensor is turned by ninety degrees you can press 1 to save the parameters in the warm start parameters in the EEPROM.

-----Original Message----- From: mohit5037 [mailto:notifications@github.com] Sent: March 8, 2016 10:03 PM To: kriswiner/EM7180_SENtral_sensor_hub Cc: Kris Winer Subject: Re: [EM7180_SENtral_sensor_hub] EM7180+BMP280, Rotation along one axis results in significant rotation along other 2 axes as well. (#5)

Hi Kris,

Thanks for the early response. I have EM7810 + MPU9250 + BMP280 sensor with me.

I tried running the code you sent above. Given the following params:

passThrough = false; warmStart = 0;

It does not stop for the magnetometer calibration for me to wave pattern eight. If I make passthrough = True then it stops for calibration but then I am not able to save those params in EEProm by entering 1 because you are reading that input inside of the first "if" block in loop function which belongs to passthrough = false;

Reply to this email directly or view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/5#issuecommen t-194128214 . https://github.com/notifications/beacon/AGY1qh3X2MQVI5df2hw1ke7Y2zoNaDwtks5 prmKLgaJpZM4HruZY.gif

mohit5037 commented 8 years ago

I had tried this earlier. Is there any particular method to wave the sensor in eight pattern which I should follow?

kriswiner commented 8 years ago

You just want to have the sensor sample as much of the response surface as you can. Shouldn't take more than a minute or so.

-----Original Message----- From: mohit5037 [mailto:notifications@github.com] Sent: March 8, 2016 11:26 PM To: kriswiner/EM7180_SENtral_sensor_hub Cc: Kris Winer Subject: Re: [EM7180_SENtral_sensor_hub] EM7180+BMP280, Rotation along one axis results in significant rotation along other 2 axes as well. (#5)

I had tried this earlier. Is there any particular method to wave the sensor in eight pattern which I should follow?

Reply to this email directly or view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/5#issuecommen t-194151413 . https://github.com/notifications/beacon/AGY1qld4ZK4Bk5pA7I5bZM5XmcvWd7pKks5 prnYlgaJpZM4HruZY.gif

mohit5037 commented 8 years ago

Hi Kris,

I did as you said. I am assuming that it keeps on calibrating the magnetometer in the background so I waved the device for a minute or so and kept on printing the WS_params array using this line of code:

 // Put the Sentral in pass-thru mode
  WS_PassThroughMode();

  // Fetch the WarmStart data from the M24512DFM I2C EEPROM
  readSenParams();

  // Take Sentral out of pass-thru mode and re-start algorithm
  WS_Resume();

Problem is that they don't seems to change at all. Is it because it is not calibrating in the background or there is some other reason.

Here is the video of the movement https://youtu.be/jPPG2EwqJsk

Here are the serial logs: WS_params_Logs.txt

kriswiner commented 8 years ago

The dynamic calibration occurs continuously and will eventualy iterate to a more or less stable calibration. The calibration parameters will continue to evolve slowly in response to changes in temperature and environment (entering a room with a strong or fluctuating local magnetic field). The asymptoting to a stable calibration will occur faster if you move the device in a figure eight motion for tens of seconds to sample the 3D response surface. Once the calibration is stable there is nothing more for the user to do; the device should give accurate absolute orientation.

The user can go through this procedure every time the device is powered on, or the user can store the calibration parameters using the in-board EEPROM such that every time the device is subsequently powered on after the initial calibration the device can retrieve the calibration parameters and return to the previous state of calibration automatically and at the start of the data stream.

In this sense, the USFS is a calibrate-once, use -forever device. The only reason to change the stored calibration would be if the environment changes substantially. Like if you calibrate it in California in the Summer and then take the device to Chile in the Winter. The average temperature and magnetic field strength of the two environments is quite different and the device would need to be calibrated again. It will calibrate itself eventually but will not start out calibrated upon each power on unless you go through the procedure of calibrating the device and storing the calibration parameters in the EEPROM.

If you calibrate the device and store the parameters in the EEPROM and the device stays in your local area there would be little need to recalibrate and re-store calibration parameters--ever.

I hope this explanation is clear.

jrsmiley commented 7 years ago

Hi Kris,

I'm having the same problem - rotation about a single axis resulted in measurement changes along all three axes. I was careful to place the sensor so that the center of the sensor (the center of the 9250) was at the center of rotation for my quad and that the edges were aligned. I also saw significant drift in yaw after rotations and 90 degree rotations rarely measured anything close to 90 degrees.

I tried doing the figure eight for about five minutes and the software vs hardware readings never converged. For a few minutes after calibration, I did manage to get yaw readings that differed by 90 after rotating the sensor 90 degrees with very little drift. Also, for those few minutes, rotation about one axis did not show up in the other two axes. However, after a few more minutes, the behavior returned to the pre-calibration behavior described in the first paragraph.

I took pains to do the calibration and measurement in an area relatively free of magnetic interference (my living room - where there are no electronic gadgets other than the laptop I was using to take the measurements). I'm not sure what I'm doing wrong.

Update: I bought a second one of these not long ago and swapped the old one for the new one. At first the new one worked fine after a brief calibration, but later started exhibiting the same bad behavior. I also tried swapping out the Teensy 3.6 for a 3.2 and moved everything to a new breadboard. I re-ran the same code and calibration as before with both sensors. No improvement.

The code I'm using is your EM7180_MPU9250_BMP280.ino. I tried the WM code, but ran into a problem where the sensor stopped updating (eventStatus = 0) after a cycle or two in the loop() code. I know the EM7180_MPU9250_BMP280.ino code won't save the WS parameters, but for now I just want to see if I can get the sensor to settle down. I let the EM7180_MPU9250_BMP280.ino code run an hour or so between tests to give the auto calibration time to work.

EinSoldiatGott commented 5 years ago

Hi Kris.

I'm also having the same issue, I fixed the board to a mechanism that can rotate only in one axis from 90° to 299°, in the next video I show the fixed mechanism which I rotated from 299 to 90° https://www.youtube.com/watch?v=u5uOvwxDJqI

But the quaternion output is changing in the three imaginary elements giving me a rotation all the angles, the measurement is very consistent between repetitions but I won't know what transformation is required because all the axes are rotating. I'm rotating the mechanism 209° from 90 to 299° (I have a digital angle measurement attached on the mechanism axes) in only one axis but all axes are rotating: roll: 90 to 281° = 191° pitch: 0 to 90 and then from 90 to 33 = 147° yaw = -90 to -180 and then from 180 to 92 = 180°

I'm using the ponycube algorithm to display the quaternion rotation and I have a rotation very similar to @mohit5037 like if I were spinning the whole board on one corner.

Here I put my output measurements of rotating from 90 to 299°

QUAT angle = [roll, pitch, yaw] QUAT value = [w, x, y, z]

For a real measured angle of: 90.0 the output quat was: [0.52, -0.49, 0.49, -0.51] and converted to angles: [94.82, 0.57, -89.51] For a real measured angle of: 90.58 the output quat was: [0.54, -0.46, 0.47, -0.52] and converted to angles: [90.69, 1.29, -89.5] For a real measured angle of: 92.67 the output quat was: [0.54, -0.46, 0.48, -0.52] and converted to angles: [90.85, 1.99, -89.6] For a real measured angle of: 94.4 the output quat was: [0.54, -0.46, 0.48, -0.51] and converted to angles: [91.08, 3.15, -89.54] For a real measured angle of: 97.8 the output quat was: [0.55, -0.45, 0.49, -0.51] and converted to angles: [91.3, 4.05, -89.49] For a real measured angle of: 99.1 the output quat was: [0.55, -0.45, 0.49, -0.5] and converted to angles: [91.61, 5.56, -89.5] For a real measured angle of: 101.52 the output quat was: [0.55, -0.44, 0.5, -0.5] and converted to angles: [91.96, 6.56, -89.47] For a real measured angle of: 102.6 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.6, 8.56, -89.56] For a real measured angle of: 103.12 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.72, 8.86, -89.56] For a real measured angle of: 104.55 the output quat was: [0.56, -0.43, 0.52, -0.48] and converted to angles: [92.97, 9.74, -89.46] For a real measured angle of: 106.05 the output quat was: [0.56, -0.43, 0.52, -0.47] and converted to angles: [93.24, 10.41, -89.5] For a real measured angle of: 107.15 the output quat was: [0.57, -0.43, 0.53, -0.47] and converted to angles: [93.51, 11.51, -89.56] For a real measured angle of: 108.05 the output quat was: [0.57, -0.43, 0.53, -0.46] and converted to angles: [93.9, 11.91, -89.67] For a real measured angle of: 109.08 the output quat was: [0.57, -0.42, 0.54, -0.46] and converted to angles: [94.23, 12.59, -89.83] For a real measured angle of: 109.68 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.51, 13.42, -89.63] For a real measured angle of: 110.46 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.69, 13.87, -89.57] For a real measured angle of: 111.64 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [94.92, 14.74, -89.63] For a real measured angle of: 113.02 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [95.18, 15.4, -89.63] For a real measured angle of: 114.44 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.6, 16.64, -89.73] For a real measured angle of: 115.87 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.75, 17.12, -89.75] For a real measured angle of: 116.65 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.92, 17.87, -89.77] For a real measured angle of: 117.51 the output quat was: [0.58, -0.4, 0.57, -0.42] and converted to angles: [96.36, 19.1, -89.85] For a real measured angle of: 118.75 the output quat was: [0.58, -0.4, 0.57, -0.41] and converted to angles: [96.53, 19.93, -90.03] For a real measured angle of: 119.71 the output quat was: [0.59, -0.39, 0.58, -0.41] and converted to angles: [96.8, 20.9, -90.07] For a real measured angle of: 122.3 the output quat was: [0.59, -0.39, 0.58, -0.4] and converted to angles: [97.1, 21.96, -90.14] For a real measured angle of: 123.39 the output quat was: [0.59, -0.39, 0.59, -0.39] and converted to angles: [97.33, 23.03, -90.18] For a real measured angle of: 124.34 the output quat was: [0.59, -0.38, 0.59, -0.39] and converted to angles: [97.56, 23.88, -90.12] For a real measured angle of: 125.29 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [97.87, 24.62, -90.14] For a real measured angle of: 127.14 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [98.15, 25.41, -90.17] For a real measured angle of: 128.83 the output quat was: [0.6, -0.37, 0.61, -0.36] and converted to angles: [98.7, 27.54, -90.36] For a real measured angle of: 130.38 the output quat was: [0.6, -0.36, 0.61, -0.36] and converted to angles: [98.83, 28.56, -90.33] For a real measured angle of: 131.7 the output quat was: [0.61, -0.36, 0.62, -0.35] and converted to angles: [99.02, 30.05, -90.46] For a real measured angle of: 134.14 the output quat was: [0.61, -0.35, 0.62, -0.35] and converted to angles: [99.34, 30.74, -90.56] For a real measured angle of: 136.26 the output quat was: [0.61, -0.35, 0.63, -0.34] and converted to angles: [99.58, 32.1, -90.62] For a real measured angle of: 138.11 the output quat was: [0.62, -0.34, 0.63, -0.32] and converted to angles: [100.3, 33.97, -90.74] For a real measured angle of: 140.35 the output quat was: [0.62, -0.33, 0.64, -0.31] and converted to angles: [100.6, 36.14, -90.7] For a real measured angle of: 141.88 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.03, 37.05, -90.81] For a real measured angle of: 142.35 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.21, 37.44, -90.76] For a real measured angle of: 144.88 the output quat was: [0.62, -0.32, 0.65, -0.29] and converted to angles: [101.52, 38.37, -90.88] For a real measured angle of: 145.91 the output quat was: [0.63, -0.32, 0.65, -0.28] and converted to angles: [101.73, 39.8, -90.94] For a real measured angle of: 147.01 the output quat was: [0.63, -0.31, 0.66, -0.28] and converted to angles: [101.98, 40.66, -91.01] For a real measured angle of: 148.54 the output quat was: [0.63, -0.31, 0.66, -0.27] and converted to angles: [102.25, 41.48, -91.15] For a real measured angle of: 150.79 the output quat was: [0.63, -0.3, 0.66, -0.26] and converted to angles: [102.56, 43.04, -91.3] For a real measured angle of: 152.09 the output quat was: [0.64, -0.29, 0.67, -0.25] and converted to angles: [103.03, 44.76, -91.46] For a real measured angle of: 154.16 the output quat was: [0.64, -0.28, 0.67, -0.24] and converted to angles: [103.37, 46.35, -91.53] For a real measured angle of: 154.83 the output quat was: [0.64, -0.28, 0.67, -0.23] and converted to angles: [103.56, 47.16, -91.5] For a real measured angle of: 157.08 the output quat was: [0.64, -0.28, 0.68, -0.23] and converted to angles: [103.68, 48.14, -91.67] For a real measured angle of: 159.36 the output quat was: [0.65, -0.27, 0.68, -0.22] and converted to angles: [103.89, 49.83, -91.69] For a real measured angle of: 160.14 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.3, 50.86, -91.88] For a real measured angle of: 160.99 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.16, 51.63, -91.72] For a real measured angle of: 164.76 the output quat was: [0.65, -0.25, 0.69, -0.2] and converted to angles: [104.49, 52.55, -91.94] For a real measured angle of: 166.36 the output quat was: [0.66, -0.23, 0.69, -0.18] and converted to angles: [104.97, 56.09, -92.05] For a real measured angle of: 168.01 the output quat was: [0.66, -0.23, 0.69, -0.17] and converted to angles: [105.23, 57.06, -92.3] For a real measured angle of: 170.63 the output quat was: [0.66, -0.22, 0.7, -0.16] and converted to angles: [105.41, 58.5, -92.22] For a real measured angle of: 172.78 the output quat was: [0.67, -0.21, 0.7, -0.15] and converted to angles: [105.86, 60.25, -92.54] For a real measured angle of: 175.19 the output quat was: [0.67, -0.2, 0.7, -0.14] and converted to angles: [105.99, 61.82, -92.54] For a real measured angle of: 176.47 the output quat was: [0.67, -0.2, 0.7, -0.13] and converted to angles: [106.11, 63.02, -92.61] For a real measured angle of: 179.14 the output quat was: [0.67, -0.19, 0.7, -0.12] and converted to angles: [106.49, 64.48, -92.91] For a real measured angle of: 181.81 the output quat was: [0.68, -0.17, 0.71, -0.1] and converted to angles: [107.31, 67.56, -93.67] For a real measured angle of: 183.76 the output quat was: [0.68, -0.16, 0.71, -0.09] and converted to angles: [107.69, 68.78, -93.84] For a real measured angle of: 186.86 the output quat was: [0.68, -0.15, 0.71, -0.08] and converted to angles: [108.34, 70.84, -94.35] For a real measured angle of: 192.28 the output quat was: [0.69, -0.14, 0.71, -0.06] and converted to angles: [109.15, 74.11, -94.76] For a real measured angle of: 194.26 the output quat was: [0.69, -0.13, 0.71, -0.05] and converted to angles: [110.02, 75.8, -95.58] For a real measured angle of: 197.59 the output quat was: [0.69, -0.12, 0.71, -0.04] and converted to angles: [110.34, 77.05, -95.9] For a real measured angle of: 201.14 the output quat was: [0.69, -0.1, 0.71, -0.02] and converted to angles: [112.1, 79.96, -97.41] For a real measured angle of: 205.47 the output quat was: [0.69, -0.09, 0.72, -0.01] and converted to angles: [114.58, 82.02, -99.76] For a real measured angle of: 208.29 the output quat was: [0.7, -0.07, 0.71, 0.02] and converted to angles: [123.92, 86.13, -108.79] For a real measured angle of: 211.91 the output quat was: [0.7, -0.05, 0.71, 0.04] and converted to angles: [144.07, 87.99, -128.72] For a real measured angle of: 214.38 the output quat was: [0.7, -0.04, 0.71, 0.05] and converted to angles: [226.41, 88.57, 149.37] For a real measured angle of: 218.92 the output quat was: [0.7, -0.03, 0.71, 0.06] and converted to angles: [255.78, 87.18, 119.92] For a real measured angle of: 222.67 the output quat was: [0.7, -0.02, 0.71, 0.08] and converted to angles: [270.42, 84.76, 105.47] For a real measured angle of: 227.68 the output quat was: [0.7, -0.0, 0.71, 0.1] and converted to angles: [276.3, 81.96, 99.79] For a real measured angle of: 230.67 the output quat was: [0.7, 0.02, 0.71, 0.12] and converted to angles: [278.99, 79.01, 97.35] For a real measured angle of: 234.54 the output quat was: [0.7, 0.02, 0.7, 0.13] and converted to angles: [279.46, 78.09, 97.1] For a real measured angle of: 238.46 the output quat was: [0.7, 0.05, 0.7, 0.16] and converted to angles: [282.95, 73.22, 94.24] For a real measured angle of: 244.79 the output quat was: [0.7, 0.07, 0.69, 0.18] and converted to angles: [283.35, 69.66, 93.93] For a real measured angle of: 250.84 the output quat was: [0.69, 0.09, 0.69, 0.2] and converted to angles: [283.93, 66.28, 93.57] For a real measured angle of: 255.81 the output quat was: [0.69, 0.1, 0.69, 0.21] and converted to angles: [283.17, 64.29, 94.23] For a real measured angle of: 259.63 the output quat was: [0.69, 0.12, 0.68, 0.24] and converted to angles: [284.51, 60.52, 93.37] For a real measured angle of: 264.67 the output quat was: [0.68, 0.14, 0.67, 0.25] and converted to angles: [283.91, 58.34, 93.58] For a real measured angle of: 270.88 the output quat was: [0.68, 0.16, 0.67, 0.27] and converted to angles: [283.85, 55.01, 93.43] For a real measured angle of: 275.54 the output quat was: [0.67, 0.2, 0.66, 0.3] and converted to angles: [283.45, 49.08, 93.21] For a real measured angle of: 281.28 the output quat was: [0.66, 0.22, 0.65, 0.31] and converted to angles: [283.43, 45.75, 93.04] For a real measured angle of: 283.7 the output quat was: [0.65, 0.23, 0.65, 0.32] and converted to angles: [282.87, 44.16, 93.01] For a real measured angle of: 288.04 the output quat was: [0.65, 0.24, 0.64, 0.33] and converted to angles: [282.69, 42.42, 93.1] For a real measured angle of: 290.86 the output quat was: [0.64, 0.25, 0.64, 0.34] and converted to angles: [282.34, 40.64, 93.0] For a real measured angle of: 294.23 the output quat was: [0.64, 0.27, 0.63, 0.35] and converted to angles: [282.27, 38.21, 92.88] For a real measured angle of: 299.17 the output quat was: [0.63, 0.28, 0.63, 0.36] and converted to angles: [282.12, 35.97, 92.79] For a real measured angle of: 299.24 the output quat was: [0.62, 0.3, 0.62, 0.37] and converted to angles: [281.9, 33.22, 92.58]

kriswiner commented 5 years ago

If you are using the EM7180 why not just read the Euler abgles directly thereby avoiding any errors in conversion. But I suspect the problem like most others is inadequate calibration.

How do you check your sensors are well calibrated?

On Sun, Feb 3, 2019 at 1:24 PM EinSoldiatGott notifications@github.com wrote:

Hi Kris.

I'm also having the same issue, I fixed the board to a mechanism that can rotate only in one axis from 90° to 299°, in the next video I show the fixed mechanism which I rotated from 299 to 90° https://www.youtube.com/watch?v=u5uOvwxDJqI

But the quaternion output is changing in the three imaginary elements giving me a rotation all the angles, the measurement is very consistent between repetitions but I won't know what transformation is required because all the axis are rotating.

I'm using the ponycube algorithm to display the quaternion rotation and I have a rotation very similar to @mohit5037 https://github.com/mohit5037 like if I were spinning the whole board on one corner.

Here I put my output measurements of rotating from 90 to 299° (I have a digital angle measurement attached on the mechanism axis)

QUAT angle = [roll, pitch, yaw] QUAT value = [w, x, y, z]

For a real measured angle of: 90.0 the output quat was: [0.52, -0.49, 0.49, -0.51] and converted to angles: [94.82, 0.57, -89.51] For a real measured angle of: 90.58 the output quat was: [0.54, -0.46, 0.47, -0.52] and converted to angles: [90.69, 1.29, -89.5] For a real measured angle of: 92.67 the output quat was: [0.54, -0.46, 0.48, -0.52] and converted to angles: [90.85, 1.99, -89.6] For a real measured angle of: 94.4 the output quat was: [0.54, -0.46, 0.48, -0.51] and converted to angles: [91.08, 3.15, -89.54] For a real measured angle of: 97.8 the output quat was: [0.55, -0.45, 0.49, -0.51] and converted to angles: [91.3, 4.05, -89.49] For a real measured angle of: 99.1 the output quat was: [0.55, -0.45, 0.49, -0.5] and converted to angles: [91.61, 5.56, -89.5] For a real measured angle of: 101.52 the output quat was: [0.55, -0.44, 0.5, -0.5] and converted to angles: [91.96, 6.56, -89.47] For a real measured angle of: 102.6 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.6, 8.56, -89.56] For a real measured angle of: 103.12 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.72, 8.86, -89.56] For a real measured angle of: 104.55 the output quat was: [0.56, -0.43, 0.52, -0.48] and converted to angles: [92.97, 9.74, -89.46] For a real measured angle of: 106.05 the output quat was: [0.56, -0.43, 0.52, -0.47] and converted to angles: [93.24, 10.41, -89.5] For a real measured angle of: 107.15 the output quat was: [0.57, -0.43, 0.53, -0.47] and converted to angles: [93.51, 11.51, -89.56] For a real measured angle of: 108.05 the output quat was: [0.57, -0.43, 0.53, -0.46] and converted to angles: [93.9, 11.91, -89.67] For a real measured angle of: 109.08 the output quat was: [0.57, -0.42, 0.54, -0.46] and converted to angles: [94.23, 12.59, -89.83] For a real measured angle of: 109.68 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.51, 13.42, -89.63] For a real measured angle of: 110.46 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.69, 13.87, -89.57] For a real measured angle of: 111.64 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [94.92, 14.74, -89.63] For a real measured angle of: 113.02 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [95.18, 15.4, -89.63] For a real measured angle of: 114.44 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.6, 16.64, -89.73] For a real measured angle of: 115.87 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.75, 17.12, -89.75] For a real measured angle of: 116.65 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.92, 17.87, -89.77] For a real measured angle of: 117.51 the output quat was: [0.58, -0.4, 0.57, -0.42] and converted to angles: [96.36, 19.1, -89.85] For a real measured angle of: 118.75 the output quat was: [0.58, -0.4, 0.57, -0.41] and converted to angles: [96.53, 19.93, -90.03] For a real measured angle of: 119.71 the output quat was: [0.59, -0.39, 0.58, -0.41] and converted to angles: [96.8, 20.9, -90.07] For a real measured angle of: 122.3 the output quat was: [0.59, -0.39, 0.58, -0.4] and converted to angles: [97.1, 21.96, -90.14] For a real measured angle of: 123.39 the output quat was: [0.59, -0.39, 0.59, -0.39] and converted to angles: [97.33, 23.03, -90.18] For a real measured angle of: 124.34 the output quat was: [0.59, -0.38, 0.59, -0.39] and converted to angles: [97.56, 23.88, -90.12] For a real measured angle of: 125.29 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [97.87, 24.62, -90.14] For a real measured angle of: 127.14 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [98.15, 25.41, -90.17] For a real measured angle of: 128.83 the output quat was: [0.6, -0.37, 0.61, -0.36] and converted to angles: [98.7, 27.54, -90.36] For a real measured angle of: 130.38 the output quat was: [0.6, -0.36, 0.61, -0.36] and converted to angles: [98.83, 28.56, -90.33] For a real measured angle of: 131.7 the output quat was: [0.61, -0.36, 0.62, -0.35] and converted to angles: [99.02, 30.05, -90.46] For a real measured angle of: 134.14 the output quat was: [0.61, -0.35, 0.62, -0.35] and converted to angles: [99.34, 30.74, -90.56] For a real measured angle of: 136.26 the output quat was: [0.61, -0.35, 0.63, -0.34] and converted to angles: [99.58, 32.1, -90.62] For a real measured angle of: 138.11 the output quat was: [0.62, -0.34, 0.63, -0.32] and converted to angles: [100.3, 33.97, -90.74] For a real measured angle of: 140.35 the output quat was: [0.62, -0.33, 0.64, -0.31] and converted to angles: [100.6, 36.14, -90.7] For a real measured angle of: 141.88 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.03, 37.05, -90.81] For a real measured angle of: 142.35 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.21, 37.44, -90.76] For a real measured angle of: 144.88 the output quat was: [0.62, -0.32, 0.65, -0.29] and converted to angles: [101.52, 38.37, -90.88] For a real measured angle of: 145.91 the output quat was: [0.63, -0.32, 0.65, -0.28] and converted to angles: [101.73, 39.8, -90.94] For a real measured angle of: 147.01 the output quat was: [0.63, -0.31, 0.66, -0.28] and converted to angles: [101.98, 40.66, -91.01] For a real measured angle of: 148.54 the output quat was: [0.63, -0.31, 0.66, -0.27] and converted to angles: [102.25, 41.48, -91.15] For a real measured angle of: 150.79 the output quat was: [0.63, -0.3, 0.66, -0.26] and converted to angles: [102.56, 43.04, -91.3] For a real measured angle of: 152.09 the output quat was: [0.64, -0.29, 0.67, -0.25] and converted to angles: [103.03, 44.76, -91.46] For a real measured angle of: 154.16 the output quat was: [0.64, -0.28, 0.67, -0.24] and converted to angles: [103.37, 46.35, -91.53] For a real measured angle of: 154.83 the output quat was: [0.64, -0.28, 0.67, -0.23] and converted to angles: [103.56, 47.16, -91.5] For a real measured angle of: 157.08 the output quat was: [0.64, -0.28, 0.68, -0.23] and converted to angles: [103.68, 48.14, -91.67] For a real measured angle of: 159.36 the output quat was: [0.65, -0.27, 0.68, -0.22] and converted to angles: [103.89, 49.83, -91.69] For a real measured angle of: 160.14 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.3, 50.86, -91.88] For a real measured angle of: 160.99 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.16, 51.63, -91.72] For a real measured angle of: 164.76 the output quat was: [0.65, -0.25, 0.69, -0.2] and converted to angles: [104.49, 52.55, -91.94] For a real measured angle of: 166.36 the output quat was: [0.66, -0.23, 0.69, -0.18] and converted to angles: [104.97, 56.09, -92.05] For a real measured angle of: 168.01 the output quat was: [0.66, -0.23, 0.69, -0.17] and converted to angles: [105.23, 57.06, -92.3] For a real measured angle of: 170.63 the output quat was: [0.66, -0.22, 0.7, -0.16] and converted to angles: [105.41, 58.5, -92.22] For a real measured angle of: 172.78 the output quat was: [0.67, -0.21, 0.7, -0.15] and converted to angles: [105.86, 60.25, -92.54] For a real measured angle of: 175.19 the output quat was: [0.67, -0.2, 0.7, -0.14] and converted to angles: [105.99, 61.82, -92.54] For a real measured angle of: 176.47 the output quat was: [0.67, -0.2, 0.7, -0.13] and converted to angles: [106.11, 63.02, -92.61] For a real measured angle of: 179.14 the output quat was: [0.67, -0.19, 0.7, -0.12] and converted to angles: [106.49, 64.48, -92.91] For a real measured angle of: 181.81 the output quat was: [0.68, -0.17, 0.71, -0.1] and converted to angles: [107.31, 67.56, -93.67] For a real measured angle of: 183.76 the output quat was: [0.68, -0.16, 0.71, -0.09] and converted to angles: [107.69, 68.78, -93.84] For a real measured angle of: 186.86 the output quat was: [0.68, -0.15, 0.71, -0.08] and converted to angles: [108.34, 70.84, -94.35] For a real measured angle of: 192.28 the output quat was: [0.69, -0.14, 0.71, -0.06] and converted to angles: [109.15, 74.11, -94.76] For a real measured angle of: 194.26 the output quat was: [0.69, -0.13, 0.71, -0.05] and converted to angles: [110.02, 75.8, -95.58] For a real measured angle of: 197.59 the output quat was: [0.69, -0.12, 0.71, -0.04] and converted to angles: [110.34, 77.05, -95.9] For a real measured angle of: 201.14 the output quat was: [0.69, -0.1, 0.71, -0.02] and converted to angles: [112.1, 79.96, -97.41] For a real measured angle of: 205.47 the output quat was: [0.69, -0.09, 0.72, -0.01] and converted to angles: [114.58, 82.02, -99.76] For a real measured angle of: 208.29 the output quat was: [0.7, -0.07, 0.71, 0.02] and converted to angles: [123.92, 86.13, -108.79] For a real measured angle of: 211.91 the output quat was: [0.7, -0.05, 0.71, 0.04] and converted to angles: [144.07, 87.99, -128.72] For a real measured angle of: 214.38 the output quat was: [0.7, -0.04, 0.71, 0.05] and converted to angles: [226.41, 88.57, 149.37] For a real measured angle of: 218.92 the output quat was: [0.7, -0.03, 0.71, 0.06] and converted to angles: [255.78, 87.18, 119.92] For a real measured angle of: 222.67 the output quat was: [0.7, -0.02, 0.71, 0.08] and converted to angles: [270.42, 84.76, 105.47] For a real measured angle of: 227.68 the output quat was: [0.7, -0.0, 0.71, 0.1] and converted to angles: [276.3, 81.96, 99.79] For a real measured angle of: 230.67 the output quat was: [0.7, 0.02, 0.71, 0.12] and converted to angles: [278.99, 79.01, 97.35] For a real measured angle of: 234.54 the output quat was: [0.7, 0.02, 0.7, 0.13] and converted to angles: [279.46, 78.09, 97.1] For a real measured angle of: 238.46 the output quat was: [0.7, 0.05, 0.7, 0.16] and converted to angles: [282.95, 73.22, 94.24] For a real measured angle of: 244.79 the output quat was: [0.7, 0.07, 0.69, 0.18] and converted to angles: [283.35, 69.66, 93.93] For a real measured angle of: 250.84 the output quat was: [0.69, 0.09, 0.69, 0.2] and converted to angles: [283.93, 66.28, 93.57] For a real measured angle of: 255.81 the output quat was: [0.69, 0.1, 0.69, 0.21] and converted to angles: [283.17, 64.29, 94.23] For a real measured angle of: 259.63 the output quat was: [0.69, 0.12, 0.68, 0.24] and converted to angles: [284.51, 60.52, 93.37] For a real measured angle of: 264.67 the output quat was: [0.68, 0.14, 0.67, 0.25] and converted to angles: [283.91, 58.34, 93.58] For a real measured angle of: 270.88 the output quat was: [0.68, 0.16, 0.67, 0.27] and converted to angles: [283.85, 55.01, 93.43] For a real measured angle of: 275.54 the output quat was: [0.67, 0.2, 0.66, 0.3] and converted to angles: [283.45, 49.08, 93.21] For a real measured angle of: 281.28 the output quat was: [0.66, 0.22, 0.65, 0.31] and converted to angles: [283.43, 45.75, 93.04] For a real measured angle of: 283.7 the output quat was: [0.65, 0.23, 0.65, 0.32] and converted to angles: [282.87, 44.16, 93.01] For a real measured angle of: 288.04 the output quat was: [0.65, 0.24, 0.64, 0.33] and converted to angles: [282.69, 42.42, 93.1] For a real measured angle of: 290.86 the output quat was: [0.64, 0.25, 0.64, 0.34] and converted to angles: [282.34, 40.64, 93.0] For a real measured angle of: 294.23 the output quat was: [0.64, 0.27, 0.63, 0.35] and converted to angles: [282.27, 38.21, 92.88] For a real measured angle of: 299.17 the output quat was: [0.63, 0.28, 0.63, 0.36] and converted to angles: [282.12, 35.97, 92.79] For a real measured angle of: 299.24 the output quat was: [0.62, 0.3, 0.62, 0.37] and converted to angles: [281.9, 33.22, 92.58]

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/5#issuecomment-460089907, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgAtBffmpzYJD-MOFo4Km6H7Yu5Cks5vJ1OmgaJpZM4HruZY .

EinSoldiatGott commented 5 years ago

If you are using the EM7180 why not just read the Euler abgles directly thereby avoiding any errors in conversion. But I suspect the problem like most others is inadequate calibration. How do you check your sensors are well calibrated? On Sun, Feb 3, 2019 at 1:24 PM EinSoldiatGott @.***> wrote: Hi Kris. I'm also having the same issue, I fixed the board to a mechanism that can rotate only in one axis from 90° to 299°, in the next video I show the fixed mechanism which I rotated from 299 to 90° https://www.youtube.com/watch?v=u5uOvwxDJqI But the quaternion output is changing in the three imaginary elements giving me a rotation all the angles, the measurement is very consistent between repetitions but I won't know what transformation is required because all the axis are rotating. I'm using the ponycube algorithm to display the quaternion rotation and I have a rotation very similar to @mohit5037 https://github.com/mohit5037 like if I were spinning the whole board on one corner. Here I put my output measurements of rotating from 90 to 299° (I have a digital angle measurement attached on the mechanism axis) QUAT angle = [roll, pitch, yaw] QUAT value = [w, x, y, z] For a real measured angle of: 90.0 the output quat was: [0.52, -0.49, 0.49, -0.51] and converted to angles: [94.82, 0.57, -89.51] For a real measured angle of: 90.58 the output quat was: [0.54, -0.46, 0.47, -0.52] and converted to angles: [90.69, 1.29, -89.5] For a real measured angle of: 92.67 the output quat was: [0.54, -0.46, 0.48, -0.52] and converted to angles: [90.85, 1.99, -89.6] For a real measured angle of: 94.4 the output quat was: [0.54, -0.46, 0.48, -0.51] and converted to angles: [91.08, 3.15, -89.54] For a real measured angle of: 97.8 the output quat was: [0.55, -0.45, 0.49, -0.51] and converted to angles: [91.3, 4.05, -89.49] For a real measured angle of: 99.1 the output quat was: [0.55, -0.45, 0.49, -0.5] and converted to angles: [91.61, 5.56, -89.5] For a real measured angle of: 101.52 the output quat was: [0.55, -0.44, 0.5, -0.5] and converted to angles: [91.96, 6.56, -89.47] For a real measured angle of: 102.6 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.6, 8.56, -89.56] For a real measured angle of: 103.12 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.72, 8.86, -89.56] For a real measured angle of: 104.55 the output quat was: [0.56, -0.43, 0.52, -0.48] and converted to angles: [92.97, 9.74, -89.46] For a real measured angle of: 106.05 the output quat was: [0.56, -0.43, 0.52, -0.47] and converted to angles: [93.24, 10.41, -89.5] For a real measured angle of: 107.15 the output quat was: [0.57, -0.43, 0.53, -0.47] and converted to angles: [93.51, 11.51, -89.56] For a real measured angle of: 108.05 the output quat was: [0.57, -0.43, 0.53, -0.46] and converted to angles: [93.9, 11.91, -89.67] For a real measured angle of: 109.08 the output quat was: [0.57, -0.42, 0.54, -0.46] and converted to angles: [94.23, 12.59, -89.83] For a real measured angle of: 109.68 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.51, 13.42, -89.63] For a real measured angle of: 110.46 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.69, 13.87, -89.57] For a real measured angle of: 111.64 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [94.92, 14.74, -89.63] For a real measured angle of: 113.02 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [95.18, 15.4, -89.63] For a real measured angle of: 114.44 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.6, 16.64, -89.73] For a real measured angle of: 115.87 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.75, 17.12, -89.75] For a real measured angle of: 116.65 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.92, 17.87, -89.77] For a real measured angle of: 117.51 the output quat was: [0.58, -0.4, 0.57, -0.42] and converted to angles: [96.36, 19.1, -89.85] For a real measured angle of: 118.75 the output quat was: [0.58, -0.4, 0.57, -0.41] and converted to angles: [96.53, 19.93, -90.03] For a real measured angle of: 119.71 the output quat was: [0.59, -0.39, 0.58, -0.41] and converted to angles: [96.8, 20.9, -90.07] For a real measured angle of: 122.3 the output quat was: [0.59, -0.39, 0.58, -0.4] and converted to angles: [97.1, 21.96, -90.14] For a real measured angle of: 123.39 the output quat was: [0.59, -0.39, 0.59, -0.39] and converted to angles: [97.33, 23.03, -90.18] For a real measured angle of: 124.34 the output quat was: [0.59, -0.38, 0.59, -0.39] and converted to angles: [97.56, 23.88, -90.12] For a real measured angle of: 125.29 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [97.87, 24.62, -90.14] For a real measured angle of: 127.14 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [98.15, 25.41, -90.17] For a real measured angle of: 128.83 the output quat was: [0.6, -0.37, 0.61, -0.36] and converted to angles: [98.7, 27.54, -90.36] For a real measured angle of: 130.38 the output quat was: [0.6, -0.36, 0.61, -0.36] and converted to angles: [98.83, 28.56, -90.33] For a real measured angle of: 131.7 the output quat was: [0.61, -0.36, 0.62, -0.35] and converted to angles: [99.02, 30.05, -90.46] For a real measured angle of: 134.14 the output quat was: [0.61, -0.35, 0.62, -0.35] and converted to angles: [99.34, 30.74, -90.56] For a real measured angle of: 136.26 the output quat was: [0.61, -0.35, 0.63, -0.34] and converted to angles: [99.58, 32.1, -90.62] For a real measured angle of: 138.11 the output quat was: [0.62, -0.34, 0.63, -0.32] and converted to angles: [100.3, 33.97, -90.74] For a real measured angle of: 140.35 the output quat was: [0.62, -0.33, 0.64, -0.31] and converted to angles: [100.6, 36.14, -90.7] For a real measured angle of: 141.88 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.03, 37.05, -90.81] For a real measured angle of: 142.35 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.21, 37.44, -90.76] For a real measured angle of: 144.88 the output quat was: [0.62, -0.32, 0.65, -0.29] and converted to angles: [101.52, 38.37, -90.88] For a real measured angle of: 145.91 the output quat was: [0.63, -0.32, 0.65, -0.28] and converted to angles: [101.73, 39.8, -90.94] For a real measured angle of: 147.01 the output quat was: [0.63, -0.31, 0.66, -0.28] and converted to angles: [101.98, 40.66, -91.01] For a real measured angle of: 148.54 the output quat was: [0.63, -0.31, 0.66, -0.27] and converted to angles: [102.25, 41.48, -91.15] For a real measured angle of: 150.79 the output quat was: [0.63, -0.3, 0.66, -0.26] and converted to angles: [102.56, 43.04, -91.3] For a real measured angle of: 152.09 the output quat was: [0.64, -0.29, 0.67, -0.25] and converted to angles: [103.03, 44.76, -91.46] For a real measured angle of: 154.16 the output quat was: [0.64, -0.28, 0.67, -0.24] and converted to angles: [103.37, 46.35, -91.53] For a real measured angle of: 154.83 the output quat was: [0.64, -0.28, 0.67, -0.23] and converted to angles: [103.56, 47.16, -91.5] For a real measured angle of: 157.08 the output quat was: [0.64, -0.28, 0.68, -0.23] and converted to angles: [103.68, 48.14, -91.67] For a real measured angle of: 159.36 the output quat was: [0.65, -0.27, 0.68, -0.22] and converted to angles: [103.89, 49.83, -91.69] For a real measured angle of: 160.14 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.3, 50.86, -91.88] For a real measured angle of: 160.99 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.16, 51.63, -91.72] For a real measured angle of: 164.76 the output quat was: [0.65, -0.25, 0.69, -0.2] and converted to angles: [104.49, 52.55, -91.94] For a real measured angle of: 166.36 the output quat was: [0.66, -0.23, 0.69, -0.18] and converted to angles: [104.97, 56.09, -92.05] For a real measured angle of: 168.01 the output quat was: [0.66, -0.23, 0.69, -0.17] and converted to angles: [105.23, 57.06, -92.3] For a real measured angle of: 170.63 the output quat was: [0.66, -0.22, 0.7, -0.16] and converted to angles: [105.41, 58.5, -92.22] For a real measured angle of: 172.78 the output quat was: [0.67, -0.21, 0.7, -0.15] and converted to angles: [105.86, 60.25, -92.54] For a real measured angle of: 175.19 the output quat was: [0.67, -0.2, 0.7, -0.14] and converted to angles: [105.99, 61.82, -92.54] For a real measured angle of: 176.47 the output quat was: [0.67, -0.2, 0.7, -0.13] and converted to angles: [106.11, 63.02, -92.61] For a real measured angle of: 179.14 the output quat was: [0.67, -0.19, 0.7, -0.12] and converted to angles: [106.49, 64.48, -92.91] For a real measured angle of: 181.81 the output quat was: [0.68, -0.17, 0.71, -0.1] and converted to angles: [107.31, 67.56, -93.67] For a real measured angle of: 183.76 the output quat was: [0.68, -0.16, 0.71, -0.09] and converted to angles: [107.69, 68.78, -93.84] For a real measured angle of: 186.86 the output quat was: [0.68, -0.15, 0.71, -0.08] and converted to angles: [108.34, 70.84, -94.35] For a real measured angle of: 192.28 the output quat was: [0.69, -0.14, 0.71, -0.06] and converted to angles: [109.15, 74.11, -94.76] For a real measured angle of: 194.26 the output quat was: [0.69, -0.13, 0.71, -0.05] and converted to angles: [110.02, 75.8, -95.58] For a real measured angle of: 197.59 the output quat was: [0.69, -0.12, 0.71, -0.04] and converted to angles: [110.34, 77.05, -95.9] For a real measured angle of: 201.14 the output quat was: [0.69, -0.1, 0.71, -0.02] and converted to angles: [112.1, 79.96, -97.41] For a real measured angle of: 205.47 the output quat was: [0.69, -0.09, 0.72, -0.01] and converted to angles: [114.58, 82.02, -99.76] For a real measured angle of: 208.29 the output quat was: [0.7, -0.07, 0.71, 0.02] and converted to angles: [123.92, 86.13, -108.79] For a real measured angle of: 211.91 the output quat was: [0.7, -0.05, 0.71, 0.04] and converted to angles: [144.07, 87.99, -128.72] For a real measured angle of: 214.38 the output quat was: [0.7, -0.04, 0.71, 0.05] and converted to angles: [226.41, 88.57, 149.37] For a real measured angle of: 218.92 the output quat was: [0.7, -0.03, 0.71, 0.06] and converted to angles: [255.78, 87.18, 119.92] For a real measured angle of: 222.67 the output quat was: [0.7, -0.02, 0.71, 0.08] and converted to angles: [270.42, 84.76, 105.47] For a real measured angle of: 227.68 the output quat was: [0.7, -0.0, 0.71, 0.1] and converted to angles: [276.3, 81.96, 99.79] For a real measured angle of: 230.67 the output quat was: [0.7, 0.02, 0.71, 0.12] and converted to angles: [278.99, 79.01, 97.35] For a real measured angle of: 234.54 the output quat was: [0.7, 0.02, 0.7, 0.13] and converted to angles: [279.46, 78.09, 97.1] For a real measured angle of: 238.46 the output quat was: [0.7, 0.05, 0.7, 0.16] and converted to angles: [282.95, 73.22, 94.24] For a real measured angle of: 244.79 the output quat was: [0.7, 0.07, 0.69, 0.18] and converted to angles: [283.35, 69.66, 93.93] For a real measured angle of: 250.84 the output quat was: [0.69, 0.09, 0.69, 0.2] and converted to angles: [283.93, 66.28, 93.57] For a real measured angle of: 255.81 the output quat was: [0.69, 0.1, 0.69, 0.21] and converted to angles: [283.17, 64.29, 94.23] For a real measured angle of: 259.63 the output quat was: [0.69, 0.12, 0.68, 0.24] and converted to angles: [284.51, 60.52, 93.37] For a real measured angle of: 264.67 the output quat was: [0.68, 0.14, 0.67, 0.25] and converted to angles: [283.91, 58.34, 93.58] For a real measured angle of: 270.88 the output quat was: [0.68, 0.16, 0.67, 0.27] and converted to angles: [283.85, 55.01, 93.43] For a real measured angle of: 275.54 the output quat was: [0.67, 0.2, 0.66, 0.3] and converted to angles: [283.45, 49.08, 93.21] For a real measured angle of: 281.28 the output quat was: [0.66, 0.22, 0.65, 0.31] and converted to angles: [283.43, 45.75, 93.04] For a real measured angle of: 283.7 the output quat was: [0.65, 0.23, 0.65, 0.32] and converted to angles: [282.87, 44.16, 93.01] For a real measured angle of: 288.04 the output quat was: [0.65, 0.24, 0.64, 0.33] and converted to angles: [282.69, 42.42, 93.1] For a real measured angle of: 290.86 the output quat was: [0.64, 0.25, 0.64, 0.34] and converted to angles: [282.34, 40.64, 93.0] For a real measured angle of: 294.23 the output quat was: [0.64, 0.27, 0.63, 0.35] and converted to angles: [282.27, 38.21, 92.88] For a real measured angle of: 299.17 the output quat was: [0.63, 0.28, 0.63, 0.36] and converted to angles: [282.12, 35.97, 92.79] For a real measured angle of: 299.24 the output quat was: [0.62, 0.3, 0.62, 0.37] and converted to angles: [281.9, 33.22, 92.58] — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#5 (comment)>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgAtBffmpzYJD-MOFo4Km6H7Yu5Cks5vJ1OmgaJpZM4HruZY .

Hi Kris, I'm going to switch the output to Euler angles to release the uC from this process, thanks for pointing me to that approach.

To get the Euler angles, do I have to modify the firmware loaded in the EEPROM? Or is just enough writing to the register AlgorithmControl = 0x54 ([2] 1 = HPR output)??

Thanks

kriswiner commented 5 years ago

You should be able to select either quaternion output or Euler angle output by changing a bit in a register, no need for new firmware in the EEPROM.

On Tue, Jun 18, 2019 at 11:49 PM EinSoldiatGott notifications@github.com wrote:

If you are using the EM7180 why not just read the Euler abgles directly thereby avoiding any errors in conversion. But I suspect the problem like most others is inadequate calibration. How do you check your sensors are well calibrated? … <#m6938168106487403519> On Sun, Feb 3, 2019 at 1:24 PM EinSoldiatGott @.***> wrote: Hi Kris. I'm also having the same issue, I fixed the board to a mechanism that can rotate only in one axis from 90° to 299°, in the next video I show the fixed mechanism which I rotated from 299 to 90° https://www.youtube.com/watch?v=u5uOvwxDJqI But the quaternion output is changing in the three imaginary elements giving me a rotation all the angles, the measurement is very consistent between repetitions but I won't know what transformation is required because all the axis are rotating. I'm using the ponycube algorithm to display the quaternion rotation and I have a rotation very similar to @mohit5037 https://github.com/mohit5037 https://github.com/mohit5037 like if I were spinning the whole board on one corner. Here I put my output measurements of rotating from 90 to 299° (I have a digital angle measurement attached on the mechanism axis) QUAT angle = [roll, pitch, yaw] QUAT value = [w, x, y, z] For a real measured angle of: 90.0 the output quat was: [0.52, -0.49, 0.49, -0.51] and converted to angles: [94.82, 0.57, -89.51] For a real measured angle of: 90.58 the output quat was: [0.54, -0.46, 0.47, -0.52] and converted to angles: [90.69, 1.29, -89.5] For a real measured angle of: 92.67 the output quat was: [0.54, -0.46, 0.48, -0.52] and converted to angles: [90.85, 1.99, -89.6] For a real measured angle of: 94.4 the output quat was: [0.54, -0.46, 0.48, -0.51] and converted to angles: [91.08, 3.15, -89.54] For a real measured angle of: 97.8 the output quat was: [0.55, -0.45, 0.49, -0.51] and converted to angles: [91.3, 4.05, -89.49] For a real measured angle of: 99.1 the output quat was: [0.55, -0.45, 0.49, -0.5] and converted to angles: [91.61, 5.56, -89.5] For a real measured angle of: 101.52 the output quat was: [0.55, -0.44, 0.5, -0.5] and converted to angles: [91.96, 6.56, -89.47] For a real measured angle of: 102.6 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.6, 8.56, -89.56] For a real measured angle of: 103.12 the output quat was: [0.56, -0.44, 0.51, -0.48] and converted to angles: [92.72, 8.86, -89.56] For a real measured angle of: 104.55 the output quat was: [0.56, -0.43, 0.52, -0.48] and converted to angles: [92.97, 9.74, -89.46] For a real measured angle of: 106.05 the output quat was: [0.56, -0.43, 0.52, -0.47] and converted to angles: [93.24, 10.41, -89.5] For a real measured angle of: 107.15 the output quat was: [0.57, -0.43, 0.53, -0.47] and converted to angles: [93.51, 11.51, -89.56] For a real measured angle of: 108.05 the output quat was: [0.57, -0.43, 0.53, -0.46] and converted to angles: [93.9, 11.91, -89.67] For a real measured angle of: 109.08 the output quat was: [0.57, -0.42, 0.54, -0.46] and converted to angles: [94.23, 12.59, -89.83] For a real measured angle of: 109.68 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.51, 13.42, -89.63] For a real measured angle of: 110.46 the output quat was: [0.57, -0.42, 0.54, -0.45] and converted to angles: [94.69, 13.87, -89.57] For a real measured angle of: 111.64 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [94.92, 14.74, -89.63] For a real measured angle of: 113.02 the output quat was: [0.57, -0.42, 0.55, -0.44] and converted to angles: [95.18, 15.4, -89.63] For a real measured angle of: 114.44 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.6, 16.64, -89.73] For a real measured angle of: 115.87 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.75, 17.12, -89.75] For a real measured angle of: 116.65 the output quat was: [0.58, -0.41, 0.56, -0.43] and converted to angles: [95.92, 17.87, -89.77] For a real measured angle of: 117.51 the output quat was: [0.58, -0.4, 0.57, -0.42] and converted to angles: [96.36, 19.1, -89.85] For a real measured angle of: 118.75 the output quat was: [0.58, -0.4, 0.57, -0.41] and converted to angles: [96.53, 19.93, -90.03] For a real measured angle of: 119.71 the output quat was: [0.59, -0.39, 0.58, -0.41] and converted to angles: [96.8, 20.9, -90.07] For a real measured angle of: 122.3 the output quat was: [0.59, -0.39, 0.58, -0.4] and converted to angles: [97.1, 21.96, -90.14] For a real measured angle of: 123.39 the output quat was: [0.59, -0.39, 0.59, -0.39] and converted to angles: [97.33, 23.03, -90.18] For a real measured angle of: 124.34 the output quat was: [0.59, -0.38, 0.59, -0.39] and converted to angles: [97.56, 23.88, -90.12] For a real measured angle of: 125.29 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [97.87, 24.62, -90.14] For a real measured angle of: 127.14 the output quat was: [0.6, -0.38, 0.6, -0.38] and converted to angles: [98.15, 25.41, -90.17] For a real measured angle of: 128.83 the output quat was: [0.6, -0.37, 0.61, -0.36] and converted to angles: [98.7, 27.54, -90.36] For a real measured angle of: 130.38 the output quat was: [0.6, -0.36, 0.61, -0.36] and converted to angles: [98.83, 28.56, -90.33] For a real measured angle of: 131.7 the output quat was: [0.61, -0.36, 0.62, -0.35] and converted to angles: [99.02, 30.05, -90.46] For a real measured angle of: 134.14 the output quat was: [0.61, -0.35, 0.62, -0.35] and converted to angles: [99.34, 30.74, -90.56] For a real measured angle of: 136.26 the output quat was: [0.61, -0.35, 0.63, -0.34] and converted to angles: [99.58, 32.1, -90.62] For a real measured angle of: 138.11 the output quat was: [0.62, -0.34, 0.63, -0.32] and converted to angles: [100.3, 33.97, -90.74] For a real measured angle of: 140.35 the output quat was: [0.62, -0.33, 0.64, -0.31] and converted to angles: [100.6, 36.14, -90.7] For a real measured angle of: 141.88 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.03, 37.05, -90.81] For a real measured angle of: 142.35 the output quat was: [0.62, -0.33, 0.64, -0.3] and converted to angles: [101.21, 37.44, -90.76] For a real measured angle of: 144.88 the output quat was: [0.62, -0.32, 0.65, -0.29] and converted to angles: [101.52, 38.37, -90.88] For a real measured angle of: 145.91 the output quat was: [0.63, -0.32, 0.65, -0.28] and converted to angles: [101.73, 39.8, -90.94] For a real measured angle of: 147.01 the output quat was: [0.63, -0.31, 0.66, -0.28] and converted to angles: [101.98, 40.66, -91.01] For a real measured angle of: 148.54 the output quat was: [0.63, -0.31, 0.66, -0.27] and converted to angles: [102.25, 41.48, -91.15] For a real measured angle of: 150.79 the output quat was: [0.63, -0.3, 0.66, -0.26] and converted to angles: [102.56, 43.04, -91.3] For a real measured angle of: 152.09 the output quat was: [0.64, -0.29, 0.67, -0.25] and converted to angles: [103.03, 44.76, -91.46] For a real measured angle of: 154.16 the output quat was: [0.64, -0.28, 0.67, -0.24] and converted to angles: [103.37, 46.35, -91.53] For a real measured angle of: 154.83 the output quat was: [0.64, -0.28, 0.67, -0.23] and converted to angles: [103.56, 47.16, -91.5] For a real measured angle of: 157.08 the output quat was: [0.64, -0.28, 0.68, -0.23] and converted to angles: [103.68, 48.14, -91.67] For a real measured angle of: 159.36 the output quat was: [0.65, -0.27, 0.68, -0.22] and converted to angles: [103.89, 49.83, -91.69] For a real measured angle of: 160.14 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.3, 50.86, -91.88] For a real measured angle of: 160.99 the output quat was: [0.65, -0.26, 0.68, -0.21] and converted to angles: [104.16, 51.63, -91.72] For a real measured angle of: 164.76 the output quat was: [0.65, -0.25, 0.69, -0.2] and converted to angles: [104.49, 52.55, -91.94] For a real measured angle of: 166.36 the output quat was: [0.66, -0.23, 0.69, -0.18] and converted to angles: [104.97, 56.09, -92.05] For a real measured angle of: 168.01 the output quat was: [0.66, -0.23, 0.69, -0.17] and converted to angles: [105.23, 57.06, -92.3] For a real measured angle of: 170.63 the output quat was: [0.66, -0.22, 0.7, -0.16] and converted to angles: [105.41, 58.5, -92.22] For a real measured angle of: 172.78 the output quat was: [0.67, -0.21, 0.7, -0.15] and converted to angles: [105.86, 60.25, -92.54] For a real measured angle of: 175.19 the output quat was: [0.67, -0.2, 0.7, -0.14] and converted to angles: [105.99, 61.82, -92.54] For a real measured angle of: 176.47 the output quat was: [0.67, -0.2, 0.7, -0.13] and converted to angles: [106.11, 63.02, -92.61] For a real measured angle of: 179.14 the output quat was: [0.67, -0.19, 0.7, -0.12] and converted to angles: [106.49, 64.48, -92.91] For a real measured angle of: 181.81 the output quat was: [0.68, -0.17, 0.71, -0.1] and converted to angles: [107.31, 67.56, -93.67] For a real measured angle of: 183.76 the output quat was: [0.68, -0.16, 0.71, -0.09] and converted to angles: [107.69, 68.78, -93.84] For a real measured angle of: 186.86 the output quat was: [0.68, -0.15, 0.71, -0.08] and converted to angles: [108.34, 70.84, -94.35] For a real measured angle of: 192.28 the output quat was: [0.69, -0.14, 0.71, -0.06] and converted to angles: [109.15, 74.11, -94.76] For a real measured angle of: 194.26 the output quat was: [0.69, -0.13, 0.71, -0.05] and converted to angles: [110.02, 75.8, -95.58] For a real measured angle of: 197.59 the output quat was: [0.69, -0.12, 0.71, -0.04] and converted to angles: [110.34, 77.05, -95.9] For a real measured angle of: 201.14 the output quat was: [0.69, -0.1, 0.71, -0.02] and converted to angles: [112.1, 79.96, -97.41] For a real measured angle of: 205.47 the output quat was: [0.69, -0.09, 0.72, -0.01] and converted to angles: [114.58, 82.02, -99.76] For a real measured angle of: 208.29 the output quat was: [0.7, -0.07, 0.71, 0.02] and converted to angles: [123.92, 86.13, -108.79] For a real measured angle of: 211.91 the output quat was: [0.7, -0.05, 0.71, 0.04] and converted to angles: [144.07, 87.99, -128.72] For a real measured angle of: 214.38 the output quat was: [0.7, -0.04, 0.71, 0.05] and converted to angles: [226.41, 88.57, 149.37] For a real measured angle of: 218.92 the output quat was: [0.7, -0.03, 0.71, 0.06] and converted to angles: [255.78, 87.18, 119.92] For a real measured angle of: 222.67 the output quat was: [0.7, -0.02, 0.71, 0.08] and converted to angles: [270.42, 84.76, 105.47] For a real measured angle of: 227.68 the output quat was: [0.7, -0.0, 0.71, 0.1] and converted to angles: [276.3, 81.96, 99.79] For a real measured angle of: 230.67 the output quat was: [0.7, 0.02, 0.71, 0.12] and converted to angles: [278.99, 79.01, 97.35] For a real measured angle of: 234.54 the output quat was: [0.7, 0.02, 0.7, 0.13] and converted to angles: [279.46, 78.09, 97.1] For a real measured angle of: 238.46 the output quat was: [0.7, 0.05, 0.7, 0.16] and converted to angles: [282.95, 73.22, 94.24] For a real measured angle of: 244.79 the output quat was: [0.7, 0.07, 0.69, 0.18] and converted to angles: [283.35, 69.66, 93.93] For a real measured angle of: 250.84 the output quat was: [0.69, 0.09, 0.69, 0.2] and converted to angles: [283.93, 66.28, 93.57] For a real measured angle of: 255.81 the output quat was: [0.69, 0.1, 0.69, 0.21] and converted to angles: [283.17, 64.29, 94.23] For a real measured angle of: 259.63 the output quat was: [0.69, 0.12, 0.68, 0.24] and converted to angles: [284.51, 60.52, 93.37] For a real measured angle of: 264.67 the output quat was: [0.68, 0.14, 0.67, 0.25] and converted to angles: [283.91, 58.34, 93.58] For a real measured angle of: 270.88 the output quat was: [0.68, 0.16, 0.67, 0.27] and converted to angles: [283.85, 55.01, 93.43] For a real measured angle of: 275.54 the output quat was: [0.67, 0.2, 0.66, 0.3] and converted to angles: [283.45, 49.08, 93.21] For a real measured angle of: 281.28 the output quat was: [0.66, 0.22, 0.65, 0.31] and converted to angles: [283.43, 45.75, 93.04] For a real measured angle of: 283.7 the output quat was: [0.65, 0.23, 0.65, 0.32] and converted to angles: [282.87, 44.16, 93.01] For a real measured angle of: 288.04 the output quat was: [0.65, 0.24, 0.64, 0.33] and converted to angles: [282.69, 42.42, 93.1] For a real measured angle of: 290.86 the output quat was: [0.64, 0.25, 0.64, 0.34] and converted to angles: [282.34, 40.64, 93.0] For a real measured angle of: 294.23 the output quat was: [0.64, 0.27, 0.63, 0.35] and converted to angles: [282.27, 38.21, 92.88] For a real measured angle of: 299.17 the output quat was: [0.63, 0.28, 0.63, 0.36] and converted to angles: [282.12, 35.97, 92.79] For a real measured angle of: 299.24 the output quat was: [0.62, 0.3, 0.62, 0.37] and converted to angles: [281.9, 33.22, 92.58] — You are receiving this because you commented. Reply to this email directly, view it on GitHub <#5 (comment) https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/5#issuecomment-460089907>, or mute the thread https://github.com/notifications/unsubscribe-auth/AGY1qgAtBffmpzYJD-MOFo4Km6H7Yu5Cks5vJ1OmgaJpZM4HruZY .

Hi Kris, I'm going to switch the output to Euler angles to release the uC from this process, thanks for pointing me to that approach.

To get the Euler angles, do I have to modify the firmware loaded in the EEPROM? Or is just enough writing to the register AlgorithmControl = 0x54 ([2] 1 = HPR output)??

Thanks

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kriswiner/EM7180_SENtral_sensor_hub/issues/5?email_source=notifications&email_token=ABTDLKWWMDMVGSGKCBDH5FDP3HJF5A5CNFSM4B5O4ZMKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODYA34PA#issuecomment-503430716, or mute the thread https://github.com/notifications/unsubscribe-auth/ABTDLKSQQS5O3KYTR6C6DSLP3HJF5ANCNFSM4B5O4ZMA .