Go to Post If you're in Israel, it might be a long flight to the nearest Walmart - MrForbes [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 02-01-2007, 13:48
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Encoder Problem

I am using four grayhill encoders for our robot that uses a mecanum drive system. I am using the frc_encoder code from kevin watson. When I download the code unmodified it works just fine and all the encoders give me a reading. When I copy and paste the mecanum drive code into the encoder code only one of the encoders gives me a reading. Any help is much appreciated.
  #2   Spotlight this post!  
Unread 02-01-2007, 13:52
Joel J's Avatar
Joel J Joel J is offline
do you..
no team
 
Join Date: May 2001
Rookie Year: 2000
Location: San Jose, CA
Posts: 1,445
Joel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond reputeJoel J has a reputation beyond repute
Re: Encoder Problem

Can you post the code that doesn't work?
__________________
Joel Johnson

Division By Zero (229) Alumni, 2003-2007
RAGE (173) Alumni, 1999-2003
  #3   Spotlight this post!  
Unread 02-01-2007, 16:07
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: Encoder Problem

Attached to this message is the user routines file that doesn't work.
Attached Files
File Type: c user_routines.c (16.2 KB, 65 views)
  #4   Spotlight this post!  
Unread 02-01-2007, 16:19
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Encoder Problem

At a quick glance I dont see anything wrong. To confirm, your sayng when you comment out/dont run Default_Routine() that all 4 encoders work but when you run it only 1 does?
  #5   Spotlight this post!  
Unread 02-01-2007, 16:19
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: Encoder Problem

Quote:
Originally Posted by DustinB_3 View Post
Attached to this message is the user routines file that doesn't work.
The "\r\n" part of your printf commands bothers me. Aren't we supposed to use just "\r" and not "\n"?

How does this code differ from what does work?
  #6   Spotlight this post!  
Unread 02-01-2007, 16:49
Tristan Lall's Avatar
Tristan Lall Tristan Lall is offline
Registered User
FRC #0188 (Woburn Robotics)
 
Join Date: Aug 2001
Rookie Year: 1999
Location: Toronto, ON
Posts: 2,484
Tristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond reputeTristan Lall has a reputation beyond repute
Re: Encoder Problem

Quote:
Originally Posted by Alan Anderson View Post
The "\r\n" part of your printf commands bothers me. Aren't we supposed to use just "\r" and not "\n"?
It's a carriage return and a line feed. He's constructed it like a Windows text file, which would normally use that escape sequence to mark a new line.
  #7   Spotlight this post!  
Unread 02-01-2007, 18:40
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: Encoder Problem

I have tried commenting out the calll to default routine but it still only will read one encoder. The only difference between my code and the frc_encoder code ist that I have added some mecanum drive code for our robot.
  #8   Spotlight this post!  
Unread 02-01-2007, 18:53
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Encoder Problem

Could you please post both copies of your code for us to look at.
  #9   Spotlight this post!  
Unread 02-01-2007, 19:56
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Encoder Problem

Did you add code any where else besides user_routines?
  #10   Spotlight this post!  
Unread 02-01-2007, 22:53
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: Encoder Problem

The new user routines is the one from my earlier post and the old user routines is attached to this message and the only thing i edited between the two codes is the addition of the mecanum drive code.
Attached Files
File Type: c user_routines.c (15.2 KB, 43 views)
  #11   Spotlight this post!  
Unread 02-01-2007, 23:13
bear24rw's Avatar
bear24rw bear24rw is offline
Team 11 Programming Captain
AKA: Max T
FRC #0011 (MORT)
Team Role: Programmer
 
Join Date: Sep 2005
Rookie Year: 2005
Location: Flanders, NJ
Posts: 385
bear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to beholdbear24rw is a splendid one to behold
Send a message via AIM to bear24rw
Re: Encoder Problem

Have you tried putting in the frc_encoders code again to see if all the encoders still work?
  #12   Spotlight this post!  
Unread 03-01-2007, 08:30
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: Encoder Problem

When I download the frc_encoders the encoders work great but when I add the mecanum drive code only one encoder will feed back values.
  #13   Spotlight this post!  
Unread 03-01-2007, 08:44
chris31 chris31 is offline
Team 2021 Captain
AKA: Chris Davidson
FRC #2021 (FA Robotics)
Team Role: Mentor
 
Join Date: Nov 2005
Rookie Year: 2006
Location: Atlanta, GA/ Fredericksburg,VA
Posts: 949
chris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond reputechris31 has a reputation beyond repute
Send a message via AIM to chris31
Re: Encoder Problem

Try running the 2 through a diff tool to see the difrences in the 2 files. I didnt see anything when I did a quick look, ill check again when I have more time.
  #14   Spotlight this post!  
Unread 03-01-2007, 08:54
DustinB_3 DustinB_3 is offline
Registered User
FRC #0935 (Railerobotics)
Team Role: Leadership
 
Join Date: Nov 2005
Rookie Year: 2001
Location: Newton, Kansas
Posts: 78
DustinB_3 is an unknown quantity at this point
Re: Encoder Problem

Where would I get a diff tool. I've never even heard of such a thing.
  #15   Spotlight this post!  
Unread 03-01-2007, 09:04
Jack Jones Jack Jones is offline
Retired
no team
 
Join Date: Jan 2003
Rookie Year: 2003
Location: Waterford, MI
Posts: 964
Jack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond reputeJack Jones has a reputation beyond repute
Re: Encoder Problem

Quote:
Originally Posted by DustinB_3 View Post
The new user routines is the one from my earlier post and the old user routines is attached to this message and the only thing i edited between the two codes is the addition of the mecanum drive code.
Not so:

From code that works:
/* SECOND: Set up the I/O pins you want to use as digital OUTPUTS. */
digital_io_17 = OUTPUT; /* Example - Not used in Default Code. */

/* THIRD: Initialize the values on the digital outputs. */
rc_dig_out17 = 0;


From modified code:
/* SECOND: Set up the I/O pins you want to use as digital OUTPUTS. */
digital_io_17 = INPUT; /* Example - Not used in Default Code. */
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
Encoder Pinout bear24rw Electrical 4 04-12-2006 21:43
Encoder help Windward Programming 21 14-01-2006 15:10
Strange Encoder Problem AIBob Electrical 3 20-02-2005 22:20
encoder.c Gary Bonner Programming 2 14-01-2005 13:41


All times are GMT -5. The time now is 03:23.

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