Go to Post It certainly shows to never give up, even if all you can do is score a single tetra. - Joe Ross [more]
Home
Go Back   Chief Delphi > Technical > Programming > NI LabVIEW
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
Reply
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 20-02-2011, 19:10
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Weird Gyro Values

We have a gyro on our robot and when we turn it we get weird values back. We think we have the right gain and everything is wired correctly but when we turn a full turn we get different values. The values aren't normal either, they are like 3 or 5 or something like that. What would cause this? Could we have the wrong gain? Is the gyro we are using just to fast to be used on our robot (110 degrees per second)?
Reply With Quote
  #2   Spotlight this post!  
Unread 20-02-2011, 19:25
MotorHead's Avatar
MotorHead MotorHead is offline
Programming Mentor
AKA: Jeff Beltramo
FRC #1922 (OZ-Ram)
Team Role: Coach
 
Join Date: Jan 2008
Rookie Year: 2006
Location: Concord, NH
Posts: 68
MotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to beholdMotorHead is a splendid one to behold
Re: Weird Gyro Values

Did you try to read the gyro using sample code or your code? I like to use the sample code first to eliminate possibility of software problem. Base on the random readings, I would also verify wired correctly. Could just be seeing electrical noise.

As to if the gyro is to fast. It can never be fast enough! Seriously, this is just the frequency response of the sensor. The higher the value, just means it is capable of responding to faster turn rates. Has nothing really to do with the software reading it.
__________________
Jeff Beltramo
Team #1922
Concord, New Hampshire

Reply With Quote
  #3   Spotlight this post!  
Unread 20-02-2011, 21:27
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Weird Gyro Values

Ok, so I just looked at our gyro (other programer had it first) and it keeps counting even when not moving. I think it might be noise on the cable. We have a shielded cable but where can we ground the cable to since we are not allowed to use the normal chassis as ground.
Reply With Quote
  #4   Spotlight this post!  
Unread 21-02-2011, 11:22
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,579
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: Weird Gyro Values

It's normal for there to be some drift in the reading over time. A few degrees per minute is normal.
Reply With Quote
  #5   Spotlight this post!  
Unread 23-02-2011, 00:53
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Weird Gyro Values

Quote:
Originally Posted by Joe Ross View Post
It's normal for there to be some drift in the reading over time. A few degrees per minute is normal.
What about a like a degree a second? Also is there anyway to reduce all the noise?
Reply With Quote
  #6   Spotlight this post!  
Unread 23-02-2011, 00:59
WizenedEE's Avatar
WizenedEE WizenedEE is offline
Registered User
AKA: Adam
FRC #3238 (Cyborg Ferrets)
Team Role: Leadership
 
Join Date: Jan 2011
Rookie Year: 2010
Location: Anacortes, WA
Posts: 395
WizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to allWizenedEE is a name known to all
Re: Weird Gyro Values

Yes. I looked at the datasheet for the gyroscope, and it says that the gain is 7ms per degree per second. The "default" gain foo the gyroscope function is something like .125. I changed that to .007, according to the datasheet.

Try that. I'm not sure it will work though, sorry. We haven't tested the gyro recently.
Reply With Quote
  #7   Spotlight this post!  
Unread 23-02-2011, 01:04
kgzak's Avatar
kgzak kgzak is offline
Registered User
AKA: Kris
FRC #4392 (Decievers) FRC #2075 (Enigma)
Team Role: College Student
 
Join Date: Dec 2008
Rookie Year: 2008
Location: Grand Rapids, Michigan
Posts: 418
kgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to beholdkgzak is a splendid one to behold
Re: Weird Gyro Values

Quote:
Originally Posted by WizenedEE View Post
Yes. I looked at the datasheet for the gyroscope, and it says that the gain is 7ms per degree per second. The "default" gain foo the gyroscope function is something like .125. I changed that to .007, according to the datasheet.

Try that. I'm not sure it will work though, sorry. We haven't tested the gyro recently.
we bought a different gyro and have set the gain. It reads fairly accurate now but you watch the value and it counts down by almost 1 degree per second. we've also tried bigger and small Volts per degree per second (V/D/S). Also for some odd reason, no matter what we set the V/D/S it still gives us a pretty decent reading. Even 12 V/D/S on a 3 volt gyro
Reply With Quote
  #8   Spotlight this post!  
Unread 25-02-2011, 01:27
apalrd's Avatar
apalrd apalrd is offline
More Torque!
AKA: Andrew Palardy (Most people call me Palardy)
VRC #3333
Team Role: College Student
 
Join Date: Mar 2009
Rookie Year: 2009
Location: Auburn Hills, MI
Posts: 1,347
apalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond reputeapalrd has a reputation beyond repute
Re: Weird Gyro Values

2 solutions:
1. Try a smaller gain. Our robot's gyro has again of 1/200, to give you some perspective.

2. Reboot. And, while you reboot, don't touch the gyro

The WPI Gyro implementation is horrible, because it polls the gyro for 2s while booting up and determines the center point. It would be much better to calibrate this center, as you wouldn't have issues where it polls the gyro while it is moving (such as if you are holding it, or positioning your robot on the field).

FYI: I managed to saturate a 150deg/sec gyro with our robot. Good thing we don't need to turn that fast, ever. 110 seems a bit slow, but if you are only using it during slow processes it could work.
__________________
Kettering University - Computer Engineering
Kettering Motorsports
Williams International - Commercial Engines - Controls and Accessories
FRC 33 - The Killer Bees - 2009-2012 Student, 2013-2014 Advisor
VEX IQ 3333 - The Bumble Bees - 2014+ Mentor

