Go to Post Ah, to be a teenager and know everything again. - Alan Anderson [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 03-02-2008, 10:47
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: Problem with negitive numbers

I don't see anything that defines the type of output. If it were an unsigned variable, it would give the behavior you describe.
  #2   Spotlight this post!  
Unread 03-02-2008, 13:05
EHaskins EHaskins is offline
Needs to change his user title.
AKA: Eric Haskins
no team (CARD #6 (SCOE))
Team Role: College Student
 
Join Date: Jan 2006
Rookie Year: 2006
Location: Elkhorn, WI USA
Posts: 998
EHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond reputeEHaskins has a reputation beyond repute
Send a message via MSN to EHaskins
Re: Problem with negitive numbers

Quote:
Originally Posted by Uberbots View Post
check your PID loop... maybe you inadvertedly got rid of a typecast.

also, are you sure you dont have any longs defined in there?
I did a find in my code, and found only one long. It is used in CalculateSpeed, to store a local copy of the encoder count. The output from CalculateSpeed appears correctly in the printfs in both CalculateSpeed and PID.

Quote:
Originally Posted by Alan Anderson View Post
I don't see anything that defines the type of output. If it were an unsigned variable, it would give the behavior you describe.
It is defined in the code in my first post, line 7. It is an int.

Quote:
Originally Posted by dcbrown View Post
If you suspect overflow in currentOutput, then bump it from int to short long type to see if the symptoms change.
I will try that next time I have access to the robot.
__________________
Eric Haskins KC9JVH
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
Problem with Lofting cooker52 Inventor 14 04-11-2007 15:00
Problem With Footsteps Popper99 3D Animation and Competition 1 04-11-2007 09:34
Problem with RoboEmu2? Calvin Programming 1 12-02-2005 11:27
Problem with communicating with STAMP through serial port Skabana159 Technical Discussion 2 06-02-2003 21:10
Problem with OI / RC Jay Lundy Technical Discussion 2 29-03-2002 23:07


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

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