Go to Post When I invite a woman to dinner, I expect her to look at my face. That's the price she has to pay. - dlavery [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 28-09-2007, 00:31
kE7JLM's Avatar
kE7JLM kE7JLM is offline
KE7JLM `
AKA: John Harris
FRC #0842 (Falcon Robotics)
Team Role: Driver
 
Join Date: May 2007
Rookie Year: 2006
Location: Phoenix, AZ`
Posts: 136
kE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to allkE7JLM is a name known to all
Send a message via MSN to kE7JLM
Re: Programming a Devantech Magnetic Compass - CMPS03

Ok I was vague on the problems with the compass, so here is the problem-
I am using the IFI Dashboard to read the PWM output (0-255) but when I turn on the robot the value shots up to 60 (not exactly) then quickly goes back to 0 then repeats the process at a slower rate. Then about a minute in to the process it eventually stops at 28. Nothing affect the process, if I turn the compass or put it by the motors it stays the same.
This is the Aliases-
* Below are aliases for reading an analog voltage on the ANALOG INPUTS
* using the Get_Analog_Value() function.
*/
#define Temp_Guage ADC_CH0
#define Pressure_Guage ADC_CH1
#define rc_ana_in03 ADC_CH2

#define Compass ADC_CH3
#define rc_ana_in05 ADC_CH4
#define rc_ana_in06 ADC_CH5
#define rc_ana_in07 ADC_CH6
#define rc_ana_in08 ADC_CH7
#define rc_ana_in09 ADC_CH8
#define rc_ana_in10 ADC_CH9
#define rc_ana_in11 ADC_CH10
#define rc_ana_in12 ADC_CH11
#define rc_ana_in13 ADC_CH12
#define rc_ana_in14 ADC_CH13
#define rc_ana_in15 ADC_CH14
#define rc_ana_in16 ADC_CH15

#define SIXTEEN_ANALOG ADC_16ANA /* All analog */


This is how I call it-
pwm11 = Get_Analog_Value(Pressure_Guage)/4;
pwm12 = Get_Analog_Value(Temp_Guage)/4.023;

pwm13 = Get_Analog_Value(Compass)/4.023;
{
unsigned int temp;
temp = Get_Analog_Value(Compass);
temp *= 4023; //fraction version of
temp /= 1000; //your conversion factor - avoid floating point
pwm13 = (unsigned char)temp;
printf("%d", pwm13);
}


Thank you!
By the way, I am using the Devantech Magnetic Compass - CMPS03 on a ROV so there no other robots around and also the motors we are using are about a 1.5 feet away and are small. (Nothing like the big CIMs) The only things that could interfere is the Aluminum water proof housing, or the electronics beside the compass.


Heres a link to some Pictures if that could help you- (The compass is not in these pictures but is inside the Aluminum water proof housing)
http://picasaweb.google.com/KE7JLM/RobotAllan
__________________
Team 842 Programmer

Pictures at:
http://picasaweb.google.com/KE7JLM
&
http://picasaweb.google.com/john.h.842

Videos -
http://www.youtube.com/user/KE7JLM

When your not busy with FIRST try NURC


Last edited by kE7JLM : 28-09-2007 at 00:34.
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
Interfacing a digital compass with the RC Kelly Electrical 14 27-09-2007 19:01
Where can I get a digital compass sensor? EHaskins Technical Discussion 6 26-09-2007 18:33
I2C Digital Compass Programming CyberWolf_22 Programming 7 03-01-2005 00:20
Political Compass Joshua May Chit-Chat 11 01-10-2004 22:32
Compass/direction sensor Frank(Aflak) Technical Discussion 10 06-04-2003 09:18


All times are GMT -5. The time now is 15:20.

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