"Sometimes, the elegant implementation is a function. Not a method. Not a class. Not a framework. Just a function." ~ John Carmack
Reply With Quote
  #9   Spotlight this post!  
Unread 25-02-2011, 08:49
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Weird Gyro Values

The WPI Gyro code collects two seconds of data in Open, not Bootup.

If you want to calibrate at a known time, open the gyro at that time. Perhaps it should be another call, and I definitely want the help to be updated to call out when the calibration takes place and that the gyro should be immobile.

If you think the robot was moving when the calibration took place, just rerun the code, no need to reboot.

Greg McKaskle
Reply With Quote
  #10   Spotlight this post!  
Unread 25-02-2011, 10:30
Chris Hibner's Avatar Unsung FIRST Hero
Chris Hibner Chris Hibner is offline
Eschewing Obfuscation Since 1990
AKA: Lars Kamen's Roadie
FRC #0051 (Wings of Fire)
Team Role: Engineer
 
Join Date: May 2001
Rookie Year: 1997
Location: Canton, MI
Posts: 1,488
Chris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond reputeChris Hibner has a reputation beyond repute
Re: Weird Gyro Values

The other people have said it in a round about kind of way, but I'll clarify it here:

If you are using a gyro:

DO NOT move the robot after power on until you enable it (it really needs a few seconds of zero motion, but I'd wait until you enable it to be safe).

After power up, there is a period of time when the CPU is determining what the voltage is of a non-moving gyro. Let's say that during this period you move the robot 2 degrees, and this "gyro-zeroing" period lasts 2 seconds. That means you've moved the robot an average of 1 deg/sec. When the zeroing routine is finished and the robot is sitting still, it thinks it's spinning at -1 deg/sec (since 1 deg/sec is what it thought was "still). Therefore your gyro reading will be changing at -1 deg/s

So, be absolutely sure that once you turn on the power, your robot does not move at all.
__________________
-
An ounce of perception is worth a pound of obscure.
Reply With Quote
  #11   Spotlight this post!  
Unread 26-05-2013, 15:49
Richard100 Richard100 is offline
Registered User
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Southern Maryland
Posts: 79
Richard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to behold
For Greg McKaskle - Re: Weird Gyro Values

Greg - I realize this is an old post. There is mention about how a gyro center voltage (for rate) is determined ... specifically that the Gyro Open vi polls the gyro for two seconds for its calibration. I gather that this would average the gyro voltage over the two seconds and save it as the reference voltage for a zero deg/sec turn rate.

I took a look at the current Gyro Open (WPI library included with LabVIEW 2012), and am not seeing this polling operation. In fact, it seems to expect you to provide this center voltage, although the vi has an I/O design apparently intended to allow you to customize the use and time period of this calibration. There is also Honeywell compass and SparkFun IMU code that looks ... unfinished (to me). I suppose the WPI library has gone through additional development since the original post, but now I'm not sure how this is supposed to work.

How is the gyro center voltage for zero deg/sec determined today?
Is IMU support in development?
Is there a reference describing how these vi's are supposed to work under the hood?

Thanks
Reply With Quote
  #12   Spotlight this post!  
Unread 26-05-2013, 16:54
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Weird Gyro Values

Sorry I'm not Greg, but the "polling" is performed by the FPGA.
The Gyro Open simply waits while the FPGA is collecting data and takes the result after a (default) time of 2 seconds.
The default of the Gyro Open has True for Calibrate on Open, so the True Case gets executed.
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle
Reply With Quote
  #13   Spotlight this post!  
Unread 26-05-2013, 17:20
Greg McKaskle Greg McKaskle is offline
Registered User
FRC #2468 (Team NI & Appreciate)
 
Join Date: Apr 2008
Rookie Year: 2008
Location: Austin, TX
Posts: 4,752
Greg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond reputeGreg McKaskle has a reputation beyond repute
Re: Weird Gyro Values

Thanks substitute-Greg.
Reply With Quote
  #14   Spotlight this post!  
Unread 27-05-2013, 10:54
Richard100 Richard100 is offline
Registered User
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: Nov 2009
Rookie Year: 2008
Location: Southern Maryland
Posts: 79
Richard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to beholdRichard100 is a splendid one to behold
Re: Weird Gyro Values

Thank you for the information ... but, here is the Gyro Open back panel. Where is the True case? How exactly is the Center Voltage updated?
What am I missing?
Attached Thumbnails
Click image for larger version

Name:	Gyro Open.png
Views:	26
Size:	75.3 KB
ID:	14893  
Reply With Quote
  #15   Spotlight this post!  
Unread 27-05-2013, 11:12
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Just Itinerant
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 8,833
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Weird Gyro Values

You're the victim of versionitis.
That is the PC version of Gyro Open, not the cRIO version.
When the Gyro Open code is loaded for a PC Target, and PCs don't have an FPGA, you get a version that runs on a PC Target cRIO simulator.
This misdirection is usually encountered when you open a blank vi (defaults to a PC Target) and drop a cRIO specific library vi onto it just to look at it.

Open a robot framework project (cRIO target) and drop a Gyro Open on it, then drill down to take a look.
Attached Thumbnails
Click image for larger version

Name:	GyroOpen-cRIOversion.png
Views:	25
Size:	78.2 KB
ID:	14894  
__________________
"Rationality is our distinguishing characteristic - it's what sets us apart from the beasts." - Aristotle

Last edited by Mark McLeod : 27-05-2013 at 11:35.
Reply With Quote
Reply


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 20:29.

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