What to Learn

Download Report

Transcript What to Learn

PMAC 기술교육 (기본과정)
DELTA TAU KOREA
PMAC ( Programmable Multi-Axis Controller )
UMAC / QMAC




동시 2/4/8/(32)축 제어 가능
강력한 Digital Signal Processor (DSP) 활용
Motorola DSP56002(일반PMAC) or
DSP563xx 80Mhz 이상
(Turbo Series, UMAC, QMAC)
PMAC2 PC/104 (경제형 4/8 Axis) : DSP563xx를
사용하지만 40Mhz 기본. Non-Turbo Firmware.
P(UMAC) MAC Versions
Non-Turbo PMAC : Mini, Lite, PC, PMAC2 PC/104
Turbo PMAC : PC, UMAC, QMAC
All Versions



Run as standalone controller
Commanded by a host
computer over a serial or a bus
port
Same Programming language
Differences




Form Factor
Bus Interface
Availability of certain I/O
ports
USB/ Ethernet available
3
UMAC NEW CPU 특징
* CPU 와 통신기능을 단일 보드에 구성 (기존 54E 불필요)
* USB2.0 / Ethernet 100Base-T 동시지원
(통신방법 변경시 firmware 변경 불필요)
* 보조시리얼 포트 기본 장착 (시리얼 포트 2개)
(외부 시리얼장치와 통신용이)
* 고속 CPU Option 가능 (160/240/400Mhz)
* DPR 메모리 용량 4배 확장 (DPR 선택사양)
* 별도 Watchdog board를 통한 상태 LED 표시 필요 (선택사양)
*DPR Base Address 변경 ($60000) <= (기존 $6C000)
(기존 장비에 적용시에는 DPR M-변수 어드레스 변경작업 필요)
New UMAC CPU &
Watchdog Interface board
* Hardware Ethernet 통신방식으로 안정된 Ethernet 통신 제공
(PC와의 조합에 따른 통신장애 없음)
4
카드설정 (점퍼,E-Point Jumpers)

PC Bus 어드레싱 (ISA ONLY)

카드번호 (daisychaining PMAC’s)

통신 속도(Communication Baud Rate)
(Turbo Series, PMAC2 는 Parameter로 설정)

서보클럭 주파수(Servo-Clock Frequency)
(PMAC2 Series (UMAC) 는 Parameter로 설정)

엔코더 신호 설정(differential/single ended)

아나로그 전원(+/-12V) 공급방식 설정
(isolated/non-isolated)

Re-Initialization Jumper (초기화 점퍼)
* 세부 내용은 PMAC Hardware Reference Manual 참고
PMAC,
Sub-nano 제어로부터 수 백Kw급의 대용량 모션제어에
이르기 까지 다양한 적용분야에 걸쳐 사용가능
다양한 적용분야






FPD Inspection / Manipulation 

로보트 (robotics)

공작기계 (machine tools)

인쇄기 (printing)
종이 및 목재 가공기

(paper and lumber processing)
팩킹기 (packaging)

조립라인 (assembly lines)
material handling
카메라 제어(camera control)
실리콘 웨이퍼 가공기
(silicon wafer processing)
자동 용접기
(automatic welding)
레이저 가공기(laser cutting)
그 외 모든 모션제어 분야
PMAC 구성
PMAC, 8(32;Turbo) 축 제어 가능한 Firmware 보유...




1개의 좌표계에서 완벽한 동기운전
완전히 독립적인 8(16; Turbo)개의 모션가능
모션제어에 적절한 자유로운 좌표계 구성가능
Turbo PMAC : 1개 좌표계에 최대 9축
구성가능(동기운전가능) . 10축 이상은 다른
좌표계에 구성하여 동기가능
PMAC 기능
모션 프로그램 실행
w 한번에 한 개의 이송(move), 이송 이전에 모든 계산 수행
w PMAC은 항상 다음 이송명령을 선독(Looking ahead) 하여
혼합이송(Blending Move)을 한다.
PLC 프로그램 실행
w 빠른 속도의 연속 스캔
w 모션에 비동기인 모든 작업에 유익
PMAC 기능 (계속)
서보루프 갱신 (Servo Loop Update)
w사용자에게 보이지않는 자동작업
w모션 발생기에 의해 발생된 방정식에 의해 지령 위치를
증감하고, 지령 커멘드를 발생하기 위해 서보루프를
close하는 동작으로 구성된다.
Commutation Update
w 자동 수행 (통상 약9KHz)
w 회전자의 자기장 방향을 측정하(거나)고 산정하여
모터상간의 명령을 분배한다
PMAC 기능 (계속)
Housekeeping
 정기적으로 자동으로 수행
 적절한 작업순서 감시
 추종에러 리미트 감시 (Following error limits)
 하드웨어 오버트러블 리미트 감시
 소프트웨어 오버트러블 리미트 감시
 서보 앰프 에러 감시 (Amplifier faults)
 워치도그 타이머 감시 (Watchdog Timer)
호스트와의 통신
 언제든지 PMAC과 호스트(컴퓨터)와의 통신가능
 지령된 잘못된 명령어 지령 시에는 호스트에 에러 리포트
작업 우선순위 결정 (Task Priorities)
 효율성 및 안전을 고려한 우선순위 결정
 우선순위는 정해져 있지만 실행속도(Frequency)는 변경가능
PMAC Feedback Capabilities
Feedback Device
Quadrature or Pulse & Direction
Encoder
Sinusoidal Encoder (SIN/COS)
Parallel Word Feedback
Interferometer, Absolute Encoder
Resolver Feedback
Yaskawa or Mitsubishi Absolute
Encoder
Synchronous Serial Interface
Encoder (SSI)
Analog Feedback
PMAC1
ACC-8D
PMAC2
ACC-8F, ACC-8A
UMAC
ACC-24E2 Family
ACC-8D opt8 (256x) ACC-8D opt8 (256x)
ACC-51P (4096x)
ACC-8A (256x)
ACC-51P (4096x)
ACC-14D/V
ACC-14D/V
ACC-51E (4096x)
ACC-8D opt 7
Acc-8D opt9
(Yaskawa only)
N/A
ACC-58E
ACC-59E (both)
ACC-28A (14-bit)
ACC-28B (16-bit)
Magnetostrictive Linear
ACC-29
Displacement Transducer (MLDT)
Sanyo Absolute Encoder
ACC-49
ACC-8D opt 7
Acc-8D opt9 (Yaskawa
only)
N/A
ACC-28A (14-bit)
ACC-28B (16-bit)
On-Board Option 12
Built In Logic
ACC-49
ACC-14E
ACC-53E
ACC-36E (12-bit)
ACC-28E (16-bit)
Built in Logic
N/A
Servo IC (Custom Gate Array)



PMAC CPU부와 외부 서보 신호의 중간에서 인터페이스 및
중요한 서보 기능을 수행하는 전용 Chip
Encoder Counter, Position Capture, Position Compare 기능 등 처리
속도에 민감한 기능들을 CPU의 관여 없이 독립적으로 수행한다.
PMAC1 Type, PMAC2 Type 두 종류가 있다.
CPU
SERVO IC
Servo Signals
Command Output
Encoder Feedback
Input / Output Flags
12
PMAC1 Servo IC
PMAC CPU는 특별히 설계된 게이트 어레이 IC(DSPGATE)
들을 통해 각 축과의 통신 수행. 이 DSPGATE 한 개는 ..




4 아나로그 출력 채널. (analog output channels)
4 엔코더 입력 채널. (encoders as inputs)
악세서리 보드를 통한 4개의 아나로그 신호
입력 채널.
한 개의 PMAC카드는 1개에서 4의 DSPGATE
사용.
HOME 1-4
+LIM 1-4
-LIM 1-4
FAULT 1-4
AENA 1-4
EQU 1-4
PMAC1 Servo IC
Selectable-Frequency Clock Inputs
Encoder
Servo
Phase DAC/ADC
Sample
DAC 1
4
Analog
Outputs
DAC 2
Input
Flags
Encoder 1
Encoder 2
DAC Shift Registers (4)
DSP-Gate
Encoder 3
ADC Shift Registers (4)
Encoder 4
Encoder
Control
Analog
Control
DAC 3
Output
Flags
Serial
Data Out
Serial
Data In
Clock
16 bit
Resolution
DAC 4
Opto Isolation
4
Encoder
Inputs
A
B
C
A
B
C
A
B
C
A
B
C
Flag
Control
ADC
16 bit
MUX
1
2
3
4
Mux
Control
ACC-28A Board
24-bit
Data Bus
5-bit
Address Bus
14
4
Analog
Inputs
4 Circuits per
Gate Array
Position Compare Register
EQL OUT
Phase Clock
Phase Capture Register
Five Inputs
“C” Channel
4 Flags
Position
Capture
Trigger
Control
A
B
Encoder Input
Digital
Filter
A/B Quad
Decoding
“Home” Flag Capture Register
Count
Direction
24 bit up/down position counter (30
MHz Max)
W/mode Control
X1 X2 X4 P D CLK
Servo Clock
Servo Position Capture Register
Clock, to 30 MHz
Timer Registers (2)
1/T Encoder Period Measurement
24-bit Data
5-bit Address
Bus and
Data
Control
Status & Control Register
Flags
5 inputs
1) ENC Err
2) Capture
3) EQU
3 Status
16 Controls
15
PMAC2(UMAC) Servo IC
UMAC’s CPU communicates with the axes through specially
designed custom gate array ICs (Servo IC’s). Each of these
ICs can handle




12 output channels (for 4 Axis Channels)
4 encoders as inputs
4 Position Compare Outputs
8 analog-derived inputs from accessory boards
16
PMAC2 Gate Array IC Clock Control
20 MHz
x6 Phase
Locked Loop
120 MHz
16
PWM COUNT
PWM
Up/Down
Counter
SIGN
16
DIR
PWM Max
Count
Max Phase
PWM Dead Time/
PFM Pulse Width
24
Data
6 Address
Encoder Sample
Clock Control
PFM
Clock Control
DAC
Clock Control
ADC
Clock Control
Int/Ext Phase
Int/Ext Servo
Phase
Clock Control
Servo
Clock Control
8
1
3
n=0-7
n=0-7
40 MHz
1
2n
n=0-7
SCLK
1
2n
n=0-7
n=0-15
n=0-15
DT/PW
1
n+1
PFMCLK
1
2n
DACCLK
1
2n
ADCCLK
PHASE
1
n+1
External
Phase
SERVO
External
Servo
17
PWM Frequency/
Deadtime Control*
Output
Select
Output A
Command Value
Output B
Command Value
Output C
Command Value
Pulse Width
Modulator
DAC Shift
Register
PWMATOP
PWMABOT
C
DACCLK
DACA
Pulse Width
Modulator
PWMBTOP
PWMBBOT
DAC Shift
Register
DACSTROB
DACB
Pulse Width
Modulator
A,B
PWMCTOP
PWMCBOT
Pulse Frequency DIR
PULSE
Modulator
DAC Frequency/
Strobe Control*
PFM Frequency
Control*
*Common to all channels
To encoder/timer
input multiplexer
PMAC2 Gate Array IC Output
18
Channel (1 of 4)
EQU
S
Q T
AENA
T
Hall
Sensor
Decode
Digital
Delay
Filter
U
V
W
=?
Compare A
Position
=?
Compare B
Position
S
Auxiliary Flags
(Subcount, Hall,
Fault Code)
USER
-LIM
+LIM
HOME
Channel
Status
Digital
Delay
Filter
Flag
Capture
Control
Channel
Control
CTRL
24
Data
CTRL
D.D.F.
A
Digital
Delay
Filter
CTRL
MUX
Encoder Inputs
Phase Capture
Position
CTRL
Index
Gating
INDEX
B
6
Address
Flag Capture
Position
Capture Flags
FAULT
Compare
Auto-Increment
CTRL
Decode
Control
Counter
(40MHz)
Time Between
Last 2 Counts
Timers
Pulse
Dir
Servo Capture
Position
(40/120MHz)
Time Since
Last Count
(From Pulse
Generator)
Servo
Clock
Phase
Clock
PMAC2 Gate Array IC Encoder/Flag Channel (1 of 4)
19
JTHW Multiplexer Port
ACC–8D Opt 7 R/D Converter
ACC–8D Opt 9 Yaskawa Encoder Interface
ACC–18 Thumbwheel Board
ACC–34 Family I/O Boards
ACC–35 Extenders
JRS232/RS422 Serial Port
ACC–20 Handwheel Terminal
ACC–26 Serial Isolator
JOPTO I/O Port
ACC–21 Opto–22 Interface Cables
JPAN Control Panel Port
ACC–16 Control Panel
ACC–39 Handwheel Interface
JS1, JS2 ADC Port
ACC–28 ADC Boards
JDISP Display Port
ACC–12 Family
LCD, VFD Displays
J1
JMACH Servo Port(s)
ACC–8 Family Breakout Boards
J2
J3
J4
J7
J5
JS1
J8
JS2
JEXP
JEXP Expansion Port
Opt 2 DPRAM (ISA)
ACC–14 I/O Board
ACC–24 Axis Expansion
ACC–29 MLDT Interface
ACC–36 ADC Board
PMAC(1) Accessory Boards
20
JMACRO Port
ACC–42 MACRO Interface
JTHW Multiplexer Port
ACC–8D Opt 7 R/D Converter
ACC–8D Opt 9 Yaskawa Encoder Interface
ACC–18 Thumbwheel Board
ACC–34 Family I/O Boards
ACC–35 Extenders
JRS232/RS422 Serial Port
ACC–20 Handwheel Terminal
ACC–26 Serial Isolator
JMACH Servo Port(s)
ACC–8 Family Breakout Boards
JDISP Display Port
ACC–12 Family
LCD, VFD Displays
JEXP Expansion Port
ACC–14 I/O Board
ACC–24 Axis Expansion
ACC–36 ADC Board
PMAC2 Accessory Boards
21
PMAC Executive Program : Pewin Pro Suite
(Windows or DOS version)
PMAC의 셋업(setup), 디버그(debug) 및 진단(diagnose)
을 위한 필수적인 프로그램
The Executive program을 통해 PMAC이 가진 필요한 모든
내용을 엑세스한다. 예를 들면..:





PMAC에 온라인 명령사용
위치(positions), 속도(velocities),및 추종에러 (following
errors) 표시
모터, 좌표계 및 모든 상태정보를 표시
모든 PMAC 변수의 표시, 변경 및 조회 가능
모든 PMAC 정보의 백업(backup) 및 환원(restore)
PMAC 매뉴얼 구성
 Hardware reference manual
각 보드별, Jumper 구성, 커넥터 핀 설명
 User Manual -- Turbo PMAC Users Manual
PMAC의 전반적인 구성 및 기능 설명
 Software Reference Manual
I-variable, Command, Address map의 설명
M-variable 구성 및 각종 예제 프로그램
 Accessory 및 Option 매뉴얼
 Application Note
