![VELMEX VXM-3 User Manual Download Page 52](http://html1.mh-extra.com/html/velmex/vxm-3/vxm-3_user-manual_3923815052.webp)
5
The
Analog Input
Appendix I
The
VXM
has
a
10-bit
analog
to
digital
converter
for
general
use,
motor
speed
setting,
or
for
use
with
the
optional
Analog
Joystick
(see
Appendix
J.)
The
analog
reference
voltage
is
the
internal
+5VDC
which
is
also
used
for
the
VXM’s
internal
logic.
This
+5VDC
is
brought
out
on
I/O
pin
2
for
use
with
additional
analog
circuitry.
The
analog
input
(Ain)
voltage
must
not
exceed
the
+5VDC
By
default
the
voltage
at
the
analog
input
Ain
(I/O,3)
is
+2.5VDC.
The
digital
value
of
the
Ain
can
be
read
directly
with
the
“
@
”
command.
Since
this
is
a
10-bit
converter,
the
2.5VDC
would
be
equal
to
512
(½
of
1024.)
Connecting
Ain
to
the
+5VDC
would
return
a
value
of
1024.
If
Ain
is
connected
to
0V
(I/O,1)
the
returned
value
will
be
0.
There
is
a
±
2
digit
margin
for
conversion/
circuitry
error
External
potentiometers
should
be
between
2K
and
10K
ohms.
CAUTION:
NOTE:
Internally
Ain
has
a
100K
ohm
resistor
to
the
+5VDC,
and
a
100K
ohm
resistor
to
0V.
There
is
also
a
100
ohm
resistor
between
the
converter
and
Ain.
@
Read
user
analog
input
value
Ain
(
I/O,3.)
The
value
returned
will
be
a
number
between
0
and
1024.
1,2,3,4,5,6,11,12,13,14,15,21,22,23,24,31,32,33,41,42,51.
See
table
at
right
to
determine
actual
range
of
speed.
Memory
usage
=
3 bytes
.
Example:
This
example
proportions
the
full
range
of
the
analog
input
to
a
speed
range
from
1000
to
3000
steps/sec
for
motor
1.
<cr>
1,2,3,4,5,6,11,12,13,14,15,21,22,23,24,31,32,33,41,42,51.
See
table
at
right
to
determine
actual
range
of
speed.
Memory
usage
=
3 bytes
.
S1M-12
m
=
motor#
(1,2,3,4)
=speed
range:
Set
Speed
to
motor
m
from
analog
input
value
and
range
(100%
power),
x
m
=
motor#
(1,2,3,4)
x
=speed
range:
m
Set Speed
to
motor
from
analog
input
value
and
range
(70%
power),
x
x
6
m
M
[
6$
m
M
[