Home→Forums→MonoBrick EV3 Firmware→Gyro readings corrupted!
- This topic has 21 replies, 3 voices, and was last updated 10 years, 8 months ago by Anders Søborg.
-
AuthorPosts
-
April 10, 2014 at 16:10 #4126
Jošt NovakParticipantHello,
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 NovakAttachments:
You must be logged in to view attached files.April 10, 2014 at 19:18 #4128
Anders SøborgKeymasterHi
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
April 10, 2014 at 21:05 #4132
544449ParticipantHey, 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.April 10, 2014 at 21:16 #4137
Anders SøborgKeymasterHi
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
April 10, 2014 at 21:17 #4138
544449ParticipantHave 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); } } }
April 10, 2014 at 21:17 #4139
Anders SøborgKeymasterAlso would it be possible for you to share plots from other UART sensors?
Anders
April 10, 2014 at 21:48 #4140
544449ParticipantAttached here is plot of color sensor and there appears to be similar problems.
Attachments:
You must be logged in to view attached files.April 10, 2014 at 21:50 #4142
Anders SøborgKeymasterThanks I will have a look at it.
Anders
April 11, 2014 at 07:24 #4143
Jošt NovakParticipantI 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 JostApril 13, 2014 at 12:27 #4148
Anders SøborgKeymasterI am looking into this… hopefully I will have a fix for it soon…
Anders
April 13, 2014 at 21:26 #4150
Anders SøborgKeymasterHi
I just located the problem… I will have a fix ready a.s.p.
Anders
- This reply was modified 10 years, 8 months ago by Anders Søborg.
April 14, 2014 at 00:01 #4152
Anders SøborgKeymasterHi all
Problem has been fixed… I will commit it tomorrow… I am off to bed.
Anders
April 14, 2014 at 07:13 #4153
Anders SøborgKeymasterHi
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
April 14, 2014 at 07:24 #4155
Jošt NovakParticipantThats great,
just pulled your commits, will test later!
Thanks for your support.Regards,
Novak JostApril 14, 2014 at 08:22 #4159
Anders SøborgKeymasterHi
No problem…
Anders
-
AuthorPosts
You must be logged in to reply to this topic.
Follow