View unanswered posts | View active topics It is currently Wed Sep 23, 2020 4:18 pm

Reply to topic  [ 2 posts ] 
Gyro drift 
Author Message

Joined: Thu Jun 11, 2015 2:33 am
Posts: 1
Post Gyro drift
I'm using Lego Mindstorms Gyro Sensor with EV3 and i have very often problem with drift(this i can see in the PortView mode). I want to write a program, that will check gyro sensor and, if it has drift, resets gyro sensor and
remove drift OR find a function for drift like drift_angle(seconds), that will compute and check angle including drift(for rotations of the robot, etc). But i can't reset gyro sensor - it does not work. Firstly I used 4(or more) commands resetGyro(...) or sensorReset(...) as first commands in main task(may be i should add command sleep(1000) before
first command to wait some sys inits?). Secondly I used something like this:
SensorType[S4] = sensorNone;
SensorType[S4] = sensorEV3_Gyro;
sleep(500);(like pragma
config but in main). I read that changing gyro mode Angle->Rate->Angle(or more steps) can solve the problem with removing drift, but i know only sensorNone and sensorEV3_Gyro variables. How can i change gyro mode in way Angle->Rate? Now the best solution i have found is to disconnect and connect again the gyro sensor, but how to remove drift in my program?? And where can i find info about function, that "computes" drift? May be there is
one in ROBOTC or where can i read about it? Who knows another solutions of this problem? Thanks

Thu Jun 11, 2015 2:42 am
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Gyro drift
I used the following program for about 10 minutes and noticed no drift. Can you show me what it is you're doing?

= Xander

#pragma config(Sensor, S1,     GYRO,           sensorEV3_Gyro, modeEV3Gyro_RateAndAngle)
//*!!Code automatically generated by 'ROBOTC' configuration wizard               !!*//

task main()
  while (true)
    displayCenteredBigTextLine(4, "DEGR: %3.2f", getGyroDegrees(GYRO));
    displayCenteredBigTextLine(6, "RATE: %3.2f", getGyroRate(GYRO));
    displayCenteredBigTextLine(8, "TIME: %d", nPgmTime);

| Professional Conduit of Reasonableness
| (Title bestowed upon on the 8th day of November, 2013)
| My Blog: I'd Rather Be Building Robots
| ROBOTC 3rd Party Driver Suite: [Project Page]

Fri Jun 12, 2015 1:44 am
Profile WWW
Display posts from previous:  Sort by  
Reply to topic   [ 2 posts ] 

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software for PTF.