PMAC 명령어(COMMAND SET)
1. 온라인 명령어(On-line Commands)
(명령지령 즉시 실행되며, 저장 안됨)
- 적용되는 범위에 따라..
A. 전체 좌표계 (Global)
B. 좌표계 (Coordinate System Specific (&n …))
C. 모터 (Motor Specific (#n…))
모드설정(Mode setting), 이송명령(move commands),조회
(queries), 변수 설정(variable setting), 버퍼제어(buffer control)
2. 버퍼 명령어 (Buffer command )
(명령에 의해 실행될 수 있도록 버퍼에 저장)
A. 모션 프로그램 (Motion Program)
이송(Moves), 모드(modes), 산술(math), 로직(logic),
commands, 메시지(messages)
B. PLC Program
산술(Math), 논리(logic), commands, 메시지(messages)
* 버퍼형식 명령어는 “OPEN”으로부터 실행된다.
Global Status Commands
#n - 모터번호 지정
&n - 좌표계 번호 지정
SIZE – 사용 가능한 메모리 용량 리포트 (words)
$$$ - Reset PMAC, 전원 재 투입과 동일기능
$$$*** - Global Reset, 초기화
SAVE – 현재 설정내용을 Flash 메모리에 저장
VER - Firmware version report / DATE
25
Motor Status Commands (#n)
P - Report position (in counts
V - Report velocity (in counts/servo cycle)
F - Report following error (in counts)
? - Report status bits (in hex ASCII)
Coordinate System Status Commands (&n)
%
??
B(n)R
PR
#n- >
- Report feedrate override value
- Report status bits (in hex ASCII)
- Program 실행 명령
- Report program remaining in rotary buffer
- Report axis definition of motor n
26
PMAC Stop Commands
J/ - “Jog Stop”: Bring motor to closed-loop, zero
velocity from moving, open-loop, or killed.
Decelerates according to Ix19-Ix21
A - “Abort”: Bring all motors in coordinate system to
closed-loop zero velocity from moving, open-loop,
or killed. Stops execution of motion program.
Motors decelerate according to Ix15. (<CTRL-A>
for all C.S.)
Q - “Quit”: Stop calculating motion program; finish
already calculated moves (<CTRL-Q> for all C.S.)
/ - Stop program at end of executing move (I13>0
mode only)
27
PMAC Stop Commands (continued)
H - “Hold”: Feedhold for coordinate system.
Equivalent to “%0” but uses Ix95 for deceleration,
and starts again with R. (<CTRL-O> for all C.S.)
\ - Feedhold that permits jogging in hold mode (I13>0
mode only)
K - “Kill”: Open loop, zero command, disable amp for
motor (<CTRL-K> for all motors)
28
PMAC 변수(Variables)
1. I-Variables (1024 / 8192), 시스템 변수
 초기화 및 셋업 용 변수 (Initialization and setup variables)
 정해진 의미를 가짐
 변수용도(번호)에 따라 카드전체, 특정 모터, 좌표계 및
엔코더에 영향을 미친다.
2.



P-Variables (1024 / 8192)
일반적인 사용자 사용 변수 (General purpose user variables)
48-bit floating point format
전체 영역 엑세스 (Global (whole card) access)
PMAC 변수(Variables) (계속)
3. Q-Variables (1024 / 8192)
 일반적인 사용자 사용 변수 (General purpose user variables)
 48-bit floating point format
 좌표계에 따라 결정 (Specific to a coordinate system)
4. M-Variables (1024 / 8192)
 카드의 메모리 및 I/O를 엑세스
 사용자 정의(address, offset, and bit width)
 형식 : Unsigned, 2’s compliment, BCD, floating point
formats 사용가능
PMAC I-VARIABLE GROUPS (Non-Turbo)
I0-I99
I100-I186
I187-I199
I200-I286
I287-I299
…..
I800-I886
I887-I899
I900-I904
I905-I909
…..
I975-I979
일반적인 카드 설정 값(General Card Setup)
모터 1 설정 (Motor 1 Setup)
좌표계 1 설정(Coordinate System 1 Setup)
모터 2 설정 (Motor 2 Setup)
좌표계 2 설정(Coordinate System 2 Setup)
모터 8 설정 (Motor 8 Setup)
좌표계 8 설정 (Coordinate System 8 Setup)
엔코더/플래그 1 설정 (Encoder/Flag 1 Setup)
엔코더/플래그 2 설정 (Encoder/Flag 2 Setup)
엔코더/플래그 16 설정 (Encoder/Flag 16 Setup)
I-Variables For All PMAC’s
I-variable
Group
General Setup
Motor Variables
C.S. Variables
Servo IC Setup
Servo IC Clocks
MACRO IC Setup
Encoder
Conversion Table
General notes
PMAC
PMAC2
TURBO PMAC
I0 - I99
Ix00 - Ix86
Ix87 – Ix99
I900-I979
Hardware
Y:$720-Y:$73F
I0 - I99
Ix00 – Ix86
Ix87 – Ix99
I9n0-I9n9
I900-I909
I990 – I999
Y:$720-Y:$73F
I0 - I99
Ixx00-Ixx99
Isx00-Isx99
I7mn0 - I7mn9
I7m00 – I7m09*
I6800-6999
I8000-I8191
x-motor number or
C.S. number
x-motor number or
C.S. number
n – Servo IC
Channel
* PMAC1 Turbo uses hardware
xx-motor number (1-32)
s – set to 5 for C.S. 1-9
set to 6 for C.S. 10-16
x - set 1 to 9 for C.S 1-9
set to C.S.minus 10 for C.S.10-16
m –Servo IC number
n – Servo IC channel
32
(Turbo) Servo IC Variables
I7mn
m: Servo IC No. m=0~.. (Turbo PMAC)
m=2~.. (UMAC)
(m값은 Axis (card) DIP SW에 의해 결정됨)
n = Channel No. (1~4) / Servo IC
Des c.
0
Encoder Dir./
Mutilpier
CH# 1
CH# 2
CH# 3
CH# 4
CH# 5
I900
I905
I910
I915
I920
I9n0
PMAC1
PMAC2
I7mn0
Turbo PMAC
1
I902
2
I907
Home Trigger방법
I912
I917
I922
I9n2
PMAC2
I7mn2
I903
3
Home 스위치 결정
I908
I913
PMAC1
Turbo PMAC
I918
I923
I9n3
PMAC1
PMAC2
I7mn3
Turbo PMAC
Turbo Coordinate Variables
Isx
s = 5 for C.S 1~9
6 for C.S 10~16
x = 1~9 ( minus 10 for C.S 10~16)
C.S1 : I51
C.S8 : I58
C.S10 : I60
ex : I190 =>
I5190
* C.S1 Feedrate Time unit
33
기본적인 모터 정의 I-변수
(BASIC MOTOR DEFINITION I-VARIABLES)
Ix00
모터 x 사용 (Motor x Activation)
Ix00=0
모터 x 사용 안 함(Motor x Deactivated)
서보 계산 안 함(No servo calculations done)
위치정보 리포트 안 함 (No position reported)
Ix00=1
모터 x 사용함 (Motor x Activated)
30msec/cycle 의 속도로 서보 계산
(Servo calculations at 30msec/cycle)
반드시 사용할 필요 없음
(Not necessarily enabled)
기본적인 모터 정의 I-변수 (계속)
(BASIC MOTOR DEFINITION I-VARIABLES)
Ix01
모터 x 커뮤테이션 (Motor x Commutation)
Ix01=0 PMAC에서 Commutation기능 안 함
(Not commuted by PMAC)
한 앰프(모터)에 한 개의 아날로그 출력사용
(One analog output for the motor , 일반적인 앰프)
Ix01=1 PMAC에서 Commutation 계산
(Commutation performed by PMAC)
한 개의 모터에 2 아날로그 출력사용
(2 analog outputs for the motor)
또는 Direct PWM 출력제어인 경우 (PMAC2)
Ix70-Ix83 (Ix61/62) 설정필요
Motor x Safety Variables
Ix11:
Fatal Following Error Limit
(Units: 1/16 ct)
=0 disables
When exceeded:
• Coordinate system program aborted
• Motor(s) killed as set by
Ix25 bits 22 and 21
• (1x): This motor only
• (01): All motors in C.S.
• (00): All PMAC motors
Ix12:
Warning Following Error Limit
(Units: 1/16 ct)
=0 disables
When exceeded:
•Sets motor and C.S. status bits
•Can set output and interrupt
•Can be used for trigger condition
36
Motor x Safety Variables (continued)
Ix13: Software Positive Position Limit
Ix14: Software Negative Position Limit
(Units: counts, referenced to motor zero)
=0 disables
When exceeded:
•Aborts motion program or motor move
•Decelerates motor(s) at Ix15 rate
Ix15: Deceleration Rate on Abort or Limit
(Units: cts/msecs2; floating point)
!
DO NOT SET TO ZERO!
(MOTOR WOULD NOT DECELERATE)
37
Motor x Safety Variables (continued)
Ix16: Maximum Permitted Program Velocity
(Units: cts/msec; floating point)
•For linear blended program moves only
(with I13=0)
•Limit scales with feedrate override (% value)
•Also serves as RAPID velocity if I50=1
38
Motor x Safety Variables (end)
Ix17: Maximum Permitted Program Acceleration
(Units: cts/msec2; floating point)
• For linear blended program moves only
(with I13=0)
• Limit scales with feedrate override (% value)
• Of limited effectiveness when
acceleration/deceleration requires more than one
programmed move
Ix19: Maximum Permitted Jog Home Acceleration
(Units: cts/msec2; floating point)
•Can override TA (Ix20) and TS (Ix21)
•Used always if Ix200 and Ix210
39
Ix25 - Motor x Flag Address and Modes
Modes
Hex($)
5
PMAC address of flags
2
C
0
0
4
Bin 0 1 0 1 0 0 1 0 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0
=0
=1
=0
=1
Use amplifier enable function
Do not use amplifier enable function
Enable hardware position limits
Disable hardware position limits
=0 Enable amplifier fault input
=1 Disable amplifier fault input
=00 Kill all PMAC motors on fault or F.E.
=01 Kill all C.S. motors on fault or F.E.
=1x Kill this motor only on fault or F.E.
=0 Low true fault input
=1 High true fault input
Ixx25 - Motor x Flag Address for TURBO
TURBO PMAC address of flags
Hex($)
0
7
8
0
0
8
Bin 0 0 0 0 0 1 1 1 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0
Because of the memory addressing of the TURBO
PMAC, a new variable had to be created for the FLAG
Mode Setting (Ixx24)
41
Ixx24 - Motor x Modes (for TURBO)
Modes
Hex($)
5
2
0
0
0
0
Bin 0 1 0 1 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
=0 PMAC1
=1 PMAC2
=0
=1
=0
=1
Use amplifier enable function
Do not use amplifier enable function
Enable hardware position limits
Disable hardware position limits
=0 Enable amplifier fault input
=1 Disable amplifier fault input
=00 Kill all PMAC motors on fault or F.E.
=01 Kill all C.S. motors on fault or F.E.
=1x Kill this motor only on fault or F.E.
=0 Low true fault input
=1 High true fault input
42
Motor x Motion Variables (continued)
Ix28: In Position Band (Units: 1/16 ct)
For indicator purposes only
A motor is “in-position” if:
• Closed loop
• Desired vel =0
• Prog timer off
• |FE|<Ix28
•Above conditions true for (I7+1)
consecutive background scans
Example use in program:
X10
;move
DWELL 0 ;stop lookahead
WHILE(M140=0)WAIT ;while not in position
M1=1
;action on in position
43
Non-PMAC vs Turbo 주요 I-변수 비교
항목
Non-Turbo
Turbo
Global variable
I0 ~ I99
I0 ~ I99
(세부의미는 서로 다름)
Motor Variable
Ix00 ~ Ix86
Ixx00 ~ Ixx99 (Ixx24/25)
Coordinate System Var.
Ix87 ~ Ix99
Isx00 ~ Isx99
(s=5 or 6, x=CS#)
Encoder (Servo IC)
I900 ~ I904 (.. I975 ~ I979)
I7mn(0~4)
Encoder Conversion Table
X/Y:$720 ~ $73F
I8000 ~ I8191
A/D Conversion
I5060 ~ I5096
Hardware address는 완전히 다름
44
P-변수 (P-Variables)
PMAC 프로그램에서 계산을 위한 일반적인 용도의 변수
(P-Variables are general use variables for user calculations in PMAC programs.)
 48-bit floating point format
 1024 P-Variables (P0 ~ P1023)
 8192 P-Variables for Turbo PMAC (P0 ~ P8191)
용도 :
계산 (Calculations)
P100=P101*(sin(45))
소프트웨어 트리거 (Software triggers)
IF( M1!= 1 AND P10 = 0)
P-변수 (P-Variables) (계속)
예를 들어, SIN(q) + COS(q) 로 정의되는 위치 궤적으로 모터를
이용하기 위해서 다음과 같이 간단히 프로그램 작성가능 :
미리 값을 계산하여 프로그램
OR
작성 (종래 방법)
X1
X1.0173
X1.0343
…
…
X0.9824
X1
간단히 변수를 사용하여
방정식에 대응 (Simple)
P1=0
WHILE (P1<361)
P2=SIN(P1) +COS(P1)
X(P2)
P1=P1+1
ENDWHILE
Q-변수 (Q-VARIABLES)
PMAC 프로그램에서 계산을 위한 일반적인 용도의 변수
(Q-Variables are general use variables for user calculations in PMAC
Programs)
Q-변수(어드레스)는 좌표계에 따라 결정
(Q-Variables are coordinate system specific)
복수 개의 좌표계를 가진 시스템에서 변수의 관리를 편하게
하기위해 Q변수를 사용할 수 있다.
(Multiple C.S. might use Q-Variables to ease variable management)
What to Learn:
 Q-변수 메모리 구성 (How Q-Variables are organized in memory)
 변수 사용 방법
(How to determine which variables are available for your system)
Q-변수 메모리 맵핑 (Memory Mapping)
Q변수의 물리적 어드레스는 현재 설정된 좌표계에 의해
결정된다.
&1 Q0
&2 Q0
accesses location
accesses location
$1400
$1600
&7 Q0
&8 Q0
accesses location
accesses location
$1580
$1780
따라서 복수의 좌표계를 가지는 적용에 메모리 관리를
간단하게 한다
 모든 프로그램이 같은 변수를 사용한다.
(All programs use the same variables)
 프로그램들이 동시에 메모리 충돌 없이 실행될 수 있다.
(Programs can run simultaneously without memory conflicts)
Q-변수 메모리 랩핑
(Variable Memory Wrapping)
다른 좌표계에서 다른 좌표계를 엑세스하여 같은 물리적
메모리 어드레스를 엑세스할 수 있다
&1 Q0
&2 Q512
accesses location
accesses location
$1400
$1400
&7 Q640
&8 Q128
accesses location
accesses location
$1400
$1400
오버래핑이 되지않는 각 좌표계의 Q변수 개수는 사용되는
좌표계의 개수가 작을수록 많아진다.
(The number of non-overlapping Q-variables available per
coordinate system decreases as the number of used coordinate
systems increases)
PMAC Q - VARIABLE MEMORY MAP
PMAC Mem
Loc.
$1400
...
$147F
$1480
...
$14FF
$1500
...
$157F
$1580
...
$15FF
$1600
...
$167F
$1680
...
$16FF
$1700
...
$177F
$1780
...
Coord.
Sys. 1
Q0
...
Q127
Q128
...
Q255
Q256
...
Q383
Q384
...
Q511
Q512
...
Q639
Q640
...
Q767
Q768
...
Q895
Q896
...
Y:\BRAD\TRAINING\Q_VARB.DOC
Coord.
Sys. 2
Q512
...
Q639
Q640
...
Q767
Q768
...
Q895
Q896
...
Q1023
Q0
...
Q127
Q128
...
Q255
Q256
...
Q383
Q384
...
Coord.
Sys. 3
Q768
...
Q895
Q896
...
Q1023
Q0
...
Q127
Q128
...
Q255
Q256
...
Q383
Q384
...
Q511
Q512
...
Q639
Q640
...
Coord.
Sys. 4
Q256
...
Q383
Q384
...
Q511
Q512
...
Q639
Q640
...
Q767
Q768
...
Q895
Q896
...
Q1023
Q0
...
Q127
Q128
...
Coord.
Sys. 5
Q896
...
Q1023
Q0
...
Q127
Q128
...
Q255
Q256
...
Q383
Q384
...
Q511
Q512
...
Q639
Q640
...
Q767
Q768
...
Coord.
Sys. 6
Q384
...
Q511
Q512
...
Q639
Q640
...
Q767
Q768
...
Q895
Q896
...
Q1023
Q0
...
Q127
Q128
...
Q255
Q256
...
Coord.
Sys. 7
Q640
...
Q767
Q768
...
Q895
Q896
...
Q1023
Q0
...
Q127
Q128
...
Q255
Q256
...
Q383
Q384
...
Q511
Q512
...
Coord.
Sys. 8
Q128
...
Q255
Q256
...
Q383
Q384
...
Q511
Q512
...
Q639
Q640
...
Q767
Q768
...
Q895
Q896
...
Q1023
Q0
...
M-변수 (M-VARIABLES)
M-변수는 PMAC 메모리와 I/O를 엑세스 하는 용도로 사용
(M-variables are used to access PMAC memory
and I/O points)
M변수는 미리 정의된 의미는 없으므로, 어느 M변수로
어떤 PMAC 어드레스를 엑세스 할 것인가를 정의한다.
(M-Variables have no pre-defined meanings.Users must
define what PMAC address an M-Variables accesses)
일단 정의된 M변수는 일반적인 계산이나 조건문에 사용
될 수 있다.
What to Learn:
 M변수 정의방법
 M변수 엑세스 및 I/O points 설정방법
X-Memory
23
$0000
$00FF
$0100
1615
87
Y-Memory
0 23
1615
87
Internal DSP
Memory
Fixed-Use Calculation
Registers
$17FF
$1800
PMAC
Memory
Map
User Buffer Storage Space
$9FFF
$A000
$BBFF
$BC00
$BFFF
$C000
0
Option 16 Battery Backed Parameter Memory
User-Written Servo
Storage
External
Static
RAM
(Battery/Flash
Backed)
M-Variable Definitions
DSP-Gate
Registers
$C03F
$D000
Dual-Ported
RAM
$DFFF
$E000
VME Setup Registers
Mailbox Registers
VME bus
registers
$F000
$FFFF
I/O
Registers
52
X-Memory
23
16 15
8
7
Y-Memory
0
23
16 15
8 7
0
$000000
$0007FF / $001FFF1
$000800 / $0020001
$005FFF
$006000
Turbo PMAC
Memory &
I/O Map
$007FFF
$008000
$009FFF
$00A000
Internal DSP Memory
Fixed-Use Calculation Registers
Standard P-Variable Registers
Standard Q-Variable Registers
External
Static
RAM
(Flash-Backed)
User-Buffer Storage Space
$0107FF / $03FFFF2
$050000
$053FFF / $05FFFF3
$060000
$060FFF / $063FFF4
$070000
$0701FF
$078000
$07B31F
Notes:
1. 56303 CPU / 56309 CPU
2. Standard / Extended Data Memory
3. Standard / Extended BBRAM Option
4. Standard / Extended DPRAM Option
Alternate P & Q-Variable Registers
Optional BatteryBacked RAM
Optional DualPorted RAM
Bus Interface ICs
Servo, MACRO,
& I/O ICs
53
M-변수 정의 예
X: {address}, {offset}, {width}, {format}
Y: {address}, {offset}, {width}, {format}
1-24bits의 정수 (integer 1-24 bits wide)
{offset}은 시작 비트 표시(starting bit number)
기본 {width}는 1; 기본 {format}은 U (unsigned)
M-Variables 정의 예
M0->x:$0,0,24 서보 클럭 정의 (Point to Servo Clock)
M1->Y:$FFC2,8,1 JOPIO의 첫번째 출력비트 정의
M9->Y:$FFC2,8,8 JOPIO의 1byte 출력 정의
M102->Y:$C003,8,16,s DAC 1 출력 정의
M-variables 사용 예
M1=1 JOPIO의 첫번째 출력비트 on
M9=45 JOPIO 출력의 1,3,4,6 번째 비트 on,
2,5,7,8번째 비트 off
( 45=00101101 binary=$2D hex)
Simple M-Variable Definitions
X: {address}, {offset}, {width}, {format}
Y: {address}, {offset}, {width}, {format}
offset - is starting bit number
width - default width 1; could be 1, 4, 8, 12, 16, 20,or 24 bits wide
format - default format U (unsigned); could be signed S
Defining M-Variables
M0->x:$0000,0,24 Point to Servo Clock
M1->Y:$FFC2,8,1 Point to Machine Output 1
M9->Y:$FFC2,8,8 Point to Machine Output 1-8
M102->Y:$C003,8,16,s
Point to DAC 1 output
M197->Y:$0806,0,24,s
Point to Feedrate Override
M120->Y:$C000,20,1
Point to Home Flag Axis 1
Delta Tau Suggested M-Variables in the PMAC Software
Reference Manual
55
M-Variable Definition Types
An M-variable may take one of the following types, as specified by the address prefix
in the definition:
X:
Y:
D:
L:
DP:
F:
TWD:
TWB:
TWS:
TWR:
*:
1 to 24 bits fixed-point in X-memory
1 to 24 bits fixed-point in Y-memory
48 bits fixed-point across both X- and Y-memory
48 bits floating-point across both X- and Y-memory
32 bits fixed-point (low 16 bits of X and Y) (for
use in dual-ported RAM)
32 bits floating-point (low 16 bits of X and Y) (for
use in dual-ported RAM)
Multiplexed BCD decoding from Thumbwheel port
Multiplexed binary decoding from Thumbwheel port
Multiplexed serial I/O decoding from Thumbwheel port
Multiplexed serial resolver decoding from Thumbwheel
port
No address definition; uses part of the definition
word as general-purpose variable
56
M-Variable Definitions
PMAC1 memory location Y:$FFC2 mapped to the JOPTO port: 8 inputs and 8 outputs
Outputs
BIT
23
22
21
20
M9->Y:$FFC2,8,8
M19->y:$FFC2,0,8
19
18
17
16
15
14
13
12
11
10
9
8
7
6
;JOPTO port output word
;JOPTO port input word
5
4
3
2
1
Inputs
Using M-variables
M1=1 Turn on Machine Output 1
M9=45 Turn on Machine Outputs 1,3,4,6 and turn
off Machine Outputs 2,5,7,8
45=00101101 binary=$2D hex
57
0
M-변수 사용시 주의할 점
OPEN PROG 66 CLEAR
LINEAR
INC(X)
FRAX(X)
TA(20)
TS(0*20*0.5)
F(50)
While (1 = 1)
M20==1
X(10)
M20==2
X(10)
EndWhile
CLOSE
PLC program: ????
OPEN PLC9 CLEAR
If (M20 = 1 Or M20 = 2)
P50=P50+1
Else
P51=P51+1
P52=M20
EndIf
CLOSE
=>
P20=M20
IF (P20=1 OR P20=2)
* Using Image bit(or word) for M-variable manipulation
is VERY, VERY IMPORTANT !!!
Ex: (M16-M17)*(M16+M17) =>
P16=m16
P17=m17
(P16-P17)*(P16+P17)
58
M-variable In-Direct Addressing
The Address Definition of M-variables being Stored in Specific memory area
M0 : $4000 ~
M8191: $5FFF (Y-address, low 12bits)
Ex: M64->D:$10F0
M65->Y:$4040,0,12
>> M65=M65+1 : On-line / Program Command
changes M64 definition to D:$10F1 automatically. (M64-> D:$10F1)
…
if ( )
m108= m64
m65=m65+1
endif
* Application : Array Reading / Writing
59
M-VARIABLE QUIZ
 How do you define an M-variable to
read Machine input 2?
 How do you define an M-variable to
read Machine inputs 1 through 8?
 How do you define an M-variable to
read Machine outputs 1 through 8?
 How do you turn on Outputs 1,2, and 8?
 How do tell if inputs 1,2, and 8 are on?
 When and where do you define M-variables?
PMAC 셋업 (SETUP)
적용되는 시스템 특성에 적합한 변수 설정
(모터, 엔코더, I/O, 기타)
셋업 과정은 온라인 커멘드 또는 P1(or 2)SETUP 프로그램을
사용한다
What to Learn:
w P1SETUP 프로그램을 이용한 셋업 방법
w P1SETUP 프로그램 기능
w PMAC 설정환경(Configuration) 저장 방법
PMAC SYSTEM SETUP
Hardware
Connect Wires
Verify Connections
Tuning Motors
JOG / Home move
Software setup
and definitions
Map M-Variables
Define Coordinate
System Scaling
Program the
System
Design program structure
(host, motion, PLC’s)
Write and debug programs
62
PMAC(1) Typical Wiring Example
PMAC (1)
Servo Amp (Vel./Torque mode)
JMACH
5V
GND
+15V
AENA
R
Servo_ON
DAC
(DAC-)
+
-
AGND
AGND
Torque or Vel. CMD
COM
A
AB
A
BC
C* Isolation 권장
FLAG
*LIM+/1
*HOME
*FLT
GND
COM
•근접스위치/리미트 스위치
•Normal Close Only for LIMIT
•NPN for PMAC(1) type
AGND
+15V
AGND
-15V
+15V
AGND
-15V
DC +/-15V
(아나로그파위)
63
ACC-24E2A , Mitsubishi Drive (위치제어)
64
ACC-24E2S , Mitsubishi® Drive (위치제어)
65
ACC-24E2A , Mitsubishi® Drive (토크,속도)
66
CEM104 , Yaskawa® Drive (토크,속도)
67
SERI , Yaskawa® Drive (토크,속도)
68
PMAC Flag Inputs
E89
E90
FLAG INPUTS
External PMAC
AGND
FGND
GND
GND
FAULTn
To ASIC
+LIMn
-LIMn
HMFLn
• Must draw current through opto-isolator
LED to create 0 state
• Three possible sources of power
• Three possible return lines
69
PMAC2(UMAC) (ACC8x) Flag Inputs
+V
0V
FLAG INPUTS
RETURN
+5V
To PMAC2
FLAGn
GND
0V
+V
External
ACC-8x
USERn
PLIMn
MLIMn
HOMEn
• Must draw current through
one of the opto-isolator LEDs
• For sinking outputs, tie
RETURN to +12V to +24V
• For sourcing outputs, tie
RETURN to 0V
• Common RETURN for one
set of four flags
70
Servo Basic Wiring & Setup
•
Encoder Reading : Ixx00=1, PEWIN POS window,
Rotate motor by Hand
•
Amp Enable Test : #xxO0, #xx K (Amp enable & 0V output)
* 아나로그 전원 이상으로 인해 모터가 폭주할 수 있음
•
Analog Output Test : #xxO5{~10}, #xxO-5
모터가 서로 반대 방향으로 회전해야 함
•
Encoder Direction Set : I900,I905.. (I7mn0; Turbo)
PEWIN POS Window w/ #xxO5 & #xxO-5
Set 3 or 7 depend on the rotation direction. (for normal motor)
** Open-Loop 명령을 사용하기 어려운 경우 : (Ix11 은 반드시 기본값)
1) Ix30 (Pro. Gain)을 적절한 값(~10000)으로 설정 후에 #1J:100 지령
2) PEWIN Position window에서 Position값 및 Following Error를 Monitoring
3) 움직임이 없는 경우 Ix33을 5000~10000 으로 설정한다.
4) 모터의 움직임이 “+” 방향이 아닌 경우는 “#1K”후 엔코더 방향설정
변수를 변경 후 재 테스트
71
** Wiring 과 기본 설정에 확신이 있기 전 까지는 모터를 부하에 연결하지 마세요.
SETUP QUIZ
What section of the PMAC manual
explains the setup process?
How do you make PMAC remember what
was setup?
How do you copy PMAC's configuration
to the PC's hard drive?
How do you verify that a PMAC configuration
file on the PC's hard drive is the same as
what is in PMAC's memory?
PMAC 튜닝 (TUNING)
PMAC의 서보 알고리즘은 적용되는 모터와 앰프의 특성에
맞게 환경이 설정되어야 한다.
이 환경설정은 PID 이득(gain)을 나타내는 I변수의 설정을
통해 이루어 진다
시스템에 맞는 적정한 이득 값을 결정하는 과정을
서보 튜닝(tuning)이라 한다.
What to Learn:
 PID의 의미
 PID루프의 의미 및 용도
 PID게인의 설정방법
전형적인 서보 루프(Typical P.I.D Servo Loop)
추종에러
(Following
Error)
=
지령된 위치
(Commanded
Position)
P (proportional gain)
I (integral gain)
D (derivative gain)
-
실제 위치
(Actual
Position)
Spring
Shock Absorber
PMAC PID + Notch Servo Filter
Kvff(1-z-1)
+
S
+
Kaff(1-2z-1+z-2)
+
Reference +
S
Position
-
+
IM
Ki-1
S
+
+
S
-
KP
“Notch” Coefficients
n1: Ix36
n2: Ix37
d1: Ix38
d2: Ix39
Out to
DAC
1  n1 z -1  n2 z -2
1  d1 z -1  d 2 z - 2
Kd
Velocity Loop
Feedback
1 -z
KP: Proportional Gain (Ix30)
Kd: Derivative Gain (Ix31)
Kvff: Vel Feedforward Gain(Ix32)
Ki: Integral Gain(Ix33)
IM: Integration Mode (Ix34)
Kaff: Acceleration Feedforward Gain(Ix35)
Ixx68 : Friction F.F Gain
1 - z -1
(Usually the
same)
Position Loop
Feedback
75
PID Gain Quick 설정 방법 (참고용) *16bit DAC / Direct PWM 제어인 경우
1. 엔코더 회전 방향 파라메터 설정 (I900.. ,I9n0, I7mn0). Ixx33=0, Ixx34=1
2. Ixx30을 증가한다. (약 ~10000 부터 시작, 2~3배씩 증가하면서 Step
Move를 실행하여 Graph를 관측한다.
3. 모터에서 진동이나 소음이 발생하지 않을 때 까지 2)번 내용을 반복한다.
4. Ix30만을 증가함에 따라 발생된 Oscillation(Step Move결과)을 없애기 위해
Ix31(Damping역할)을 증가한다(100~200씩 증가). 만일 Oscillation이 없고
Rise-time이 크다면 Ixx31 값은 감소되어야 한다.
5. Ix30의 값은 클수록 좋지만, Ixx31의 값은 필요이상으로 크게 하지 않는다.
[Feed Forward Gain값 조절]
6. “Parabolic Move”를 실행한다. F.E(Following Error)가 지령속도 패턴과
같은 모양인 경우에는 Ixx32를 증가한다. 지령속도와 F.E가 반대형식의 패턴이
발생되는 경우에는 Ixx32를 감소한다.
7. Ixx35 (Acc. FF Gain) 역시 “Parabolic Move”를 실행하면서 결정한다.
“MoveTime” 값을 Default 500msec에서 200msec로 설정하고 Parabolic move를
실행한다. Commanded Acc. 파형과 F.E 가 같은 형태가 나온 경우에는 Ixx35를
증가한다(1000~3000단위). 두개의 그래프가 반대의 경향을 보이는 경우는 Ixx35를
감소한다.
8. Ixx33=30000(Overshoot가 큰 경우는 작은 값으로 설정)
Ix34=0
76
POS
1/2 to 1/4
motor rev
Step Move
Time
Commanded Position
POS
POS
1/2 to 1/4
1/2 to 1/4
motor rev
motor rev
Time
Overshoot and Oscillation
Cause: too little Damping
or too much proportional gain
Fix: Increase KP (Ix31)
Decrease Kd (Ix30)
Time
Position Offset
Cause: Friction or Constant
Force
Fix: Increase K (Ix33)
i
77
POS
1/2 to 1/4
motor rev
Time
Commanded Position
POS
1/2 to 1/4
1/2 to 1/4
motor rev
motor rev
Time
Time
Sluggish Response
Cause: Too much Damping or
too little Proportional
Fix: Increase KP (Ix30) or
Decrease Kd (Ix31)
Physical System Limitation
Cause: Limit of the Motor/Amplifier/Load
and gain combination
Fix: Evaluate Performance and maybe
use more K (Ix30)
i
78
Parabolic Move Tuning
Vel
Acc
Time
Time
Velocity Profile
Acceleration Profile
F.E.
F.E.
Time
Time
High vel/FE correlation
Cause: Damping
Fix: Increase K vff(Ix32)
High vel/FE correlation
Cause: Friction
Fix: Add "Friction Feedforward" (Ix68)
and/or turn on integral gain (Ix33, Ix34)
F.E.
F.E.
Time
High acc/FE correlation
Cause: Inertial lag
Fix: Increase K aff(Ix35)
Time
High acc/FE correlation
Cause: Physical system limitations
Fix: Use less sudden accel, or add
"Friction Feedforward" (Ix68)
79
Parabolic Move Tuning (continued)
Vel
Acc
Time
Time
Velocity Profile
Acceleration Profile
F.E.
F.E.
Time
F.E.
Negative vel/FE correlation
Cause: Too much vel FF
Fix: Decrease K vff(Ix32)
Time
Negative acc/FE correlation
Cause: Too much acc FF
Fix: Decrease K aff(Ix35)
Time
F.E.
High vel/FE correlation
Cause: Damping & Friction
Fix: Increase K vff(Ix32) first
Time
Mod. vel/FE & acc/FE correlation
Cause: Inertial lag and friction
Fix: Increase K aff(Ix35) first
80
PMAC Auto-Tuning
The PMAC Executive Software has an AUTO-TUNING feature
which provides an easy means of tuning the PID filter.
The Auto-Tuning function of the Executive stimulates the motor,
evaluates the response, and then calculates the gains required
for the desired response level.
81
PMAC Auto-Tuning
This auto-tuning setup procedure was intended for the person who
has never used the PMAC Executive Auto-tuner. For safety
reasons, we suggest the first time user become familiar with the
auto-tuner with the motor de-coupled. Once the user has
confidence tuning de-coupled motors, then he/she should not
hesitate to try the auto-tuner with the motor coupled to the load.
The auto-tuner will figure out the dynamics of the motor based on
the quick movements of the motor and calculate the PID gains. If
the load cannot be “jerked” the in fashion required for the
auto-tuner to calculate the gains, then you might not be able to
auto-tune the motor while coupled to the load. If this is the
case, then you will have to tune the motor manually.
82
PMAC Auto-Tuning Procedure
(1) Calibrate DAC
Use the DAC Calibration in Auto-Tune, procedure
described with P1Setup Program, or manually adjust
potentiometer on amplifier to ensure no movement from
motor with a command 0% output to DAC
(2) Choose the Autotuning Option from the PID Tuning Dialog
Box. Select Autoselect Bandwidth and make sure you have not
selected velocity feedforward, acceleration feedforward, and
no ‘integral action’. Select the Begin PID Auto-tuning ‘button’
This will force PMAC to select a conservative bandwidth
value, Proportional gain and derivative gain.
83
PMAC Auto-Tuning Procedure (cont.)
(3) Take the conservative bandwidth chosen by the auto-tuner
and increase this value by multiplying it by 2 or 3 and place the
bandwidth box. Also Select a damping ratio of 0.7. Un-check the
autoselect bandwidth and then select the Begin PID Auto-tuning
‘button’
(4) Select velocity feedforward, acceleration feedforward, and soft
or hard integral action (your choice) and select the Begin PID
Auto-tuning ‘button’
(5) Increase the bandwidth, and select the Begin Autotuning ‘button’.
Continue to increase the bandwidth until motor starts to vibrate, then
decrease the bandwidth and select the Begin PID Auto-tuning button
until the motor no longer vibrates.
84
조그 운전 (JOGGING MOTORS)
조깅은 가장 간단한 형태의 Closed Loop 제어
(Jogging is PMAC’s simplest form of closed-loop motion)
조깅 운전는 On-Line 명령에 의해 제어
(Jogging is controlled by on-line commands)
조깅은 간단한 위치제어나 스핀들과 같이 일정한
속도로 계속 움직이는 운동에 사용될 수 있다.
(Jogging can be used for simple positioning or moving indefinitely at constant
velocity as in a spindle)
What to learn:
w 조그 운전 방법 (How to Jog Motors)
w 조그 속도 변경방법 (How to change the jog speed)
w 조그 가속도 변경방법 ( How to change the jog acceleration)
온라인 조그 명령어 (On-line Jog
commands)
J+
JJ/
J=
- “+” 방향으로 연속적인 조그 운전 (Jog positive indefinitely)
- “-”방향으로 연속적인 조그 운전 (Jog negative indefinitely)
- 조그 이송 정지 또는 Closed Loop (Jog stop (or close loop)
- 이전 프로그램 위치로 복귀지령
(Jog back to prejog (last programmed) position)
J={constant} - 지정된 위치로 조그 이송 (단위: counts)
(Jog to specified position (in counts))
J^{constant} - 현재의 실제 위치로부터 지정된 거리이송
(Jog to specified distance from present actual position)
J:{constant} - 현재 지령 위치로부터 지정된 거리 이송
(Jog specified distance from present commanded position)
Ix19~Ix22로 조그 이송 제어. 이 값들은 조그 운전 중에 변경될 수
있으나, 다음 조그 명령이 지령되기 전까지는 유효하지 않다.
Variable Jog Commands
J=* - Jog to position (in counts) specified in variable jog register
J^* - Jog distance (from present actual) specified in variable jog
register
J:* - Jog distance (from present commanded) specified in variable
jog register
Mx73 is suggested M-variable for variable jog register
Example:
M173 = P1+500
#1J=*
87
온라인 조그명령 예제
(On-line Jog Commands Examples)
#1J+ - 모터1 “+”방향으로 조깅
(Jog Motor #1 in positive direction)
#1J=1000 #2j+ - 모터1을 1000 카운트 위치로 이동,
모터2를 “+”방향 회전 동시 지령
( Jog Motor #1 to position 1000 and
jog motor #2 in a positive direction )
I122=30 - 모터1의 조그 속도를 30counts/msec로 설정
( Set motor #1 jog speed to 30 counts/msec )
I220=50 - 모터2의 조그 가속시간을 50 msec로 설정
( Set motor #2 jog acceleration time at 50 msec )
Note: 모터가 정의된 좌표계에서 모션 프로그램을 중일 때는
조그 운전을 할 수 없다.
(Motor cannot be JOGGED when it is defined in a coordinate
system that is running a motion program.)
모터 x 모션 변수 (Motor x Motion Variables)
Ix20 가속 시간 (조그, 원점) Acceleration Time (Jog, Home)
Ix21 “S” 커브 시간 (조그, 원점) S-Curve Time (Jog, Home)
V
Ix21=0
Ix20
Ix20
T
모터 x 모션 변수 (Motor x Motion Variables)
Ix20 가속 시간 (조그, 원점) Acceleration Time (Jog, Home)
Ix21 “S” 커브 시간 (조그, 원점) S-Curve Time (Jog, Home)
V
Ix20 < 2 * Ix21
Ix21
Ix21
Ix21
2*Ix21
Note that Ix20 is not used
Ix21
2*Ix21
T
모터 x 모션 변수 (Motor x Motion Variables)
Ix20 가속 시간 (조그, 원점) Acceleration Time (Jog, Home)
Ix21 “S” 커브 시간 (조그, 원점) S-Curve Time (Jog, Home)
V
Ix20 > 2 * Ix21
Ix21
Ix21
Ix21
Ix21
Ix20
T
Jog Move Trajectory
Move Timer Active=0
(if command was J+ or J-)
Vel
Jog Stop
given (J/)
Move Timer Active=1
(Running a Program=1)
Desired Velocity Zero=0
In Position=0
Move Timer Active=1
Max Accel
=Ix19
Max Accel
=Ix19
Ix22
Desired Velocity Zero=1
Move Timer Active=0
In Position=1
(when FE in range)
Time
Ix21
Jog Start
given (J+)
Ix21
Ix21
Ix20
I12
Note: If the jog command is not of
indefinite length (not J+ or J-) then
the "Running a Program" status bit will
be high for the entire jog move
Ix21
Ix20
I12
Note: Rate of acceleration
limited by Ix19 - can override
Ix20 and Ix21
92
Jogging Quiz
How do you make motor 1 jog at 10 cts/msec?
How do you make motor 2 reach its jog velocity
in 2 seconds spending only 1 second in constant
acceleration?
How do you make motor 1 jog at 300 RPM?
*All motors have 500 line encoders (2000 cts/rev with
4 times decode)
원점 복귀 (HOMING MOTORS)
원점 이송은 모션 프로그램 또는 온라인 명령으로 실행
원점복귀 방법(트리거조건)은 유저가 선택
전원 공급 시 또는 리셋($$$)한 경우에는 기계의 원점설정을
위해 원점복귀가 필요
(At power on or reset most machines will need to be homed to
locate the machine zero location.)
What to Learn:



온라인 명령에 의한 원점복귀 방법
원점이송 속도 및 방향 변경방법
원점복귀 조건 설정방법( How to set the home trigger.)
온라인 원점이송 명령어
(On-line Homing Commands)
HM - 원점이송 명령 (Do home search move)
HMZ - 현재 지령된 위치를 원점으로 설정한다
(Present command position is set to home)
온라인 명령 예제 (On-line Examples):
#1HM - 모터1 원점 이송 (Do a home search move for motor #1)
#1HM #2HM #3HM - 모터 1/2/3 동시 원점복귀
(Start moves at the same time)
note: 모터가 정의된 좌표계에서 모션 프로그램을 실행 중
일 때는 원점 복귀 온라인 명령어는 사용할 수 없다.
( On-line homing commands are locked out when a motor motor is in a
coordinate system that is running a motion program )
PMAC 홈밍 관련 변수 (Homing Variables)
Ix19
최대 허용 조그 가속도 (Maximum Permitted Jog Acceleration)
(units: cts/msec2; floating point)
Can Override TA (Ix20) and TS (Ix21) * Used always if Ix20=0 and Ix21=0
Ix20
원점복귀 시 가속시간 (Home Acceleration Time)
(units: msec; integer)
Not used if less than 2*Ix21
Ix21
원점복귀 시 “S”커브 시간 (Home S-Curve Time)
(units: msec; integer)
Can override TA (Ix20)
Ix23

원점복귀 속도 (Home Speed)
(units: cts/msec; floating point)
부호로 이송방향을 설정한다. (Sign is direction)
Ix26
원점 옵셋 (Home Offset)
(units: 1/16 ct)
트리거 위치로부터 원점까지의 거리
(Distance from trigger to motor zero position)
모터 x 홈 트리거 설정 (MOTOR x HOME TRIGGER)
(PMAC1) I902, I907, ..I977 : 엔코더 위치 캡쳐 제어
(Encoder Position Capture Control)
이 변수들은 원점복귀를 위해 어떤 신호를 어떻게 사용할 것인지를
결정한다.
(PMAC1) I903,I908, … , I978: 플래그 선택제어 (Flag Select Control)
포지션 캡쳐로 사용될 플래그를 결정한다.
0: HMFLn
1: -LIMn*
2: +LIMn*
3: FAULTn* *Ix25로 통상의 기능사용을 일시적으로 중지해야 한다.
( must disable normal function with Ix25 )
Vel
Homing Search Move
Trajectory
Trigger
Occurs
Home Complete=1
Home Search in Progress=0
Home Complete=0
Home Search
In Progress=1
Net distance from
trigger position
= Ix26
Ix23
Time
Ix21
Ix21
Ix21
Ix20
Desired Velocity Zero=1
In Position=1
(when FE in range)
Ix23
Note: Rate of acceleration
limited by Ix19 - can override
Ix20 and Ix21
Ix21
Ix20
Ix21
Ix21
Ix20
98
HOMING QUIZ



How do you make motor #1 home at 10 cts/msec
in the negative direction?
How do you make motors 1 and 2 start their home
search moves at the same time?
How do you make motor 2 home into a position
limit and motor 3 home to a combination of the
Home Flag and its C-channel?
좌표계 (COORDINATE SYSTEMS)
모든 모션프로그램은 좌표계에서 실행된다
(Motion programs run in Coordinate Systems)
서로 연관성이 있는 모터들을 같은 좌표계에 설정
(Motors are grouped into Coordinate Systems
depending upon how they must work together.)
What to Learn:

좌표계?

좌표계 설정방법

축 (axis) 설정방법
100
PMAC 축 특성 (Axis Properties)
사용 가능한 축 명칭 : X,Y,Z,U,V,W,A,B,C
X,Y,Z: 기본 선형운동 축

메트릭스 축 정의 (Matrix Axis Definition)

메트릭스 축 전환 (Matrix Axis Transformation)

원호보간 (Circular Interpolation)

공구 경 보정 (Cutter Radius Compensation)
101
PMAC 축 특성 (Axis Properties)
(계속)
U,V,W : 제2의 선형 축

메트릭스 축 정의 (Matrix Axis Definition)
A,B,C: 회전축
(A rotates about X, B about Y, C about Z)

위치 롤오버 (Position Rollover (Ix27))
102
좌표계 정의 (Defining Coordinate Systems)
좌표계 번호를 입력하고 모터번호를 축 이름 에 할당
(Define a coordinate system by addressing it and
assigning motors to axes within it)
&1
#1->X
#2->Y
#3->Z
&2
#4->20X
#6->25.4Y
103
좌표계 정의 (Defining Coordinate Systems) (계속)
모터들을 한 개의 좌표계에 설정하는 경우(이유)

같은 모션 프로그램 사용하는 경우

컨튜어링과 같은 제어를 위해 모터들이
동시에 시작하고 정지해야 하는 경우

한 개의 공구이송을 위해 모터들이 조합하여
궤적을 결정할 때
Examples:
Machining Center, Robot, Gantry, X-Y table104
좌표계 정의 (Defining Coordinate Systems) (계속)
서로 다른 좌표계에 모터들을 분리하여 설정하는 이유 (경우)

다른 모션 프로그램으로 제어되는 경우

서로 독립적인 작업을 수행할 때

각 모터들이 서로 다른 공구나 기계를 제어할 때
Examples:
Packaging Line, Robot Loader, Spindle
105
복수 축 정의 (Multiple Axis Definitions)
&1
#1->X
&2
#2->X
&1
#1->X
#2->X
{
유효한 정의 (This is permitted)
두개의 모터가 독립적인
좌표계에서 X축(같은 축 이름)
유로 동작한다
{
유효한 정의 (This is permitted)
갠트리와 같은 시스템에서 다른
모터를 동일한 축 이름으로 정의하여
같은 운동을 하는 경우에 사용된다
106
복수 축 정의 (Multiple Axis Definitions)
&1
#1->X
#1->Y
&1
#1->X
&2
#1->X
{
잘못된 정의(NOT permitted)
두 번째 정의가 첫 번째 정의를
무시한다.
{
잘못된 정의(NOT permitted)
지령되는 명령에 충돌 발생.
두 번째 정의를 무시한다.
107
좌표계 정의 (COORDINATE SYSTEM DEFINITION)

각 좌표계는 특정한 “FEEDRATE” 축을 가질 수 있으며,
나머지 축은 시간 좌표계를 가진다( Each coordinate
system can have specified “FEEDRATE” axes, other axes
are time coordinated.)

모터들은 축 정의 선언(축 이름, 스케일, 옵셋 정의.
AXIS DEF. STATEMENT)을 통해 좌표계에 할당된다.
(Motors are assigned to a coordinate system with “AXIS
DEFINITION STATEMENTS”, which match motor to axis,
with scaling and offset):
EXAMPLE:
#1 -> 10000X + 5000
108
좌표계 정의 (COORDINATE SYSTEM DEFINITION)

직교좌표 축들은 모터들의 선형조합이 될 수 있다
(Cartesian axes can be linear combinations of motors) :
#1 -> A11X + A12Y + A13Z + B1
#2 -> A21X + A22Y + A23Z + B2
#3 -> A31X + A32Y + A33Z + B3
Where A11 to A33 are scale factors and
B1 to B3 are offsets
따라서 좌표계의 회전 및 변형이 가능하다.
109
(This permits coordinate rotation and transformation)
PMAC 좌표계 정의 (Coordinate Definition)

스케일링과 평형이동 (Scaling and Translation)
Y
(in)
#1 -> 10000X + 40000
#2 -> 10000Y + 20000
Motor #2 (10,000 cts )
in
4"
X (in)
2"
Motor #1 (10,000 cts )
in
110
PMAC 좌표계 정의 (Coordinate Definition)

스케일링과 회전 (Scaling and Rotation)
#1 -> 7071.07X - 7071.07Y
#2 -> 7071.07X + 7071.07Y
)
(in
X
Y
(i n
)
cts
Motor #2 (10,000 in )
45
Motor #1 (10,000 cts )
in
111
PMAC 좌표계 정의 (Coordinate Definition)

직교 축 교정 (Orthogonal Correction)
Y (in)
cts
Motor #2 (10,000 in )
#1 -> 10000.00X - 2.91Y
#2 -> 10000.00Y
X (in)
1 arc min
(exaggerated)
cts
Motor #1 (10,000 in )
112
Programmable Axis Offsets
• Axis origin for programming purposes can be changed
• Change made by redefining present commanded position
• On-Line command {axis}={constant}
e.g. X=10 Y=20
• Buffered motion program command PSET {axis}{data}…
e.g. PSET X10 Y(P1)
• These commands change “position bias” register–difference
between motor origin and axis origin
• Also possible to write directly to position bias register (must
then use PMATCH command to re-align motor and axis)
113
PMAC Position Scales
Transformed
Axis Pos.
Transformed
Axis Origin
0
Offset from
Matrix Transformations
Transformed
Engineering
Units
Axis
Origin
Axis
Position
0
Engineering
Units
Position Bias
(=Axis Definition
Offset on Homing)
Motor
Position
Encoder
Position
Home
Offset
(Ix26)
0 Home
Position
Home
Trigger Pos.
Counts,
Counts
1
Ix08 32
Power-On
Position
0
Home Capture
Position
Counts
114
PMAC POSITION PROCESSING
Input
Signal
Encoder
Position
Encoder
Position
Quadrature,
Parallel,
Analog,
etc.
Capture Position (Mx03)
Compare Position (Mx03)
Phase Position (Mx01)
Motor
Position
Act. Pos. Cmd., Target Pos.
"P", (Mx62)
(Mx61),(Mx63)
Interpolated
Count
Integer
Count
Axis
Position
Extended
Count
(1/(Ix08 32)ct)
(1/32 ct)
User
Units
(fixed point)
Decoder/
Counter
24 bits
Done Always
Encoder 24 bits
Conversion
(e.g. 1/T)
* 32
Done Always
Set to Zero on
Power-up/Reset
Position
Extension
(PMATCH)
(floating point)
48 bits
Axis
Scaling
Axis Coefficients
* Ix08
Done for
Activated Motor
Set to Zero on
Power-up/Reset
ACTUAL POSITION
48 bits
Move End Pos.
(Mx65)
Done for
Defined Axis
Set to Zero on
Power-up/Reset
and Home
Can be Offset
(Axis offset, PSET,
{axis}= )
COMMAND
POSITION
115
COORDINATE SYSTEMS QUIZ




How many coordinate systems can a motor be defined
in?
Which motors can be assigned to the X-axis in
Coordinate System 2?
Motor 3 has an encoder with 2048 counts per
revolution and is coupled to a 0.25 inch pitch lead
screw through a 3-to-1 gear reduction. How would
you define motor 3 in C.S. 7 as the Z-axis so that you
could write your program using inches?
How do you remove a motor from a coordinate system
and how would you clear a coordinate system?
116
모션 프로그램 (MOTION PROGRAMS)
모션 프로그램은 위치결정 및 윤곽이송을 위해 모터를
제어하고 조정하는 역할을 한다
(Motion programs are what you use to control and coordinate
motor movements for positioning, contouring, etc.)
모션 프로그램은 PMAC 적용에서 가장 중요한 내용임.
(Motion programs are the heart of most PMAC applications)
What to Learn:

모션 프로그램 ?

모션 프로그램 작성방법
모션 프로그램 실행방법

117
모션 프로그램 (MOTION PROGRAMS)
PMAC 프로그램은
한번에 한 블록 실행, 모든 계산은 이송이전에
수행된다(Executed one move at a time, performing all
calculations up to that move)


좌표계에서 실행됨 (Run in coordinate systems)
한 프로그램은 복수개의 좌표계에서 동시에 실행될 수
있다. (One program can simultaneously run in multiple
coordinate systems)

한 개의 좌표계에서는 한 개의 프로그램만이 실행가능
(One program can run in any coordinate system)

118
모션 프로그램 (MOTION PROGRAMS)
프로그램 실행 절차 :

온라인 명령어를 통해 원하는 좌표계를 선택한다 : &n
온라인 명령어를 통해 실행하려는 프로그램을 좌표계에
인식 시킨다 : Bn


실행 명령을 입력한다 : R or <CTRL-R>
프로그램 정지 :

온라인 명령어를 통해 원하는 좌표계를 선택한다 : &n
정지명령을 입력한다 : Q, S, A, or
<CTRL-Q>, <CTRL-S>, <CTRL-A>, <CTRL-K>

119
PMAC 모션프로그램 문장 (Statements)

이송 명령 (Move Commands)
X1000 Y2000 Z3000
U(P1*3.14159) V(20*SIN(Q6))
DWELL, DELAY

모달 명령 (Modal Commands)
ABS, INC, FRAX, NORMAL
LINEAR, RAPID, CIRCLEn, SPLINEn, PVT
TA, TS, TM, F

변수 값 지정 (Variable Value Assignment)
{variable} = {expression}
120
PMAC 모션프로그램 문장 (Statements)

논리 제어 문장 (Logic Control Statements)
N, O, GOTO, GOSUB, CALL, RETURN
G, M, T, D (special CALL statements)
IF, ELSE, ENDIF, WHILE, ENDWHILE

기타 문장 (Miscellaneous Statements)
COMMAND, SEND, DISPLAY
ENABLE PLC, DISABLE PLC
121
UMAC Logic Operators
used in Motion Programs and PLCs

Logic Operators
&
|
^

Comparators
=
!=
>
!>
<

(bit by bit AND)
(bit by bit OR)
(bit by bit Exclusive OR)
(equal to)
(not equal to)
(greater than)
(not greater than; less than or equal to)
(less than)
Functions
SIN, COS, TAN, ASIN, ACOS, ATAN, ATAN2,
SQRT, LN, EXP, ABS, INT
122
PMAC Motion Program Execution
Active Registers
Calculating
Suspended
Here
X5 Y5
LINEAR
F10 TA50
M1=1
P1=P2*SIN(P3)
M2= =1 }
SEND ”P1=“}
CMD ”P1”}
X(P1) Y10 }
F20

}
At Program Calculation Time
At Program
At Move
Calculation
Execution
Output
Time
Time
At Program
Calculation
Time
At Program
Calculation
Time
At Program
Calculation
Time
Stack
Motion
Equation
Stack
Command
Queue
Response
Queue
At Move
Execution
Time
Interpolation
Registers
Executed next
Background
cycle
Read by
Host Computer
at will
123
Example 1: A Simple Move
This example shows how to program a simple move on the program
specifies how to do the move, then commands the move.
********************* Set-up and Definitions *********************
CLOSE
END GAT
DEL GAT
&1
#1->X
;
;
;
;
;
;
Make sure all buffers are closed
stop data gathering
Erase any defined gather buffer
Coordinate System 1
Assign motor 1 to the X-axis - 1 program unit
of X is 1 encoder count of motor #1
********************* Motion Program Text *************************
OPEN PROG 1
; Open buffer for program entry, Program #1
CLEAR
; Erase existing contents of buffer
LINEAR
; Blended linear interpolation move mode
ABS
; Absolute mode - moves specified by position
TA500
; Set 1/2 sec (500 msec) acceleration time
TS0
; Set no S-curve acceleration time
F5000
; Set feedrate (speed) of 5000 units(cts)/sec
X10000
; Move X-axis to position 10000
DWELL500 ; Stay in position for 1/2 sec (500 msec)
X0
; Move X-axis to position 0
CLOSE
; Close buffer - end of program
To run this program:
&1 B1 R ; Coord. System 1, point to Beginning of Program 1, Run 124
Example 1: A Simple Move
Mtr 1 Cmd Vel (cts/sec)
10000
5000
0
0
1
2
3
4
5
6
-5000
-10000
Time (second)
125
PEWIN32 를 사용한 Motion Program Download
다
운
로
드
결과 창 확인
126
MOTION PROGRAM QUIZ

What part of a motion program file is part of a PMAC
program buffer?

What can be part of a program file?

What types of commands go in motion programs and
where are these found in the manual?

If you SAVE a program file as EXAMPLE5.PMC,
what name will PMAC call it?

What editor can you use to write your PMAC
programs?
127
데이타 수집 (DATA GATHERING)
“Data Gathering”이라고 불리는 내장된 데이타
수집 기능 보유
What to Learn:

수집할 수 있는 데이타

데이타 Gathering 방법

데이타 Gathering 하는 경우
128
PMAC 데이타 개더링 (Data Gathering)

모든 PMAC 어드레스의 실시간 수집

Up to 24 addresses, each 24 or 48 bits wide, at once
(specified by I21-I44; masked by I20)

(Turbo : by I5001-I5048; masked by I5050 & I5051)
1~ 8백만 서보 사이클의 샘플링 타임
( I19 for Non-Turbo, I5049 for Turbo )

외부 트리거 조건에 의한 데이타 수집가능

데이타 처리 및 분석을 위한 호스트에 업로드 가능

PMAC Executive로 수집된 데이타의 플롯팅 및 테이블 생성
용도 :
서보 루프 튜닝 (Servo Loop Tuning)

프로그램 디버그 (Program Debugging)
기계 진단 및 보전
129
Data Gather Process & Sample Rate
Gathering On-Line Commands.
DEFINE GATHER (DEF GAT)
GATHER (GAT)
END GATHER (ENDG)
DELETE GATHER (DEL GAT)
Prepares PMAC to gather data
Starts PMAC Gather process
Ends PMAC’s Gather process
Delete gather buffer (Free User Memory)
In motion programs or PLC’s, these commands can be used as follows:
COMMAND “DEFINE GATHER”
CMD”DEF GAT”
COMMAND “GATHER”
CMD”GAT”
COMMAND “END GATHER”
CMD”ENDG”
COMMAND “DELETE GATHER”
CMD”DEL GAT”
The data gather Sample Rate is set by I5049. (The unit for I5049 are servo cycles.)
* PMAC Plot Program을 이용하여 쉽게 Gathering기능 활용가능
130
■ PmacPlot32 를 이용한 데이터 개더링 (Detail Plot)
* M100(Servo cycle counter) Gathering
2. Scaling and Processing
1. Item to Gather
3. Item to Plot
131
■ Detail Plot 결과 ( Servo Cycle Counter )
Plot of “Servo cycle counter”
132
Example 2: A Simple Move with Data Gathering
This example shows how to program a simple move on the program
specifies how to do the move, then commands the move.
********************* Set-up and Definitions *********************
CLOSE
END GAT
DEL GAT
&1
#1->X
;
;
;
;
;
;
Make sure all buffers are closed
stop data gathering
Erase any defined gather buffer
Coordinate System 1
Assign motor 1 to the X-axis - 1 program unit
of X is 1 encoder count of motor #1
********************* Motion Program Text *************************
OPEN PROG
CLEAR
LINEAR
ABS
TA500
TS0
F5000
X10000
DWELL500
X0
DWELL0
CMD"ENDG"
CLOSE
1
;
;
;
;
;
;
;
;
;
;
;
;
; Open buffer for program entry, Program #1
Erase existing contents of buffer
Blended linear interpolation move mode
Absolute mode - moves specified by position
Set 1/2 sec (500 msec) acceleration time
Set no S-curve acceleration time
Set feedrate (speed) of 5000 units(cts)/sec
Move X-axis to position 10000
Stay in position for 1/2 sec (500 msec)
Move X-axis to position 0
Stop program lookahead
Send On-line command to stop data gathering
Close buffer - end of program
To run this program and gather data:
DEF GAT<CR>
GAT &1 B1 R
; GATHER, CS. 1, point to Beginning of Program 1, Run
133
■ Quick Plot 사용방법
* Command Velocity Gathering
1. Motors to Gather Settings & Define Gather
2. Start Gather & Program Run
3. Upload Data
134
■ Quick Plot 결과 (Command Velocity)
Plot of “Command Velocity”
135
Example 2: A Simple Move with Data Gathering
Mtr 1 Cmd Vel (cts/sec)
10000
5000
0
0
1
2
3
4
5
6
-5000
-10000
Time (second)
136
DATA GATHERING QUIZ

What is PMAC Data Gathering?

How do you prepare PMAC to gather data?

How do you start data gathering?

How do you stop data gathering?

How does PMAC store gathered data?

What information can PMAC gather data on?
137
직선 운동 (LINEAR MODE TRAJECTORIES)
직선 형식(Linear mode)은 가장 일반적인 이송
형식이며, 이 직선 궤적은 가속시간과 이송
(move)시간으로 구성된다.
What to Learn:



직선 형식 궤적 (Linear mode trajectory)
궤적 특성 (characteristics of the trajectory변경방법
블렌딩 이송방법 (moves get blended together)
138
Linear Mode Trajectories
Small Acceleration Time
V
TMT
TA
TM or
P/F
TA
TA
  TM 
2
2
P
TM 
F
time
TA
V
TMT
TA
TM or
P/F
TA
TM or
P/F
TA
TA
   TM 
2
2
time
TA
139
Linear Mode Trajectories (continued)
Small Acceleration Time
V
TM or
P/F
TA
TA
TM or
P/F
time
TA
V
TA
TA
TM or
P/F
TA
TM or
P/F
TA
TM or
P/F
time
140
Linear Mode Trajectories
Acceleration Time matches Move Time
V
TM or
P/F
TM or
P/F
time
V
TA
TM or
TA
time
P/F
TA
141
Linear Mode Trajectories (continued)
Acceleration Time matches Move Time
V
TM or
P/F
TM or
TA
TA
time
P/F
TA
V
TM or
TA
P/F
TM or
time
P/F
TA
TA
TA
142
Linear Mode Trajectories
Large (velocity limiting) Acceleration Time
V
TM or
time
P/F
TA
TA
V
TM or
TA
TM or
P/F
TA
time
P/F
TA
143
Linear Mode Trajectories (continued)
Large (velocity limiting) Acceleration Time
V
TM or P/F
TA
time
TM or P/F
TA
TA
144
가속도 결정 상수 (Acceleration Parameters)
프로그래머블 가속시간 (Acceleration time)
TA
(Units: msec); integer
프로그래머블 S-커브 시간 (S-curve Time)
TS
(Units: msec); integer
V
TA > 2 * TS
TS
TS
TA
TS
TS
T
TA
145
가속도 결정 상수 (Acceleration Parameters) (계속)
V
TA <= 2 * TS
TS
TS
TS
2*TS
V
TS
T
2*TS
TS=0
TA
TA
T
146
Example 3: A More Complex Move
This example introduces incremental and time-specification of moves,
looping logic, using variables, scaling of axes, and simple arithmetic.
Note that logical and mathematical operations do not delay moves.
;******************** Set-up and Definitions ********************
CLOSE
END GAT
DEL GAT
&2
#5->1000X
;
;
;
;
;
Make sure all buffers are closed
stop data gathering
Erase any defined gather buffer
Coordinate system 2
1 unit (cm) of X is 1000 counts of motor 5
;******************** Motion Program Text ***********************
OPEN PROG 2
; Open buffer for entry, Program #2
CLEAR
; Erase existing contents of buffer
LINEAR
; Blended linear interpolation move mode
INC
; Incremental mode - moves specified by distance
TA500
; 1/2 sec (500 msec) acceleration time
TS250
; 1/4 sec in each half of S-curve
TM2000
; 2 sec move time (to start of decel)
P1=0
; Initialize a loop counter variable
WHILE (P1<10)
; Loop until condition is false (10 times)
X10
; Move X-axis 10 cm (=10,000 cts) positive
DWELL500
; Hold position for 1/2 sec
X-10
; Move X-axis back 10 cm negative
DWELL500
; Hold position for 1/2 sec
P1=P1+1 ; Increment loop counter
ENDWHILE ; End of loop
CLOSE
; Close buffer - end of program
To run this program:
&2 B2 R
; Coordinate System 2, point to Beginning of Program 2, Run
147
Example 3: A More Complex Move
Velocity
(count/second)
5000
Repeat 9
More Times
0
0
1
2
3
4
5
6
Time (second)
-5000
148
TRAJECTORY QUIZ

What do the horizontal and vertical axes of the
trajectory plot show?

What is TS, TA, TM and F?

How do TM and F relate?

How long does a move with a TA time of 100 a TS
time of 20 and a TM time of 500 take to complete?

How long do 3 blended moves take to finish if the
program stated TS100 TA100 TM100?
149
PMAC 이송 블렌딩 (MOVE BLENDING)
PMAC은 다음 조건들 중 한가지도 만족하지 않을 때에
블렌딩 이송을 한다 :
 이송명령이
DWELL 명령으로 분리된 경우
 다음 이송 명령이 “2 backward jumps”를 만나지
않는 경우 (GOTO, ENDW)
 Move Blend기능이 Disable된 경우 (Ix92=1)
Blending allowed - Ix92 = 0, no DWELL's, no double jumpback
Blending not allowed - Ix92 = 1, DWELL's or double jumpback
150
드웰 과 딜레이 (DWELL vs. DELAY)
DWELL
 항상 일정한 시간 단위를 이용한다 (I10)
 앞서는 감속시간을 포함하지 않는다
 다음 이송명령의 계산은 DWELL시간이
끝나기 전까지 수행되지 않음 (add I11 time)
Move Time
TM or P/F
TA
I11
DWELL Time
Time
Move Time ...
151
드웰 과 딜레이 (DWELL vs. DELAY)
DELAY
 가변 시간단위를 이용한다 (% value)
 전 감속시간을 포함한다
 최소시간은 현재의 TA 시간이다
 다음 이송시간은 DELAY시작 때부터 계산된다
Move Time
TM or P/F
DELAY
Time
Move Time ...
152
Example 4: Moves with Blending Enabled
This example shows how to program a blended move on the PMAC and
the function of Ix92. First the program specifies how to do the move, then
commands the move.
******************* Set-up and Definitions *******************
CLOSE
END GAT
DEL GAT
&1
#1->X
I192=0
;
;
;
;
;
;
;
Make sure all buffers are closed
stop data gathering
Erase any defined gather buffer
Coordinate System 1
Assign motor 1 to the X-axis - 1 program unit
of X is 1 encoder count of motor #1
Enable blending ( Isx92 for Turbo, I5192 for C.S.1 )
******************* Motion Program Text **********************
OPEN PROG
CLEAR
LINEAR
ABS
TA500
TS0
F5000
X10000
X20000
X30000
DWELL0
CMD"ENDG"
CLOSE
1
;
;
;
;
;
;
;
;
;
;
;
;
; Open buffer for program entry, Program #1
Erase existing contents of buffer
Blended linear interpolation move mode
Absolute mode - moves specified by position
Set 1/2 sec (500 msec) acceleration time
Set no S-curve acceleration time
Set feedrate (speed) of 5000 units(cts)/sec
Move X-axis to position 10000
Move X-axis to position 20000
Move X-axis to position 30000
Stop program lookahead
Send On-line command to stop data gathering
Close buffer - end of program
To run this program:
DEF GAT<CR>
GAT &1 B1 R
; GATHER, CS. 1, point to Beginning of Program 1, Run
153
Example 4: Moves with Blending Enabled
Mtr 1 Cmd Vel (cts/sec)
10000
5000
0
0
1
2
3
4
5
6
7
Time (second)
154
Example 5: Moves with Blending Disabled
This example shows how to program moves on the PMAC and the
function of Ix92. First the program specifies how to do the move, then
commands the move.
******************* Set-up and Definitions *******************
CLOSE
END GAT
DEL GAT
&1
#1->X
I192=1
;
;
;
;
;
;
;
Make sure all buffers are closed
stop data gathering
Erase any defined gather buffer
Coordinate System 1
Assign motor 1 to the X-axis - 1 program unit
of X is 1 encoder count of motor #1
Disable blending ( Isx92 for Turbo, I5192 for C.S.1 )
******************* Motion Program Text **********************
OPEN PROG
CLEAR
LINEAR
ABS
TA500
TS0
F5000
X10000
X20000
X30000
DWELL0
CMD"ENDG"
CLOSE
1
;
;
;
;
;
;
;
;
;
;
;
;
; Open buffer for program entry, Program #1
Erase existing contents of buffer
Blended linear interpolation move mode
Absolute mode - moves specified by position
Set 1/2 sec (500 msec) acceleration time
Set no S-curve acceleration time
Set feedrate (speed) of 5000 units(cts)/sec
Move X-axis to position 10000
Move X-axis to position 20000
Move X-axis to position 30000
Stop program lookahead
Send On-line command to stop data gathering
Close buffer - end of program
To run this program:
DEF GAT<CR>
GAT &1 B1 R
; GATHER, CS. 1, point to Beginning of Program 1, Run
155
Example 5: Moves with Blending Disabled
Mtr 1 Cmd Vel (cts/sec)
10000
5000
0
0
1
2
3
4
5
6
7
8
Time (second)
156
BLENDING QUIZ

What is the difference in the motion profile for a
program using feedrate commands (F) in incremental
mode (INC) between the move performed by the
statement X1000 and the statements X100 X400
X500 if Ix92=0, TA< P/F, and 2*TS<TA?
157
VECTOR FEEDRATES
PMAC은 “feedrate”라고 불리는 원하는 속도로 모터를
이송하기 위해 이송시간 (move time, TM)을 자동으로
계산한다.
이 기능은 여러 모터가 한 개의 공구를 제어할 때
사용한다.
What to Learn:

Feedrate ?

PMAC의 feedrates 계산방법
158
Vector Feedrate Axes
INC
FRAX (X,Y)
X3 Y4 F10
Dist  3 2  4 2  5
Move Time  5 / 10  0.5
Vx  3 / 0.5  6
Vy  4 / 0.5  8
INC
FRAX (X,Y)
X3 Y4 Z12 F10
Dist  3 2  4 2  5
Move Time  5 / 10  0.5
Vx  3 / 0.5  6
Vy  4 / 0.5  8
Vz  12 / 0.5  24
159
Vector Feedrate Axes (continued)
INC
FRAX (X,Y,Z)
X3 Y4 Z12 F10
Dist  3 2  4 2  12 2  13
Move Time  13 / 10  1.3
Vx  3 / 1.3  2.31
Vy  4 / 1.3  3.08
Vz  12 / 1.3  9.23
INC
FRAX (X,Y)
C10 F10
Dist  0
Move Time  0/10  0 (< TA)
Accelerati on - limited move
(Isx86 for Turbo, Alternate Feedrate)
160
Feedrate Time Units
Ix90 Feedrate Time Units
(Unit: msec)
LENGTH UNIT
AXIS DEF. SCALING
F UNIT =

TIME UNIT
Ix90 (msec)
Example:
#1 -> 2000X
Ix90 = 1000
2000 cts
mm
F UNIT =

1000 msec
sec
161
FEEDRATE QUIZ

What are the feedrate time units of C.S. 1 if
I190=60000?

If X and Y are the feedrate axes, which axis X or Y
will move at the commanded feedrate in the move
X100 Y200?

If you want the program command F5 to specify a
feedrate of 5 inches/sec, how must Ix90 be set and
how must your axes be defined?
162
원호보간 (CIRCULAR INTERPOLATION)
PMAC은 좌표계의 X,Y 및 Z축에서 원호 보간을 제공한다.
직선 블렌딩 이송과 마찬가지로 TA 와 TS로 정지 및 각
이송간의 가감속을 제어한다. 원호 블렌딩 이송도 직선이송과
같이 FEEDRATE(F) 또는 시간(TM) 단위로 정의될 수 있다.
직선과 원호이송을 혼용 시에 정지 없이 이송 가능하다
What to learn:



원호보간 제어변수
원호보간 사용방법
원호보간 평면설정
CIRCULAR INTERPOLATION
+Z
G17
+Z
CW
CW
+X
+Y
+X
NORMAL K-1
+Y
NORMAL K1
+Z
+Z
CW
G18
+X
+Y
+X
CW
+Y
NORMAL J-1
NORMAL J1
+Z
+Z
CW
G19
+X
+Y
NORMAL I-1
+X
CW
+Y
NORMAL I1
NORMAL VECTORS FOR CIRCULAR MOVES:
THE PLANES AND CLOCK WISE ARCS THEY DEFINE
164
(NRML-VEC)
Circular Interpolation
General Setup and definitions for circular interpolation:
1) Move segmentation time (Setup)
2) Interpolation plane definition
3) End Point definition mode
(4) Center vector definition mode
(if vector mode definition is used)
(5) Circle direction
(6 ) Circle commands
Typical value: Isx13 = 5 (I13)
NORMAL {vector} {data} …
ABS
INC
ABS ( R )
INC ( R )
CIRCLE 1
CIRCLE 2
X{Data} Y{Data} I{Data} J{Data}
X{Data} Y{Data} R{Data}
Example:
NORMAL K-1
INC
INC(R)
CIRCLE 1
X20 Y0 I10 J0
;XY plane
;Incremental End Point definition
;Incremental Center Vector definition
;Clockwise circle
;Arc move
Center (10,0)
Start (0,0)
End (20,0)
165
END
(25,30)
PMAC Circular Interpolation
Y
Y
NORMAL K-1
Defaults ABS (X,Y)
INC (R)
CIRCLE1
F10
X25Y30I20J5
Y
CENTER
(15,20)
START
(25,20)
I
CENTER
(30,10)
START
(10,5)
END
(15,10)
J
I
Y
X
Y
CIRCLE1
F25
X30Y10I-10J10
or
I-10J10
Y
X
X
X
CIRCLE2
TM2000
X0Y10R10
END
(0,10)
CIRCLE2
TM2000
X0Y10R-10
CENTER
(20,20)
J
CIRCLE2
TM1000
X15Y10I-10
I
Y
START,END
(30,10)
X
X
START (10,0)
X
166
■ Circular Interpolation Data Gathering
* Circular Path Gathering
2. Program & Run
1. Motors to Gather(#1,#2)
3. Upload Data
167
■ Circular Path Result
Plot of “Circular Path”
* Plot Items는 수평,수직 축에 각각 #1,#2번 모터의 위치를 설정합니다.
168
선행처리 (PRECALCULATION)
블렌딩 및 스프라인 이송을 위해 모션 프로그램은 이후의
이송을 예견(look-ahead)해야 한다.
이송형식에 따라, 예견되는 이송블록은 0, 1 또는 2개가
될 수 있다.
What to learn:



선행처리 (precalculation) ?
선행처리 정지방법
Synchronous 변수 (variables) ?
선행처리 (PRECALCULATION)
현재 이송과 다음 이송명령 사이에 있는 Synchronous M-변수
assignments를 제외한, 모든 프로그램 계산 및 assignments는
다음 이송명령을 예견하면서 실행된다.
이 특성 때문에 출력으로 사용되는 M변수 사용시에 원하는
시간보다 빨리 동작이 발생하는 문제가 발생한다.
Example:
LINEAR
X10
X20
M1=1
X50
;linear move mode
;move X-axis to 10
;move X-axis to 20
;turn on output #1
;move X-axis to 50
The output M1will be turned on at the beginning of the X10
move due to PMAC’s precalculation of the program
PMAC 모션 프로그램 선행처리
A.
Two moves ahead:
LINEAR with I13=0, SPLINE1
2
3
4
4
5
6
1
Execute
"R"
I11
1
2
time
3
Calculate
* LIST PE(PC) 명령으로 위의 블록을 확인할 수 있습니다.
LIST PE
: 현재 실행 중인 블록 Report
LIST PC
: 현재 계산 중인 블록 Report
171
PMAC 모션 프로그램 선행처리
B. One move ahead
LINEAR with I13>0
CIRCLE, PVT
Execute
1
3
4
3
4
5
1
"R"
I11
Calculate
2
2
time
PMAC 모션 프로그램 선행처리
C. No moves ahead
Ix92=1, RAPID,
HOME, DWELL,"S"
Execute
"S"
"R"
I11
Calculate
1
1
2
DWELL
time
I11
2
2a
3
2a
I11
3
time
동기(Synchronous) M변수
Synchronous M-Variables assignments는 이송의 선행처리에 의한
synchronization problems을 해결하기 위해 사용한다.
Synchronous M-variable assignment를 만나면, 이것은 즉시 실행
되지 않고 스택에 저장되어 다음 블록의 시작과 동시에 실행된다.
따라서 출력동작이 모션동작과 동기 된다.
Example:
LINEAR
X10
X20
M1==1
X50
;linear move mode
;move X-axis to 10
;move X-axis to 20
;turn on output #1
;move X-axis to 50
The statement M1==1 is encountered at the beginning of the move
to X10, but the action is not performed until the start of blending into
the move X50
매크로 (MACROS)
매크로는 PMAC변수 또는 프로그램 목적의 명령어를 특정한
이름을 할당하는 것을 말한다. 예를 들면, PUMP_PRESSURE
라는 이름을 변수 P10에 할당할 수 있다.
프로그램을 이해하기 쉽게 하고 메모리 관리를 간결하게 한다.
매크로는 Executive Program의 특징이며 PMAC자체의 기능은
아니다. 마크로 문장을 가진 파일을 PMAC에 다운로드 할 때,
Executive program이 PMAC자체의 명령이나 변수로 매크로 문을
대체한다.
;***********MACRO DEFINITIONS*******************************************
;
#define clamp_on
M1==1
#define clamp_off
M1==0
#define
#define
#define
move_x_axis_to
move_y_axis_to
move_z_axis_to
X
Y
Z
#define
#define
wait_for_XYstage_in_position
wait_for_robot_in_position
while(M187=0)wait
while(M287=0)wait
#define start_xy_stage CMD"&1B3R"
#define start_robot
CMD"&2B4R"
;
;***********MOTION PROGRAM TEXT*******************************************
;
OPEN PROG3
;OPEN BUFFER FOR ENTRY OF PROGRAM #1
CLEAR
;ERASE EXISTING CONTENTS OF BUFFER
FRAX(X,Y)
;X AND Y ARE USED AS AXES IN VECTOR FEEDRATE CALCULATIONS
F10
;FEEDRATE OF 10 INCHES/SEC
LINEAR
;BLENDED LINEAR INTERPOLATION MOVE MODE
ABS
;ABSOLUTE MOVE MODE - MOVES SPECIFIED BY POSITION
move_x_axis_to 30
DWELL3000
move_y_axis_to 30
DWELL3000
move_x_axis_to 0 move_y_axis_to 0
DWELL0
wait_for_XYstage_in_position
start_robot
CLOSE
;MOVE TO TEST STATION #1
;DWELL 3 SECONDS
;MOVE TO TEST STATION #2
;DWELL 3 SECONDS
;MOVE TO LOAD/UNLOAD STATION
;STOP LOOK AHEAD
;LOOP UNTIL TESTED RACK IS IN POSITION
;START PICK & PLACE ROBOT PROGRAM
OPEN PROG4
;OPEN PROGRAM BUFFER 4
CLEAR
;ERASE ANYTHING IN PROGRAM BUFFER
FRAX(Y,Z)
;USE Y AND Z IN VECTOR FEEDRATE CALCULATIONS
F10
;FEEDRATE OF 10 INCHES PER SECOND
LINEAR
;BLENDED LINEAR INTERPOLATION MOVE MODE
ABS
;ABSOLUTE MOVE MODE - MOVES SPECIFIED BY POSITION
move_z_axis_to 15
;LOWER THE PICK & PLACE ROBOTIC JAWS
clamp_on
;SET MACHINE OUTPUT #1 TO CLAMP RACK
move_z_axis_to 0
;LIFT RACK
move_y_axis_to 80
;POSITON RACK OVER DROP-OFF STATION
move_z_axis_to 25
;LOWER RACK
clamp_off
;RESET MACHINE OUTPUT TO UNCLAMP RACK
move_z_axis_to 0
;RETRACT EMPTY JAWS
move_y_axis_to -60
;POSITION JAWS OVER PICK-UP STATION
move_z_axis_to 25
;LOWER JAWS
clamp_on
;SET MACHINE OUPUT #1 TO CLAMP RACK
move_z_axis_to 0
;LIFT RACK
move_y_axis_to 0
;POSITION RACK OVER LOAD/UNLOAD STATION
move_z_axis_to 15
;LOWER RACK
clamp_off
;UNCLAMP RACK
move_z_axis_to 0
;RETRACT EMPTY JAWS
DWELL0
;STOP LOOK AHEAD
wait_for_robot_in_position
;LOOP UNTIL PICK & PLACE JAWS ARE IN POSITION
start_xy_stage
;START X/Y STAGE PROGRAM
CLOSE
PMAC Computation Priorities
1. Single character I/O
Serial, PCbus, STDbus, 200ns/char
2. Commutation update
E29-E33 set freq.(9KHz default); 3msec/axis
3. Servo update: interpolation & loopclosure
E3-E6 set freq.(2.25KHz default)
30 msec/axis (20Mhz CPU), 3~5usec (Turbo)
177
PMAC Computation Priorities (continued)
4. Real time interrupt tasks
I8 sets freq; rotates between:
A. Motion program move planning
Each time new move starts; works 1 or 2 moves ahead
B. PLC 0, PLCC0
When not doing motion program
5. VME mailbox processing (16 chars.)
Event driven
178
PMAC Computation Priorities (continued)
6. Background tasks
Done in time left over; rotates between:
A. PLC 1 - 31
One scan of one active PLC
B. PLCC 1 - 31
One scan of all active
C. Communications line processing
Event driven
D. General Housekeeping
Safety checks, status update
179
Multi-Tasking Structure
1. Servo Interrupt
442usec
CT
#1
442usec
CT #1
#2~#n
HK
#2~#n
?
PLC0
PLC1 COMM
CT #1
#2~#n
2. Real Time Interrupt Task
PLC0
Motion Planning
I8=2 (실행주기 결정)
* 3rd Interrupt
PLC2 COMM
HK
Motion Planning
PLC3 COMM
HK
PLC4 COMM
HK
3. Background Task
PLCn
House Keeping
Communication 처리
180
PLC 프로그램
모션 프로그램과 같이 PMAC은 PLC 프로그램을 실행할 수
있다.
PMAC PLC 프로그램은 PMAC이 모션 프로그램과 독립적으로
하드웨어 PLC의 기능의 프로그램을 실행하게 한다.
What to learn:
PMAC PLC program 작성방법
PMAC PLC program 실행방법
PMAC PLC program 이용방법
PLC 프로그램
* 하드웨어 PLC와 같은 량의 많은 작업수행
* 모션 프로그램에 관계없이 반복적이고 빠른 동작
용도 :입력모니터 (monitoring inputs)
출력모니터 (setting outputs)
각종 게인 값 변경 (changing gains)
PMAC 상태감시 (monitoring card status)
명령실행 (commanding actions, cmd “ ”)
메세지 전송 “sending messages”
PMAC PLC 종류
Foreground PLC (PLC0 or PLCC0)
서보 인터럽트 시간 마다 동작
반복 속도는 I8에 의해 결정
사용하지 않거나 매우 짧게 작성 (KEEP SHORT!!)
Background PLC (PLC1-31 or PLCC1-31)
서보 사이클 사이에 동작한다
반복 속도는 다음 조건에 따라 달라진다 :
서보 주기 (Servo Frequency)
모터의 종류 및 개수 (Number and types of motors)
모션 프로그램 계산 소요시간
(Calculation requirements of motion programs)
자체의 길이와 복잡성
(Length and complexity of PLC programs)
PLC 와 PLCC의 차이점
PLCC는 Compiled 형식의 PLC
빠른 실행속도 :
해석(Interpretation) 시간의 제거
정수산술 (Integer Arithmetic)의 실행능력
Floating-point 연산은 compiled PLC program에서 일반
PLC (Interpreted PLC)보다 2~3배 빠르게 동작한다
정수연산(Integer operations)은, 부울 연산 포함,
컴파일 된 형식에서 20~30배 빠르게 동작한다
Background PLC/PLCC
Execution Example
Uncompiled PLC1, 2, 3
Compiled PLCC1, 2, 3, 4
Execution order:
PLC1
PLCC1, 2, 3, 4
PLC2
PLCC1, 2, 3, 4
PLC3
PLCC1, 2, 3, 4
PLC0 and PLCC0 are at a higher priority
level and can interrupt any of the
background PLC's
PLC Program Control
I5 = 0 No PLC’s can be enabled
= 1 Foreground PLC’s can be enabled (PLC0 & PLCC0)
Background PLC’s cannot be enabled
= 2 Foreground PLC’s cannot be enabled
Background PLC’s can be enabled (PLC’s & PLCC’s 1-31)
= 3 All PLC’s and PLCC’s can be enabled
All existing PLC’s permitted by I5 are enabled on power-up or reset
PLC Program Control (cont.)
On-line commands, motion program and PLC program statements
ENABLE PLC n
DISABLE PLC n
PAUSE PLC n // RESUME PLC n (newer)
control programs individually or in groups
<CONTROL-D> disables all PLC programs
OPEN PLC n disables PLC n
CLOSE does not enable PLC n
* Download한 PLC는 다시 ENABLE명령을 줘야 동작합니다.
PMAC PLC Program Statements
1. Conditional Statements (nestable)
IF({condition})
WHILE({condition})
AND({condition})
OR({condition})
where {condition}={expression}{comparator}{expression}
[AND/OR{expression}{comparator}{expression}...]
2. Logical Control Statements
ELSE
ENDIF
ENDWHILE
3. Action Statements
{variable} = {expression}
COMMAND “{on-line command}”
SEND “{message}”
DISPLAY “{message}”
PLC 작성시 주의사항
1. Timer (Delay) 사용방법
2. While ( ) ~ Endwhile 문 실행
3. CMD 문 사용시 주의사항
4. M-변수 (하드웨어 정의) 사용시
Image Register 사용
189
PLC Timer Delays
Since DWELL and DELAY commands can only be used in motion programs,
PMAC timer registers can be used to issue time delays in a PLC program
Four PMAC memory locations have been created for this purpose:
X:$0700,0,24,s
* Turbo : Isx11 / Isx12
Y:$0700,0,24,s
(I5111, i5112, i5211, i5212,…. )
X:$0701,0,24,s
Y:$0701,0,24,s
Example: If you wanted a 1 second delay in a PLC program
M70->X:$0700,0,24,s
open plc 1 clear
…
m70=(1000)*8388608/(I10)
while (m70>0)
endwhile
…
close
The units of these registers are in servo cycles. These registers are
continuously decremented each servo cycle..
Example 8: PLC Programming
This example shows how to use a PLC program to create customized
inputs. As the PLC program repeatedly cycles in background, it
checks the input lines and issues commands as appropriate. This
program shows how to use a thumbwheel input line to create a jog
switch dedicated to a particular motor. Note the use of a "latching
flag" so that commands are only given on a change of state, making
them edge triggered.
NEW IDEAS IN MOTION
191
Example 8: PLC Programming (continued)
;********************* Set-up and Definitions*****************
CLOSE
M50->Y:$FFC1,0
; Thumbwheel port input bit 0
M60->*
; Latching bit for M50
;****************** PLC Program Text **********************
OPEN PLC 16
CLEAR
IF (M50=1)
; Motor 1 jog plus switch on
IF (M60=0)
; But not on last time
COMMAND"#1J+"
; Issue command
M60=1
; Set latching flag
ENDIF
ELSE
; Motor 1 jog plus switch off
IF (M60=1)
; But not off last time
COMMAND"#1J/"
; Issue stop command
M60=0
; Set latching flag
ENDIF
ENDIF
CLOSE
192
Example 8 : Execution Results (continued)
1. PLC 작성 후 Download (i5=2,BG)
2. IOSIM을 이용한 Input 시뮬레이션
193
Example 9: PLC Programming (continued)
;********************* Set up and Definitions *********************
CLOSE
#1->-100U+15000
; Radial arm at 100 cts/mm; offset 150 mm
#2->40C
; Rotary axis at 40 cts/deg
M162->D:$002B
; Motor 1 actual position
M262->D:$0067
; Motor 2 actual position
M100->F:$D400
; DPRAM register for X position reporting
M200->F:$D401
; DPRAM register for Y position reporting
;******************* PLC Program Text ***************************
OPEN PLC 6 CLEAR
P162=150-M162/(I108*32*100)
; Radial distance from center in mm
P262=M262/(I208*32*40) ; Rotary position in degrees
M100=P162*COS(P262)
; X position in mm => DPRAM register
M200=P162*SIN(P262)
; Y position in mm => DPRAM register
CLOSE
194
PLC QUIZ
• Name 3 types of PLC programs.
• What determines if a PLC program will run or not?
• How do you make PLC programs 2,3, and 10 run
automatically at power up or reset?
• How do you know if a certain command can be used
in a PLC program?
• How do you make your Y-axis move from a PLC program?
기타 내용



IOSIM (가상 I/O 시뮬레이터)를 이용해서
간단한 PLC 프로그램을 작성합니다.
SWITCH 입력이 ON되면, LED출력이
1000msec 주기로 깜박이는 PLC입니다.
아래 매크로를 사용해서 프로그램 합니다.
#define SWITCH
#define LED
#define TIMER1
#define TIME_SCALE
#define ON
#define OFF
P100
P101
I5111
(8388608/I10)
1
0
SWITCH
LED
1000msec
196
기타 내용 (continue)
1. PLC 작성 후 Download (i5=2,BG)
2. IOSIM을 이용한 I/O 시뮬레이션
197
PMAC Encoder Conversion Table Principle
Ix03: Position Loop Feedback Address
Servo Address Ix04: Velocity Loop Feedback Address
I-Variables
Ix05: Master Position Address
Ix93: Time Base Source Address
To Servo
Algorithms
Data
Address
PMAC Hardware
Registers
Encoder Conversion
Table
Conversion Instructions:
Process & Address
Processed
Feedback Data
RAM
Address
Data
Raw
Feedback
Data
Feedback
Data Signals
Encoder Counters
& Timers, Latches, ADC's
198
PMAC Encoder Conversion Table
X - Memory
(Results)
Y - Memory
(Set-up)
1. Single Line Entry
Bits
Bits
Bits
Bits
5 - 23
0-4
16 - 23
0 - 15
Result: IntegerFraction Method Source Address
2. Multi-Line Entry
Bits
5 - 23
Bits
0-4
(Intermediate Result)
Bits
Bits
16 - 23
0 - 15
Method Source Address
(Conversion Factors)
Result: IntegerFraction
199
Conversion Methods
Method
Example
Method and Address
$00
Incremental with 1/T
extension
$00C004
$10
ACC-28 A/D Register
$10C006
$20
Parallel Y-source no filtering
2nd entry: Active-bit mask
$20FFD0
$003FFF
$30
Parallel Y-source with filtering
2nd entry: Active-bit mask
3rd entry: Max P/cycle
$30FFD1
$000FFF
$000200
200
Conversion Methods (continued)
Method
Example
Method and Address
$40
Time-Base Conversion
2nd entry: Scale Factor
$400723
$000800
$50
Integrated A/D Conversion
2nd entry: Reference Bits
$50C007
$000200
$60
Parallel X-source, no filtering
2nd entry: Active Mask
$60C001
$00FFFF
$70
Parallel X-source with filtering
2nd entry: Active-bit mask
3rd entry: Max P/cycle
$700721
$07FFFF
$000040
201
Conversion Methods (continued)
Method
Example
Method and Address
$80
Incremental with parallel
extension
$80C010
$90/A0/B0
Trigger-started time base
$A0C00C
($90:frozen; $B0:armed; $A0: post trigger)
2nd entry: Scale factor
$C0
Incremental with no extension
$D0
Exponential Filter
2nd entry: Max P/cycle
3rd entry: Filter Gain
$0008000
$C0C020
$700721
$07FFFF
$000040
202
PMAC Dual-Ported RAM Memory MAP
Host
Address
Offset
PMAC
Address
0x000
Control Panel Functions
$D000
0x0024
Servo Data Reporting Buffer
$D009
0x0228
Background Data Reporting Buffer
$D08A
0x062C
ASCII Command Buffer
$D18B
(HOST to PMAC)
0x06D0
ASCII Response Buffer
$D1B4
(PMAC to Host)
0x7E8
Pointers to Variable Size Buffers
$D1FA
0x0800
Room for Variable-Size Buffers
$D200
0x3FFC
(1)
Data Gathering
(2)
Background Variable Data
(3)
Binary Rotary Program
Open Use Space
$DFFF
203
PCOMM Dual Ported RAM
Feature Support Functions
Control Panel
Servo Time
Fixed Buffer
Background
Fixed Buffer
DPR
Features
Variable
Background
ASCII I/O
Binary Rotary
Buffer
204
PMAC1 Block Diagram
Display
EPROM
128 k x 8
Firmware
Expansion
SRAM
128 k x 24
Active
Memory
FLASH
512 x 8
Firmware
& User
Backup
Option 4A,
5A, 5B, 5C
Multiplexer
Extra
SRAM
16 k x 24
Parameter
Storage
Serial
OPTO I/O
Machine Port 2
I/O
Control
ICs
Encoder
Receivers
Isolated
16 -Bit
DACs
Flag
Isolators
Flag
Isolators
CPU
24-Bit
20/40/60/
80 MHz
DSP
56001/2
Watchdog
Timer
Serial
Comm.
Interface
“DSPGATE”
4-Axis
Servo ASIC
“DSPGATE”
4-Axis
Servo ASIC
Isolated
16-bit
DACs
ADC Port
ADC Port
DPRAM
8 k x 16
Interface
EAROM
2kx8
Setup
Storage
Option 16
Option 2
Bus
Comm.
Interface
Option 1
Encoder
Receivers
Compare Port
Standard CPU
only
Bus Port
205
Machine Port 1
Standard CPU only
Panel
Why Use PMAC2 over PMAC?








Ability to do direct PWM control
Ability to do on-board MACRO interface
More compact for sinewave control
Superior pulse-and-direction stepper control
Superior MLDT interface
Enhanced position compare output function
Increased DAC resolution (18-bit vs. 16-bit)
Many accessory boards come on-board:

DPRAM, ADCs, MLDT interface, supplemental encoder interface,
stepper interface
206
Why Use PMAC over PMAC2?


Existing PMAC customers don’t have to
change
More cost-effective for traditional analog drive
interface:
 Velocity-mode
drives
 Torque-mode drives


Onboard 24V I/O (JOPTO port)
Automatic control panel port
207
Cubic Spline Trajectories
V
V
TA (added)
TA
TA (added) time
TA (added)
TA
TA
TA (added) time
Two Programmed Segments
One Programmed Segment
V
TA (added)
TA
TA
TA
TA (added)
time
Three Programmed Segments
V
TA (added)
TA
TA
TA
TA
Four Programmed Segments
TA (added) time
208
PMAC Splined Moves
If segment were
done at constant
velocity:
DP
Vc =
TA
All segments same time
etc.
VEL
No velocity or acceleration
discontinuities at segment
boundaries
INC
SPLINE1
TA500
X10000
X9000
X10500
X12000
etc.
TA
(added)
TA
TA
TA
TA
TA
(added)
TIME
209
Position, Velocity, and Time (PVT mode)
[Parabolic Velocity]
VEL
P1 (specified)
V1 (specified)
A1 (calculated)
A0
(calculated)
P0 V0 (from
before)
….
PVT200
X1000:30
….
TA
(specified)
TIME
210
PVT Mode: Positions and Velocities Specified
Velocity
(Units/sec)
Move Program
INC
PVT200
1 Y133.333:1000
PVT100
2 Y100:1000
3 Y96.667:900
PVT200
4 Y140:500
PVT500
5 Y83.333:0
1000
900
500
200
0
1
100
200
2
100
400
3
200
4
500
600
5
Time
1100 (msecs)
211
Vel
Vel
V
V
 P=1/2 Vt
 P=1/3 Vt
t
Common PVT
Segment Shapes
Time
Vel
t
Time
t
Time
Vel
V
V
 P=2/3 Vt
 P=Vt
t
Time
Vel
Vel
V2
V
V1
 P1 =1/6 Vt
V/2
P2=5/6
 P=1/2(V 1+V )2t
t
Time
t
Vt
2t
Time
212
Pi+3
Vi+2
PVT Mode Contouring
(Hermite Spline)
Ri+2
Pi+2
Ci+2
Vi+1
Ci
To compute axis velocities at point P:
Ci+1
Pi+1
Ri+1
Vi
1. Find common center of Pi-1, Pi, and Pi+1
2. Compute velocity vector as normal
to radius vector
Ri
VYi
Q
Pi
3. Resolve velocity vector into components
VXi
Pi-1
213
G,M,T and D Codes
 For RS-274 compatible motion
programs
G 73 is equivalent to
Call 1000.73000
M 3 is equivalent to
Call 1001.03000
T 01 is equivalent to
Call 1002.01000
D 12 is equivalent to
Call 1003.12000
214
G, M, T, and D Codes (continued)
System designer writes custom routines in
PROG 1000 to PROG 1003
 Part programmers and machine operators
can treat system as regular “G-Code”
machine
 PROG 1000 and up can password protected
(also PLC’s 0 - 15)

215
Example 5: A Simple G-Code Program
;*************** Part Program Text ******************
Note that the part program does not need to know how the Gcodes and M-codes are executed
OPEN PROG 5 CLEAR ;Prepare motion program 5 for entry
G17 G90
; XY plane, absolute move spec
G97 S1800
; Set spindle speed of 1800 rpm
F500
; Cutting speed 500 mm/min
G00 X10.00 Y5.00 ; Rapid move to (10, 5)
M03
; Start spindle
G04 P2.0
; Wait 2 seconds
G01 Z0
; Lower cutter
X30.25 Y5.00
; Linear XY move
G03 X35.25 Y10.00 J5
; CCW arc move
G01 X35.25 Y50.10 ; Linear move
G03 X30.25 Y55.10 I-5
; CCW arc move
G01 X10.00 Y55.10 ; Linear move
G03 X5.00 Y50.10 J-5
; CCW arc move
G01 X5.00 Y10.00
; Linear move
G03 X10.00 Y5.00 I5
; CCW arc move
G01 Z5 M05
; Cutter up, stop
G00 X0 Y0
; Back to home
CLOSE
216
Example 5: A Simple G-Code Program (continued)
OPEN PROG 1000 CLEAR ; prepare buffer 1000 for entry
RAPID RETURN
; G00Rapid mode (N0 is implied)
N01000 LINEAR RETURN
; G01 Linear interpolation mode
N02000 CIRCLE1 RETURN
; G02 CW circle mode
N03000 CIRCLE2 RETURN
; G03 CCW circle mode
N04000 READ(P)
; G04 Dwell for P seconds
IF (Q100 & 32768 > 0)
; P parameter specified?
DWELL (Q116*1000)
; PMAC specifies dwell in msec
ENDIF
RETURN
N17000 NORMAL K-1 RET
; G17 Specify XY plane
N18000 NORMAL J-1 RET
; G18 Specify ZX plane
N19000 NORMAL I-1 RET
; G19 Specify YZ plane
N90000 ABS RET
; G90 Absolute mode
N91000 INC RET
; G91 Incremental mode
N97000 READ(S)
; G97 Spindle speed set
IF (Q100 & 262144 > 0); S parameter specified?
I422=Q119/30
; #4 jog speed in cts/msec
ENDIF
RETURN
217
CLOSE
Example 5: A Simple G-Code Program (continued)
OPEN PROG 1001 CLEAR
N03000 CMD "#4J+" RET
N04000 CMD "#4J-" RET
N05000 CMD "#4J/" RET
CLOSE
;To run this program:
;
;
;
;
;
;
Prepare buffer 1001 for entry
Start spindle clockwise
(closed loop)
Start spindle
counterclockwise (ditto)
Stop spindle
&1 B5 R ;Coordinate System 1, point to Beginning of
Program 5, Run
218
Motor 1 Cmd Position (cts)
219
What is PMAC Time-Base Control?

Interpolation function computes commanded
positions each servo cycle as:
CPn = CPn-1 + CVnt

t represents time elapsed in servo cycle
24-bit register: 223 = 1 msec


Physical time between servo cycles set by
hardware
Varying t register value from true time elapsed
provides “time base control” (a.k.a. “feedrate
override”)
220
PMAC Time-Base Control Variables

I10 Servo Interrupt Time
 Tells
interpolator true time of servo cycle
 Scaled so that 223 (8M) = 1msec
 Default I10 = 3,713,707 (442 msec)

Ix93 C.S.x Time-Base Address
 Tells
what register is read for time base value
 Contents of register have units of I10
221
What are Common Time-Base Sources?
% Commands (default)
 Operator Pot thru A/D or V/F
 Operator Switch thru PLC program
 Master Encoder Count Frequency
 External Clock Frequency
 Process variable servo loop output

222
Time Base Host Commands





% {constant} command puts (I10*{constant}/100)
into special register for addressed C.S.
%100 is “real time”
% query command reports back preset time base
value (regardless of source)
Ix93 = default, this value is used for time base t
Time base value slews to new command at Ix94
units per servo cycle
223
What is External Time Base?

PMAC’s motion language describes commanded
position as function of time:
CP=f(t)


PMAC’s basic units of time are milliseconds
In Slaving applications, we want to describe
commanded position as function of master
position:
CP=f(MP)
224
What is External Time Base? (continued)



Since language is still in terms of time, we must
define relationship between “time” (units: msecs)
and master position (units: cts)
This is Real Time Input Frequency (RTIF) in
cts/msec
If we use a RTIF of 32 cts/msec, when we refer to
a msec in the program, we are really referring to
32 counts of the master
225
Position
External Time Base Concept
Time-Based trajectory
Position
time
Real-Time Input Frequency (cts/msec)
Time-Based trajectory
Master Position
226
How Does External Time Base Work?

Conversion Table Computes
MPn = 2*SF*(MPn - MPn-1)
Ix93 contains address of MPn register in
conversion table
 Coordinate system uses MPn as “t” in

CPn = CPn-1 + CVnt

Trajectories are now function of master
position
227
Time Base Conversion Table Setup
HEX
$720
•••
$723
•••
$728
DEC
X-Register
Y-Register
1824
•••
1827 Interpolated Cts(n) $00
C00C
{1/T} {Enc 4 counter}
•••
1832 Interpolated Cts(n-1) $40
0723
{Time Base} {Int. Enc. 4}
$729 1833
Result
$001000
{Scale factor}
I193=1833
Result =2*S.F.*[Interp Cts(n)-Interp Cts(n-1)]
=2*(217/RTIF)*(25*IF*I10/223)
=I10*(IF/RTIF)
228
PMAC External Time Base Example
Coil Winder: Traverse slaved to spindle
Spindle Axis:
500 lines/rev = 2000 cts/rev (often power of 2)
229
PMAC Time Base Example
Time Base Setup:
Define Real-Time Input Frequency (RTIF)
=128 cts/msec (usually power of 2)
(must be integer)
At RTIF, spindle speed is
Assume this spindle speed to write traverse program e.g.
230
Constraints on Choosing Time Base RealTime Input Frequency
The choice of RTIF in master counts per millisecond is quite arbitrary.
There are only a few constraints:
1) The Time Base Scale Factor (217/RTIF) must be an integer to prevent drift
a) RTIF=100cts/msec=>TBSF=1310.72 (BAD)
b) RTIF=128cts/msec=>TBSF=1024 (Good)
2) Maximum Input Frequency < Servo Update Frequency ( kHz )
Real Time Input Frequency
to prevent saturation
MIF
RTIF> SUF (kHz)
cts
a) SUF=2.25 kHz, MIF = 100m sec,
cts
b) SUF=2.25 kHz, MIF = 100m sec ,
cts
MIF
RTIF =32 m sec=>RTIF< SUF
cts
MIF
RTIF =64 m sec=>RTIF> SUF
(BAD)
(Good)
231
Constraints on Choosing Time Base Real-Time Input
Frequency (continued)
3) SPLINE and PVT segment times (at RTIF) must be an integer number of
milliseconds, so here master cycle time must be an integer number of
milliseconds
cts
a) Master Encoder = 4000 rev
Max Speed = 3000 rpm = 50 rps
cts
RTIF=MIF=200 m sec =>TBSF655.36 (BAD)
cts
b) Master Encoder = 4000 rev
Max Speed = 3000 rpm = 50 rps
cts
Real Time Speed = 64 rps RTIF = 256 rev
TBSF=512
Rev Time=15.625 msec
(BAD)
cts
c) Master Encoder =4096 rev
Max Speed = 3000 rpm = 50 rps
cts
RTIF=MIF=204.8 m sec => TBSF=640 Rev Time=20msec (GOOD)
Glossary:
RTIF: Real Time Input Frequency (cts/msec)
TBSF: Time Base Scale Factor
MIF: Maximum Input Frequency (cts/msec)
SUF: Servo Update Frequency
232
Time Base I-Variable (continued)
Ix94 Time Base Slew Rate / Slew Limit
•Determines maximum rate of time base change
•Expressed in (units of I10)/servo cycle
•Set relatively low for host-commanded time-base
(default is 1644) to prevent step velocity change
•Set high for external time base to prevent loss of
synchronization
233
Time Base I-Variables (continued)
Ix95 Feed Hold Slew Rate
•Works like Ix94, has same units
•Affects only deceleration on ‘H’ command and reacceleration on following ‘R’
•‘Hold’ is effectively a ‘%0’ command
•Ix95 permits controlled hold even when
Ix94 is high for external time base
234
DELTA TAU
DATA SYSTEMS, INC.
Pcomm32 Applications
235
Pcomm32에 관하여(1)
• PComm32.dll – 32-bit DLL
• PmacServer.exe – PMAC과의
통신을 담당하는 서버 프로그램
• USB/ETHERNET Configure
Tool 사용
• PCOMM32는 모든 Windows
Platform에서 사용 가능한 통신
드라이버이다.
• PCI/ISA/USB/ETH/SERIAL 등
의 모든 통신 방법을 제공한다.
• 지원 가능한 Language
- Microsoft Visual C/C++
- Microsoft Visual Basic
- Borland Delphi
- Borland C++ Builder
236
Pcomm32에 관하여(2)
• PCOMM32는 윈도우 표준 라이브
러리 포멧을 지원하는 동적연결 라
이브러리이다.
• Win32 API로 동적연결
- LoadLibrary()
- GetProcAddress()
• Install시에 필요한 header파일
“…\PComm32PRO\Include”
<PComm32PRO Benchmark Times>
PMAC과 사용을 위한 초기화 과정
1.
Load the DLL, and get procedure addresses
2.
Call OpenPmacDevice()
PMAC 통신 종료 과정
1.
Call ClosePmacDevice()
2.
Call FreeLibrary, unload PCOMM32.dll from memory
• “runtime.cpp”의 RuntimeLink() 루
틴을 사용해서 각 함수의 포인터를
쉽게 가져와 사용한다.
• ISA/PCI/USB/ETH 에서 DPR관련
Function 사용 가능하다.
• 대부분의 동작은 ASCII 통신 함수
로 해결할 수 있다. (GetResponse)
237
각 언어별 Pcomm32 사용하기 (1)
1. Visual C++ 에서 PCOMM 사용하기
•
[Tools]->[Options]의 [Directories]탭에서 PCOMM Header 경로를 설정한다.
•
[FILE]->[NEW] 에서 새로운 Project를 생성한다.
•
해당 Project에 “Runtime.h”,”Runtime.cpp” 두 파일을 추가한다.
•
[Project]->[Settings]를 열어 “Runtime.cpp”파일을 선택한 후 “C/C++”탭의
“Category”에서 “Precompiled Headers”를 선택한다. 여기서 “Not using
precompiled headers”를 선택하여 사용하지 않는 것으로 설정한다.
<초기화 하기>
<사용 종료하기>
HINSTANCE m_hPmacLib;
If ( m_bDriverOpen )
BOOL m_bDriverOpen;
{
DWORD m_dwDevice;
If (!m_hPmacLib)
m_hPmacLib = OpenRuntimeLink();
If (m_hPmacLib==NULL)
m_bDriverOpen = !DeviceClose(m_dwDevice);
}
If ( m_hPmacLib )
{
return FALSE;
CloseRuntimeLink();
m_dwDevice = DeviceSelect(NULL);
m_bDriverOpen = DeviceOpen(m_dwDevice);
m_hPmacLib = NULL;
}
If ( m_bDriverOpen )
……
238
각 언어별 Pcomm32 사용하기 (2)
2. Visual BASIC 에서 PCOMM 사용하기
•
IDE에서는 별도의 설정이 필요하지 않다.
•
PCOMM을 사용하기 위해서 별도의 모듈을 만들어야 한다. 모듈의 이름을
정하고 “Runtime.cpp/h”의 내용을 참조하여 함수를 선언해야 한다.
Ex) DLL_LINK( DeviceOpen, OPENPMACDEVICE, "OpenPmacDevice");
typedef BOOL( CALLBACK *OPENPMACDEVICE ) ( DWORD dwDevice );
 Declare Function OpenPmacDevice Lib “Pcomm32.dll” (ByVal pmac As Long) As Long
