Go to Post something i thought was impossible just happened: Brandon's awesomeness level has grown exponentially! just when you think he's at his peak, he does something new and extremely cool for CD. - Winged Wonder [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 06-02-2007, 08:59
buddy.smith buddy.smith is offline
Master Control
FRC #1795
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: atlanta
Posts: 20
buddy.smith is an unknown quantity at this point
Vex encoders/Interrupts

Hi,

Has anyone used the encoders with the Vex bot? We're using a Vex platform for prototyping so that the programmers can work on the drive code while everyone else builds the real thing.

If I use Kevin's encoder code with the Vex encoders, or if I use EasyC with the Vex provided encoder code, I don't quite get what I expect!

Interrupt 1 comes up as Encoder 2 (Kevin) or Interrupt 2 (Easy C)
Interrupt input 2 comes up as Encoder 4 (Kevin) or Interrupt 4 (Easy C)
3 comes up as 6, and I can't find the rest of them.

This happens on at least 2 Vex controllers, so I'm sure it's not a bad controller.

Does anyone know for sure what ports the Interrupt pins map top, or do I need to disassemble my controller and map it out with a meter?

Has anyone successfully used 4 encoders on a Vex bot, all connected as interrupts?

ttyl,

--buddy
  #2   Spotlight this post!  
Unread 07-02-2007, 00:37
JohnC's Avatar
JohnC JohnC is offline
my other name is nigel
FRC #0360 (360 Revolution)
Team Role: Programmer
 
Join Date: Mar 2005
Rookie Year: 2005
Location: user_routines.c
Posts: 100
JohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the roughJohnC is a jewel in the rough
Send a message via AIM to JohnC
Re: Vex encoders/Interrupts

I remember the Vex encoders not being quad-output, so you can't have the "phase A plugged into dig-01 and phase B plugged into dig-02" problem. Hm.

Just out of curiosity, especially if you're using tank drive, what is the purpose of putting an encoder on the front and rear wheels of the same side of the robot? Shouldn't those wheels turn the same amount anyway?

I guess it wouldn't be a bad idea to say exactly what you have plugged in exactly where. That seems to be the starting point for a lot of these questions
__________________
What place are we at? ... TODAI!
  #3   Spotlight this post!  
Unread 07-02-2007, 00:44
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: Vex encoders/Interrupts

We had the same problem last year. Interrupt pin 3 registered as encoder 6, interrupt pin 6 registered as encoder 4, and interrupt pin 4 either registered as a random thing each time, or stayed at -13. I know the answer, but my brain doesn't want to remember it right now. I will try to think about it and get back to you tomorrow.
  #4   Spotlight this post!  
Unread 07-02-2007, 00:54
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: Vex encoders/Interrupts

Quote:
Originally Posted by JohnC View Post
Just out of curiosity, especially if you're using tank drive, what is the purpose of putting an encoder on the front and rear wheels of the same side of the robot? Shouldn't those wheels turn the same amount anyway?
He probably is using one motor per wheel rather than having them chained together like the typical 4wd FRC robot. The bigger question what good encoders are on a tank drive robot other than to control wheel speed.
  #5   Spotlight this post!  
Unread 07-02-2007, 08:33
buddy.smith buddy.smith is offline
Master Control
FRC #1795
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: atlanta
Posts: 20
buddy.smith is an unknown quantity at this point
Re: Vex encoders/Interrupts

Quote:
Originally Posted by JohnC View Post
I remember the Vex encoders not being quad-output, so you can't have the "phase A plugged into dig-01 and phase B plugged into dig-02" problem. Hm.

Just out of curiosity, especially if you're using tank drive, what is the purpose of putting an encoder on the front and rear wheels of the same side of the robot? Shouldn't those wheels turn the same amount anyway?
This is no ordinary Vex bot! It's....It's...It's....frankenVex!

It's a prototype with mecanum wheels, so that our programmers can work on the mecanum drive code while the actual robot is being built. FrankenVex consists of a Vex controller, 4 Victor 884s (Motor 1-4), some power wheel motors (I think...very beefy), and the mecanum wheels.

There's a photo attached below. We need the encoders in order to make the thing drive straight!

What's plugged in where: Motors go to ports 1-4, encoders, I've tried plugging an encoder in each of the interrupt ports, and got the weird mapping I described before. I'd like to plug the encoders into ports 1-4...but I'm willing to plug them into any 4 ports such that they'll work

I think I'll probably just stick an old FRC controller onto FrankenVex, making it into FrankenFirst, since the encoders seem to work correctly on the FRC.

Here's a poor picture of it. Once I get it put back together I'll post a better one.

ttyl,

--buddy
Attached Thumbnails
Click image for larger version

Name:	frankenvex.jpg
Views:	61
Size:	83.4 KB
ID:	5025  
  #6   Spotlight this post!  
Unread 07-02-2007, 08:57
Andrew Morris's Avatar
Andrew Morris Andrew Morris is offline
Oh hey, it's build season!
FRC #0177 (Bobcat Robotics)
Team Role: Student
 
Join Date: Nov 2006
Rookie Year: 2005
Location: South Windsor
Posts: 16
Andrew Morris will become famous soon enough
Re: Vex encoders/Interrupts

Switching to an FRC controller shouldn't affect anything unless you change the code because the FRC controller and the VEX controller have the exact same microchips and are just packaged differently. Also, I was wondering how you are powering the Victors and motors because you don't appear to have a 12v FRC battery on the robot and running them off a 7.2v VEX battery could be causing your uneven drive problems if they are made to run off 12v.
__________________
2010 Newton Division & Championship Winner w/ 67 & 294
2009 CMP Champion - Newton Division
2008 CMP Champion - Archimedes Division
2007 Newton Division & Championship Winner
  #7   Spotlight this post!  
Unread 07-02-2007, 09:08
buddy.smith buddy.smith is offline
Master Control
FRC #1795
Team Role: Mentor
 
Join Date: Jan 2007
Rookie Year: 2007
Location: atlanta
Posts: 20
buddy.smith is an unknown quantity at this point
Re: Vex encoders/Interrupts

Quote:
Originally Posted by Andrew Morris View Post
Switching to an FRC controller shouldn't affect anything unless you change the code because the FRC controller and the VEX controller have the exact same microchips and are just packaged differently.
It seems that the interrupts and encoders work on the First controller, but not the Vex. I'm not sure why.

Quote:
Originally Posted by Andrew Morris View Post
Also, I was wondering how you are powering the Victors and motors because you don't appear to have a 12v FRC battery on the robot and running them off a 7.2v VEX battery could be causing your uneven drive problems if they are made to run off 12v.
I checked the datasheet of the Victor 884s and they're okay with 7.2V. I do have a second Vex battery just for the 884/motors.

--buddy
  #8   Spotlight this post!  
Unread 08-02-2007, 00:22
Jared Russell's Avatar
Jared Russell Jared Russell is offline
Taking a year (mostly) off
FRC #0254 (The Cheesy Poofs), FRC #0341 (Miss Daisy)
Team Role: Engineer
 
Join Date: Nov 2002
Rookie Year: 2001
Location: San Francisco, CA
Posts: 3,082
Jared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond reputeJared Russell has a reputation beyond repute
Re: Vex encoders/Interrupts

The Vex controller may have a different mapping of processor I/O pins to digital inputs. So even though the processor inside is the same, "what goes to where" is different.
  #9   Spotlight this post!  
Unread 08-02-2007, 00:56
yongkimleng yongkimleng is offline
deus ex programmeur
AKA: James Yong
FTC #0747
Team Role: Mentor
 
Join Date: Aug 2006
Rookie Year: 2004
Location: Singapore, West
Posts: 134
yongkimleng is a jewel in the roughyongkimleng is a jewel in the roughyongkimleng is a jewel in the rough
Send a message via MSN to yongkimleng
Re: Vex encoders/Interrupts

Just a personal comment, I've been through the recent FVC and I experienced much unpleasantness when using the VEX encoder. Not sure due to its poor build quality or otherwise, there is often much plastic dust (due to friction between plastic parts when spinning) accumulating INSIDE the encoder unit, which affects the encoder's output and hence would affect you during tuning/testing and soon you will find yourself changing program values unneccessarily. The abrasive dust would get clogged not only in the optical wheel but also in the IR sensing area which results ultimately in the failure of the device to sense any rotation at all (after long runs) and you will need to open it up and blow air into it in an attempt to clear out whatever crap is inside...
One solution could be to position the optical wheel properly and suspend the optical wheel on bearings.. not sure if that helps..
In a nutshell, don't rely too much on the vex encoder
__________________
| jamesyong.net |
FVC2007, FTC2008
  #10   Spotlight this post!  
Unread 08-02-2007, 08:01
Kingofl337's Avatar
Kingofl337 Kingofl337 is offline
You didn't see anything....
AKA: Adam
FRC #0501 (Power Knights)
Team Role: Mentor
 
Join Date: Feb 2005
Rookie Year: 1998
Location: Manchester, NH
Posts: 861
Kingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond reputeKingofl337 has a reputation beyond repute
Send a message via Yahoo to Kingofl337
Re: Vex encoders/Interrupts

If you are using easyC Pro you can use quad encoders on the VEX bot. Plug your encoder A channel into interrupt ports 1-4 and plug your B channel into I/O ports 5-8 or hit F5 and reasign I/O ports 1-4 to Digital Inputs.

It looks like you are using the VEX encoders though so you probably need to upgrade to a set of quad encoders.

Good Luck
__________________
FIRST Team 501 PowerKnights - Mentor
FIRST Team 40 Checkmate - Mentor Alum
FIRST Team 146 Blue Lightning - Alumni
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
Interrupts JSonntag Programming 1 14-01-2006 12:43
Vex navigation with ultrasonic and encoders GlennGraham Electrical 4 13-01-2006 12:58
VEX Optical Shaft encoders in FRC sanddrag FIRST Tech Challenge 8 04-10-2005 07:52
Encoders, interrupts, and edge-triggering issues Alan Anderson Programming 6 11-03-2005 16:06
Interrupts CyberWolf_22 Control System 3 12-01-2004 21:46


All times are GMT -5. The time now is 04:13.

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