View unanswered posts | View active topics It is currently Sat Aug 15, 2020 6:43 am

Reply to topic  [ 3 posts ] 
Questions about the Hightechnic Gyro Sensor 
Author Message

Joined: Mon Jan 14, 2013 2:50 pm
Posts: 12
Post Questions about the Hightechnic Gyro Sensor
I have some questions. Does the gyro measure stuff by degrees? Why is there an offset needed? If I do
const tSensors GyroSensor = (tSensors) S2; //gyro sensor//

#define offset 598 //offset value may vary depending on sensor & temperature
long Gyro_value;

int cool = 40;

task main()

Gyro_value=SensorValue(GyroSensor); //read the gyro sensor

The program doesn't work without the offset. What is the programming to calibrate the offset at the begginning of a program?

Sun Jan 20, 2013 4:11 pm
Site Admin
Site Admin
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3654
Location: Rotterdam, The Netherlands
Post Re: Questions about the Hightechnic Gyro Sensor
The offset is dependent on many things like temperature. The offset is different for each sensor, as it's an analogue sensor. My one tends to have an offset of around 619-625 or so, depending on planetary alignment.
The offset is best calculated as average of numerous measurements. You may want to take a look at my driver suite, specifically the hitechnic-gyro* files. Unless you're using a Sensor MUX, it is safe to ignore the SMUX files. You can download the suite from the link in my signature. The driver has a function that allows you to calibrate the gyro. Note that you should do this every time you start the program and that your robot should be perfectly stationary while you do this.

I would also advise you to upgrade to ROBOTC 3.55 B2, as there are bugs in 3.54 that affect things like casting from ubyte to int, which in turn affects my driver suite. You can find ROBOTC 3.54 B2 here: viewtopic.php?f=52&t=5122

= Xander

| 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]

Sun Jan 20, 2013 4:46 pm
Profile WWW

Joined: Mon Jan 14, 2013 2:50 pm
Posts: 12
Post Re: Questions about the Hightechnic Gyro Sensor
OK, I got the newest firmware and downloaded the newest drivers. I looked the gyro sensor part in the driver suite tutorial and it was kind of comfusing. Xander, please look at this other forum thread viewtopic.php?f=1&t=5362 and try to help.

Sun Jan 20, 2013 8:40 pm
Display posts from previous:  Sort by  
Reply to topic   [ 3 posts ] 

Who is online

Users browsing this forum: No registered users and 1 guest

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.