•
VB에서는 “int”형의 변환에 있어서 주의해야 한다. Int(4Byte)는 반드시
“Long”으로 변환해야 한다.
<초기화 하기>
Dim DriverOpen As Boolean
<사용 종료하기>
ClosePmacDevice(dwDevice)
Dim dwDevice As Long
dwDevice = PmacSelect(0)
bDriverOpen = OpenPmacDevice(dwDevice)
If ( bDriverOpen ) Then
……
End If
239
각 언어별 Pcomm32 사용하기 (3)
3. Borland C++ Builder 에서 PCOMM 사용하기
•
새로운 Project를 먼저 생성한다.
•
[Project]->[Options]를 열어 “Directories”에 헤더파일 경로를 설정한다.
•
해당 Project에 “Runtime.h”,”Runtime.cpp” 두 파일을 추가한다.
<초기화 하기>
<사용 종료하기>
HINSTANCE m_hPmacLib;
If ( m_bDriverOpen )
BOOL m_bDriverOpen;
{
DWORD m_dwDevice;
If (!m_hPmacLib)
m_hPmacLib = OpenRuntimeLink();
If (m_hPmacLib==NULL)
m_bDriverOpen = !DeviceClose(m_dwDevice);
}
If ( m_hPmacLib )
{
return FALSE;
CloseRuntimeLink();
m_dwDevice = DeviceSelect(NULL);
m_bDriverOpen = DeviceOpen(m_dwDevice);
m_hPmacLib = NULL;
}
If ( m_bDriverOpen )
……
240
각 언어별 Pcomm 사용하기 (4)
4. Borland Delphi 에서 PCOMM 사용하기
•
새로운 Project를 먼저 생성한다.
•
“PComm32.dll”을 사용하기 위한 새로운 Module을 추가한다.
•
VB와 마찬가지로 직접 DLL내부의 함수 포인터를 가지고 오도록 Module내
에서 정의한다.
Ex)
DLL_LINK( DeviceOpen, OPENPMACDEVICE, "OpenPmacDevice");
typedef BOOL( CALLBACK *OPENPMACDEVICE ) ( DWORD dwDevice );
=> function OpenPmacDevice (dwDevice : Dword) : Boolean; stdcall;
const
dll_name = ‘PComm32.dll’;
function OpenPmacDevice; external dll_name name ‘OpenPmacDevice’;
•
VB와 마찬가지로 형 변환에 주의하도록 한다.
<초기화 하기>
Var
nDevice : LongInt;
begin
nDevice := PmacSelect(0);
if ( OpenPmacDevice(nDevice) <> true ) then
ShowMessage('cannot open device');
End;
<사용 종료하기>
ClosePmacDevice(nDevice);
241
Pcomm32 – GetResponse
(ASCII 통신함수)
1. PMAC과의 통신은 대부분 GetResponse()함수로 구현할 수 있다.
2. 이 함수는 효과적이고, 안전하게 사용할 수 있다. ( Multi-Thread Safe Function)
3. 함수 사용상에서의 제약 사항
•
DeviceGetResponse(DWORD dwDevice, LPTSTR s, UINT maxchar, LPCTSTR outstr) 에서
PMAC쪽으로 보내는 문자열(outstr)은 255(BYTE)를 넘어서는 안 된다.
•
실제 PMAC쪽의 응답을 받는 ‘s’문자열은 크기를 무한정으로 잡아도 된다. ( 현재 Test결과… )
•
GetResponse 함수로 I3, I4, I6, I63, I64 등의 Handshake와 관련한 I-Variable을 변경해서는 안
된다.
4. Error Handling을 위해서 가급적 GetResponseEx()함수를 사용한다.
•
Bit28~31까지는 에러와 관련한 데이터가 리턴된다.
•
“mioctl.h” 파일의 MACRO를 사용하여 통신 에러 여부를 쉽게 판단할 수 있다.
int nRet;
TCHAR strCmd[255];
TCHAR strResponse[4096];
strcpy(strCmd, “RHL:$60000, 200");
nRet = DeviceGetResponse(0, strResponse, 4096, strCmd);
If ( nRet == 0 )
TRACE(“PMAC Error : %d\n”, DeviceGetError(0));
int nRet;
TCHAR strCmd[255];
TCHAR strResponse[255];
strcpy(strCmd, “WL:$60000,$12345678");
nRet = DeviceGetResponseEx(0, strResponse, 255, strCmd);
If (COMM_STATUS(nRet) )
TRACE(“PMAC Error : %d\n”, COMM_STATUS(nRet));
242
Pcomm32 – DPRAM 관련 명령어 (1)
Fixed Real Time Data Buffer 를 이용한
데이터 읽기
1.
2.
ISA/PCI/USB/ETH 통신에서 DPRAM OPTION이 있는
보드에서만 사용할 수 있다.
DPRAM을 통한 기능 구현 종류
•
Fixed Real Time Data Buffer
•
Fixed Background Data Buffer
•
Variable Background Data Buffer
•
Binary Rotary Buffer
•
Read/Write Function
3.
PCOMM의 DPRAM함수는 PMAC에 I-Variable 등을 직접 설정
하지 않고도 함수 사용만으로 기능 구현이 가능하다.
4.
Fixed Real Time Data Buffer 함수
•
이 함수 설정에 의해서 PMAC은 설정된 실시간 주기를
가지고 DPRAM에 각 모터들의 위치,속도 등을 업데이
트 한다.
•
BOOL DeviceDPRRealTimeEx(DWORD dwDevice, long mask,
UINT period, int on ) 함수로 해당 축, 업데이트 주기, Enable을
설정한다.
•
DeviceDPRUpdateRealtime() 함수 호출에 의해서 업데이트되어
있는 모든 데이터를 로컬 메모리로 복사해 온다.
•
No
Func Enable?
Yes
DeviceDPRRealTimeEx 함수로 Enable
(mask, period, enable)
DeviceDPRUpdateRealtime
(Update된 데이터를
PCOMM에서 읽어옴)
DeviceDPRGetServoTimer()
DeviceDPRPosition()
DeviceDPRGetCommanedPos()
DeviceDPRFollowError()
DeviceDPRGetBiasPos()
DeviceDPRGetVel()
DeviceDPRGetPrevDAC()
...
(여기서 축 번호는 axisNo-1)
Yes
Continue to get
data ?
No
DeviceDPRRealTimeEx 함수로 Disable
(mask, period, enable)
나머지 값들을 얻어오는 함수들은 로컬 메모리에 있는 데이터를
리턴하게 된다.
Fixed Real Time Data Buffer 를 이용한
데이터 읽기 종료
243
Pcomm32 – DPRAM 관련 명령어 (2)
Fixed Background Data Buffer 를 이용한
데이터 읽기
1.
Fixed Background Data Buffer 함수
•
•
•
이 함수는 Fixed Real Time Data Buffer와 비슷하게
동작하며, 단지 좌표계에 해당되는 데이터를 얻어오
고, Background로 실행된다는 점이 다르다.
BOOL DeviceDPRBackgroundEx (DWORD dwDevice, int on,
UINT period, UINT crd) 함수로 해당 좌표계, 업데이트 주기,
Enable을 설정한다. 여기서 주의할 점은 crd의 범위가 1~8이고,
나머지 데이터 업데이트 함수들은 0 base index를 취함으로
0~7을 입력한다.
No
Func Enable?
Yes
DeviceDPRBackgroundEx 함수로 Enable
(crd, period, enable, 여기서 crd 1~8)
DeviceDPRBackground
(Update된 데이터를
PCOMM에서 읽어옴)
BOOL DeviceDPRBackground(DWORD dwDevice, int on )
함수 호출에 의해서 업데이트되어 있는 모든 데이터를 로컬
메모리로 복사해 온다.
•
나머지 값들을 얻어오는 함수들은 로컬 메모리에 있는 데이터를
리턴하게 된다.
•
옆의 순서도에서와 같이 Fixed Real Time Data Buffer와 동작이
거의 유사하다.
DeviceDPRCommanded()
DeviceDPRGetTargetPos()
DeviceDPRGetFeedRateMode()
...
(여기서 좌표계는 crd-1,
축 번호는 axisNo-1)
Yes
Continue to get
data ?
No
DeviceDPRBackgroundEx 함수로 Disable
(crd, period, enable, 여기서 crd 1~8)
Fixed Background Data Buffer 를 이용한
데이터 읽기 종료
244
Pcomm32 – DPRAM 관련 명령어 (3)
1.
Variable Background Data Buffer 함수
•
PMAC 내부의 어떤 레지스터라도 DPR영역에 복사하도
록 한다.
•
최대 128개의 레지스터를 복사할 수 있다.
•
long DeviceDPRVarBufInitEx( DWORD dwDevice,
long num_entries, long *addrarray, PUINT addrtype);
함수를 사용해서 복사하고자 하는 레지스터를 지정해 준
다.
Variable Background Data Buffer 를
이용한 데이터 읽기
[DPRAM Set/Get Mem Ex]
void SetMemory()
No
{
BOOL bRet;
PMAC_DPRTYPE dprDatas[1000];
for ( int i = 0; i < 1000; i++ )
{
dprDatas[i].dwData=
((i<<16)&0xFFFF0000) +
(i&0x0000FFFF);
}
bRet=m_pPComm-> DPRSetMem
(0x0000,sizeof(PMAC_DPRTYPE)*100
0, dprDatas);
Func Enable?
•
BOOL DeviceDPRBackGroundVar(DWORD dwDevice,
int on); 함수로 Update 활성/비활성화 하도록 설정한다.
•
BOOL DeviceDPRVarBufRead( DWORD dwDevice,
long h, long entry_num, PLONG long_2); 함수를 호출
하여 미리 설정해 놓은 번호의 메모리 내용을 읽어 온다.
여기서 long_2는 최소 2*sizeof(long)만큼 할당된 메모
리이다.
2. DPR Read/Write 함수
•
DPRAM 영역의 지정한 부분에 데이터를 읽고, 쓴다.
DPRAM 어드레스 영역 내부에만 있다면 어디든 읽고 쓸
수 있다.
Yes
DeviceDPRVarBufInitEx함수로 복사할
영역을 지정한다.
Void GetMemory()
{
DeviceDPRVarBufRead()
DeviceDPRVarBufReadEx()
등의 함수로 원하는 entry의 값을
읽어와서 데이터 포멧에 맞게
처리한다.
•
PVOID DeviceDPRSetMem( DWORD dwDevice,
DWORD offset, size_t count, PVOID val);
Continue to get
data ?
•
PVOID DeviceDPRGetMem( DWORD dwDevice,
DWORD offset, size_t count, PVOID val);
No
•
typedef union _PMAC_DPRTYPE_ {
float fData;
DWORD dwData;
} PMAC_DPRTYPE, *PPMAC_DPRTYPE;
}
DeviceDPRBackGroundVar함수로
Update를 Enable한다.
BOOL bRet;
PMAC_DPRTYPE dprDatas[1000];
Yes
bRet = m_pPComm-> DPRGetMem
(0x0000, sizeof(PMAC_DPRTYPE) *
1000, dprDatas);
for ( int i = 0; i < 1000; i++ )
{
TRACE("DPR[%d] : %08X\n", i,
dprDatas[i].dwData);
Sleep(1);
}
}
DeviceDPRBackGroundVar함수로
Update를 Disable한다.
Variable Background Data Buffer 를
이용한 데이터 읽기 종료
245
DELTA TAU
DATA SYSTEMS, INC.
Position Capture
246
PMAC Position-Capture
개요

PMAC Position Capture 기능은 외부 입력이 발생한
시점에서의 현재의 정확한 엔코더 포지션을 특별한
Register에 저장 하는 기능입니다.

이 기능은 소프트웨어(CPU 및 프로그램)의 개입 없이 SERVO
IC내에서 하드웨어적으로 구현되기 때문에 상당히 정밀한
위치 기록을 할 수 있습니다. (설정 및 응용은 S/W적으로
합니다.)

PMAC의 HOME 기능은 항상 Position Capture 기능을 사용하기
때문에 속도에 관계없는 정확한 원점기능이 가능합니다.

다양한 신호의 조합으로 Trigger조건을 설정할 수 있습니다.
247
Requirements for Hardware Capture

PMAC 서보 IC내에서의 하드웨어 포지션 캡쳐 기능은 미리 정의된 해당 채널의 플래그 또는
인덱스 채널의 변화 시에(Trigger 조건 만족 시에) 엔코더 카운터 값을 저장 합니다.

이러한 하드웨어 캡쳐 가능 출력을 가지기 위한 포지션 data는 반드시 서보 IC의 엔코더
카운터를 통해서 처리되어야 합니다.

병렬 입력 형식과 아나로그 피드백 장치는 하드웨어 캡쳐 기능을 지원하지 않습니다.
(정확하진 않지만 servo 사이클 안에서 가장 가깝게 Data를 읽을 수 있습니다)

PMAC 1 style 및 PMAC2 style 서보 IC 모두 하드웨어 포지션 캡쳐 기능을 지원합니다.
PMAC2 style의 서보 IC 중 최신의 개정판(개정판 “D” 이후)은 선택적으로 서브 카운트 포지션
켑쳐 기능도 지원합니다.

포지션 캡쳐 기능은 해당 채널에 들어오는 엔코더 신호에 의해서만 캡쳐 할 수 있습니다.
248
Setting the Trigger Condition

포지션 캡쳐 사용시에 변수 I7mn2 (Servo IC m Channel n Capture Control) 와
I7mn3(Servo IC m Channel n Capture Flag Select Control) 으로 캡쳐 하기 위한
트리거 조건의 방식을 결정합니다.

이것은 PMAC-style 과 PMAC2-style Servo ICs에 동일하게 적용 됩니다.

I7mn2는 트리거에 사용된 엔코더의 인덱스 채널 , 플래그 ,또는 둘 다(인덱스 ,
플래그)를 정의 합니다. 이러한 트리거 신호들의 엣지에서 트리거가 발생합니다.

I7mn3은 4개의 플랙 입력(+리밋,-리밋, 사용자 입력, 홈 입력) 중에서 트리거
입력으로 사용될 입력을 정의 합니다.
(i7mn2에서 플래그 입력을 사용하기로 정의 되어 있으면)
249
Position-Capture Flag

각 채널은 상태 표시 word에 포지션 캡쳐 플래그(Capture Flag)을
가지고 있습니다. Suggested M-변수 Mxx17가 이 이 비트를 포인트
합니다.

이 비트는 트리거 조건이 발생하고 포지션 레지스터에 포지션이
래치될 때 서보 IC의 캡쳐 로직에 의해 1로 설정 됩니다.

캡쳐 포지션 레지스터(Mxx03)가 프로세서에 의해 읽혀지면 이
비트는 0으로 설정 됩니다.

이 레지스터가 읽혀지면 Capture Flag(Mxx17)자동적으로 는
리셋되고 SERVO IC내의 Capture Logic은 다시 Capture 할 수 있는
준비를 합니다.
250
PMAC2-style Servo IC 포지션 캡쳐 플래그 Address
251
Captured Position Register

해당 엔코더 채널의 Position Capture Register는 트리거 조건이
만족 되었을 때의 엔코더 카운터의 값을 저장합니다.

이 레지스터는 하드웨어 엔코더 카운트 값을 단위로 하며 부호를
가지는 24비트 레지스터 입니다.

Suggested M-변수 Mxx03이 Position Capture Register를
정의합니다.
252
PMAC2-style Servo IC 포지션 캡쳐 레지스터
253
Position Capture 예제

1) 필요 M-변수 (기본설정변수 이용)
Mx17 ; Postion capture flag : 원점을 복귀를 위한 설정(I7mn2/i7mn3)이 만족되면
(HM 명령과는 무관) 이 bit가 1로 되어, position capture 조건이 만족한 것을 알려 줍니다.
Mx03 : Position capture register : 24bit encoder count단위를 저장하는 레지스터 이며, 위의
trigger조건 (position capture)가 발생한 위치를 카운트단위로 저장합니다.
이 레지스터 값을 프로그램이나 on-line command로 읽으면 위 Mx17 값이 0으로 clear됩니다.
단, 저장된 값은 Power-on/Reset된 위치 (즉 Mx01 이 0 인 점을 기준으로 합니다.)
따라서 home된 위치를 기준으로 하기 위해서는, P104=M103-M173(Home Capture Pos)과
같은 식을 이용하시면 됩니다.
254
Position Capture 예제(Cont.)

2) 활용예
조건이 만족 했을 때 위치를 변수에 저장하기 위해서는...
Open PLC.. clear
P117= M117_Postion_Capture_Flag
if (P117=1)
P103=M103_Position_Capture_Register -(M173_Home Capture_Position)
; 이식에서 M103이 read되기 때문에 M117은 0으로 됩니다.
Q0= Q0 +1 ;모니터링 용
endif
Close
255
Motor xx Homing and Hardware Capture in
Triggered Moves –ACC -51E

