Go to Post Screws come even smaller, #0000 - 160 at Small Parts.They're about $4 each, and made by elves. - DonRotolo [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 31-01-2005, 12:22
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Kevin's Navigation Script Working for Your Team?

Anyone using Kevin's navigation script? How's it going for you? Was you able to get it to work for your team? At one point our team was doing ok then we went away from the software and now we are back to it but can't seem to get the PID to settle down. Actually the PID does settle down, but when we issue a CMD_DRIVE 1500 in the command list, the robot does not drive straight nor is it going the right direction, it's going backwards. We've changed the varibles:

/* Set these to change the motor direction,
1 = forward, -1 = backward. */
#define LEFT_DIR (-1)
#define RIGHT_DIR (1)

to

/* Set these to change the motor direction,
1 = forward, -1 = backward. */
#define LEFT_DIR (1)
#define RIGHT_DIR (-1)

But it still goes backwards and doesn't drive straight.

Also....
Does anyone know what these varibles do for sure?

/* Motor defines */
#define LEFT 0
#define RIGHT 1

I am bit confused at what we've got now. I am certain our encoders are working, checked them with an O-Scope. Any ideas or success stories anyone would like to share about getting your NAV code working?

Any trouble shooting tips would be appreacaited.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #2   Spotlight this post!  
Unread 31-01-2005, 13:27
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by chakorules
Any trouble shooting tips would be appreacaited.
You might be spinning the encoder(s) too fast. This is addressed in question 6 of the encoder FAQ I've started. Also check that you have the correct sign specified for each of the encoders in encoder.h.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #3   Spotlight this post!  
Unread 31-01-2005, 13:59
Chris_Elston's Avatar
Chris_Elston Chris_Elston is offline
Controls Engineer
AKA: chakorules
FRC #1501 (Team THRUST)
Team Role: Engineer
 
Join Date: Feb 2004
Rookie Year: 2001
Location: Huntington, Indiana
Posts: 751
Chris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond reputeChris_Elston has a reputation beyond repute
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by Kevin Watson
You might be spinning the encoder(s) too fast. This is addressed in question 6 of the encoder FAQ I've started. Also check that you have the correct sign specified for each of the encoders in encoder.h.

-Kevin

Thanks for the tips Kevin. I'll double check this with our crew tonight and see what we can find.


Any comments on what these varibles do?
/* Motor defines */
#define LEFT 0
#define RIGHT 1


Also, FYI...last night we have a working camera and Kevin Nav script that we are willing to share. We want to clean up the logic flow of the function calls, but from what we can see, we've got it working. Minus the backward glitch above.

Our team will start a new thread on CD once we feel comfortable and have tested all our combo-code to release to everyone.
__________________
Team T.H.R.U.S.T. 1501
Download all of our past robot's source code here:Repository

Favorite CD quote:
"That can't be their 'bot. not nearly enough (if any) rivets to be a 1501 machine." ~RogerR: Team #1369
  #4   Spotlight this post!  
Unread 31-01-2005, 16:33
cabbagekid2 cabbagekid2 is offline
Registered User
#0368 (Kika Mana)
 
Join Date: Jun 2001
Rookie Year: 2000
Location: Honolulu, HI
Posts: 85
cabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura aboutcabbagekid2 has a spectacular aura about
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by Kevin Watson
You might be spinning the encoder(s) too fast. This is addressed in question 6 of the encoder FAQ I've started. Also check that you have the correct sign specified for each of the encoders in encoder.h.

-Kevin
Would changing the code to make the encoders interrupt on both a change in A or B fix this problem? Or would this cause the microcontroller to interrupt too often?
  #5   Spotlight this post!  
Unread 31-01-2005, 16:56
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by chakorules
Any comments on what these varibles do?
/* Motor defines */
#define LEFT 0
#define RIGHT 1
These #defines are used to identify the motors that belong to the motor_info[] array. See the top of pid.c to see how they're used.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #6   Spotlight this post!  
Unread 31-01-2005, 17:06
Kevin Watson's Avatar
Kevin Watson Kevin Watson is offline
La Caņada High School
FRC #2429
Team Role: Mentor
 
