TELKOM
NIKA Indonesia
n
Journal of
Electrical En
gineering
Vol.12, No.5, May 2014, pp
. 3603 ~ 36
0
8
DOI: http://dx.doi.org/10.11591/telkomni
ka.v12i5.4920
3603
Re
cei
v
ed O
c
t
ober 2
5
, 201
3; Revi
se
d Decem
b
e
r
17, 2013; Accept
ed Ja
nua
ry 6,
2014
Design of a Grating Ge
nerator for Thre
e
-dimensional
Scanner
He Xingzh
e
n
g
Chin
a Acad
e
m
y
of Safet
y
S
c
ienc
e an
d T
e
chno
log
y
, Be
iji
n
g
100
01
2, Chin
a
e
-ma
i
l
:
hy
ge
hy@
1
26
.co
m
A
b
st
r
a
ct
In the thr
ee-d
i
mensi
o
n
a
l sc
ann
ers (3
D s
c
ann
ers)
b
a
se
d o
n
structure
d
-lig
ht tech
nol
ogy, t
h
e
commercia
l vid
eo pro
j
ector w
a
s alw
a
ys borr
o
w
ed to act as
the electron
ic gratin
g
ge
nerat
or, w
h
ich is a key
hardw
are to th
e dev
ice. But there w
e
re s
o
me
defects
ex
i
s
ted. F
o
r exa
m
p
l
e, the s
i
z
e
w
a
s too larg
e
for
setting
in t
h
e
case
of th
e
devic
e, a
nd
it cou
l
d
not
be
contro
lle
d
by
a s
i
ng
le
chi
p
micro
p
roc
e
s
s
or
conve
n
ie
ntly,
etc. T
o
solv
e t
hese
pro
b
l
e
ms, a n
e
w
gratin
g g
ener
ator w
a
s d
e
sig
n
e
d
.
T
he gr
atings
w
e
re
nu
mb
ered
a
n
d
enc
ode
d i
n
c
o
mp
uter i
n
struct
ions,
and
th
en
a
com
p
l
e
x p
r
og
ramm
ab
l
e
l
ogi
c d
e
v
i
c
e
(C
PLD
)
chip w
a
s use
d
to control a
liqu
i
d
crystal
on
silic
on
(L
C
O
S) video ch
i
p
, to w
r
ite its data ports di
rectly
corresp
ond
in
g to the instructi
ons. It has small si
z
e
, si
mp
le
interfaces, pro
m
pt res
pons
e, clear i
n
structio
ns,
and it w
o
rked
w
e
ll.
Ke
y
w
ords
: gra
t
ing ge
ner
ator, 3D scan
ner, struct
ured-
lig
ht, electron
ic gratin
g, CPLD
Copy
right
©
2014 In
stitu
t
e o
f
Ad
van
ced
En
g
i
n
eerin
g and
Scien
ce. All
rig
h
t
s reser
ve
d
.
1. Introduc
tion
Thre
e-di
men
s
ion
a
l (3D)
scan
ning te
ch
nology b
e
lon
g
s to
comput
er visi
on fiel
d
.
The 3
D
coo
r
din
a
tes o
f
the surfa
c
e
s
of an obje
c
t can b
e
non
-contact me
asu
r
ed by this te
chn
o
logy ra
pi
dly
and
accu
rate
ly. In the re
cent ye
ars, t
h
ree
-
dim
e
n
s
i
onal scan
ners (3
D scann
ers) have be
en
applie
d am
on
g a
wide fiel
d [1-3]. Th
ey play mo
re
a
nd mo
re im
p
o
rtant
role
s i
n
e
c
ono
mic
and
so
cial life.
In
indu
stry, be
u
s
eful i
n
reve
rs
e engi
nee
rin
g
to create
complex auto
m
otive
pa
rts and
a variety of m
e
ch
ani
cal mo
dels. In
ortho
pedi
cs, to
pro
s
the
s
e
s
fab
r
i
c
ation
and i
n
Rob
o
tics, ma
ke
possibl
e the
artificial visi
o
n
to mobile robots. In
fore
nsi
c
medi
cine
, they help to con
s
tru
c
t dig
i
tal
3D mo
del
s
of accide
nts.
3D
scann
e
r
s g
a
the
r
inf
o
rmatio
n of
an obj
ect a
nd re
present
it
grap
hically in three dim
e
n
s
i
ons u
s
in
g different te
chniq
ues [4, 5].
Usually, the
key ha
rd
wa
res of
a 3
D
scann
er
ba
sed on
struct
ured
-lig
ht technolo
g
y
inclu
de digita
l came
ra
s an
d a gratin
g gene
rato
r, as sho
w
n in Fi
gure 1. Th
e purp
o
se of the
grating g
ene
rator is to proj
ect a se
rial of
gratin
g
s
to the su
rfaces o
f
the object to be mea
s
u
r
ed.
These g
r
atin
gs a
r
e
usuall
y
electronic
grating
s
. Co
mmonly, the
y
are a
bout
10 to 15
re
g
u
lar
pattern
s
with
black-white
strip
s
, in
cludi
ng several
Gray-co
de p
a
tterns an
d
several Cosi
ne-
function
pattern
s. A pattern exa
m
ple
of the gr
at
ings i
s
sho
w
n in Fi
gure 2. Du
ring
the
measurement
, these gratin
gs ar
e modul
ated by the surface of
the obje
c
t to be measured, and
then the i
m
a
ges of the m
odulate
d
g
r
ati
ngs are
capt
ured
by digi
t
a
l ca
meras.
Via these im
age
s,
the 3D
coo
r
di
nates of the
surfac
e can be
calculated
wi
th prop
rieta
r
y algorithm. T
he asse
mbla
ge
inclu
d
ing all o
f
the coordina
tes is called p
o
int clou
d [6, 7].
The
comm
ercial video p
r
oj
ector is
often
borro
wed to
gene
rate a
n
d
proj
ect the
el
ectro
n
ic
grating
s
for
common
3
D
scan
ners,
but t
here
a
r
e
so
m
e
obvio
us p
r
o
b
lems.
Fo
r ex
ample, th
e
si
ze
is too la
rge, i
t
is not conve
n
ient to setu
p, t
he RGB li
ghts
come
from the p
r
oje
c
tor
can
not f
o
cu
s
exactly, the internal p
a
ra
meters of gratings
can n
o
t be adjuste
d easily, the interfaces a
r
e not
conve
n
ient f
o
r exte
rnal
control, the
internal
ci
rcu
i
ts for vid
e
o
sign
al tre
a
tment a
r
e ve
ry
compli
cate
d. Due to these
factors, it be
come
s
difficu
lt to meet the
demand
s of miniaturi
z
atio
n
and autom
atization to the device, and a
l
so limit some
applicatio
ns i
n
certai
n fields [8-10]. In this
pape
r, a new
grating g
ene
rator is de
sig
n
ed to solve th
ese i
s
sue
s
.
Evaluation Warning : The document was created with Spire.PDF for Python.
ISSN: 23
02-4
046
TELKOM
NI
KA
Vol. 12, No. 5, May 2014: 3603 – 36
08
3604
2. Grating G
e
nera
tor Des
i
gn
To 3
D
scan
n
e
rs,
the
grati
ngs to b
e
pro
j
ected
de
pen
d on
the
spe
c
ially d
e
si
gne
d sy
stem
algorith
m
an
d vary from prod
uct to produ
ct.
But fo
r a ce
rtain commercial 3
D
scan
ner, th
e
numbe
r of the grating
s
an
d all of the grating pa
tte
rn
s are fixed. So it is possi
ble to use th
e
compl
e
x pro
g
ramm
able l
ogic d
e
vice (CPLD) chip to gene
rate a
nd co
ntrol th
ese g
r
ating
s
and
avoid the bef
ore
-
mentio
ne
d probl
em
s. The CPL
D
chip is hig
h
-in
t
egrated
with
conveni
ent I/O
ports, it is p
r
ogra
mmabl
e
and ea
sy to
control.
More
over, it is hi
gh-p
e
rfo
r
ma
n
c
e with
pro
p
e
r
price. Base
d on these, in this pa
per, a
CPLD
chip
was u
s
ed to write the input ports of a grating
chip
dire
ctly, to get the g
r
a
t
ings requi
re
d
.
The
Block d
i
agra
m
of the
system i
s
sh
own
as Fi
gu
re
3.
Figure 3. Block
Diag
ram o
f
the System
2.1. Grating
Chip
There are 3
main tech
n
o
logie
s
for i
m
age p
r
oje
c
t
i
ng, they are
digit light proce
s
sing
(DLP
), liquid
cry
s
tal display (LCD) and l
i
quid
crysta
l
on
silicon (LCOS). LCOS is sort of a hybrid
betwe
en L
C
D and DLP. It use
s
liqui
d crystal chip
s wi
th a mirro
red
backin
g
. So it’s refle
c
tive, like
DLP, but blo
c
ks lig
ht usin
g liquid
cry
s
tal, like
L
CD.
In this pap
er,
a LCOS vid
eo chip HX
7
027
serve
s
a
s
th
e g
r
ating
chi
p
. It is
a
pro
ductio
n
of
Hi
max Di
spl
a
y
Inc. It is an
a
c
tive matrix
li
quid
cry
s
tal displa
y with resoluti
on of 640 by
480 pixel
s
. It
receives
8-bit
s
RGB d
a
ta (3 dots p
e
r pix
e
l)
input per cl
o
ck
simultan
e
ously and g
e
nerate
s
corre
s
po
ndin
g
voltage output of
256 level gra
y
scale
s
. It is ideal for the p
e
r
forma
n
ce de
mand
s of ligh
t
weight, sm
a
ll size, hi
gh speed, excelle
nt
contrast ratio
and go
od resolution ap
plications. Th
e chip si
ze i
s
ab
out only 0.44
inch
es di
ago
nal.
It is suitable for 3D
scanni
ng.
2.2. Control Chip
A CPLD chip
EPM3256AT
C
14
4 from Al
tera Corp
orat
ion is cho
s
en
to drive the above-
mentione
d
HX7027
chip. I
t
own
s
256
macro
cell
s
a
nd M
a
ximum
161 I/O
po
rts for
user,
and
its
cou
n
ter f
r
eq
uen
cie
s
a
r
e
up to 1
27M
Hz. It
can
b
e
re
-p
rog
r
am
med fo
r qui
ck an
d effici
ent
iteration
s
du
ri
ng de
sign d
e
v
elopment an
d debu
gging
cycle
s
.
Figure 1. Sch
e
matic Di
ag
ram of a 3D Scan
ner
Figure 2. An Example of Gray-cod
e Grat
ings
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
ISSN:
2302-4
046
De
sign of a G
r
ating Ge
ne
ra
tor for Three
-
dim
ension
a
l Scann
er (He
Xingzh
eng
)
3605
2.3. Light Source
Usually, pro
p
e
r sele
ction f
o
r t
he light
source of the
grati
ng gen
erator
is often
ignored
becau
se the i
m
porta
nce is
not really real
ized. In
fact, i
t
affects the
measuri
ng re
sults
a lot. One
of the rea
s
on
s i
s
that the
optical
sy
ste
m
ca
nnot
fo
cus th
e
colo
r l
i
ght exa
c
tly. The
comm
ercial
proje
c
to
r is u
s
ually fo
r
col
o
r im
age
s, e
v
ery pixel
co
nsi
s
ts
with at
lea
s
t 3
colo
r dot
s, i.e. tri
-
chromati
c
col
o
rs of
red, g
r
een
an
d blu
e
(RGB).
No
rmally, it is
difficult to ge
t ideal g
r
ati
n
g
pattern
s, esp
e
cially to Co
sine
-fun
ction
grating
s
. The
diagram of light focu
s e
r
ror is
sho
w
n
as
Figure 4.
Figure 4. Dia
g
ram of Lig
h
t Focu
s
A single whit
e-colo
r LED (light emissio
n
di
ode
) is u
s
ed to be the light source of the
grating
ge
ne
rator to
de
al
with this i
s
sue.
For
LED, th
e
other advant
age
s a
r
e
its f
eature
s
of lo
n
g
-
life and low p
o
we
r co
nsum
ption mean
while.
2.4. Sy
stem
Design
Firstly, list all
the grating p
a
tterns nee
d
ed,
and th
en
label them to
se
rial nu
mb
ers. T
h
e
seri
al n
u
mbe
r
s a
r
e
en
code
d in
comp
ute
r
in
stru
ct
ion
s
with simple g
r
amma
r.
Se
condly,
for ea
ch
grating, the correspon
ding
softwares a
r
e em
bed
ded
in the CPLD
and be relate
d to the above-
mentione
d in
stru
ction
s
.
Figure 5. Electroni
c Ci
rcui
t
Diagram of the System
In 3D scan
nin
g
pro
c
e
ssi
ng,
the above-m
entione
d instruction
s
are sent to the CPLD chip
on-d
e
ma
nd, via RS232 or USB interface, by the
host compute
r
(o
r microproce
s
sor) of the 3D
scann
er. T
h
e
n
the
se
rial
n
u
mbe
r
s of the
gratings
a
r
e
decode
d fro
m
the in
structio
ns, a
c
co
rding
l
y,
the CPLD
wri
t
es the co
rre
s
po
ndin
g
1 o
r
0 to
each d
a
ta input port
of HX7027
simultaneo
usly.
HX702
7 is a
dot-mat
rix chi
p
, due to its high-sp
eed
fe
ature, the re
q
u
ired g
r
atin
g pattern
s ca
n be
Evaluation Warning : The document was created with Spire.PDF for Python.
ISSN: 23
02-4
046
TELKOM
NI
KA
Vol. 12, No. 5, May 2014: 3603 – 36
08
3606
proje
c
ted
wit
hout flicke
r.
Of co
urse, a
proj
ecti
n
g
o
p
tical
system
is n
e
cessa
r
y. The ele
c
tronic
circuit diag
ra
m of the system is shown as Figu
re 5.
2.5. The Softw
a
r
e
o
f
CPL
D
Figure 6. Simplified Softwa
r
e Flo
w
Ch
art
of CPLD
alway
s
@ (ne
gedg
e
cl
kout)
begin
if (counte
n
== 1’b1)
begin
if (lineco
u
n
t
< 480) //image line
cou
n
t
begin
case
(datain) //any data input
8’h1:begin
if (column
c
ou
nt < 320) //image
column
cou
n
t
b
egin
de <= 1’b1; //enabl
e data i
nput
d
a
taout <= 24’
b111
1111
111
1111
1111
111
111; //white line
e
n
d
else if (colum
ncount >= 320
&& column
co
unt < 640
)
b
egin
d
e
<= 1’
b1; //enable d
a
ta in
put
d
a
taout <= 24’
b0; //black lin
e
e
n
d
els
e
begin
d
e
<
=
1’b0; //dis
able data input
d
a
taout <= 24’
b0;
e
n
d
end
end
end
end
Figure 7. A segment of the
Software of CPLD
The mai
n
fun
c
tion of th
e
software
emb
e
dded i
n
the
CPLD
chip i
s
t
o
write data
1
or
0 to
each data in
put port
s
of
HX702
7 pe
r timing cl
ock,
with high
-spe
ed. In each p
r
ocedu
re, CP
LD
write
s
d
a
ta t
o
every
matrix dot (T
otal
640
×4
80
d
o
t
s)
of HX7
0
2
7
con
s
tantly and rep
eated
ly
Evaluation Warning : The document was created with Spire.PDF for Python.
TELKOM
NIKA
ISSN:
2302-4
046
De
sign of a G
r
ating Ge
ne
ra
tor for Three
-
dim
e
nsion
a
l Scann
e
r (He
Xingzh
e
ng
)
3607
according to
the inst
ru
ctio
n re
ceived
from the h
o
st
comp
ut
er
(o
r
micr
op
ro
ce
s
s
or
).
D
a
t
a
w
r
it
ing
process will continue
until a
new
i
n
st
ruction coming.
The
simplified software flow
chart of
CP
LD
is sh
own as F
i
gure 6. A se
gment of the
softwa
r
e of CPLD is
sho
w
n
in Figure 7.
2.6. Heat M
a
nagemen
t
In this desig
n
,
the CPLD chip wo
rks very busy,
and write
s
data to
I/O ports con
s
tantly in
very high fre
quen
cie
s
. A desi
gn re
aso
nable softwa
r
e
architectu
re
of CPLD to redu
ce the po
wer
consum
ption becomes very impo
rtant for
the system
stability.
Moreover, sometimes
a small
ventilation fan is also ne
ce
ssary for chip
coolin
g.
3. Results a
nd Tests
3.1. Outpu
t
o
f
Electronic
Grating
s
The
g
r
ating g
enerator bee
n
de
sign
ed works we
ll,
onl
y
simple com
puter comm
a
nds are
need
ed for p
r
ojectin
g
sp
eci
f
ied gratin
gs.
The si
ze i
s
about 80
mm
long, 70mm
wide a
nd 4
0
m
m
high, so it i
s
easy to set in limited sp
a
c
e. 2 ex
am
ples of the p
r
o
j
ected g
r
atin
g
s
are shown
in
Figure 8 and
Figure 9.
Figure 8.
Proj
ected G
r
ay-code Grating
Figure 9.
Proj
ected Co
sine Grating
3.2. Scanning Resul
t
s
The g
r
ating
gene
rato
r a
b
o
ve was in
sta
lled in
a 3
D
scan
ner for testing. It wa
s e
a
sy to
be
controlled by
host
mi
croproce
s
sor and respon
ded
promptly. The
measured da
ta wa
s goo
d
, a
s
sho
w
n in Fig
u
re 10.
Figure 10.
Example
s
of Scanne
d Data
Evaluation Warning : The document was created with Spire.PDF for Python.
ISSN: 23
02-4
046
TELKOM
NI
KA
Vol. 12, No. 5, May 2014: 3603 – 36
08
3608
4. Conclusio
n
In this p
ape
r, a ne
w g
r
ati
ng ge
ne
rator based
on L
C
OS te
chn
o
l
ogy for 3
D
scan
ner is
desi
gne
d, wit
h
a
CPL
D
chi
p
bein
g
u
s
e
d
to insta
n
t of
the traditio
nal
video-pro
c
e
s
sing
chi
p
. Th
e
new
gratin
g g
enerator i
s
smaller a
nd e
a
sy to se
tup i
n
the case, a
nd its inte
rnal
para
m
eters
ca
n
be ea
sily a
d
juste
d
a
c
co
rding
to the
cu
stome
r
requireme
nts.
The inte
rfa
c
e
s
an
d
co
ntrol
instru
ction
s
a
r
e si
mple, th
e desi
gn of t
he ele
c
tr
o
n
ic
circuits and the
software are clea
r.
It
wa
s
installe
d in 3
D
scan
ners a
nd perfo
rme
d
well.
Ackn
o
w
l
e
dg
ements
This work
wa
s
sup
p
o
r
ted
by “Chin
a
n
a
t
ional
sci
en
ce an
d te
ch
no
logy supp
ort
prog
ram
Develo
pment
of techniqu
es and e
qui
pments fo
r
on-site han
dl
ing in gas-le
a
ka
ge accid
ent”
(2012BAK03B05-03).
Referen
ces
[1]
Dias P, Mat
o
s
M, Santos V.
3D R
e
constr
uc
tion
of
Rea
l
W
o
rld Sc
en
es U
s
ing
a L
o
w
-
co
st 3D Ra
ng
e
Scann
er.
Co
mputer Aid
ed Ci
vil an
d Infrastructure Eng
i
n
e
e
r
ing
. 20
06; 21(
7); 486-4
89.
[2]
Martinez-
L
lar
i
o
J, Coll E, Herraez J. T
h
ree-
Dieme
nsi
ona
l Scann
er Soft
w
a
re Usi
ng a Vi
deo C
a
mera
.
Advanc
es in E
ngi
neer
in
g Softw
are
. 2006; 37
(7): 484-4
89.
[3]
Asahi
na D, T
a
yl
or MA. Geometr
y
of irre
gu
lar
partic
l
es: D
i
rect surface
measur
ements
b
y
3-
D laser
scann
er.
Pow
der T
e
chno
lo
gy
. 2011; 2
13(1):
70-7
8
.
[4]
Rey
e
sa AL, Cervantesb JM, Guti
érrez
b
NC. Lo
w
Cost 3D Sc
ann
er b
y
Me
an
s of a 1D Optical Distanc
e
Sensor.
Proce
d
ia T
e
ch
nol
ogy
. 2013; 7: 223-
230.
[5]
Cui H, L
i
a
o
W
,
Che
ng
X, et a
l
. A T
h
ree-step S
y
stem C
a
li
br
ation Pr
oced
ur
e
w
i
th Error
C
o
mpe
n
satio
n
for 3D Shap
e
Measur
ement.
Chinese Optics Letters.
201
0; 8(1): 33-37.
(in Chi
nes
e)
[6]
Nikol
ov SI, Jensen JA. Applic
ation of Differe
nt
Spatial Sam
p
lin
g Patterns for Sparse Arra
y T
r
ansduc
e
r
Desig
n
.
Ultras
onics
. 20
00; 37
(10): 667-
67
1.
[7]
Che
ng J, Qiao M, Bian W
,
et
al. 3D Huma
n Post
ure Segm
entatio
n b
y
S
p
ectral
Cluster
in
g
w
i
t
h
Surfac
e
Normal C
onstr
aint.
Sign
al Pro
c
essin
g
. 201
1; 91(9): 22
04-
22
12.
[8]
Ma S. Comput
er Visio
n
. Beiji
ng: Scienc
e Press. 1998. (in
Chin
ese)
[9]
Je C,
Lee
KH
, Lee
SW
. Multi-Proj
ector
Color
Structur
ed-L
i
ght V
i
si
o
n
.
Sig
nal
Proc
essin
g
: Imag
e
Co
mmun
icati
o
n
. 2013; 2
8
(9): 104
6–
105
8.
[10]
Ben-H
a
mad
ou A,
Soussen C,
D
aul
C, et al.
F
l
exibl
e
ca
libr
a
tion of
structur
ed-li
ght s
y
stem
s projecti
ng
poi
nt patterns.
Co
mp
uter Visi
on an
d Ima
ge
Und
e
rstand
in
g
. 2013; 1
17(1
0
): 1468
–1
481.
Evaluation Warning : The document was created with Spire.PDF for Python.