홈 센서와(또는) Index Pulse 트리거 플래그를 ACC-51E에 연결 하십시오.

ACC-51E에 대한 인덱스 또는 홈 플래그의 알맞은 Edge 설정 을 위해
-51E의 I7mn2와 I7mn3 변수를 설정 하십시오.

Ixx25는 반드시 ACC-51E의 기준 어드레스의 값을 설정 하십시오.

Ixx42 와 Ixx43는 AMP Enable과 리미트 플래그에 Address 를 설정합니다.
일반적으로 ACC-24E2(A)의 어드레스를 설정합니다.
256
DELTA TAU
DATA SYSTEMS, INC.
Position Compare
257
0
M108 = 1000
1000
(M108)
Compare B
Compare A
Setting up for a Single Pulse Output
Position
[cts]
1100
(M109)
SUGGESTED M-VARIABLE로 정의된 경우
M109 = 1100
M110 = 0
※ M108 : Pulse output의 Start Trigger를 결정
M109 : Pulse output의 End Trigger를 결정
258
Setting up for Multiple Pulse Outputs
-1000
-900
(M109)
0
M108 = 1000
M109 = -900
1000
(M108)
Compare B
현재위치
M110
Compare A
Compare B
Compare A
Bracket
1100
3000
3100
Position
[cts]
SUGGESTED M-VARIABLE로 정의된 경우
; 1100-M110
* PMAC2 Servo IC만 Auto Increment 기능지원
M110 = 2000
※ 해당 위치의 Edge에서 Trigger될 때 다른 위치 값에 대한 Auto-increment가 적용.
즉, 현재위치 가 1000[cts]이 되면, compare A가 trigger되면서 compare B에 대해
Increment 적용되므로 M109는1100[cts]이 된다. 마찬가지로 COUNT가 1100[cts]이 되면
compare A가 Increment 적용되어 M108이 3000[cts]이 된다.
※ Auto-increment를 적용하기 위해서는 현재 위치(M101에 저장되는 실제 H/W ENCODER
COUNT)가 Bracket(현재위치를 기준으로 이전의 Compare B에서 다음 Compare A
output의 구간)의 내부에 있어야 한다.
즉, M109 ≤ M101 ≤ M108 의 조건을 만족해야 한다.
259
※ M101은 전원투입 시부터 H/W로 counting 되는 값이기 때문에, Homing등 모션 제어에 따라
실제 Position Window에 보이는 값과는 차이가 있을 수 있다.
이 경우, 아래의 식을 적용하여 보완할 수 있다.
1
m108=m8190-m164/(i108*32)+m173+i126/16
m109=m8191-m164/(i108*32)+m173+i126/16
=> M108 , M109를 적용하는 것이 아니라, M8190 , M8191을 이용하여 EQU Output 위치를
결정한다
=> Position Window 상에 보이는 위치를 기준으로 현재 위치에서 M8190, M8191을 조정한다
=> “HMZ” 명령을 주면 계산된 위치와 Hardware적인 위치의 차이에 의해 M108, M109의 값이
변할 수 있다. (위의 식을 적용할 경우 Home 위치 이외에서 “HMZ”명령을 주면 안됨)
2
m108=m8190+m101
m109=m8191+m101
=> M108 , M109를 적용하는 것이 아니라, M8190 , M8191을 이용하여 EQU Output 위치를
결정한다
=> Position Window 상에 보이는 위치를 기준으로 현재 위치에서 M8190, M8191을 조정한다
=> “HMZ” 명령에 상관없이 동작할 수 있으나 적용시점의 오차가 계속 적용된다.
즉, m108, m109가 입력되는 순간에 오차가 3cts였다면, 전 영역에 걸쳐 EQU가 3cts 오차를
가진다.
260
DPR Indirect memory를 이용한 Compare Output
&1
#1->X
M116->X:$078200,9
; ENC1 compare output value
M191->L:$0000CF
; #1 X/U/A/B/C-Axis scale factor (cts/unit)
M164->D:$0000CC
; #1 Position bias (1/[Ixx08*32] cts)
M173->Y:$0000CE,0,24,S
; #1 Encoder home capture position (cts)
Ixx26
; Motor xx Home Offset
;
M8000->Y:$5FFE,0,24
;1번 DPRAM ADDRESS Pointer
M8001->Y:$5FFF,0,24
;2번 DPRAM ADDRESS Pointer
;
M8190->F:$60450
; 1번(DPRAM 의 내용을 정의 함)
M8191->F:$60451
; 2번(DPRAM 의 내용을 정의 함)
M816->*
; Image word of compare status
M817->*
; Previous value of compare status
; DP:$060450 DPRAM variable-size
; buffers start (0x1140)
; DP:$060FFF DPRAM end address
(Option 2: 8K x 16) (0x3FFC)
; DP:$063FFF DPRAM end address
(Option 2B: 32K x 16)
M817=0
M8000=$60450
; 1번(DPRAM 의 Address를 정의 함)
M8001=$60451
; 2번(DPRAM 의 Address를 정의 함)
261
DPR Indirect memory를 이용한 Compare Output
Q0=0
;Foreground & Background PLC Enable
I5 =3
//Position Compare 를 시작 하겠다.
Open plc0 clear
If (P1000 = 1)
M816=M116 ; M816의 역할
P1000=0
If (M816 = 0 And M817 = 1) Or (M7999 = 1)
M108=M5000
Q0=Q0+1
M8000=M8000+2
M8001=M8001+2
M109=M5001
EndIf
If (M816 = 0)
M7999=0
M108=M191*M8190+M164/(i108*32)+M173+i126/16
M817=0
Else
M109=M191*M8191+M164/(i108*32)+M173+i126/16
EndIf
M817=1
EndIf
;
;
If (M8000 = $6046E)
close
M8000=$60450
M8001=$60451
M108=0
M109=0
EndIf
262
Compare Output for ACC-51E
※ 만약 여분의 channel이 있을 경우 해당채널의 Encoder Port를 이용해서
ACC-51E도 Position Compare Output을 사용할 수 있다.
I7246=3
I7240=8
; Command Output Mode
; Encoder decode Control
I400=1
I402=*
I402=i402+2
; Default 값 +2
I405=$350B
; Motor #1의 Encoder 입력 Address
I406=1
I424=$20001
I415=5
; 충분히 높은 값으로 SETTING 한다
I417=5
I419=5
I411=0
263
DELTA TAU
DATA SYSTEMS, INC.
Position Compensation
264
표준 리드스크류 보정

