Instruction
Interpretation
#CONT
Label
AC 80000;DC 80000
Acceleration rate
JG 0
Start job mode
BGX
Start motion
#LOOP
vp=@AN[1]*1000
Compute desired position
ve=vp-_TPA
Find position error
vel=ve*20
Compute velocity
JG vel
Change velocity
JP #LOOP
Change velocity
EN
End
Example – Low Pass Digital Filter for the Analog inputs
Because the analog inputs on the Galil controller can be used to close a position loop, they have a very high
bandwidth and will therefor read noise that comes in on the analog input. Often when an analog input is used in a
motion control system, but not for closed loop control, the higher bandwidth is not required. In this case a simple
digital filter may be applied to the analog input, and the output of the filter can be used for in the motion control
application. This example shows how to apply a simple single pole low-pass digital filter to an analog input. This
code is commonly run in a separate thread (XQ#filt,1 – example of executing in thread 1).
#filt
REM an1 = filtered output. Use this instead of @AN[1]
an1=@AN[1];'set initial value
REM k1+k2=1 this condition must be met
REM use division of m/2^n for elimination of round off
REM increase k1 = less filtering
REM increase k2 = more filtering
k1=32/64;k2=32/64
AT0;'set initial time reference
#loop
REM calculate filtered output and then way 2 samples from last
REM time reference (last AT-2,1 or AT0)
an1=(k1*@AN[1])+(k2*an1);AT-2,1
JP#loop
Extended I/O of the DMC-42x0 Controller
The DMC-42x0 controller offers 32 extended I/O points which can be configured as inputs or outputs in 8 bit
increments through software. The I/O points are accessed through 1 44 pin high density connector.
Configuring the I/O of the DMC-42x0
The 32 extended I/O points of the DMC-42x0 series controller can be configured in blocks of 8. The extended I/O is
denoted as blocks 2-5 or bits 17-48.
The command, CO, is used to configure the extended I/O as inputs or outputs. The CO command has one field:
CO n
where n is a decimal value which represents a binary number. Each bit of the binary number represents one block
of extended I/O. When set to 1, the corresponding block is configured as an output.
The least significant bit represents block 2 and the most significant bit represents block 5. The decimal value can
be calculated by the following formula. n = n2 + 2*n3 + 4*n4 + 5*n5 where nx represents the block. If the nx value
is a one, then the block of 8 I/O points is to be configured as an output. If the nx value is a zero, then the block of 8
I/O points will be configured as an input. For example, if block 4 and 5 is to be configured as an output, CO 12 is
issued.
Chapter 7 Application Programming ▫ 139
DMC-42x0 User Manual
Содержание DMC-42 0 Series
Страница 85: ...Chapter 6 Programming Motion 81 DMC 42x0 User Manual Figure 6 14 ECAM cycle with Z axis as master...
Страница 195: ...ICM 2900 PCB Layout Appendices 191 DMC 42x0 User Manual...
Страница 205: ...CB 50 100 Drawings Appendices 201 DMC 42x0 User Manual...
Страница 206: ...Appendices 202 DMC 42x0 User Manual...
Страница 207: ...Appendices 203 DMC 42x0 User Manual...
Страница 208: ...Appendices 204 DMC 42x0 User Manual...
Страница 209: ...Appendices 205 DMC 42x0 User Manual...
Страница 210: ...Appendices 206 DMC 42x0 User Manual...
Страница 211: ...Appendices 207 DMC 42x0 User Manual...
Страница 214: ...CB 50 80 Drawing Appendices 210 DMC 42x0 User Manual...
Страница 215: ...Appendices 211 DMC 42x0 User Manual...