Go to Post I've found that housework is more fun with power tools. - RogerR [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 20-02-2006, 18:30
Prgrmin' Prgrmin' is offline
Registered User
FRC #1721
 
Join Date: Feb 2006
Location: NH
Posts: 1
Prgrmin' is an unknown quantity at this point
Send a message via AIM to Prgrmin'
GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

We have just hooked up our gear tooth sensors and finally started getting readouts. problem is there are 238 gear tooths and when we spin it around we get gear counts in the hundred millions. we have no idea of why the gear count is reading out like this. We are using the easyC to program the geartooth sensors. Any input on what to do or what might be causing this problem would be much appriciated.
  #2   Spotlight this post!  
Unread 20-02-2006, 22:36
Rombus's Avatar
Rombus Rombus is online now
Registered User
AKA: Rick Kosbab
FRC #4188 (Columbus Space Program)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 2005
Location: Opelika, AL
Posts: 346
Rombus is a jewel in the roughRombus is a jewel in the roughRombus is a jewel in the rough
Send a message via AIM to Rombus
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Hate to be the bearer of bad news, but i THINK the gear tooth sensors only sense direction, not tooth count.

http://www2.usfirst.org/2006comp/oth..._Operation.pdf
__________________


  #3   Spotlight this post!  
Unread 20-02-2006, 22:52
Dad1279 Dad1279 is offline
Registered User
FRC #1279 (Cold Fusion)
Team Role: Mentor
 
Join Date: Jan 2005
Rookie Year: 2004
Location: NJ
Posts: 511
Dad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud ofDad1279 has much to be proud of
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Quote:
Originally Posted by Rombus
Hate to be the bearer of bad news, but i THINK the gear tooth sensors only sense direction, not tooth count.

http://www2.usfirst.org/2006comp/oth..._Operation.pdf
They definitely count. With Easy C, are you preseting them with zero?
  #4   Spotlight this post!  
Unread 21-02-2006, 19:48
Mark_K Mark_K is offline
Registered User
FRC #1721 (Charette)
Team Role: Mentor
 
Join Date: Feb 2006
Rookie Year: 2001
Location: Concord NH
Posts: 9
Mark_K will become famous soon enoughMark_K will become famous soon enough
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

The actual issue is the sample code included with EZ C. The printf display of the geartooth variable needs to be cast as a long. Otherwise the upper bytes will be filled in with random data that will make the count look incorrect.
  #5   Spotlight this post!  
Unread 21-02-2006, 22:59
TimCraig TimCraig is offline
Registered User
AKA: Tim Craig
no team
 
Join Date: Aug 2004
Rookie Year: 2003
Location: San Jose, CA
Posts: 221
TimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to beholdTimCraig is a splendid one to behold
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Actually, the gear tooth sensor should sense ONLY counts and give NO CLUE as to direction.
  #6   Spotlight this post!  
Unread 21-02-2006, 23:01
gnirts gnirts is offline
Suspicious pointer conversion
AKA: Robinson Levin
FRC #1648 (The Gearbox Gangstaz)
Team Role: Programmer
 
Join Date: Jan 2006
Rookie Year: 2005
Location: ATL
Posts: 116
gnirts will become famous soon enough
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Quote:
Originally Posted by TimCraig
Actually, the gear tooth sensor should sense ONLY counts and give NO CLUE as to direction.
Apparently, direction is possible. Just a little more convoluted.

See "GTS Counting" at http://www.chiefdelphi.com/forums/sh...threadid=44479
__________________
'... who are you, then?'
'I am part of that power which eternally
wills evil and eternally works good.'
Goethe, Faust
  #7   Spotlight this post!  
Unread 21-02-2006, 23:26
Stuart's Avatar
Stuart Stuart is offline
#include coffee.h
FRC #1745 (P51- Mustangs)
Team Role: Mentor
 
Join Date: Jan 2006
Rookie Year: 2004
Location: Dallas, TX
Posts: 414
Stuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond reputeStuart has a reputation beyond repute
Send a message via AIM to Stuart
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

well you should know what way you are turrning your motor . .so while the sensor may not know what way its going your code can.


