Go to Post Might change next year. Read the manual then too. - Billfred [more]
Home
Go Back   Chief Delphi > Technical > Programming > Java
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 19-02-2013, 22:33
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
KOP Gyro steadily decreasing

We were fooling around with a gyro, but as we print gyro.getAngle, we've noticed the angle steadily increasing as the robot sits. We've had this problem before in previous years, but we can't remember what we did to mitigate the issue. Any suggestions?
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
Reply With Quote
  #2   Spotlight this post!  
Unread 19-02-2013, 22:35
Team3266Spencer's Avatar
Team3266Spencer Team3266Spencer is offline
Team Captain and Lead Programmer
AKA: Spencer Lanman
FRC #3266 (Robots-R-US)
Team Role: Programmer
 
Join Date: Oct 2011
Rookie Year: 2012
Location: Richmond, Indiana
Posts: 280
Team3266Spencer is an unknown quantity at this point
Re: KOP Gyro steadily decreasing

Reset the gyro as often as possible in the code. The gyro we use for targeting we reset right before we move the robot so there's less time for error to develop.
__________________
2012: Buckeye Regional, Queen City Regional, Human Player
2013: Queen City Regional, Buckeye Regional, Crossroads Regional
Shooter Operator
2014: Crossroads Regional, Queen City Regional
Catapult Operator
2015: Georgia Southern Classic Regional (Winner), Queen City Regional
Chainsaw Operator
Want to talk? TeamSpeak: team3266.noip.me
Reply With Quote
  #3   Spotlight this post!  
Unread 19-02-2013, 22:44
MagiChau's Avatar
MagiChau MagiChau is offline
Registered User
AKA: Michael Chau
FRC #0085 (B.O.B. (Built on Brains))
Team Role: Alumni
 
Join Date: Jan 2010
Rookie Year: 2010
Location: Zeeland, Michigan
Posts: 875
MagiChau is just really niceMagiChau is just really niceMagiChau is just really niceMagiChau is just really nice
Re: KOP Gyro steadily decreasing

The gyro naturally accumulates error due to drift. The getAngle() it sends back is an accumulation in rate of change of angle. Error accumulates every time the gyro finds this. I agree with resetting the gyro as much as possible. There is a good white paper on gyros as well that you should read if you haven't in the following link.

http://team358.org/files/programming...rFRCRobots.pdf
Reply With Quote
  #4   Spotlight this post!  
Unread 19-02-2013, 23:20
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,572
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: KOP Gyro steadily decreasing

what rate does it drift? a few degrees in 15 seconds is a reasonable rate for an FRC gyro.
Reply With Quote
  #5   Spotlight this post!  
Unread 20-02-2013, 08:07
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: KOP Gyro steadily decreasing

As mentioned, gyros are not perfect or magic. They are a sensor circuit and are affected by a number of real-world issues such as electrical noise, temperature, and operating procedures.

Electrical noise: The heart of the sensor is an element that affects the voltage of the circuit proportional to rotational movement. Electrical noise and power dips on the input circuit look like rotation.

Temperature: The sensor's gain changes with temperature. When you boot the robot, it calibrates. If the temperature changes substantially, the sensor's assumptions are off and it will increase drift. The data sheet should indicate the amount of the temperature effect.

Procedures: It is important that the robot be steady when the program boots because it is measuring for a few seconds to identify what voltage correlates to a rotation of 0. If the robot is moving at this point, the assumptions are wrong and the gyro will spin at the opposite of that "zero" rate.

Another procedural issue is that the gyro has an upper limit on rotation. If you exceed this limit, it under-reports the rotation and throws off your idea of where the robot is pointing.

With all of these issues handled correction, it will drift, but for short periods of time, like during auto, or when aiming, you can use it for relative turning measurements.

Greg McKaskle
Reply With Quote
  #6   Spotlight this post!  
Unread 20-02-2013, 09:27
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: KOP Gyro steadily decreasing

Thanks for the responses, guys.

Quote:
Originally Posted by Team3266Spencer View Post
Reset the gyro as often as possible in the code.
Quote:
Originally Posted by MagiChau
I agree with resetting the gyro as much as possible.
As in every cycle of test/auto/teleopPeriodic()? I thought that resetting set your current point as the new reference frame.

