Hi David,
Thanks for the links. You forgot to include your CustomDef.h file. Please post it.
It seems clear there are discontinuities in the encoder position. Typically an apparent sudden jump of varying amounts in the 20-60 count range.
Communication noise can cause a glitch in the reading but the next reading would normally be correct as KFLOP basically reads the absolute position from SnapAmp. This doesn't seem to be the case here.
Is the position drifting and incorrect after this occurs? For example if you return back to some commanded position before and after all these jerks is the physical position the same?
One possibility is a software bug causing KFLOP to lockup for a few milliseconds. So that instead of sampling every 90us it stalls and the next sample is much longer for some reason. its like KFLOP goes to sleep and when it wakes up things have changed alot. The discontinuities seem to always be in the forward direction which would fit this scenario. Shifting the red curve after the discontinuity ~4ms to the right would fit the expected position.
Attachment 259070
Here is a KFLOP C Program (also attached as a text file) that will time KFLOP Time Slices and print the maximum value seen about every 1 second on the Console. Please have it running and do a Step Response that shows discontinuities and post the results.
Code:
#include "KMotionDef.h"
// measure time from one time slice to the next
main()
{
int i=0;
double t0,t1,dt,tmax=0.0;
t0=WaitNextTimeSlice();
for (;;)
{
t1=WaitNextTimeSlice();
dt=t1-t0;
t0=t1;
if (dt>tmax) tmax=dt;
if (++i==10000)
{
printf("Max Time Slice = %8.2f us\n",tmax*1e6);
t0=WaitNextTimeSlice();
i=0;
}
}
}
Regards