10. High-speed Input/Output Design Examples 10.4 SPD - Wheel Rotation Speed Measurement Photoelectric sensor for detecting pulses Control Purpose: z Calculating the wheel rotation speed by the equation based on the counted input pulses Devices: Control Program: X7 M1000 DMUL DDIV Program Description: z When X7 = ON, SPD instruction will be executed. D2 will calculate the high-speed input pulses by X1 and stop the calculation after 500ms. The result will be stored in D0 and D1. z The following equation is for obtaining the rotation speed of the car: N : Rotation speed (unit: rpm ).
N = ( ) rpm nt D 3 10 60 0 Ч Ч t : Pulse receiving time (ms) n : The number of pulses produced per rotation If the number of pulses produced per rotation is K100 and the number of pulses within 500ms is K750, the rotation speed will be: N= 3 10 60 0 Ч Ч nt D = ( ) rpm Ч Ч Ч Ч 500 100 10 60 750 3 =900 rpm z The rotation speed N is stored in D20 and D21. DVP-PLC Application Examples 10-6 Device Function X1 Pho toelectric sensor for detecting pulses X7 Exe cuting SPD instruction SPD X1 K500 D0 D0 K60000 D10 D10 K50000 D20