DEFINE COMP {entries}, [#{source}[D],[#{target},]] {count length}


Entries : 보정데이터 개수
Source : 보정을 하는 모터
있으면 명령위치를 참조해서 보정
- D옵션이 없으면 실제위치를 참조해서 보정
- D옵션이





Target : 보정을 받는 모터
Count Length : 보정테이블의 거리를
나타내는 엔코더 카운트 (cts)
사용 예는 다음과 같다.
#1 DEFINE COMP 10, #1(D), #1, 100000
-160 80 120 96 20 -56 -12 40 20 0
보정데이터의 단위는 1/16 (cts)이다.
보정테이블의 끝은 항상 0 이다.
265
교차축(Cross-Axis) 보정


교차 축 보정의 사용은 통상적으로
XY테이블에서 Y축의 위치를 X축의
위치 함수(function)처럼 보정을
받거나 X축의 위치를 Y축의
위치함수(function)처럼 보정을 받는
경우에 사용한다.
사용 예는 다음과 같다.
1. #1 Source 모터로 #2 Target 모터를 보정하는 경우
#1 DEFINE COMP 10, #1(D), #2, 100000
-160 80 120 96 20 -56 -12 40 20 0
2. #2 Source 모터로 #1 Target 모터를 보정하는 경우
#1 DEFINE COMP 10, #2(D), #1, 100000
-160 80 120 96 20 -56 -12 40 20 0
266
평면(2D) 보정

DEFINE COMP {Rows}.{Columns},#{RowMotor}[D],[#{ColumnMotor}[D],
[#{TargetMotor}]], {RowSpan},{ColumnSpan}






Rows : 보정테이블 행의 개수
Columns : 보정테이블 열의 개수
RowMotor : 첫 번째 소스(행) 모터번호
ColumnMotor : 두 번째 소스(열) 모터번호
RowSpan : 보정테이블 행의 폭
ColumnSpan : 보정테이블 열의 폭
평면(2D) 테이블 작성시 몇 가지 중요한 항목을 언급하면 다음과 같다.
1) 행과 열의 개수는 콤마(,)가 아닌 마침표(.)로 구분한다.
2) 행과 열의 모터의 제로(0) 위치의 보정은 제로(0)로 규정한다. 테이블의 시작을
나타내는 Entry로 보정 값을 넣지는 않는다. (공백으로 처리)
3) 테이블의 행 공백은 열의 폭(ColumnSpan)을 행(Rows)으로 나눈 값이며, 테이블의
열의 공백은 행의 폭(RowSpan)을 열(Columns)로 나눈 값이다. 그리고 보정데이터
는 (행{Rows}+1)(열{Column}+1)-1 숫자인 상수만큼 입력된다.
267



