Chief Delphi

Chief Delphi (http://www.chiefdelphi.com/forums/index.php)
-   Programming (http://www.chiefdelphi.com/forums/forumdisplay.php?f=51)
-   -   How do I change the Gyro & Acc analog chanels? (http://www.chiefdelphi.com/forums/showthread.php?t=63946)

TEAM1949 13-02-2008 08:40

How do I change the Gyro & Acc analog chanels?
 
In Kevins codes how do I do that?

tnx ahead.

eaglesfan10 13-02-2008 08:48

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.

TEAM1949 13-02-2008 09:21

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?

Kevin Watson 13-02-2008 13:38

Re: How do I change the Gyro & Acc analog chanels?
 
Quote:

Originally Posted by TEAM1949 (Post 697954)
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

TEAM1949 14-02-2008 08:17

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?

Qbranch 14-02-2008 08:19

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

Kevin Watson 14-02-2008 12:01

Re: How do I change the Gyro & Acc analog chanels?
 
Quote:

Originally Posted by TEAM1949 (Post 698681)
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

TEAM1949 14-02-2008 12:42

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?


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

Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi