think about this (assuming he is linearly and radially engaging the gears)
g1 dia = 15, roots = 60, teeth = 40
g2 = 10, 40, 27
typically the root is 1.5 x tooth area per rev
let's say 60% root and 40% tooth
and a gear ratio of 1.5:1
assume tooth to tooth vel for g1 is 100
and root a bit less (smaller dia) 98
both gears ~ the same since
vg1 = D1 x Pi x v1 rev/sec
vg2 = 2/3 x D x Pi x 3/2 x v1
same
set the encoder up so it always starts to engage g2 when a root is pointing/perpendicular towards/at g2
so consider it stationary
your odds are
g1 is always 1 or 100% root since it is positioned by the encoder
g2 root 60% and tooth 40%
that you hit a root 60%
that you hit a tooth 40%
if you hit a tooth good
if you hit a root we need to adjust, but how do we know? we have no feedback
you need to make sure that by the time the next root on g1 is 'in position' we have a tooth
in line on g2
I assume g2 is driving the load
and g1 is xmting power to it
so let us run g2 a bit slower if required
g1 root to root 98/60 = 1.63, same as g2
g2 tooth to tooth 100/60 = 1.67, same as g2
if it is synch'ed will continue to strike at the same point, root-root
g1's next root will be in position again 1.63 later
but if g2 is run a bit slower it will have a tooth in position
root to land delta 1.67-1.63 = 0.04 (using vel, easily converted to time, deg, etc)
so if g2 is run 0.04/1.67 x 100% = 2.4% slower than g1
if it doesn't engage the first tooth it will get the second
speed of linear engagement = tooth depth/0.04 in this case