View unanswered posts | View active topics It is currently Fri Oct 31, 2014 6:17 pm






Reply to topic  [ 9 posts ] 
HiTechnic Gyro Sensor 
Author Message
Rookie

Joined: Thu Sep 29, 2011 11:07 pm
Posts: 5
Post HiTechnic Gyro Sensor
I want to know exactly, what does the gyro sensor do? I've been told that it is helpful when you are trying to turn. How do you use it to turn?


Thu Sep 29, 2011 11:28 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: HiTechnic Gyro Sensor
The gyro will give you the turning rate, meaning you have a higher value if the robot is turning faster, a lower value if it turns slower and zero when it is not turning (degrees/second). If you turn in opposite direction, you get a negative value. So if you integrate the "angular velocity" against time, you can keep track of the current heading.
For example, let's say your robot is heading north and not moving and you set the currentHeading to zero. Then the robot starting moving at a constant velocity clockwise at 30-degree/second for 3 seconds. If you integrate that (30 degree/sec * 3 second) = 90 degree. So at the end of the 3 seconds, your robot is facing east.
So if you want to turn your robot clockwise for 90 degrees, you turn the robot until your heading value reaches 90 degrees. If you want to turn your robot anticlockwise for 90 degrees, you turn the robot until your heading value reaches -90 degrees.


Fri Sep 30, 2011 12:15 am
Profile
Rookie

Joined: Thu Sep 29, 2011 11:07 pm
Posts: 5
Post Re: HiTechnic Gyro Sensor
So how would you exactly program the robot to do this. I under stand it now. Thank you for replying.


Fri Sep 30, 2011 8:46 am
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3240
Location: Rotterdam, The Netherlands
Post Re: HiTechnic Gyro Sensor
I have some code that uses the gyro to calculate current heading in this article: http://botbench.com/blog/2010/09/22/rot ... it-mobile/

Go check it out :)

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


Fri Sep 30, 2011 8:50 am
Profile WWW
Rookie

Joined: Thu Sep 29, 2011 11:07 pm
Posts: 5
Post Re: HiTechnic Gyro Sensor
Ok. Thank you for that link it helped a lot. One other question. How would I program the robot to turn 90 degrees using this sensor.


Tue Oct 04, 2011 12:04 pm
Profile
Moderator
Moderator
User avatar

Joined: Wed Mar 05, 2008 8:14 am
Posts: 3240
Location: Rotterdam, The Netherlands
Post Re: HiTechnic Gyro Sensor
Why not try to make a program for a robot that turns very slowly and shows you its current heading on the screen. Once you have that working, I am sure the rest will come to you.

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


Tue Oct 04, 2011 12:14 pm
Profile WWW
Rookie

Joined: Tue Jan 10, 2012 8:25 pm
Posts: 1
Post Re: HiTechnic Gyro Sensor
I'm a complete noob. I've been using RobotC for all of three weeks and my mentor needs me to program a gyro sensor to make a 90 degree turn. I know how a gyro sensor works but I dont really know how to integrate the time into the gyro readings and correlate them to the motor speeds. Any help would be appreciated. I've attached my robot's configuration. An explanation of commands used would be even better. Thanks in advance.

-Matt


Attachments:
File comment: Robot's config (motors and sensors)
online sample.c [535 Bytes]
Downloaded 611 times
Tue Jan 17, 2012 6:31 pm
Profile
Guru
User avatar

Joined: Sun Nov 15, 2009 5:46 am
Posts: 1347
Post Re: HiTechnic Gyro Sensor
There are many threads in the forums about this subject. For example:
viewtopic.php?f=52&t=3152


Tue Jan 17, 2012 7:33 pm
Profile
Rookie

Joined: Tue Aug 27, 2013 10:59 am
Posts: 4
Post Re: HiTechnic Gyro Sensor
Hey Guys well i think that gyroscope sensor has the following features:
Measurement variety, Number of detecting axes.Thanks!!


Tue Aug 27, 2013 11:11 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 9 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.