Go to Post There are so many creative and brilliant minds out there that build wonderful inventions and machines---surely we can be equally creative and open minded ... - Tonya Scott 476 [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 08-11-2007, 09:07
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
Deventeh Digatal - CMPS03 - Robot Compass Module

I am in desperate need of help, I have been trying to integrate this compass for a while now with out any luck. At first we used interrupt code to read it, but the RC loop was too slow and did not give a accurate reading.


The compass has two interfaces, I2C, PWM. The PWM method is the one that did not work. Now since the RC is not compatible with I2C we bought a converter, it converts I2C to RS232. That means we have to connect it though the TLL port. But I have not experience with programming that port. Can anyone help me out. Anyone?


Thank You!
__________________
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

  #2   Spotlight this post!  
Unread 08-11-2007, 09:59
Daniel_LaFleur's Avatar
Daniel_LaFleur Daniel_LaFleur is offline
Mad Scientist
AKA: Me
FRC #2040 (DERT)
Team Role: Engineer
 
Join Date: Apr 2005
Rookie Year: 2003
Location: Peoria, IL
Posts: 1,964
Daniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond reputeDaniel_LaFleur has a reputation beyond repute
Send a message via MSN to Daniel_LaFleur
Re: Deventeh Digatal - CMPS03 - Robot Compass Module

Quote:
Originally Posted by kE7JLM View Post
I am in desperate need of help, I have been trying to integrate this compass for a while now with out any luck. At first we used interrupt code to read it, but the RC loop was too slow and did not give a accurate reading.


The compass has two interfaces, I2C, PWM. The PWM method is the one that did not work. Now since the RC is not compatible with I2C we bought a converter, it converts I2C to RS232. That means we have to connect it though the TLL port. But I have not experience with programming that port. Can anyone help me out. Anyone?


Thank You!

You may want to consider converting the PWM signal to an analog 0-5 Volt signal using something like this and then putting it into the analog in ports on the RC.
__________________
___________________
"We are not now that strength which in old days moved earth and heaven; that which we are, we are;
One equal temper of heroic hearts, Made weak by time and fate, but strong in will
To strive, to seek, to find, and not to yield. "
- Tennyson, Ulysses
  #3   Spotlight this post!  
Unread 08-11-2007, 11:35
Alan Anderson's Avatar
Alan Anderson Alan Anderson is offline
Software Architect
FRC #0045 (TechnoKats)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Kokomo, Indiana
Posts: 9,113
Alan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond reputeAlan Anderson has a reputation beyond repute
Re: Deventeh Digatal - CMPS03 - Robot Compass Module

Quote:
Originally Posted by kE7JLM View Post
At first we used interrupt code to read it, but the RC loop was too slow and did not give a accurate reading.
I don't understand what you mean. Using interrupts should make reading the sensor independent of the "RC loop".

Quote:
...since the RC is not compatible with I2C...
The RC will talk to I2C devices. You just need to write the program to control the I/O pins with appropriate timing.
  #4   Spotlight this post!  
Unread 08-11-2007, 14:38
Phil Mack Phil Mack is offline
Registered User
FRC #0836 (RoboBees)
Team Role: Mentor
 
Join Date: May 2007
Rookie Year: 2007
Location: Maryland
Posts: 30
Phil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to beholdPhil Mack is a splendid one to behold
Re: Deventeh Digatal - CMPS03 - Robot Compass Module

Quote:
Originally Posted by kE7JLM View Post
I have not experience with programming that port.
Hello,
first, start by using Kevin's implementation of the serial drivers. you can download that at http://www.kevin.org/frc/frc_serial_ports.zip

You can then use the Read_Serial_Port and Write_Serial_Port functions to asynchronously send and receive bytes to either serial port.

Check in the documentation for the converter and the documentation for the compass to find out what bytes to send. If you are still using the emicros device, the documentation is at http://www.emicros.com/useri2c.zip and explains what you need to send to the converter to send a message over the I2C bus. It has complete examples that show exactly what you need to do.

Good luck,
~Phil
  #5   Spotlight this post!  
Unread 08-11-2007, 16:34
JamesBrown JamesBrown is offline
Back after 4 years off
FRC #5279
Team Role: Engineer
 
Join Date: Nov 2004
Rookie Year: 2005
Location: Lynchburg VA
Posts: 1,277
JamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond reputeJamesBrown has a reputation beyond repute
Re: Deventeh Digatal - CMPS03 - Robot Compass Module

Quote:
Originally Posted by kE7JLM View Post
I am in desperate need of help, I have been trying to integrate this compass for a while now with out any luck. At first we used interrupt code to read it, but the RC loop was too slow and did not give a accurate reading.

Thank You!
To read the pulse width from the compass you really need to write an interrupt function that uses the internal clock to count when the signal goes high and stop counting when the signal goes low. You can take this count convert it into microseconds (bases on frequency of the controllers internal clock) and then divide that by 100 to get a number in degrees.

I am not sure if you are using it for FIRST but be warned computers and other large metal objects will severely effect the heading of the compass. I am using one for a project for one of my classes, in the room where we have class the magnetic field varies so much that when the car with the compass is told to drive in a straight line you end up driving in a wave like shape. However in better settings (in this case a huge gymnasium) we use the compass with the same control algorithms on a blimp and get much better results.
__________________
I'm Back


5279 (2015-Present)
3594 (2011)
3280 (2010)
1665 (2009)
1350 (2008-2009)
1493 (2007-2008)
1568 (2005-2007)
  #6   Spotlight this post!  
Unread 08-11-2007, 19:08
jgannon's Avatar
jgannon jgannon is offline
I ᐸ3 Robots
AKA: Joey Gannon
no team
 
Join Date: Feb 2004
Rookie Year: 2004
Location: Pittsburgh, PA
Posts: 1,467
jgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond reputejgannon has a reputation beyond repute
Re: Deventeh Digatal - CMPS03 - Robot Compass Module

Hi John,
I already posted some code and instructions to help you out in another thread:

http://www.chiefdelphi.com/forums/sh...9&postcount=15

It'd be nice to hear one way or another if this worked out for you.
__________________
Team 1743 - The Short Circuits
2010 Pittsburgh Excellence in Design & Team Spirit Awards
2009 Pittsburgh Regional Champions (thanks to 222 and 1218)
2007 Pittsburgh Website Award
2006 Pittsburgh Regional Champions (thanks to 395 and 1038)
2006 Pittsburgh Rookie Inspiration & Highest Rookie Seed

Team 1388 - Eagle Robotics
2005 Sacramento Engineering Inspiration
2004 Curie Division Champions (thanks to 1038 and 175)
2004 Sacramento Rookie All-Star

_
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
Programming a Devantech Magnetic Compass - CMPS03 kE7JLM Programming 7 28-09-2007 08:23
Interfacing a digital compass with the RC Kelly Electrical 14 27-09-2007 19:01
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 00:22.

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