Go to Post But now we know what's inside Shaun's backpack! ...Don Rotolo's plastic egg. - MishraArtificer [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 17-02-2007, 10:34
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Odd math issues

Our current robot has the following function in it which adjusts the desired orientation of one of our joints based upon the joystick:

Code:
void Waist(void) {
    long delta;
   
    if(p1_wheel>147) {
      delta=-1L;
    }
    if(p1_wheel<107) {
      delta=1L;
    }
  
    waist_theta-= delta;


}
All the variables in this code are declared as longs, except for p1_wheel (obviously). waist_theta is only read in other functions, not written.

Despite this, somehow the value of waist_theta is sporadically jumping instantly to a large negative number. Any ideas? I'm suspecting some unusual type conversion issue.
  #2   Spotlight this post!  
Unread 17-02-2007, 11:10
Joe Ross's Avatar Unsung FIRST Hero
Joe Ross Joe Ross is offline
Registered User
FRC #0330 (Beachbots)
Team Role: Engineer
 
Join Date: Jun 2001
Rookie Year: 1997
Location: Los Angeles, CA
Posts: 8,559
Joe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond reputeJoe Ross has a reputation beyond repute
Re: Odd math issues

I would tend to guess your problem is in an interrupt routine. Are you saving all the appropriate sections?

Read this post for more details: http://www.chiefdelphi.com/forums/sh...ad.php?t=44046
  #3   Spotlight this post!  
Unread 17-02-2007, 12:32
kaszeta's Avatar
kaszeta kaszeta is offline
Registered User
FRC #0095 (Grasshoppers)
Team Role: Mentor
 
Join Date: Feb 2004
Rookie Year: 2002
Location: Lebanon, NH
Posts: 334
kaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of lightkaszeta is a glorious beacon of light
Re: Odd math issues

Quote:
Originally Posted by Joe Ross View Post
I would tend to guess your problem is in an interrupt routine. Are you saving all the appropriate sections?

Read this post for more details: http://www.chiefdelphi.com/forums/sh...ad.php?t=44046
We'll check that, but I'm pretty sure we're already doing that.

We simplified the routine and it seems to be working now, however. I'll dig into this more when we get back from the CT scrimmage.
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
Odd Reincarnation Eugenia Gabrielov Chit-Chat 30 21-08-2004 00:21
A really odd math problem.... Adam Y. Math and Science 12 07-07-2004 10:04
Odd Escape ZZII 527 Math and Science 25 09-04-2004 22:14
Odd occurrences Adam Y. General Forum 23 27-04-2003 02:44
Odd Email... Tom Schindler General Forum 10 13-09-2001 00:47


All times are GMT -5. The time now is 10:59.

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