M1
HSD0: Y0 accumulated pulses low 16-bit
(unit is pulse number)
REGR K1 H1039 K4 HD100 K4
100ms clock
pulse
Normally ON
coil
REGR K1 H1039 K4 HD206 K4
RST HSC0
SM12
SM0
FUNC1 D0 M0
REGR K1 H0B K1 HD10 K4
DRVI HD500 HD150 K10 Y0 Y2
M10
// Send pulses of UHD[500] and
homing
// Read the pulses per turn for C
function calculation
// Call the function to read the passed
distance pulses and save in
UHD[500]
// Real-time read encoder
feedback
// Reset HSD0 at zero position
// Read current encoder value at zero
position and save in HD0. K1 is PLC
station no., the first K4 is register
numbers, the second K4 is serial port
no.
Define the register data word
real-time read encoder feedback-initial value
position=passed distance encoder feedback, saved in
UHD[700].
forward running, distance feedback>0. As the encoder
feedback resolution is different from pulses per turn,
calculated the passed turns, then multiply with the pulses per
turn to obtain the pulses of actual passed distance.
if running in forward direction, so homing needs negative
pulses, which saved in UHD[500].
get the absolute value of real-time passed distance encoder
feedback.
As the encoder feedback resolution is different from pulses
per turn, do the operation of last step .