MicroLYNX – Traverse
This program runs a traverse. The traverse axis follows quadrature encoder inputs from a take up roll. The traverse, or follower axis starts at the origin and travels in the positive direction to some maximum positive position. It dwells for an adjustable number of master encoder counts. At this point, following starts in the negative direction until the maximum negative position is reached.
Traverse applies to winding applications using electronic gearing, or "lineshafting".
.

Application flowchart:

'******** Parameter Setup ********
munit = 400 'driver set to half step
ios 15 = 5,0,1,0,1,1
ios 16 = 6,0,1,0,1,1
var Encct=480 'Encoder 120 quadrature (Lynx uses 4x mult.)
var Folratio = Munit/Encct 'Output Counts/Input Counts - 1:1
'following with Lynx trainer
var Dwell = 480 'Dwell 480 counts at pos/neg limits.
var Dwellpos
var Startpos
'******** Program ********
pgm 1
lbl traverse
pos = 0 'Start at 0
ctr3 = 0 'Clear Master Encoder counter
has = Folratio
hae = 1 'Enable following (half-axis operation)
lbl idle1
br idle1, pos < 2 'Wait until the follower reaches 2 revs
hae = 0 'Disable following.
Startpos = ctr3
lbl idle2
Dwellpos = Ctr3 - Startpos
br idle2, Dwellpos < Dwell 'Wait until master has turned
'"Dwell" counts
has = -Folratio 'Reverse the following ratio.
hae = 1 'Enable following.
lbl idle3
br idle3, pos > 0 'Wait until follower returns to 0.
hae = 0 'Disable following
Startpos = ctr3
lbl idle4
Dwellpos = Ctr3 - Startpos 'Wait until master has turned
br idle4, Dwellpos < Dwell '"Dwell" counts
has = Folratio 'Reverse the following ratio.
hae = 1 'Enable following
br idle1 'Return to first loop.
end
pgm
Download Traverse .lxt file
Right-click, select Save Target As...
(color-coded in IMS Terminal)