Gyro readings corrupted!

HomeForumsMonoBrick EV3 FirmwareGyro readings corrupted!

This topic contains 21 replies, has 3 voices, and was last updated by Author Image Anders Søborg 3 years, 4 months ago.

Viewing 15 posts - 1 through 15 (of 22 total)
  • Author
    Posts
  • #4126
    Author Image
    Jošt Novak
    Participant

    Hello,

    we examined gyro readings and noticed some strange behaviour.
    Gyro seems to “perform” strange jumps periodically (see attached photo).

    We have tried replacing gyro and examined monobrick gyro/uart code, but no successes.
    It seems, that gyro read buffer is “broken”

    Is anybody else experiencing same problems? (we have also used example code, but again, no success).

    best Regards,
    Jost Novak

    Attachments:
    You must be logged in to view attached files.
    #4128
    Author Image
    Anders Søborg
    Key Master

    Hi

    This is really a nice finding. I would like you to do another test if it is possible…try to sample at a lower frequency. Do you get the same result?

    Have you tried to do a similar thing with the standard firmware?

    Also what do you exactly mean by

    We have tried replacing gyro and examined monobrick gyro/uart code, but no successes…

    Thanks a lot…

    Anders

    #4132
    Author Image
    544449
    Participant

    Hey, we’re teammates. I have attached three pictures and raw files at different sampling rates.

    Also what do you exactly mean by

    We have tried replacing gyro and examined monobrick gyro/uart code, but no successes…

    We have replaced gyro with one from the different EV3 set and results were the same. Jošt has also looked in the gyro drivers and he didn’t find any problems.

    best regards,

    Attachments:
    You must be logged in to view attached files.
    #4137
    Author Image
    Anders Søborg
    Key Master

    Hi

    We have replaced gyro with one from the different EV3 set and results were the same. Jošt has also looked in the gyro drivers and he didn’t find any problems.

    I actually think that there is a problem with the UART driver. Most likely something to do with the CalcRawOffset() function in the UART class… it might be possible to figure out what “index” to use if the whole raw data set is read and plotted… then it should be possible to see what indexes match.

    Anders

    #4138
    Author Image
    544449
    Participant

    Have you tried to do a similar thing with the standard firmware?

    No, we haven’t tried to do same thing with standard firmware.

    It also appears that at 1ms sampling time every other sample is duplicated (or I just didn’t rotate gyro fast enough).

    below is the code that was used for measurements:

    using System;
    using System.Threading;
    using System.Collections.Generic;
    using System.Resources;
    using MonoBrickFirmware.Display;
    using MonoBrickFirmware.UserInput;
    using MonoBrickFirmware.Sensors;
    
    namespace GyroSensorExample
    {
    	class MainClass
    	{
    		public static void Main (string[] args)
    		{
    			var gyro = new EV3GyroSensor(SensorPort.In1, GyroMode.Angle);
    
                gyro.Reset();
                Thread.Sleep(1000);
                int x=0;
                do
                {
                    Console.WriteLine("{0:F}", gyro.Read());
                    Thread.Sleep(20);
                    x++;
                }
                while (x < 1000);
    		}
    	}
    }
    #4139
    Author Image
    Anders Søborg
    Key Master

    Also would it be possible for you to share plots from other UART sensors?

    Anders

    #4140
    Author Image
    544449
    Participant

    Attached here is plot of color sensor and there appears to be similar problems.

    Attachments:
    You must be logged in to view attached files.
    #4142
    Author Image
    Anders Søborg
    Key Master

    Thanks I will have a look at it.

    Anders

    #4143
    Author Image
    Jošt Novak
    Participant

    I actually think that there is a problem with the UART driver. Most likely something to do with the CalcRawOffset() function in the UART class… it might be possible to figure out what “index” to use if the whole raw data set is read and plotted… then it should be possible to see what indexes match.

    Anders

    I examined exactly that part of the code, but i couldn’t figure out how indexing works… by UART driver you mean d_uart kernel driver written in C? or monobrick uart class?

    I also tried recompiling d_uart module from git repository at https://github.com/mindboards/ev3sources
    and replacing it with “your” d_uart module (same result)

    Regards,
    Novak Jost

    #4148
    Author Image
    Anders Søborg
    Key Master

    I am looking into this… hopefully I will have a fix for it soon…

    Anders

    #4150
    Author Image
    Anders Søborg
    Key Master

    Hi

    I just located the problem… I will have a fix ready a.s.p.

    Anders

    #4152
    Author Image
    Anders Søborg
    Key Master

    Hi all

    Problem has been fixed… I will commit it tomorrow… I am off to bed.

    Anders

    #4153
    Author Image
    Anders Søborg
    Key Master

    Hi

    Fix has been committed to GIT. I will update the download link with a new version later today… Again thanks for finding this bug…

    Anders

    #4155
    Author Image
    Jošt Novak
    Participant

    Thats great,

    just pulled your commits, will test later!
    Thanks for your support.

    Regards,
    Novak Jost

    #4159
    Author Image
    Anders Søborg
    Key Master

    Hi

    No problem…

    Anders

Viewing 15 posts - 1 through 15 (of 22 total)

You must be logged in to reply to this topic.

Posted in

Make a donation