Join Date: Jan 2002
Rookie Year: 2001
Location: La Caņada, California
Posts: 1,335
Kevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond reputeKevin Watson has a reputation beyond repute
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by cabbagekid2
Would changing the code to make the encoders interrupt on both a change in A or B fix this problem? Or would this cause the microcontroller to interrupt too often?
Two things than can easily be done are: 1) Capture the state of the phase-B signal earlier in the ISR, and 2) use a D-type flip-flop to capture the state of the phase-B signal as the phase-A signal transitions from low to high. You can do this by wiring the phase-A signal to the flip-flop's clock input and to the interrupt input. Wire the phase-B signal to the flip-flop's D input and connect the flip-flop's Q output to the phase-B input on the robot controller. Option one will get you perhaps an extra microsecond or two. Option two will give you a much more significant increase.

-Kevin
__________________
Kevin Watson
Engineer at stealth-mode startup
http://kevin.org
  #7   Spotlight this post!  
Unread 31-01-2005, 17:44
SQUiD SQUiD is offline
Registered User
no team
 
Join Date: Jan 2005
Location: none
Posts: 1
SQUiD is an unknown quantity at this point
Re: Kevin's Navigation Script Working for Your Team?

Also check your encoders wires, and make sure they are going to the correct wheels, and PWM ports.
  #8   Spotlight this post!  
Unread 31-01-2005, 18:01
gnormhurst's Avatar
gnormhurst gnormhurst is offline
Norm Hurst
AKA: gnorm
#0381 (The Tornadoes)
Team Role: Programmer
 
Join Date: Jan 2004
Location: Trenton, NJ
Posts: 138
gnormhurst will become famous soon enoughgnormhurst will become famous soon enough
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by chakorules
...the robot does not drive straight nor is it going the right direction, it's going backwards. We've changed the varibles:

/* Set these to change the motor direction,
1 = forward, -1 = backward. */
#define LEFT_DIR (-1)
#define RIGHT_DIR (1)

to

/* Set these to change the motor direction,
1 = forward, -1 = backward. */
#define LEFT_DIR (1)
#define RIGHT_DIR (-1)

But it still goes backwards and doesn't drive straight.

Just a guess:

If the motors are wired so that positive pwm values make both wheels turn the same direction, then I think the LEFT_DIR and RIGHT_DIR values need to be the same. By changing both of them, they are still different, and you haven't really changed anything. There are four combinations to try!
__________________
Trenton Tornadoes 381
2004 Philadelphia Regional Winners
2006 Xerox Creativity Award
---
My corner of the USPTO.
My favorite error message from gcc: main is usually a function
My favorite error message from Windows: There is not enough disk space available to delete this file.
  #9   Spotlight this post!  
Unread 31-01-2005, 21:04
Astronouth7303's Avatar
Astronouth7303 Astronouth7303 is offline
Why did I come back?
AKA: Jamie Bliss
FRC #4967 (That ONE Team)
Team Role: Mentor
 
Join Date: Jan 2004
Rookie Year: 2004
Location: Grand Rapids, MI
Posts: 2,071
Astronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud ofAstronouth7303 has much to be proud of
Re: Kevin's Navigation Script Working for Your Team?

Quote:
Originally Posted by gnormhurst
Just a guess:

If the motors are wired so that positive pwm values make both wheels turn the same direction, then I think the LEFT_DIR and RIGHT_DIR values need to be the same. By changing both of them, they are still different, and you haven't really changed anything. There are four combinations to try!
LEFT_DIR and RIGHT_DIR are used to determine if 254 is forward or 0 is forward. See the end of pid() in pid.c. The PWM value internally is stored as a signed int.
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
The Death of FIRST Anton Abaya General Forum 23 03-05-2006 17:18
Thank a Team with an i-Pod !!! OZ_341 General Forum 8 20-04-2004 23:57
Disqualifications archiver 1999 13 23-06-2002 21:53
Competition at UTC New England Rick Gibbs Regional Competitions 6 02-04-2002 09:25
Novi Kickoff Seminar List (Tentative) Joe Johnson General Forum 1 05-12-2001 13:47


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

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