Go to Post It shows more than anything, that there are students out there that want to learn, to do better, to improve their own lives and those around them. Thankfully, FIRST is there to help them realize some of their goals. - Al Skierkiewicz [more]
Home
Go Back   Chief Delphi > Technical > Programming
CD-Events   CD-Media   CD-Spy   FRC-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 02-11-2004, 10:22 PM
kor kor is offline
Registered User
#0694
 
Join Date: Feb 2004
Location: New York City
Posts: 1
kor is an unknown quantity at this point
Interrupts and rotation sensors

I want to be able to make dead reckoning code based on almost the exact position of the robot. To do this I need rotation sensors for at least one of the wheels, and I need to be able to use interrupts in the code. I'm out of my depth with the interrupt code - All I want to do is to increment a rotation count whenever I receive certain values from an analog input rotation sensor (for example, “the input”%16). I’ve looked over the heavily commented example code but I am still not sure what I need to change to make it work for one specific input. I also need a rotation sensor with which to use this code, and I have no idea where to get it. There has to be some sort of potentiometer or something that functions like the Lego rotation sensors (i.e., it can keep on turning indefinitely), but I have no idea what it would be called or where I can get it.
If anyone can help me out on either of these issues I would really appreciate it. Simply put, I need some tips on using interrupts, and I also need information on where to get rotation sensors.
  #2   Spotlight this post!  
Unread 02-11-2004, 10:36 PM
JRHaddock JRHaddock is offline
Registered User
AKA: Joey Haddock
FRC #3025 (DARC)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Decatur, AL
Posts: 7
JRHaddock is an unknown quantity at this point
Re: Interrupts and rotation sensors

http://www.chiefdelphi.com/forums/pa...le&paperid=272

I have included a link to a white paper written by Daniel Katanski which is an excellent place to start learning about this capability.

You say you want to use interrupts to increment a rotation count, but then you describe an analog measurement. The interrupts are digital inputs, typically a pulse and the pic controller can be configured to generate an interrupt on rising edge, falling edge, and (for some inputs) both edges. One method to apply this to determine the displacement of the machine would be to use a encoder on one of the drive train shafts that would generate a specific number of pulses for each revolution of the shaft. The interrupt routine would accumulate the number of pulses from a starting point and this would be directly related to displacement of the machine.
  #3   Spotlight this post!  
Unread 02-12-2004, 03:03 AM
Avarik Avarik is offline
Registered User
#0022
 
Join Date: Jan 2004
Location: Chatsworth, CA
Posts: 75
Avarik is an unknown quantity at this point
Re: Interrupts and rotation sensors

Try Kevin's encoder code, found here: Kevin's Code

Take the encoder code, and take a look at that. A few changed need to be made (don't know what specifically) and the encoder.c and encoder.h files need to be added to the frc code for it to work.

To order encoders, try digi-key. Aim for a good pulse per revolution, and make sure you don't try to get too much feedback from encoders (try to stay at around 1000? maybe 1500?) and goodluck!
  #4   Spotlight this post!  
Unread 02-12-2004, 10:05 AM
Mark McLeod's Avatar
Mark McLeod Mark McLeod is offline
Itinerant Programmer
AKA: Hey dad...Father...MARK
FRC #0358 (Robotic Eagles)
Team Role: Engineer
 
Join Date: Mar 2003
Rookie Year: 2002
Location: Hauppauge, Long Island, NY
Posts: 7,188
Mark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond reputeMark McLeod has a reputation beyond repute
Re: Interrupts and rotation sensors

Encoders is the keyword you're looking for and they are discussed in several forum threads.
Do a search on "encoder". One such thread is http://www.chiefdelphi.com/forums/showthread.php?t=16691
__________________
"A child of five could understand this. Fetch me a child of five." - Groucho Marx
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


All times are GMT -5. The time now is 07:05 AM.

The Chief Delphi Forums are sponsored by Innovation First International, Inc.


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