Go to Post That's is why I raised this question, becuase I do not know all the facts (I doubt anyone does). - Ken Leung [more]
Home
Go Back   Chief Delphi > Technical > Control System > Sensors
CD-Media   CD-Spy  
portal register members calendar search Today's Posts Mark Forums Read FAQ rules

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Spotlight this post!  
Unread 04-04-2013, 13:54
trilogy2826's Avatar
trilogy2826 trilogy2826 is offline
Mentor - 2826
AKA: Jake Fischer
FRC #2826 (Wave Robotics)
Team Role: Mentor
 
Join Date: Nov 2008
Rookie Year: 2006
Location: Oshkosh, WI
Posts: 113
trilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond reputetrilogy2826 has a reputation beyond repute
Delay after resetting Gyro

Background:
-C++
-KOP Gyro
-4-Slot cRIO
-Gyro plugged into Analog Channel 1:1

Issue:
After calling gyro.Reset(), it takes approximately 50 to 100 ms for the gyro to zero.

Symptoms:
Our Auto control (where the gyro interface lives) is running in a separate task than MyRobot. MyRobot (when running in auto mode) calls a series of actions, in this case turning the robot to a specified angle.

For each spin request, a new task is created and the gyro is reset immediately after the task runs.
The condition to end the task and permit the next to begin is based on the proximity to the angle goal (in this case within 1 degree). When this occurs, the task exits and is deleted.

One such sequence was to spin the robot Counterclockwise 45 degrees, then Clockwise 45 degrees, for a total of 4 cycles. In competition, this is a very impractical function, but this was used to measure spatial accuracy after several consecutive spins.

So the odd part is that once one spin task is completed, MyRobot calls another. Using a console print of the gyro angle right after the gyro.Reset() at the top of the task shows that the gyro has not yet reset. The issue is that if the gyro has not reset, when the task exit condition is reached, it is incorrectly satisfied and the task exits without doing the intended function.

Through experimentation, adding a simple Wait(x) after the gyro.Reset() in the task allows proper "time" for the gyro to complete the reset. we found the time x to be a little flaky at 50ms and pretty stable at 100ms.

In the end...
After doing some digging, after Reset() is called a few other tasks are generated in the AnalogChannel class, so maybe some delay is inherent with this. It's unlikely that this is a practical issue, I would just like to understand the mechanics behind this and create a discussion on the behind the scenes Gyro implementation.

Thanks in advance for any advice
Reply With Quote
 


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 08: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