52
•
Chapter 7 Application Programming
CDS-3310
AMA After
completion
JP #LOOP
Repeat
EN End
Example - Position Follower (Continuous Move)
Method: Read the analog input, compute the commanded position and the position error. Command
the motor to run at a speed in proportions to the position error.
Instruction Interpretation
#CONT Label
AC 80000;DC 80000
Acceleration rate
JG 0
Start Jog mode
BGX Start
motion
#LOOP
vp=@AN[1]*1000
Compute desired position, 1000 chosen for system
ve=vp-_TPA
Find position error
vel=ve*20
Compute velocity, 20 chosen for system
JG vel
Change velocity
JP #LOOP
Change velocity
EN End
NOTE:
Position tacking mode also provides for a continuous move.
Analog Output
The controller has one analog output which may be set in Volts using the AO 1,n command where n is
the voltage from -9.999 to 9.999. The resolution of the Digital-to-Analog conversion is 16 bits.
Example
Objective – Produce a sinusoidal analog signal with a specified amplitude and period.
Instruction Interpretation
Amplitud = 5
;’-5 Volts to +5 Volts
Period = 1000
;’1 second period
#loop ;’Label
AO 1, Amplitud * @SIN[360/Period * TIME]
;’set analog output
JP#loop
The Auxiliary Encoder Inputs
The auxiliary encoder inputs can be used for general use. The controller has one auxiliary encoder,
which consists of two inputs, channel A and channel B. The auxiliary encoder inputs are mapped to
the inputs 81-82.
Each input from the auxiliary encoder is a differential line receiver and can accept voltage levels
b/-12Volts. The inputs have been configured to accept TTL level signals. To connect TTL
signals, simply connect the signal to the + input and leave the - input disconnected. For other signal
levels, the - input should be connected to a voltage that is ½ of the full voltage range (for example,
connect the - input to 6 volts if the signal is a 0 - 12 volt logic).
Example:
Summary of Contents for CDS-3310
Page 26: ...18 i Chapter 2 Getting Started CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 32: ...24 i Chapter 3 Connecting I O CDS 3310 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 124: ...CDS 3310 Chapter 8 Hardware Software Protection i 63 THIS PAGE LEFT PLANK INTENTIONALLY...
Page 138: ...CDS 3310 Chapter 10 Theory of Operation i 77 THIS PAGE LEFT BLANK INTENTIONALLY...