-
Notifications
You must be signed in to change notification settings - Fork 2
/
EL8_machine.hal
149 lines (118 loc) · 5.47 KB
/
EL8_machine.hal
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
loadrt [KINS]KINEMATICS
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadusr -W lcec_conf ethercat-conf.xml
loadrt lcec
loadrt cia402 count=3
loadrt mult2
loadusr -W wj200_vfd --device /dev/ttyUSB1
addf lcec.read-all servo-thread
addf cia402.0.read-all servo-thread
addf cia402.1.read-all servo-thread
addf cia402.2.read-all servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf mult2.0 servo-thread
addf cia402.0.write-all servo-thread
addf cia402.1.write-all servo-thread
addf cia402.2.write-all servo-thread
addf lcec.write-all servo-thread
setp iocontrol.0.emc-enable-in 1
#*******************
# Spindle
#*******************
setp mult2.0.in1 2
setp wj200-vfd.0.mbslaveaddr 5
setp wj200-vfd.0.enable 1
net schpeeed spindle.0.speed-out-rps-abs => mult2.0.in0
net 4pole_correction mult2.0.out => wj200-vfd.0.commanded-frequency
net spindle-startsignal spindle.0.on => wj200-vfd.0.run
net spindle-direction spindle.0.reverse => wj200-vfd.0.reverse
net spindle-at-speed <= wj200-vfd.0.is-at-speed
#*******************
# AXIS X
#*******************
setp cia402.0.csp-mode 1
setp cia402.0.pos-scale 10000
# joint signals for motion
net x-pos-cmd joint.0.motor-pos-cmd => cia402.0.pos-cmd
net x-pos-fb joint.0.motor-pos-fb <= cia402.0.pos-fb
net x-enable joint.0.amp-enable-out => cia402.0.enable
net x-amp-fault joint.0.amp-fault-in <= cia402.0.drv-fault
# ethercat to cia402 driver
net x-statusword lcec.0.3.cia-statusword => cia402.0.statusword
net x-opmode-display lcec.0.3.opmode-display => cia402.0.opmode-display
net x-drv-act-pos lcec.0.3.actual-position => cia402.0.drv-actual-position
# cia402 driver to ethercat
net x-controlword cia402.0.controlword => lcec.0.3.cia-controlword
net x-modes-of-operation cia402.0.opmode => lcec.0.3.opmode
net x-drv-target-pos cia402.0.drv-target-position => lcec.0.3.target-position
# homing
net x-home-request joint.0.request-custom-homing => cia402.0.home
net x-homing joint.0.is-custom-homing <= cia402.0.stat-homing
net x-homed joint.0.custom-homing-finished <= cia402.0.stat-homed
#*******************
# AXIS Y
#*******************
setp cia402.1.csp-mode 1
setp cia402.1.pos-scale 10000
# joint signals for motion
net y-pos-cmd joint.1.motor-pos-cmd => cia402.1.pos-cmd
net y-pos-fb joint.1.motor-pos-fb <= cia402.1.pos-fb
net y-enable joint.1.amp-enable-out => cia402.1.enable
net y-amp-fault joint.1.amp-fault-in <= cia402.1.drv-fault
# ethercat to cia402 driver
net y-statusword lcec.0.2.cia-statusword => cia402.1.statusword
net y-opmode-display lcec.0.2.opmode-display => cia402.1.opmode-display
net y-drv-act-pos lcec.0.2.actual-position => cia402.1.drv-actual-position
# cia402 driver to ethercat
net y-controlword cia402.1.controlword => lcec.0.2.cia-controlword
net y-modes-of-operation cia402.1.opmode => lcec.0.2.opmode
net y-drv-target-pos cia402.1.drv-target-position => lcec.0.2.target-position
# homing
net y-home-request joint.1.request-custom-homing => cia402.1.home
net y-homing joint.1.is-custom-homing <= cia402.1.stat-homing
net y-homed joint.1.custom-homing-finished <= cia402.1.stat-homed
#*******************
# AXIS Z
#*******************
setp cia402.2.csp-mode 1
setp cia402.2.pos-scale 10000
# joint signals for motion
net z-pos-cmd joint.2.motor-pos-cmd => cia402.2.pos-cmd
net z-pos-fb joint.2.motor-pos-fb <= cia402.2.pos-fb
net z-enable joint.2.amp-enable-out => cia402.2.enable
net z-amp-fault joint.2.amp-fault-in <= cia402.2.drv-fault
# ethercat to cia402 driver
net z-statusword lcec.0.1.cia-statusword => cia402.2.statusword
net z-opmode-display lcec.0.1.opmode-display => cia402.2.opmode-display
net z-drv-act-pos lcec.0.1.actual-position => cia402.2.drv-actual-position
# cia402 driver to ethercat
net z-controlword cia402.2.controlword => lcec.0.1.cia-controlword
net z-modes-of-operation cia402.2.opmode => lcec.0.1.opmode
net z-drv-target-pos cia402.2.drv-target-position => lcec.0.1.target-position
# homing
net z-home-request joint.2.request-custom-homing => cia402.2.home
net z-homing joint.2.is-custom-homing <= cia402.2.stat-homing
net z-homed joint.2.custom-homing-finished <= cia402.2.stat-homed
#*******************
# AXIS A
#*******************
#setp cia402.3.csp-mode 1
#setp cia402.3.pos-scale 10000
# joint signals for motion
#net a-pos-cmd joint.3.motor-pos-cmd => cia402.3.pos-cmd
#net a-pos-fb joint.3.motor-pos-fb <= cia402.3.pos-fb
#net a-enable joint.3.amp-enable-out => cia402.3.enable
#net a-amp-fault joint.3.amp-fault-in <= cia402.3.drv-fault
# ethercat to cia402 driver
#net a-statusword lcec.0.0.cia-statusword => cia402.3.statusword
#net a-opmode-display lcec.0.0.opmode-display => cia402.3.opmode-display
#net a-drv-act-pos lcec.0.0.actual-position => cia402.3.drv-actual-position
# cia402 driver to ethercat
#net a-controlword cia402.3.controlword => lcec.0.0.cia-controlword
#net a-modes-of-operation cia402.3.opmode => lcec.0.0.opmode
#net a-drv-target-pos cia402.3.drv-target-position => lcec.0.0.target-position
# homing
#net a-home-request joint.3.request-custom-homing => cia402.3.home
#net a-homing joint.3.is-custom-homing <= cia402.3.stat-homing
#net a-homed joint.3.custom-homing-finished <= cia402.3.stat-homed