Go to Post If you can spare 2 minutes (And I know you can, because the season’s over and you’re STILL on Chief Delphi) - LVMastery [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

 
 
 
Thread Tools Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #3   Spotlight this post!  
Unread 09-02-2008, 10:53
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,586
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: 2008 Gyro Code

Process_Gyro_Data() should be called in a spin function, as it needs to process the data after each interrupt and the telop function isn't fast enough.

Code:
		Start_Gyro_Bias_Calc();
		
		
		while (t2 < 76)
		{
			printf("Calculating gyro bias. State: %d.\n\r", Get_Gyro_Bias_Status());
			//Start_Gyro_Bias_Calc();
			t2++;
		}
		

		Stop_Gyro_Bias_Calc();
The bias calc should last for several seconds. This starts the gyro bias calc, runs the while loop very quickly, and then stops the gyro bias calc too soon.

You should start the bias calc when t2=0, change your while loop to an if statement (so it gets called once each time through telop()) and stop it when t2=76 (or higher, since longer is better). You might also want to consider a delay so that the bias calc doesn't start right away, for everything to stabilize.

Kevin has an example of all this in the ifi_frc_sensor project.
 


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
Gyro code problem AMIRAM Programming 10 23-01-2006 04:26
problems using gyro/adc code with camera default code tanstaafl Programming 7 22-01-2006 23:09
gyro code odin892 Programming 2 08-04-2003 14:50
Gyro Chip Code archiver 2001 4 24-06-2002 00:57


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

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