Search code examples
c++croboticssensorstilt-sensor

how can i perform discrete integration of gyroscope data?


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


Solution

  • 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.