Need help finding a conversion between units

34 Views Asked by At

I am measuring an angle with a gyroscope, but it gives outputs 0-100. I wish to convert this into degrees;

Actual (degrees) Gyro Reading
0 100
90 0

I have also measured (although I am not sure the reliablity of these data points);

Actual (degrees) Gyro Reading
30 85
45 70
60 50

I am not sure how to tackle this type of problem, and how to convert a given gyroscope reading into degrees.

1

There are 1 best solutions below

0
On BEST ANSWER

To convert the gyroscope reading into degrees, you can use linear interpolation based on the provided data points. Observe that the relationship between the actual angle (in degrees) and the gyro reading (based on the given data) suggests an inverse linear relationship between the actual angle and the gyro reading.

To convert a given gyro reading into degrees, follow these steps:

  • Identify the two nearest data points in your table based on the gyro reading. One point should have a gyro reading lower than the given reading, and the other should have a gyro reading higher than the given reading. e.g., if the gyro reading is $80$, the two nearest data points would be $(30, 85) $ and $(45, 70)$.

  • Use linear interpolation to calculate the corresponding angle in degrees. This involves finding the ratio of the difference between the gyro readings and the actual difference in angles between the data points.

    e.g., using the two nearest data points $(30, 85)$ and $(45, 70)$: Gyro reading difference, $\Delta G = 85 - 70 = 15$; and Actual angle difference, $\Delta\theta = 45 - 30 = 15$. Given gyro reading, $g_0 = 80$; Gyro reading difference from the lower data point, $\Delta g = 80 - 70 = 10$.

    Then the Ratio is given by $$ \frac{\text{Gyro reading difference}}{\text{Actual angle difference}} = \frac{10}{15} \approx 0.6667$$ Then the interpolated angle is given by "$\text{Lower data point angle} + (\text{Ratio $\times$ Actual angle difference})$". Thus, $$ \text{Interpolated angle} = 30 + (0.6667 \times 15) \approx 40^\circ $$

So, for a gyro reading of $80$, the corresponding angle would be (approximately) $40^{\circ}$. Keep in mind that the reliability of such interpolation depends on the accuracy and consistency of your data points.