Hi Andy.
The LinuxCNC PID component has a pin to avoid this problem, it can be
connected to index-enable.
Yep, I tried this.
Which basically freezes the PID for one servo cycle when the index resets.
Looking at the pid.c sources shows, it skips the error calculation in
the cycle of the falling edge of the index signal.
But this is IMHO pointless (pls correct me if i'm wrong), because
switching to the positioning PID is not synchronised with the index signal.
It happens at a random positions after spindle stops from speed
controlled rotation.
And the problem occurs at the first PID call after PID enable.
What actually really helped:
I changed the orient component that way, that it puts the actual
position permanently to its command output if it is NOT enabled.
Because the orient component is designed to output the actual position +
setangle/360 (with a ceil() function to determine the direction of
movement))
as soon as it get enabled, you never get a difference bigger that 1.0 at
the positioning PID inputs.
Funny enough, this all depends not only on the I-component of the PID
but also on the max value of the spindle positioning counter.
Having a 16 Bit counter and a 8192 encoder count per revolution your max
(signed) position value is 8.
So in worst case your error in the first PID call can max be 8 instead of 1.
Having a 32 Bit counter (like I have) with the same encoder , your max
(signed) value is 524288.
So in worst case your error is 524288.
This input must strongly impress every PID with an Integral component
tuned to a max difference of 1.0
cheers
Rainer
_______________________________________________
Emc-developers mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-developers