By the way, MagiChau, thanks for the whitepaper. It is exceptionally informative.

Quote:
Originally Posted by Greg McKaskle
As mentioned, gyros are not perfect or magic. They are a sensor circuit and are affected by a number of real-world issues such as electrical noise, temperature, and operating procedures.
I understand. My concern was that the drift was exceptionally steady, which I assumed meant a problem outside of the sensor.
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
Reply With Quote
  #7   Spotlight this post!  
Unread 20-02-2013, 09:35
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: KOP Gyro steadily decreasing

Quote:
Originally Posted by brennonbrimhall View Post
I thought that resetting set your current point as the new reference frame.
Yes. So you set the current point as your new reference... when the current point is your desired zero.


Reply With Quote
  #8   Spotlight this post!  
Unread 20-02-2013, 09:37
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: KOP Gyro steadily decreasing

Quote:
Originally Posted by Ether View Post
Yes. So you set the current point as your new reference... when the current point is your desired zero.

Hence my confusion. To reset every iteration of testPeriodic(), autoPeriodic(), or teleopPeriodic() would reset my current frame of reference every 20ms. When would you suggest resetting the gyro, so that the drift is minimized, but the reference is functionally unchanged?
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.

Last edited by brennonbrimhall : 20-02-2013 at 09:39. Reason: Clarification
Reply With Quote
  #9   Spotlight this post!  
Unread 20-02-2013, 09:43
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: KOP Gyro steadily decreasing

Quote:
Originally Posted by brennonbrimhall View Post
By the way, MagiChau, thanks for the whitepaper. It is exceptionally informative.
Be aware that the paper was written years before the introduction of the cRIO and its FPGA. The FPGA handles all the integration of the yaw rate signal from the gyro. You don't have to write all that code shown in the paper.


Reply With Quote
  #10   Spotlight this post!  
Unread 20-02-2013, 09:47
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: KOP Gyro steadily decreasing

Quote:
Originally Posted by brennonbrimhall View Post
Hence my confusion. To reset every iteration of testPeriodic(), autoPeriodic(), or teleopPeriodic() would reset my current frame of reference every 20ms.
Spencer said to reset it "as often as possible", not every 20ms.


Quote:
When would you suggest resetting the gyro, so that the drift is minimized, but the reference is functionally unchanged?
It depends on the application. For example, if you're using it to measure the heading of the robot, you could have a reset button on the joystick that the driver could push whenever the robot is pointing straight downfield.


Reply With Quote
  #11   Spotlight this post!  
Unread 20-02-2013, 23:17
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: KOP Gyro steadily decreasing

Quote:
Originally Posted by Ether View Post
For example, if you're using it to measure the heading of the robot, you could have a reset button on the joystick that the driver could push whenever the robot is pointing straight downfield.
Thanks for the suggestions. Ether, for the purposes of autonomous driving, would you just ignore the sensor drift because of the short time span?
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
Reply With Quote
  #12   Spotlight this post!  
Unread 21-02-2013, 00:23
Ether's Avatar
Ether Ether is offline
systems engineer (retired)
no team
 
Join Date: Nov 2009
Rookie Year: 1969
Location: US
Posts: 8,089
Ether has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond reputeEther has a reputation beyond repute
Re: KOP Gyro steadily decreasing

Quote:
Originally Posted by brennonbrimhall View Post
for the purposes of autonomous driving, would you just ignore the sensor drift because of the short time span?
Most likely. If you have access to more than one gyro, you could test them and pick the one with the least drift.



Reply With Quote
  #13   Spotlight this post!  
Unread 21-02-2013, 08:20
brennonbrimhall brennonbrimhall is offline
Free Agent
AKA: Brennon Brimhall
no team
Team Role: Alumni
 
Join Date: Jan 2012
Rookie Year: 2012
Location: Clifton Park, NY
Posts: 222
brennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to allbrennonbrimhall is a name known to all
Re: KOP Gyro steadily decreasing

Thanks for all the help!
__________________
Team 20, 2012-2014: 4 blue banners, 5 medals, and 9 team awards.
Church of Jesus Christ of Latter-day Saints, 2014-2016: Missionary, Colorado Denver South Mission.
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 11:43.

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