Go to Post When mentors and students battle it's the team that loses. - Koko Ed [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

 
Closed Thread
 
Thread Tools Rate Thread Display Modes
  #1   Spotlight this post!  
Unread 13-02-2008, 08:40
TEAM1949 TEAM1949 is offline
Registered User
FRC #1949
 
Join Date: Jan 2006
Location: IsRaEl
Posts: 24
TEAM1949 is an unknown quantity at this point
How do I change the Gyro & Acc analog chanels?

In Kevins codes how do I do that?

tnx ahead.
  #2   Spotlight this post!  
Unread 13-02-2008, 08:48
eaglesfan10's Avatar
eaglesfan10 eaglesfan10 is offline
Registered User
FRC #1647 (Iron Devils)
Team Role: Programmer
 
Join Date: Oct 2007
Rookie Year: 2005
Location: New Jersey
Posts: 19
eaglesfan10 is an unknown quantity at this point
Re: How do I change the Gyro & Acc analog chanels?

Look in gyro.h. There's an option to change the analog input that the gyro is connected to.
  #3   Spotlight this post!  
Unread 13-02-2008, 09:21
TEAM1949 TEAM1949 is offline
Registered User
FRC #1949
 
Join Date: Jan 2006
Location: IsRaEl
Posts: 24
TEAM1949 is an unknown quantity at this point
Re: How do I change the Gyro & Acc analog chanels?

When I do that, I am not able to get any signal.

And what about the Accelerometer?
  #4   Spotlight this post!  
Unread 13-02-2008, 13:38
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: How do I change the Gyro & Acc analog chanels?

Quote:
Originally Posted by TEAM1949 View Post
In Kevins codes how do I do that?

tnx ahead.
Open up adc.h and define the number of channels you want the software to cycle through. The channels must be consecutive and always start at channel 1. Then you can assign the gyro to one of those enabled ADC channels.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #5   Spotlight this post!  
Unread 14-02-2008, 08:17
TEAM1949 TEAM1949 is offline
Registered User
FRC #1949
 
Join Date: Jan 2006
Location: IsRaEl
Posts: 24
TEAM1949 is an unknown quantity at this point
Re: How do I change the Gyro & Acc analog chanels?

Did that (anabled another 2 analog chanenls) and consequently the Gyro won't give me any accurate values. I guess it's because of the change in the sample rates.
What else can I do ? Change some other definitions?
  #6   Spotlight this post!  
Unread 14-02-2008, 08:19
Qbranch Qbranch is offline
wow college goes fast.
AKA: Alex
FRC #1024 (Kil-A-Bytes)
Team Role: Alumni
 
Join Date: Apr 2006
Rookie Year: 2006
Location: Indianapolis
Posts: 1,174
Qbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond reputeQbranch has a reputation beyond repute
Re: How do I change the Gyro & Acc analog chanels?

Most likely, you'll need to double your sampling rate. Make sure your system can handle this higher interrupt rate before doing it, interrupt timing issues are very difficult to debug once they crop up.

-q
__________________
Electrical Engineer Illini
1024 | Programmer '06, '07, '08 | Driver '08
  #7   Spotlight this post!  
Unread 14-02-2008, 12:01
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: How do I change the Gyro & Acc analog chanels?

Quote:
Originally Posted by TEAM1949 View Post
Did that (anabled another 2 analog chanenls) and consequently the Gyro won't give me any accurate values. I guess it's because of the change in the sample rates.
What else can I do ? Change some other definitions?
This expression, from adc_readme.txt, will allow you to calculate the update rate:

Update Rate = Sample Rate / (Samples Per Update * Number Of Channels)

If you are sampling three ADC channels and left the other settings at the default, you're only getting ~17 updates per second, which is pretty low. You'll want to bump this up to somewhere in the 50-100 updates per second range by raising the sample rate and/or lowering the number of samples per update. For grins, try changing the sample rate to 1600Hz and change the samples per update to 8 and see if it's any better.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #8   Spotlight this post!  
Unread 14-02-2008, 12:42
TEAM1949 TEAM1949 is offline
Registered User
FRC #1949
 
Join Date: Jan 2006
Location: IsRaEl
Posts: 24
TEAM1949 is an unknown quantity at this point
Thumbs up Re: How do I change the Gyro & Acc analog chanels?

yup works perfect.

A new question came up - if will increase the opened analog channels by another 2 (for example), I'll have to do this actions again?
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

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do i change the color of the scroll bar? Compnerd Website Design/Showcase 6 06-03-2007 19:40
Using gyro.c with other analog sensors no go Astronouth7303 Programming 17 03-01-2006 21:04
Need help with Gyro = Analog Devices ADXRS150EB Jack Jones Technical Discussion 9 18-07-2005 07:00
Using gyro with other analog sensors...again demerski Programming 0 19-02-2005 08:23
How do the Analog Inputs work? JBotAlan Electrical 3 07-01-2005 00:11


All times are GMT -5. The time now is 00:57.

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