For a user-servo, the manual states:
"Power PMAC automatically computes the values of several commonly used quantities before
calling a user-written servo algorithm each cycle.
The following automatically computed elements are of particular use. All are “double” format
floating-point values.
Motor[x].DesPos Net desired position (trajectory, master, compensation)
Motor[x].DesVel Net desired velocity (DesPosnew – DesPosold)
Motor[x].ActPos Outer loop net actual position (measured, compensation, backlash)
Motor[x].ActPos2 Inner loop net actual position (measured, compensation)
Motor[x].PosError Following error (DesPos – ActPos)
Motor[x].ActVel Inner loop net actual velocity (ActPos2new – ActPos2old)"
When in the schedule of real-time tasks that happen relating to the servo do these values get calculated? I presume that it is just before that particular user-servo is called (ie after the previous motor's PID calculations are complete) - is this correct? I presume that it would also be after a compensation table is calculated, if this precedes this loop?
On a related matter, is it possible to have a user-servo that pre-processes some data for compensation or feedback purposes and then calls one of the standard servo PIDs? If so, would these automatic values be calculated incorrectly for the called PID? If this is a sensible strategy - is there any example code available?
Thanks.