평면(2D)보정 중 #1모터(행)를 보정하는 예
#1 DEFINE COMP 5.6,#1D,#2D, #1, 60000, 50000
공백 80 112 176 96 -112 0
48
32 48 192 128 192 0
80
80 112 80 144 96
0
112 -128 96 96 -96 144 0
-160 160 128 112 80 176 0
0
80 112 176 96 -112 0

보정데이터의 적용여부를 확인하려면
Mx69/3072의 값이 측정값과
일치하는지를 Watch Window에서
확인하면 된다.
평면(2D)보정 중 #2모터(열)를 보정하는 예
#2 DEFINE COMP 5.6,#1D,#2D, #2, 60000, 50000
공백 80 80 128 -48 160 0
64
64 96 64 112 128 0
96 112 64 112 96 112 0
128 80 128 128 128 128 0
128 80 -48 144 96
48 0
0
80 80 128 -48 160 0
268
기







타
I51=1은 보정테이블을 적용시켜 동작하며 I51=0은 보정테이블 적용을 중지한다 .
리셋 상태에서는 I51=0으로 유지하고 모터 홈 이동 완료 후 I51=1로 활성화한다.
BackUp File에서 Compensation Tables을 체크하여 값을 확인/저장할 수 있다.
보정테이블은 높은 번호의 모터부터 낮은 번호의 모터 순으로 정의(DEFINE)한다.
#32 DEF COMP 10, #32D, #32, 100000
#31 DEF COMP 10, #31D, #31, 100000
.. ..
#1 DEF COMP 10, #1D, #1, 100000
보정테이블은 낮은 번호의 모터부터 높은 번호의 모터 순으로 삭제(DELETE)한다.
#1 DEL COMP
#2 DEL COMP
.. ..
#32 DEL COMP
보정테이블의 정의(DEFINE) 및 내용을 터미널 윈도우에서 보고자 한다면 다음과 같다.
(#1모터인 경우)
- 정의(DEFINE)
- 내용
#1 LIST COMP DEF
#1 LIST COMP
보정테이블을 삭제하고자 할 때는 다음과 같다. (#1모터인 경우)
#1 DELETE COMP 또는 #1 DEL COMP
269
PMAC Motor Backlash Parameters
Ix86: Backlash Size (1/16 count)
Added {hidden} position change on reversal
Ix85: Backlash Take-Up Rate (1/16 count/background cycle)
Rate of change of backlash on reversal
Set as high as possible without rough transition
I99:
Backlash Hysteresis (1/16 count) (global)
Required size of reversal before backlash change
Set non-zero to prevent dithering
270
PMAC Motor Backlash Tables
#x DEFINE BLCOMP {#entries}, {count span}
• Position-dependent backlash
• Added to Ix86 {constant} backlash
• Table backlash is zero at motor zero
• Used with COMP table for bidirectional compensation
271