Go to Post If all goes well (cross fingers) we'll have a joystick for driving and one - count it, one - button: FIRE - DonRotolo [more]
Home
Go Back   Chief Delphi > Technical > Technical Discussion
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 26-01-2014, 10:54
Wazzaps Wazzaps is offline
Registered User
FRC #1573
 
Join Date: Jan 2014
Location: Israel
Posts: 11
Wazzaps is an unknown quantity at this point
Question Gyro problems

OK so we wanted to install a gyro, and we did it, no explosions yet, but the values aren't correct at all, they randomly fluctuate w/o any response to the actual gyro rotation. We wired all correctly, and programmed according to
Any help? <- my mentor's addition
  #2   Spotlight this post!  
Unread 26-01-2014, 11:20
Kevin Phan's Avatar
Kevin Phan Kevin Phan is offline
College Student
FRC #0357 (Royal Assault)
Team Role: Alumni
 
Join Date: Apr 2013
Rookie Year: 2010
Location: PA, United States
Posts: 95
Kevin Phan will become famous soon enoughKevin Phan will become famous soon enough
Re: Gyro problems

When using a gyro, the gyro will not at first give a degree that you do not expect. If you are thinking in the form of 0-360 degrees. You need to use the modular division to get the 0-360 you want. I noticed in your begin that your gain is set to 125 mV/sec, you want to refer to the first technical resources for setting up the gyro. It is actually 7 mV/sec. When setting up the gain it should have .007 as the constant for the set gain vi. Also you probably do not want to continually read a gyro in the tele-op vi, since LabVIEW will continually read the gyro and eat up your processing time. You want to use the example to figure out a loop delay and move your gyro reading into Periodic tasks.

Another note to add is that a gyro will continually add on to itself due to factors you can't control. To mitigate this, you would want to reset your gyro at points where it will not affect your measured heading.(i.e. Reset gyro when the robot faces the drive station.)

Last edited by Kevin Phan : 26-01-2014 at 11:24.
  #3   Spotlight this post!  
Unread 26-01-2014, 11:52
Wazzaps Wazzaps is offline
Registered User
FRC #1573
 
Join Date: Jan 2014
Location: Israel
Posts: 11
Wazzaps is an unknown quantity at this point
Re: Gyro problems

Quote:
Originally Posted by Kevin Phan View Post
When using a gyro, the gyro will not at first give a degree that you do not expect. If you are thinking in the form of 0-360 degrees. You need to use the modular division to get the 0-360 you want. I noticed in your begin that your gain is set to 125 mV/sec, you want to refer to the first technical resources for setting up the gyro. It is actually 7 mV/sec. When setting up the gain it should have .007 as the constant for the set gain vi. Also you probably do not want to continually read a gyro in the tele-op vi, since LabVIEW will continually read the gyro and eat up your processing time. You want to use the example to figure out a loop delay and move your gyro reading into Periodic tasks.

Another note to add is that a gyro will continually add on to itself due to factors you can't control. To mitigate this, you would want to reset your gyro at points where it will not affect your measured heading.(i.e. Reset gyro when the robot faces the drive station.)
we tried changing the value but it still didnt help.
ill explain in more detail what you can see
when you deploy the robot code it shows a value that gets higher and higher, stops and then lowers itself or raises itself again.
can anyone explain why?
  #4   Spotlight this post!  
Unread 26-01-2014, 13:54
jbsmithtx's Avatar
jbsmithtx jbsmithtx is offline
FIRST Fanatic
AKA: Josh Smith
FRC #4206 (RoboVikes)
Team Role: Engineer
 
Join Date: Aug 2012
Rookie Year: 2012
Location: Fort Worth, TX
Posts: 91
jbsmithtx is a jewel in the roughjbsmithtx is a jewel in the roughjbsmithtx is a jewel in the rough
Re: Gyro problems

Try using the gyro "reset" vi. Our team had this same problem last year, and this fixed it
  #5   Spotlight this post!  
Unread 26-01-2014, 13:54
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Gyro problems

Quote:
Originally Posted by Wazzaps View Post
We wired all correctly, and programmed according to
If you wired it correctly and programmed it correctly and the gyro is working, then you wouldn't be having a problem. Pictures of your actual wiring and actual code would go a long way help others figure out your problem.

Common problems that people have are:
Not powering the Analog Breakout
Wiring to the Temperature output instead of rate
Plugging it in backwards
Not using Analog Input 1 or 2.


Quote:
Originally Posted by Kevin Phan View Post
Also you probably do not want to continually read a gyro in the tele-op vi, since LabVIEW will continually read the gyro and eat up your processing time. You want to use the example to figure out a loop delay and move your gyro reading into Periodic tasks.
Reading the gyro is not taxing. There is no problem reading the gyro in every loop in telop. All of the hard work is done in the background in the FPGA, all the gyro get does is get the latest value.

Last edited by Joe Ross : 26-01-2014 at 14:10.
  #6   Spotlight this post!  
Unread 26-01-2014, 14:05
efoote868 efoote868 is offline
foote stepped in
AKA: E. Foote
FRC #0868
Team Role: Mentor
 
Join Date: Mar 2006
Rookie Year: 2005
Location: Noblesville, IN
Posts: 1,403
efoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond reputeefoote868 has a reputation beyond repute
Re: Gyro problems

Make sure you're not reading the temperature pin instead of the angular rate pin.
__________________
Be Healthy. Never Stop Learning. Say It Like It Is. Own It.

Like our values? Flexware Innovation is looking for Automation Engineers. Check us out!
  #7   Spotlight this post!  
Unread 08-02-2014, 16:02
Roshang Roshang is offline
Registered User
FRC #0204
 
Join Date: Feb 2014
Location: Eastern High School
Posts: 1
Roshang is an unknown quantity at this point
Re: Gyro problems

Hi,
I've been trying to implement a gyro into our code so that we can do field-oriented Mecanum Drive. I've gotten the gyro and the mecanum drive to work in their own programs. However, when I put them in the same program, neither work. I've tried it with both in teliop and with the gryo code in periodic storing angle to a global variable, which is read in teliop with the drive control. With my code as it is right now, if I only deploy teliop.vi from labview, the gyro works. But with the entire code deployed, it doesn't. I'm at my wit's end trying to figure out what's wrong. Any ideas?
Thanks
Attached Thumbnails
Click image for larger version

Name:	Begind.png
Views:	12
Size:	11.5 KB
ID:	16162  Click image for larger version

Name:	Teleopd.png
Views:	16
Size:	37.9 KB
ID:	16163  Click image for larger version

Name:	Teleopd10.png
Views:	5
Size:	1.8 KB
ID:	16164  Click image for larger version

Name:	Teleopp.png
Views:	8
Size:	11.8 KB
ID:	16165  
  #8   Spotlight this post!  
Unread 08-02-2014, 16:37
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,563
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Gyro problems

You can't put a while loop in teleop. See Tutorial 7- Integrating Examples into Robot Code.
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


All times are GMT -5. The time now is 17:26.

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