Mitsubishi — 9.4.2.5 Offset Compensation to Slave Error

9 Electrical CAM Step 1: Run the program and read the E-CAM status by DFROM instruction. Read the data in CR#10001 of special module K100 to D100~D108. Step 2: Set M3 to write the length of Slave into D126 and the initial Slave error into D128. Calculate the real error, i.e. difference between the increased error and the initial error, and take the half of Slave length as the reference. Step 3: When the real error is between “± half of Slave length”, take the real error as the offset value directly. Step 4: When the real error exceeds “± half of Slave length”, follow the below rule:

⎪⎨ ⎧ ratio Offset Slave of length error Real Offset Slave of length error Real Ч = ⇒ > ) - ( 2 1 ⎪⎩ ratio Offset Slave of length error Real Offset Slave of length error Real Ч + = ⇒ − ) ( 2 1 Step 5: Set M4 to calculate the modified length of Slave with offset compensation. Step 6: When M4 is reset, fill the original length of Slave back to D302. Ladder Diagram: M1000 Read the error between DOG signal and the end point of Slave position (D108) M3 Backup initial value of D108 Length of Slave DMOV Backup D302 DMOV Backup D108 in D128 ..

M3 Take the difference between D108 (initial error) and D128 (increased error) " D132 = 1/2*D126 D136 = -1/2*D126 Take D132 and D136 as the criteria for judging 1. If D130 (real error)is between D132 and D136, backup D130 in D138 directly .. .. 2. If D130 is bigger than D132 ,subtract D130 with D126 and store the result in D138. M1000 3. If D130 smaller than D136 , add D130 with D126 and store the result in D138 .. D138 is the offset value for compensation DVP-PM Application Manual 9-51 DMOV K10001 D0 DFROM K100 D0 D100 K5 D302 D126 D108 D128 DSUB D108 D128 D130 DDIV D126 K2 D132 DMOV D130 D138 DLD> D130 D132 DSUB D130 D126 D138 DSUB K0 D132 D136 DLD D130 D136 DADD D130 D126 D138