Go to Post You are done with designing something, not when there's nothing more to add, but when there's nothing left to remove. - EricH [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Closed Thread
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 29-11-2006, 14:03
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Problems with the Gyro

Hi,
I started to learn how to use the gyro. I downloaded Kevin's code from the internet and tried to use it. There are some things which I haven't understood completely.
I tried to print the variable "gyro_rate", but its values were between 1800-2200.
Shouldn't it be much lower? Shouldn't this variable be measuring the angular velocity in (radians/seconds)? I don't know if there is something wrong with the code, or something wrong with my understanding. I then tried to print the value from the function Get_Gyro_Angle(), but again, the printed values were unreasonable. The value jumped from positive to negative numbers without any logical order.

I would be very glad if someone could guide me through it.

Thanks,
Guy
__________________
Team #1574 Misgav High School - Israel

Winner of the 2007 Israeli Regional

Winner of the 2007 Motorola Quality in Design Award

Visit our website:
www.miscar1574.com
  #2   Spotlight this post!  
Unread 29-11-2006, 14:13
neilsonster's Avatar
neilsonster neilsonster is offline
Registered User
AKA: Andrew Neilson
FRC #0772 (Sabre Bytes)
Team Role: College Student
 
Join Date: Jan 2005
Rookie Year: 2005
Location: Waterloo, ON, Canada
Posts: 188
neilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to allneilsonster is a name known to all
Send a message via MSN to neilsonster
Re: Problems with the Gyro

Quote:
Originally Posted by Guy_E
Hi,
I started to learn how to use the gyro. I downloaded Kevin's code from the internet and tried to use it. There are some things which I haven't understood completely.
I tried to print the variable "gyro_rate", but its values were between 1800-2200.
Shouldn't it be much lower? Shouldn't this variable be measuring the angular velocity in (radians/seconds)? I don't know if there is something wrong with the code, or something wrong with my understanding. I then tried to print the value from the function Get_Gyro_Angle(), but again, the printed values were unreasonable. The value jumped from positive to negative numbers without any logical order.

I would be very glad if someone could guide me through it.

Thanks,
Guy
I haven't used the gyro code in a little over a year, but if I remember right the angular unit used in Kevin Watson's gyro code is milliradians, not radians. You should also be able to change it to tenths of a degree in the gyro.h file. That would at least explain the large numbers you were getting.

Sorry I don't know the complete answer to your question, but it's a start.
__________________
Andrew Neilson - Team 772 Alumnus
University of Waterloo Computer Science, Class of 2010
  #3   Spotlight this post!  
Unread 29-11-2006, 14:33
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,281
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Problems with the Gyro

Hey, I don't have the code in front of me but I can look at it when I get back to my dorm.

For your First question neilsonster is right about the units. That would explain the large numbers 1.8 radians per second is alot easier to explain than 1800. I am assuming that the values you are giving us are when the robot is at rest if this is not the case then please specify what you are doing to the robot while it is printing out the data. If the robot is just sitting there than your problem is probably in the initialization of the gyro. When you enable the robot let it sit for a second or two, also make sure the gyro isn't too close to the compressor or anything else that may cause it to vibrate. If this doesn't help then give us any more information that you can and I'll try again.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #4   Spotlight this post!  
Unread 29-11-2006, 14:47
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Problems with the Gyro

The value of "gyro_rate" is about 2030 while not moving. When I do rotate the gyro the value decreases or increases depending on the direction. My guess is that the gyro is somehow not calibrated or initialized well, but I don't know how to make it correct....
__________________
Team #1574 Misgav High School - Israel

Winner of the 2007 Israeli Regional

Winner of the 2007 Motorola Quality in Design Award

Visit our website:
www.miscar1574.com
  #5   Spotlight this post!  
Unread 29-11-2006, 18:08
Noah Kleinberg Noah Kleinberg is offline
Registered User
FRC #0395 (2TrainRobotics)
Team Role: Driver
 
Join Date: Jan 2006
Rookie Year: 2006
Location: New York
Posts: 196
Noah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to beholdNoah Kleinberg is a splendid one to behold
Send a message via AIM to Noah Kleinberg
Re: Problems with the Gyro

That sounds like a problem with the bias. You should try calling Get_Gyro_Bias() and printing the return value, which I think should be something relatively close to 512 if I remember correctly, also make sure that you called Initialize_Gyro() at some point in the code, otherwise it might be the case that the variable holding the bias was never initialized, and contains a random number, offsetting all of your data by that number.
  #6   Spotlight this post!  
Unread 29-11-2006, 21:51
eshteyn's Avatar
eshteyn eshteyn is offline
WOOPS! shorted the deep cycle batt.
AKA: the supply seargent, Eugene
FRC #0375 (the robotic plague)
Team Role: Mechanical
 
Join Date: Apr 2006
Rookie Year: 2005
Location: Staten Island, New York
Posts: 213
eshteyn is just really niceeshteyn is just really niceeshteyn is just really niceeshteyn is just really niceeshteyn is just really nice
Send a message via AIM to eshteyn Send a message via Yahoo to eshteyn
Re: Problems with the Gyro

hey , whats up, ask our programmer Dan about the gyro, we put one in Rambo last year and Dan has some great experience with it, good luck.
__________________
--------------------------------------------

Championship - Delphi "Driving Tomorrows Technology"
  #7   Spotlight this post!  
Unread 30-11-2006, 06:12
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Problems with the Gyro

Quote:
Originally Posted by Noah Kleinberg
That sounds like a problem with the bias. You should try calling Get_Gyro_Bias() and printing the return value, which I think should be something relatively close to 512 if I remember correctly, also make sure that you called Initialize_Gyro() at some point in the code, otherwise it might be the case that the variable holding the bias was never initialized, and contains a random number, offsetting all of your data by that number.
I printed Get_Gyro_Bias ans the outcome was 0. What does this value represent? I call Initialize_Gyro in User_Initialization, where Kevin located it.
__________________
Team #1574 Misgav High School - Israel

Winner of the 2007 Israeli Regional

Winner of the 2007 Motorola Quality in Design Award

Visit our website:
www.miscar1574.com
  #8   Spotlight this post!  
Unread 30-11-2006, 07:04
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Problems with the Gyro

Quote:
Originally Posted by Noah Kleinberg
That sounds like a problem with the bias. You should try calling Get_Gyro_Bias() and printing the return value, which I think should be something relatively close to 512 if I remember correctly, also make sure that you called Initialize_Gyro() at some point in the code, otherwise it might be the case that the variable holding the bias was never initialized, and contains a random number, offsetting all of your data by that number.
I havent used to gyro but if i recall it is supposed to be 512 for the x and 512 for the y when they gyro isnt moving. Then then you start moving it values will vary from 0 to 1023.
  #9   Spotlight this post!  
Unread 30-11-2006, 07:05
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Problems with the Gyro

Any idea what the problem could be?
__________________
Team #1574 Misgav High School - Israel

Winner of the 2007 Israeli Regional

Winner of the 2007 Motorola Quality in Design Award

Visit our website:
www.miscar1574.com
  #10   Spotlight this post!  
Unread 30-11-2006, 11:54
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problems with the Gyro

Do you have your code calling the StartGyroCalibration() and StopGyroCalibration()?

If you tried to integrate Kevin's code into your own code you might not be initializing the gyro correctly. Look at the ProcessDataFromMasteruP() in Kevin's code.
__________________
Eric Haskins KC9JVH
  #11   Spotlight this post!  
Unread 30-11-2006, 13:57
aviv aviv is offline
Registered User
FRC #1657
 
Join Date: Jan 2006
Location: Israel
Posts: 34
aviv will become famous soon enough
Re: Problems with the Gyro

You need to set the gyro's bias.. You do this by using the Start_Gyro_Bias_Calc() and
Stop_Gyro_Bias_Calc(). Let The start_bias_calc() run for a few secs while the robot isn't moving.

If you need anymore help u can email me at avivgalon@gmail.com

I haven't seen you for a while... (Samur)
__________________
Winner of 2006 GM/Technion Israel Regional
Chairman's Award 2006 GM/Technion Israel Regional
Best Website 2006 GM/Technion Israel Regional

HaMosad Robotics #1657
  #12   Spotlight this post!  
Unread 30-11-2006, 16:32
6600gt's Avatar
6600gt 6600gt is offline
Registered User
AKA: Lohit
FRC #0226 (Hammerhead)
Team Role: Alumni
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Troy, MI
Posts: 221
6600gt is a jewel in the rough6600gt is a jewel in the rough6600gt is a jewel in the rough
Re: Problems with the Gyro

Quote:
Originally Posted by Guy_E
The value of "gyro_rate" is about 2030 while not moving. When I do rotate the gyro the value decreases or increases depending on the direction. My guess is that the gyro is somehow not calibrated or initialized well, but I don't know how to make it correct....
If you are using Kevin Watson's code, Get_Gyro_Angle is giving you the actual calculated angle 1800 is 180.0 degrees. He removed the decimal to help the pic process faster(it sucks at floating point stuff).

The actual gyro only outputs the angular rate but his code integrates to give you the actual angle at that point in time.

Read the "Readme" file that came with the gyro code. It should help you setup and calibrate the whole gyro.
  #13   Spotlight this post!  
Unread 01-12-2006, 07:35
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Problems with the Gyro

I'm such a fool. I forgot that there was code executed in the Process_Data_From_Master_uP function, and I worked with the gyro with the RC turned off...

When I did work with the RC switched on, the gyro's bias was indeed calculated, but its value was 2040.... As a consequence, I believe, the angle and the angular rate were not calculated correctly.

Any idea how can I correct it?
__________________
Team #1574 Misgav High School - Israel

Winner of the 2007 Israeli Regional

Winner of the 2007 Motorola Quality in Design Award

Visit our website:
www.miscar1574.com
  #14   Spotlight this post!  
Unread 02-12-2006, 09:52
Guy_E Guy_E is offline
Registered User
FRC #1574 (MisCar)
Team Role: Leadership
 
Join Date: Mar 2006
Rookie Year: 2006
Location: ISRAEL
Posts: 81
Guy_E has a spectacular aura aboutGuy_E has a spectacular aura about
Send a message via MSN to Guy_E
Re: Problems with the Gyro

Please, someone?
__________________
Team #1574 Misgav High School - Israel

Winner of the 2007 Israeli Regional

Winner of the 2007 Motorola Quality in Design Award

Visit our website:
www.miscar1574.com
  #15   Spotlight this post!  
Unread 02-12-2006, 10:19
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problems with the Gyro

Try running a "clean" copy of kevin's code . Then if the gyro acts correctly you'll know its your code. If it still has problems it could be a hardware issue.
__________________
Eric Haskins KC9JVH
Closed Thread


Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problems with the gyro Conan Programming 7 06-02-2006 01:45
Gyro Code Problems railerobotics Programming 8 27-01-2006 10:45
problems using gyro/adc code with camera default code tanstaafl Programming 7 22-01-2006 23:09
problems mounting the camera to the 'bot with the default servo/mount set up Redneck Programming 0 16-02-2005 20:53
Help with the gyro chip Team852 Electrical 1 10-01-2003 22:31


All times are GMT -5. The time now is 19:11.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi