سؤال

gyroscopes which measure rate of rotation of angles when integrated produce angles right? my question is how do i do this? what im doing so far is just adding all the angles ive detected and that seems to be very wrong

AngleIntegrated = GyroDegPersec * (1/GyroBandWidth);

suggestions are very welcome. thanks

هل كانت مفيدة؟

المحلول

Knowing that of course you can't count on having a correct value in the long run (by integration your error window will always increase over time) what I would do is reading the gyroscope, interpolating the current read and previous few ones to get a smooth curve (e.g. a parabola using current read and previous two) and then computing the integral of that parabola from last read time and current time.

نصائح أخرى

You need to integrate with respect to time. So ideally you should sample the gyroscope at regular (fixed) time intervals, T, and then incorporate that sampling interval, T, into your integral calculation.

Note that T needs to be small enough to satisfy the Nyquist criterion.

You can integrate in discrete domain. Suppose the angular rate is da, it's time integral is a. k is the discrete step number.

a(k) = a(k-1) + T*0.5*(da(k) + da(k-1))

For example, da(k) is current angular rate reading. da(k-1) is previoud angular rate reading. a(k-1) is the previous step's integration value(rotation angle). T is sampling rate. If the sensor outputs in every 1 millisecond, T becomes 0.001.

You can use this formula when k>0. The initial value, a(0), must be given.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top