55
54
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.
CAUTION: The analog input (Ain) voltage must not exceed the +5VDC
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.
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.
NOTE: There is a ± 2 digit margin for conversion/ circuitry error
External potentiometers should be between 2K and 10K ohms.
@ Read user analog input value Ain ( I/O,3.) The value returned will be a number
between 0 and 1024.
SmM-x m=
motor# (1,2,3,4)
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.
S1M-12<cr>
SAmM-x m=
motor# (1,2,3,4)
Memory usage = 3 bytes.
Read and assign analog input value to motor m speed (70% power),
x=speed range:
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.
Read and assign analog input value to motor m speed (100% power),
x=speed range:
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.
x
Speed Range
(steps/sec.)
1 1 - 1000
2 1 - 2000
3 1 - 3000
4 1 - 4000
5 1 - 5000
6 1 - 6000
11 1000 - 2000
12 1000 - 3000
13 1000 - 4000
14 1000 - 5000
15 1000 - 6000
21 2000 - 3000
22 2000 - 4000
23 2000 - 5000
24 2000 - 6000
31 3000 - 4000
32 3000 - 5000
33 3000 - 6000
41 4000 - 5000
42 4000 - 6000
51 5000 - 6000
Table for analog assigned motor speed
NOTE: When a “ is stored in a program, the original x value will be kept with the
command. However, when the “lst” command is used to list the program, the x value
displayed will be the steps/sec speed converted from reading Ain.
This feature allows viewing the actual derived speed the VXM is going to use.
SmM-x”
+5V (I/O,2)
0V (I/O,1)
Ain (I/O,3)
2K to 10K Ohm Potentiometer
(5K recommended)
Connection to Potentiometer