Feedback delay

Feedback delay is the time between when KINGSTAR sends a command and when it receives the result from the servo drive. Adding the delay to the PID calculations prevents new commands from generating the error value. This can remove oscillations in the motor response. The feedback delay is usually useful only when proper feedforward gains are used. The cycle varies with each servo drive.

Why does the delay happen?

KINGSTAR (master) sends a commanded position to a servo drive (slave). This position is calculated by interpolation. Next, the PID takes the commanded position to calculate a target, which can be a position, velocity, or torque. The target is contained in the packet sent to the EtherCAT chip (usually it's ET1200). After the slave application receives the Sync0 signal, the target is sent to the drive, which uses its logic to calculate and convert the target to a current. After the axis moves, the drive records its actual position and sends it back to the EtherCAT chip at the next Sync0. In the next packet, the actual position is sent from the EtherCAT chip to KINGSTAR. Every cycle KINGSTAR sends a commanded position. When KINGSTAR receives the actual position from the original command, a few cycles have passed. This is the cause of the delay.

How does KINGSTAR handle the delay?

KINGSTAR needs to know how many cycles it should backtrack, so it can compare the actual position with the commanded position sent before. If the delay is 0 cycles, it compares the actual position with the current commanded position; if the delay is 1 cycle, it compares the actual position with the commanded position sent 1 cycle before, and so on. Typically, KINGSTAR needs to backtrack 3 cycles, but the number of cycles can vary if the drive does not follow the synchronization properly.