Open DrStein99 opened 7 years ago
Thanks @DrStein99.
It does not look good, but the initial aim was to use this feature only for PID tuning, where the tool would create a step from 0 to 220 (so all the expected values there would be with the byte range).
But you are right that this feature won't work properly most of the time unless used under similar conditions.
Not using a larger data size was due to the scarcity of RAM memory on Arduino UNO, so for other platforms, data type might be changed to integer or even long for reducing or removing the limitation you pointed out.
I can see this is mentioned in the comments of PID tunning tool: https://github.com/misan/dcservo/blob/master/PIDtunningTool.pde#L15
int targetVal = 220; // use this to set the target value
//please note the warparound effect on th graph if using values > 255 as Arduino only recording 8 bits location values :-(
There are at least a couple other hang ups in the example I had to correct.
After I replaced the ENCODER translation to use the Encoder library, it solved ALOT.
The "example" assigns "POS" as a byte, yet - assigns the LONG encoder position to this BYTE array.... Not sure how this actually would work