Quote:
Originally Posted by Uberbots
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
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
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.