if(motorPWM# <127)
gtscountdown():
if(motorPWM# >127)
gtscountup();
__________________
Proud mentor of Team #1745 the P-51 Mustangs

If at first it doesn't work, use a hammer.
If that doesn't work, use a bigger hammer.
  #8   Spotlight this post!  
Unread 22-02-2006, 01:13
b_mallerd b_mallerd is offline
Programmer
FRC #1346 (Trobotics)
Team Role: Programmer
 
Join Date: Dec 2005
Rookie Year: 2005
Location: Vancouver
Posts: 35
b_mallerd is on a distinguished road
Send a message via MSN to b_mallerd
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Sadly, that only works in theory.

When you are stopping and your motors are getting a pwm of 127 the gears still spin for a little bit. I guess this wouldn't matter too too much but then your gear count wouldn't register during these times.
__________________
  #9   Spotlight this post!  
Unread 22-02-2006, 09:09
Cuog's Avatar
Cuog Cuog is offline
Registered Linux User: 390661
AKA: Alex
FRC #0422
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2004
Location: Richmond, Virginia
Posts: 852
Cuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond reputeCuog has a reputation beyond repute
Send a message via AIM to Cuog
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

i have found that using the IR sensors they gave us a few years ago and a visual encoder will also give fairly accurate results and with very little programming. The code to handle all the stuff for our visual encoders is about 10 lines in total including overload handling and reset capability.
__________________
KK4KQO
http://voltair.us
Too many projects, too little time.
  #10   Spotlight this post!  
Unread 22-02-2006, 10:59
jzampier's Avatar
jzampier jzampier is offline
Finger Lakes Regional Staff
AKA: Jeffrey Zampieron
no team (-)
Team Role: Engineer
 
Join Date: Jan 2003
Rookie Year: 2001
Location: Rochester
Posts: 74
jzampier is on a distinguished road
Send a message via AIM to jzampier
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

I tried counting teeth (well sort of... I was using an optical sensor to count the number of revs of a shaft collar). I found the best way is to hook up the output of the sensor to an interrupt pin. That way when the sensor trips you increment your count (or decrement, depending on which way the motor was going last, use a tracking variable).

It's quite a bit more accurate than counting in the main loop as the IRQ time on those PICs is in the microseconds.
And, it's largely free.
__________________
"Put your hand on a hot stove for a minute, and it seems like an hour.
Sit with a pretty girl for an hour,
and it seems like a minute. THAT'S relativity." -Einstein

----
First Resume: (If I can remember)
2001 NJ Regional
2001 Championship
2002 NYC Regional
2003 OH Regional
2003 Championship
2004 OH Regional
2005 Finger Lakes Regional
2006 Finger Lakes Regional (yes!)
  #11   Spotlight this post!  
Unread 22-02-2006, 11:43
Gdeaver Gdeaver is online now
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

In my opinion the gear tooth sensors are a pain. A cheap alternative solution is to use the vex encoders in place of the gear tooth sensors. They work with the same Easy-C functions as the gear tooth sensors. They are also higher resolution. They can be added to the kit chassis and frame very easily. The KOP trans output shaft is tapped. A piece of threaded rod can be coupled to a piece of 1/8" key stock. Attach the encoder with a piece of 1/16" aluminum angle. You'll need a female by female PWM extension cable.
Works very well for going "x" feet during autonomous. Could easily be done Thurs. morning.
  #12   Spotlight this post!  
Unread 23-02-2006, 16:39
Chriszuma's Avatar
Chriszuma Chriszuma is offline
Jack of all trades
AKA: Chris Hammond
FRC #0068 (Truck Town Thunder)
Team Role: Alumni
 
Join Date: Oct 2004
Rookie Year: 2005
Location: Clarkston, MI
Posts: 290
Chriszuma is just really niceChriszuma is just really niceChriszuma is just really niceChriszuma is just really nice
Send a message via AIM to Chriszuma
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Quote:
Originally Posted by Gdeaver
In my opinion the gear tooth sensors are a pain. A cheap alternative solution is to use the vex encoders in place of the gear tooth sensors. They work with the same Easy-C functions as the gear tooth sensors. They are also higher resolution. They can be added to the kit chassis and frame very easily. The KOP trans output shaft is tapped. A piece of threaded rod can be coupled to a piece of 1/8" key stock. Attach the encoder with a piece of 1/16" aluminum angle. You'll need a female by female PWM extension cable.
Works very well for going "x" feet during autonomous. Could easily be done Thurs. morning.
How do you interface with those in the code? Does it just give you a tick every revolution or something similar?

EDIT: 200th post! w00t!
  #13   Spotlight this post!  
Unread 23-02-2006, 20:27
Gdeaver Gdeaver is online now
Registered User
FRC #1640
Team Role: Mentor
 
Join Date: Mar 2004
Rookie Year: 2001
Location: West Chester, Pa.
Posts: 1,370
Gdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond reputeGdeaver has a reputation beyond repute
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

The Vex encoders give 90 counts per revolution. There is no direction info. The same easy-c function that is for the gear tooth sensor can be used for the Vex encoder. They are not of the Grayhill quality or cost. You wouldn't want to use one to measure the shooter wheel RPM but for measuring distance they're not to bad.
  #14   Spotlight this post!  
Unread 25-02-2006, 13:10
Denz's Avatar
Denz Denz is offline
Registered User
FRC #0772 (Sabre Bytes Robotics)
Team Role: Programmer
 
Join Date: Jan 2006
Location: LaSalle, Ont, Canada
Posts: 66
Denz is on a distinguished road
Send a message via MSN to Denz
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

When using GTS do you have to use interrupts? Because we wrote a code using simple counters, it kinda works. It would be great if maybe someone could help us up and give like a sample code for the gts. Thanks!
__________________
www.sabrerobotics.com
  #15   Spotlight this post!  
Unread 25-02-2006, 13:16
Tom Bottiglieri Tom Bottiglieri is offline
Registered User
FRC #0254 (The Cheesy Poofs)
Team Role: Engineer
 
Join Date: Jan 2004
Rookie Year: 2003
Location: San Francisco, CA
Posts: 3,188
Tom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond reputeTom Bottiglieri has a reputation beyond repute
Re: GearTooth Sensor Destroying Hopes of Autonomous~!!!!!!

Quote:
Originally Posted by Denz
When using GTS do you have to use interrupts? Because we wrote a code using simple counters, it kinda works. It would be great if maybe someone could help us up and give like a sample code for the gts. Thanks!
Using interrupts really isnt as hard as it seems. You can even use the same code you've already written.. Just take the guts of your counter, put it in a function that whenever called will add one to the counter, and call that function in the ISR for whatever interrupt you choose to use. (I1-I3 are the easiest to get set up and running.)
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:55.

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