2904
XL250BB Large Negative Values for Analog Feedback
XL200

A V4 controller came in from the field that was reporting large negative numbers, in the millions, for axis that have analog feedback. Forcing the memory to be cleared by removing the battery was the only thing that fixed it.

On the V4, the analog feedback comes from the DSP. Analog is read and stored in a 16 bit variable that has a numeric range of 32,767 to -32768. When it comes to the x86 it is stored into a 32 bit variable but it gets sign extended into the extra 16 bits. It was not possible to report values outside of the 16 bit range unless some other math was taking place befor the value was reported.

A code review revealed that the analog value had a 32 bit reference variable subtracted from it and that nothing in the code was setting the reference variable. Somehow the variable got set to a positive value larger than the 16 bit range and the subtraction resulted in a very large, in the millions, negative number.

This reference variable appears to be a hold over from a prior implementation. We don't expect to be making any other changes or new development in this code base so we chose the easiest fix. We zero out the reference variables when the PC sets the model.

Model Version Released
XL250BB 4.02.08 2/16/2016
XL250BB 3.11.08 2/16/2016