TECHNICAL NOTE
MOTION APPLICATION ENGINEERING GROUP
Yaskawa Electric America - 2121 Norman Drive South – Waukegan IL 60085
(800) YASKAWA - Fax (847) 887-7280
11/23/2005 37 of 37 eng/05.055/MCD
Gearing
Creating a gear application mainly consists of scaling the incoming master pulses with a B/A ratio
and sending the result to the slave’s commanded position register. In the MP its possible to
perform these calculations in ladder on a scan by scan basis. In this mode, the calculation is
performed every scan, by taking the differential pulses of the master encoder (called Scan
Difference), applying the formula below, and generating a scaled slave position output. The
power of the MP platform allows adjustments to be made at each step of the calculation at the
rate of the program scan, thereby allowing the user to change the ratio on the fly. The resulting
scaled segments are accumulated in a register that is fed to the slave commanded position.
When scaling the master position segments, often the result is not an integer number; to avoid
loosing synchronization, the remainder must be stored and added on the next scan.
Therefore, the calculation done each scan should be:
Scaled Slave Position Segment = Scan Difference * B + Modulus of the Last Scan
A
The Process in steps:
1. Calculate the master position difference from the last scan and store the current
position.
Notice the use of SUBX and ADDX for proper calculation through the rollover point of a
32 bit register. These instructions perform “two’s complement math,” which results in the
correct answer even as one value crosses the rollover point. No math errors are
generated.