|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
Re: Programming a Devantech Magnetic Compass - CMPS03
Interfacing a digital compass is a good project. However, after you master the compass you may not find it meets your needs. These devices measure the earths magnetic field in 2 axis and can give orientation. The problem is a FRC robot usually has some ferrous metal in it and our motors have some big powerful magnets in them. Even if you mounted the compass far away from these fields, they will affect them. You can calibrate for hard iron effects but the margin of error is going to be less than desirable. I played with a PNI VX2e and the best I could get with a FRC robot environment was +- 5 degrees. That was with out the motors running. If another robot is near you and it has allot of ferrous metal, The compass is going to get real bad. I have given up on digital compasses for FRC uses. For the tele-operated part of the match the organic analog computer- sensor network between the drivers ears may be your best bet for detecting the robots orientation. Don't give up though. The skills you learn for the compass have other applications for our robots.
|
|
#2
|
||||
|
||||
|
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 Last edited by kE7JLM : 28-09-2007 at 00:34. |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|
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 |