You are on page 1of 3

Auto Focus

Syntax: AFCO axis, channel, pos, gain, speed [, deadband, max, min, flags]
Aguments:
[] indicates optional parameters
units
where: axis XYZU
channel A/D converter channel 1-! or " # o$$
pos tar%et A/D position & set point ' volts
%ain sets responsiveness o$ loop & (i)e *+,- '
speed maximum correction speed o$ motor same as $eedrate
./0
(opt.) dead-1and dead 1and A/D counts
(opt.) max maximum motor movement in positive
direction
units
(opt.) min minimum motor movement in ne%ative
direction
units
(opt.) $la%s see text
!esciption:
2he A/3, command ena1les a secondar4 position loop in the U5"" much li)e the primar4
position loop & usin% *pos '6 Unli)e the primar4 position loop which uses the encoder $or $eed1ac)
! this loop uses the analo% input $or $eed1ac)6 2he analo% input is converted to a di%ital si%nal 14
the optional 17 1it A/D converter6 2he U5"" commands the motor to move so that the analo%
input is at the user speci$ied volta%e6
2he analo% input num1er is speci$ied 14 the .channel0 ar%ument6 2his should 1e 1etween 1 and
6 A 8ero value tells the U5"" to stop the trac)in% mode and return to normal operation6
2he .pos0 ar%ument is the desired position & set point ' o$ the analo% input in terms o$ volts6
2he .%ain0 ar%ument is a num1er which multiplies the A/D error to %ive a correction speed6 2his
%ain num1er is li)e the *pos ar%ument in the normal servo loop6 9$ the scalin% o$ the analo% input
and encoder is 1:1! the .%ain0 value can 1e the same as the *pos6 2his is assumin% that the
analo% transducer is properl4 mounted6
2he .speed0 parameter is the maximum speed that the motor will move when the analo% input is
not at the desired position6 2he motor ma4 not actuall4 move at this speed i$ the %ain o$ the loop
is low6 2he units o$ the speed parameter are the same as the $eedrate units o$ /!X/!Y/!Z/!U/6
2he units can 1e :n%lish / metric! units / minute! units/second! pro%ram steps / minute! or
pro%ram steps / second6
Optional aguments: " default to # $
All optional parameters de$ault to "6
2he .dead 1and0 ar%ument allows the user to speci$4 a re%ion a1out the tar%et A/D position $or
which there will 1e no motor movement6 A 8ero value here indicates no dead 1and6
2he .max0 ar%ument is the maximum motor movement in units! that will 1e allowed6 2his num1er
can 1e interpreted as a1solute or incremental dependin% on the settin% o$ 1it ;< o$ the $la%s
ar%ument6 2he .min0 ar%ument is the minimum motor movement in units! that will 1e allowed6 2his
num1er can 1e interpreted as a1solute or incremental dependin% on the settin% o$ 1it ;< o$ the
$la%s ar%ument6 A1solute values are with respect to the hardware home position = ie6 the position
displa4ed in the dia%nostic window6 9ncremental values are with respect to the position o$ the
motor when the command was %iven6 >it ;7 o$ the $la%s ar%ument! when set! ena1les this $eature6
2he units o$ the max and min ar%ument are the current pro%rammin% unit! ie6 mm! 9nches! or
pro%ram steps6
2he .$la%s0 ar%ument allows the user to chan%e certain characteristics o$ the auto $ocus loop6 2he
1its in the $ollowin% ta1le can 1e ,?ed to%ether6 ?eserved 1its should 1e pro%rammed as 8ero6
1it ; value description hex
" " 3ommand is @ueued! will 1e a$$ected 14 wait mode6 3onsidered
done when the error is within the dead-1and6
1it ;A-11 o$ status word 5 will 1e set until $inished6
"x""""""
1 command will not 1e @ueued! not a$$ected 14 wait mode6
1it ;A-11 o$ status word 5 will 1e not 1e a$$ected 14 command is
$inished6
"x"""""1
1 " command will continue to trac) when null position is $ound
1 $unction will automaticall4 turn o$$ a$ter null position is $ound "x"""""7
7 " motor travel is not limited
1 ena1le motor travel limits & max/min ar%uments ' "x"""""
< " max / min ar%uments are with respect to home & a1solute '
1 max / min ar%uments are incremental "x"""""A
76677 reserved & pro%ram as " '
7< " polarit4 o$ loop is not reversed6
1 reverse polarit4 o$ loop6 "xA"""""
Botion command such as C"!C1!etc cannot 1e issued to the U5"" when in the $ocus mode6 2he
$ocus mode will 1e exited 14 sendin% an A/3, command with the channel set to "6 2he so$tware
position should 1e updated usin% the -,/2DA?: +,-929,E command when the auto $ocus
mode is stopped6 2he a1ort $unction will also terminate the $ocus mode and automaticall4 update
the so$tware position re%isters6
2he ran%e o$ this input is F1"G to H1"G which %ives a di%ital value o$ F7"A to H7"I respectivel4
$or the 17 1it A/D converter6
%xample &':
0A/3, X!1!"!1""!1"""!1!1"!-1"!"xA""""/0
Description: trac) on analo% input ;1! 8ero position with a %ain o$ 1""6 Baximum correction speed
is 1""" mm / min6 2here is one A/D count o$ dead-1and6 2he encoder will move H/- 1" mm
& assumin% metric mode ' relative to the point where to command was %iven6 2he polarit4 o$ the
trac)in% loop is reversed6 2he U5"" will not wait $or command execution to complete6 Auto $ocus
will shut o$$ when the axis is within 1 count o$ the " position6
%xample &(:
A/3, Y!1!-5!1""!1"""!1 = trac)in% to -5G analo% input level
DD:(( 1" = wait $or s4stem to settle
A/3, Y!" = turn $ocus o$$
DA92 ,E = wait $or a1ove commands to $inish
-,/2DA?: +,-929,E Y = update encoder positions
Analo% input locations:
3hannel U5"" +1 D?5"" >>5"1 other $unctions
1 JK &A9E1' L1<-75 &B9-369,' 2>1- B/,
7 J5 &A9E7' L1<-7 &B9-369,' 2>1-< none
< J" &A9E<' L17-K &L,Y-293*' L17-K Mo4stic) vertical
AJ &A9E' L17-< &L,Y-293*' L17-< Mo4stic) hori8ontal
)ogamming *otes:
An unused channel on the U5"" can 1e setup to displa4 the analo% input value6 2his is done 14
settin% the axis parameter <A to 5-A $or analo% channel 1- respectivel46 2his is use$ul $or initial
setup o$ the analo% sensor and $or polarit4 veri$ication6 9$ the polarit4 o$ the sensor is incorrect! the
motor will run in wron% direction6 2his ma4 result in dama%e to the s4stem6 ,n initial setup o$ the
trac)in% loop! it is recommended that the max correction speed 1e set low and the max / min
encoder movement parameters 1e utili8ed6
Ceneral parameter ;JJ should have 1it ;7 set & ie6 set it to ' to si%nal that the U5"" should read
the 17 1it A/D converter6 2his so$tware $eature re@uires G56"J or hi%her and a U5"" U(2?A
1oard with the optional 17 1it A/D converter6 2he $irmware $ile .U5""3E6LD+0 should 1e used6
2he Mo4stic) and B/, analo% inputs are not availa1le when usin% the 17 1it A/D converter6
2he A>,?2 $unction / 1utton will stop the auto $ocus mode6 2he axis cannot 1e homed when in
auto $ocus mode6
2he A/D tar%et position can 1e chan%ed 14 sendin% a new A/3, command with a di$$erent tar%et
volta%e6 2his can 1e done even i$ a A/3, command is currentl4 active6
9t is hi%hl4 recommended that a dead-1and o$ at least one A/D count is used $or applications
where the user is monitorin% the completion i$ the c4cle6

You might also like