Advertisement
LAIR82

Gmoccapy Hal file

May 29th, 2014
650
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.09 KB | None | 0 0
  1.  
  2. loadrt trivkins
  3. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  4. loadrt probe_parport
  5. loadrt hostmot2
  6. loadrt hm2_pci config="firmware=hm2/5i23/rmsvss6_8.bit num_resolvers=6 num_pwmgens=6 num_3pwmgens=0 num_stepgens=0 sserial_port_0=0000xxxx"
  7. setp hm2_5i23.0.pwmgen.pwm_frequency 24000
  8. setp hm2_5i23.0.pwmgen.pdm_frequency 6000
  9. setp hm2_5i23.0.watchdog.timeout_ns 10000000
  10. setp hm2_5i23.0.resolver.excitation-khz 2.5
  11.  
  12. loadrt pid names=pid.x,pid.z
  13. loadrt abs names=abs.0,abs.1,abs.2,abs.3
  14. loadrt lowpass names=lowpass.0,lowpass.1,lowpass.2,lowpass.3
  15. loadrt scale names=scale.0,scale.1,scale.2,scale.3,scale.4,scale.5
  16.  
  17. loadrt classicladder_rt numRungs=150 numSections=15 numBits=30 numWords=20 numTimers=5 numMonostables=5 numCounters=20 numPhysInputs=120 numPhysOutputs=96 numS32in=20 numS32out=20 numFloatIn=5 numFloatOut=5 numTimersIec=30 numArithmExpr=75 numSymbols=600
  18.  
  19. loadrt mux16 names=foincr,soincr
  20. loadrt and2 count=3
  21. loadrt or2 count=1
  22. loadrt gearchange
  23. loadrt encoder num_chan=1
  24. loadrt mux4 count=1
  25. loadrt ilowpass count=1
  26. loadrt debounce cfg=3
  27.  
  28.  
  29.  
  30. addf hm2_5i23.0.read servo-thread
  31. addf motion-command-handler servo-thread
  32. addf motion-controller servo-thread
  33. addf pid.x.do-pid-calcs servo-thread
  34. addf pid.z.do-pid-calcs servo-thread
  35. addf classicladder.0.refresh servo-thread
  36. addf foincr servo-thread
  37. addf soincr servo-thread
  38. addf hm2_5i23.0.write servo-thread
  39. addf hm2_5i23.0.pet_watchdog servo-thread
  40. addf lowpass.0 servo-thread
  41. addf lowpass.1 servo-thread
  42. addf lowpass.2 servo-thread
  43. addf lowpass.3 servo-thread
  44. addf abs.0 servo-thread
  45. addf abs.1 servo-thread
  46. addf abs.2 servo-thread
  47. addf abs.3 servo-thread
  48. addf scale.0 servo-thread
  49. addf scale.1 servo-thread
  50. addf scale.2 servo-thread
  51. addf scale.3 servo-thread
  52. addf scale.4 servo-thread
  53. addf scale.5 servo-thread
  54. addf and2.0 servo-thread
  55. addf and2.1 servo-thread
  56. addf and2.2 servo-thread
  57. addf or2.0 servo-thread
  58. addf gearchange.0 servo-thread
  59. addf encoder.capture-position servo-thread
  60. addf encoder.update-counters servo-thread
  61. addf mux4.0 servo-thread
  62. addf ilowpass.0 servo-thread
  63. addf debounce.0 servo-thread
  64.  
  65.  
  66. #==============================================================================
  67.  
  68. # 15CC I/O
  69.  
  70. #==============================================================================
  71. # 7I70-1 input signals
  72.  
  73. net spindle-lube-oil-temp <= hm2_5i23.0.7i70.0.0.input-47
  74. net headstock-pressure-ok <= hm2_5i23.0.7i70.0.0.input-46
  75. net spindle-lube-pressure-ok <= hm2_5i23.0.7i70.0.0.input-45
  76. net hydraulic-fluid-temp <= hm2_5i23.0.7i70.0.0.input-44
  77. net chip-conveyor-reverse <= hm2_5i23.0.7i70.0.0.input-43
  78. net jaws-out-rolling-guard <= hm2_5i23.0.7i70.0.0.input-42
  79. net coolant-flow-off <= hm2_5i23.0.7i70.0.0.input-41
  80. net coolant-flow-on <= hm2_5i23.0.7i70.0.0.input-40
  81. net change-tool-pb <= hm2_5i23.0.7i70.0.0.input-39
  82. net tailstock-retract <= hm2_5i23.0.7i70.0.0.input-38
  83. net coolant-pump-on/off-sw <= hm2_5i23.0.7i70.0.0.input-37
  84. net chip-conveyor-forward <= hm2_5i23.0.7i70.0.0.input-36
  85. net jaws-in-rolling-guard <= hm2_5i23.0.7i70.0.0.input-35
  86. net rolling-guard-prox <= hm2_5i23.0.7i70.0.0.input-34
  87. net turret-position-4 <= hm2_5i23.0.7i70.0.0.input-33
  88. net turret-position-2 <= hm2_5i23.0.7i70.0.0.input-32
  89. net turret-position-1 <= hm2_5i23.0.7i70.0.0.input-31
  90. net position-strobe-release <= hm2_5i23.0.7i70.0.0.input-30
  91. net position-strobe <= hm2_5i23.0.7i70.0.0.input-29
  92. net turret-in-final-position <= hm2_5i23.0.7i70.0.0.input-28
  93. net ID-turret-unclamped <= hm2_5i23.0.7i70.0.0.input-27
  94. net ID-turret-clamped <= hm2_5i23.0.7i70.0.0.input-26
  95. net manual-tool-sel-d <= hm2_5i23.0.7i70.0.0.input-25
  96. net manual-tool-sel-c <= hm2_5i23.0.7i70.0.0.input-24
  97. net m-contactor <= hm2_5i23.0.7i70.0.0.input-23
  98. net spindle-e-stop <= hm2_5i23.0.7i70.0.0.input-22
  99. net up-to-speed <= hm2_5i23.0.7i70.0.0.input-21
  100. net spindle-stalled <= hm2_5i23.0.7i70.0.0.input-20
  101. net low-speed <= hm2_5i23.0.7i70.0.0.input-19
  102. net spindle-motor-OL <= hm2_5i23.0.7i70.0.0.input-18
  103. net x-axis-motor-overload <= hm2_5i23.0.7i70.0.0.input-17
  104. net x-motor-overtemp <= hm2_5i23.0.7i70.0.0.input-16
  105. net x-circuit-breaker-tripped <= hm2_5i23.0.7i70.0.0.input-15
  106. net x-drive-shear-pin-broke <= hm2_5i23.0.7i70.0.0.input-14
  107. net z-axis-motor-overload <= hm2_5i23.0.7i70.0.0.input-13
  108. net z-axis-motor-temp <= hm2_5i23.0.7i70.0.0.input-12
  109. net z-circuit-breaker-tripped <= hm2_5i23.0.7i70.0.0.input-11
  110. net z-drive-shear-pin-broke <= hm2_5i23.0.7i70.0.0.input-10
  111. net spindle-motor-temp <= hm2_5i23.0.7i70.0.0.input-09
  112. net spindle-transformer-temp <= hm2_5i23.0.7i70.0.0.input-08
  113. net hydraulic-motor-ol <= hm2_5i23.0.7i70.0.0.input-07
  114. net heat-exchanger-motor-ol <= hm2_5i23.0.7i70.0.0.input-06
  115. net coolant-motor-ol <= hm2_5i23.0.7i70.0.0.input-05
  116. net chip-conveyor-motor-ol <= hm2_5i23.0.7i70.0.0.input-04
  117. net x-axis-motor-voltage <= hm2_5i23.0.7i70.0.0.input-03
  118. net z-axis-motor-voltage <= hm2_5i23.0.7i70.0.0.input-02
  119. net spindle-blower-motor-ol <= hm2_5i23.0.7i70.0.0.input-01
  120. net hydraulic-filter-bypassing <= hm2_5i23.0.7i70.0.0.input-00
  121.  
  122. #==============================================================================
  123.  
  124. # 7I70-2 input signals
  125.  
  126. net tailstock-up-limit <= hm2_5i23.0.7i70.0.1.input-47
  127. net axis-overtravel-pushbutton <= hm2_5i23.0.7i70.0.1.input-30
  128. net spindle-stop <= hm2_5i23.0.7i70.0.1.input-29
  129. net spindle-restart <= hm2_5i23.0.7i70.0.1.input-28
  130. net z-pos-overtravel <= hm2_5i23.0.7i70.0.1.input-27
  131. net z-neg-overtravel <= hm2_5i23.0.7i70.0.1.input-26
  132. net x-pos-overtravel <= hm2_5i23.0.7i70.0.1.input-25
  133. net x-neg-overtravel <= hm2_5i23.0.7i70.0.1.input-24
  134. net manual-tool-sel-b <= hm2_5i23.0.7i70.0.1.input-23
  135. net manual-tool-sel-a <= hm2_5i23.0.7i70.0.1.input-22
  136. net tailstock-up-sw <= hm2_5i23.0.7i70.0.1.input-21
  137. net tailstock-down-sw <= hm2_5i23.0.7i70.0.1.input-20
  138. net feedrate-percent-d <= hm2_5i23.0.7i70.0.1.input-19
  139. net feedrate-percent-c <= hm2_5i23.0.7i70.0.1.input-18
  140. net feedrate-percent-b <= hm2_5i23.0.7i70.0.1.input-17
  141. net feedrate-percent-a <= hm2_5i23.0.7i70.0.1.input-16
  142. net feed-hold <= hm2_5i23.0.7i70.0.1.input-15
  143. net cycle-start <= hm2_5i23.0.7i70.0.1.input-14
  144. net tailstock-advance <= hm2_5i23.0.7i70.0.1.input-13
  145. net spindle-neutral <= hm2_5i23.0.7i70.0.1.input-12
  146. net spindle-brake <= hm2_5i23.0.7i70.0.1.input-11
  147. net spindle-jog <= hm2_5i23.0.7i70.0.1.input-10
  148. net jaws-in-headstock <= hm2_5i23.0.7i70.0.1.input-09
  149. net jaws-out-headstock <= hm2_5i23.0.7i70.0.1.input-08
  150. net chuck-grip-OD <= hm2_5i23.0.7i70.0.1.input-07
  151. net chuck-grip-ID <= hm2_5i23.0.7i70.0.1.input-06
  152. net chuck-low-pressure <= hm2_5i23.0.7i70.0.1.input-05
  153. net lube-oil-in-resevoir <= hm2_5i23.0.7i70.0.1.input-04
  154. net lube-cycle-completed <= hm2_5i23.0.7i70.0.1.input-03
  155. net tailstock-up-permission <= hm2_5i23.0.7i70.0.1.input-02
  156. net e-stop <= hm2_5i23.0.7i70.0.1.input-01
  157. net tailstock-down-limit <= hm2_5i23.0.7i70.0.1.input-00
  158.  
  159. #==============================================================================
  160.  
  161. # 7I73 Input signals
  162.  
  163. net mpg-a encoder.0.phase-A <= hm2_5i23.0.7i73.0.2.input-08
  164. net mpg-b encoder.0.phase-B <= hm2_5i23.0.7i73.0.2.input-09
  165.  
  166. net mpg-x <= hm2_5i23.0.7i73.0.2.input-16-not
  167. net mpg-z <= hm2_5i23.0.7i73.0.2.input-17-not
  168. net scale1 <= hm2_5i23.0.7i73.0.2.input-19-not
  169. net scale2 <= hm2_5i23.0.7i73.0.2.input-20-not
  170.  
  171. #==============================================================================
  172.  
  173. # 7I71 output signals
  174. net master-control-relay <= hm2_5i23.0.7i71.0.3.output-40
  175. net hydraulic-motor-on <= hm2_5i23.0.7i71.0.3.output-39
  176. net coolant-motor <= hm2_5i23.0.7i71.0.3.output-38
  177. net chip-conveyor-fwd <= hm2_5i23.0.7i71.0.3.output-37
  178. net chip-conveyor-rev <= hm2_5i23.0.7i71.0.3.output-36
  179. net heat-exchanger-fan <= hm2_5i23.0.7i71.0.3.output-35
  180. net spindle-blower-motor-cr <= hm2_5i23.0.7i71.0.3.output-34
  181. net slide-drives-contactor <= hm2_5i23.0.7i71.0.3.output-33
  182. net x-axis-brake <= hm2_5i23.0.7i71.0.3.output-32
  183. net jaws-in-sol <= hm2_5i23.0.7i71.0.3.output-31
  184. net jaws-out-sol <= hm2_5i23.0.7i71.0.3.output-30
  185. net chuck-low-pressure <= hm2_5i23.0.7i71.0.3.output-29
  186. net tailstock-up-sol <= hm2_5i23.0.7i71.0.3.output-28
  187. net tailstock-down-sol <= hm2_5i23.0.7i71.0.3.output-27
  188. net retract-tailstock-sol <= hm2_5i23.0.7i71.0.3.output-26
  189. net advance-tailstock-sol <= hm2_5i23.0.7i71.0.3.output-25
  190. net spindle-low-range-sol <= hm2_5i23.0.7i71.0.3.output-24
  191. net spindle-high-range-sol <= hm2_5i23.0.7i71.0.3.output-23
  192. net spindle-brake-sol <= hm2_5i23.0.7i71.0.3.output-22
  193. net spindle-run-sol <= hm2_5i23.0.7i71.0.3.output-21
  194. net spindle-free-sol <= hm2_5i23.0.7i71.0.3.output-20
  195. net outer-tool-coolant-sol <= hm2_5i23.0.7i71.0.3.output-19
  196. net inner-tool-coolant-sol <= hm2_5i23.0.7i71.0.3.output-18
  197. net turret-unclamp-sol <= hm2_5i23.0.7i71.0.3.output-17
  198. net turret-index-sol <= hm2_5i23.0.7i71.0.3.output-16
  199. net slide-lube-sol <= hm2_5i23.0.7i71.0.3.output-15
  200. net fault-alert-to-spindle <= hm2_5i23.0.7i71.0.3.output-07
  201. net spindle-motor-on-command <= hm2_5i23.0.7i71.0.3.output-05
  202. net spindle-blower-motor-on <= hm2_5i23.0.7i71.0.3.output-04
  203. net spindle-stop-restart <= hm2_5i23.0.7i71.0.3.output-02
  204. net in-cycle-light <= hm2_5i23.0.7i71.0.3.output-01
  205. net feed-hold-light <= hm2_5i23.0.7i71.0.3.output-00
  206.  
  207.  
  208.  
  209. #==============================================================================
  210.  
  211. #----------------- MISC UNUSED I/O ---------------------------------
  212.  
  213. #net machine-is-enabled => hm2_5i23.0.7i71.0.3.output-
  214. #net servos-enabled <= hm2_5i23.0.7i70.0.1.input-
  215. #net axis-overtravel <= hm2_5i23.0.7i70.0.1.input-
  216.  
  217.  
  218. #==============================================================================
  219.  
  220. #----------------------- SRT ADDED LINUX-CNC LOGIC ----------------------------
  221.  
  222. net z-pos-overtravel => axis.2.pos-lim-sw-in axis.2.home-sw-in
  223. net z-neg-overtravel => axis.2.neg-lim-sw-in
  224. net x-neg-overtravel => axis.0.neg-lim-sw-in
  225. net x-pos-overtravel => axis.0.pos-lim-sw-in axis.0.home-sw-in
  226. #net drives-enable => motion.drives-enable
  227. net x-axis-homing => axis.0.homing
  228. net z-axis-homing => axis.2.homing
  229.  
  230. net program-running <= halui.program.is-running
  231. net cycle-stop <= halui.program.stop
  232. net program-pause => halui.program.pause
  233. net program-run => halui.program.run
  234. net program-resume => halui.program.resume
  235. net mode-auto => halui.mode.auto
  236. net mode-is-auto <= halui.mode.is-auto
  237. net single-line => halui.program.step
  238. net program-is-paused <= halui.program.is-paused
  239.  
  240. net flood-off => halui.flood.off
  241. net flood-on => halui.flood.on
  242.  
  243. net optional-stop-on => halui.program.optional-stop.on
  244. net optional-stop-is-on => halui.program.optional-stop.is-on
  245. net optional-stop-off => halui.program.optional-stop.off
  246.  
  247. #==============================================================================
  248.  
  249. #setp debounce.0.delay 20
  250.  
  251. #net turret-position-44 debounce.0.2.in
  252. #net turret-position-22 debounce.0.1.in
  253. #net turret-position-11 debounce.0.0.in
  254.  
  255. #net turret-position-4 debounce.0.2.out
  256. #net turret-position-2 debounce.0.1.out
  257. #net turret-position-1 debounce.0.0.out
  258.  
  259. #==============================================================================
  260.  
  261. #----------------------- Jog Pendant -----------------------------------------
  262.  
  263. setp encoder.0.x4-mode 0
  264.  
  265. setp axis.0.jog-vel-mode 1
  266. setp axis.2.jog-vel-mode 1
  267.  
  268. setp mux4.0.in0 0.000001
  269. setp mux4.0.in1 0.0000001
  270. setp mux4.0.in2 0.00000001
  271. #setp mux4.0.in3 0.0001
  272.  
  273. net mpg-scale <= mux4.0.out
  274. net mpg-scale => axis.0.jog-scale
  275. net mpg-scale => axis.2.jog-scale
  276.  
  277. setp ilowpass.0.gain 0.009
  278. setp ilowpass.0.scale 10000
  279.  
  280.  
  281.  
  282. net encoder-counts <= encoder.0.counts
  283. net encoder-counts => ilowpass.0.in
  284. net smoothed-encoder-counts <= ilowpass.0.out
  285. net smoothed-encoder-counts => axis.0.jog-counts
  286. net smoothed-encoder-counts => axis.2.jog-counts
  287.  
  288. net mpg-x <= axis.0.jog-enable
  289. net mpg-z <= axis.2.jog-enable
  290. net scale1 <= mux4.0.sel0
  291. net scale2 <= mux4.0.sel1
  292.  
  293. #==============================================================================
  294.  
  295.  
  296.  
  297. #==============================================================================
  298. #*******************
  299. # AXIS X
  300. #*******************
  301.  
  302. setp pid.x.Pgain [AXIS_0]P
  303. setp pid.x.Igain [AXIS_0]I
  304. setp pid.x.Dgain [AXIS_0]D
  305. setp pid.x.bias [AXIS_0]BIAS
  306. setp pid.x.FF0 [AXIS_0]FF0
  307. setp pid.x.FF1 [AXIS_0]FF1
  308. setp pid.x.FF2 [AXIS_0]FF2
  309. setp pid.x.deadband [AXIS_0]DEADBAND
  310. setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
  311.  
  312.  
  313. #net x-index-enable <=> pid.x.index-enable
  314. net x-enable => pid.x.enable
  315. net x-output => pid.x.output
  316. net x-pos-cmd => pid.x.command
  317. net x-pos-fb => pid.x.feedback
  318.  
  319. # ---PWM Generator signals/setup---
  320.  
  321. setp hm2_5i23.0.pwmgen.04.output-type 2
  322. setp hm2_5i23.0.pwmgen.04.scale [AXIS_0]OUTPUT_SCALE
  323.  
  324. net x-output => hm2_5i23.0.pwmgen.04.value
  325. net x-pos-cmd axis.0.motor-pos-cmd
  326. net x-enable axis.0.amp-enable-out => hm2_5i23.0.pwmgen.04.enable
  327.  
  328. # ---Reslover feedback signals/setup---
  329.  
  330. setp hm2_5i23.0.resolver.04.scale [AXIS_0]RESOLVER_SCALE
  331.  
  332. net x-pos-fb <= hm2_5i23.0.resolver.04.position
  333. net x-pos-fb => axis.0.motor-pos-fb
  334.  
  335.  
  336.  
  337.  
  338. #==============================================================================
  339. #*******************
  340. # AXIS Z
  341. #*******************
  342.  
  343. setp pid.z.Pgain [AXIS_2]P
  344. setp pid.z.Igain [AXIS_2]I
  345. setp pid.z.Dgain [AXIS_2]D
  346. setp pid.z.bias [AXIS_2]BIAS
  347. setp pid.z.FF0 [AXIS_2]FF0
  348. setp pid.z.FF1 [AXIS_2]FF1
  349. setp pid.z.FF2 [AXIS_2]FF2
  350. setp pid.z.deadband [AXIS_2]DEADBAND
  351. setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
  352.  
  353.  
  354. #net z-index-enable <=> pid.z.index-enable
  355. net z-enable => pid.z.enable
  356. net z-output => pid.z.output
  357. net z-pos-cmd => pid.z.command
  358. net z-pos-fb => pid.z.feedback
  359.  
  360.  
  361. # ---PWM Generator signals/setup---
  362.  
  363. setp hm2_5i23.0.pwmgen.02.output-type 2
  364. setp hm2_5i23.0.pwmgen.02.scale [AXIS_2]OUTPUT_SCALE
  365.  
  366. net z-output => hm2_5i23.0.pwmgen.02.value
  367. net z-pos-cmd axis.2.motor-pos-cmd
  368. net z-enable axis.2.amp-enable-out => hm2_5i23.0.pwmgen.02.enable
  369.  
  370. # ---Resolver feedback signals/setup---
  371.  
  372. setp hm2_5i23.0.resolver.02.scale [AXIS_2]RESOLVER_SCALE
  373.  
  374. net z-pos-fb <= hm2_5i23.0.resolver.02.position
  375. net z-pos-fb => axis.2.motor-pos-fb
  376.  
  377.  
  378. # ---setup home / limit switch signals---
  379.  
  380.  
  381.  
  382. #==============================================================================
  383. #*******************
  384. # SPINDLE S
  385. #*******************
  386.  
  387. # ---PWM Generator signals/setup---
  388.  
  389. setp hm2_5i23.0.pwmgen.00.output-type 2
  390. setp hm2_5i23.0.pwmgen.00.scale [SPINDLE_9]OUTPUT_SCALE
  391.  
  392.  
  393. net spindle-vel-cmd => hm2_5i23.0.pwmgen.00.value
  394. net motion.drives-enable => hm2_5i23.0.pwmgen.00.enable
  395.  
  396. # ---Resolver feedback signals/setup---
  397. setp hm2_5i23.0.resolver.00.velocity-scale 1 # motor speed in RPS
  398. setp hm2_5i23.0.resolver.00.scale [SPINDLE_9]RESOLVER_SCALE
  399. #setp hm2_5i23.0.resolver.00.lowpass.0
  400. #setp hm2_5i23.0.resolver.00.index-invert 0
  401. #setp hm2_5i23.0.resolver.00.index-mask 0
  402. #setp hm2_5i23.0.resolver.00.index-mask-invert 0
  403.  
  404. setp hm2_5i23.0.resolver.00.index-divisor 2
  405.  
  406. net spindle-revs-true <= hm2_5i23.0.resolver.00.position
  407. net spindle-vel-fb <= hm2_5i23.0.resolver.00.velocity
  408. net spindle-index-enable <=> hm2_5i23.0.resolver.00.index-enable
  409.  
  410.  
  411.  
  412. #==============================================================================
  413. # ---setup spindle control signals---
  414.  
  415. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  416. net spindle-junk <= motion.spindle-speed-out
  417. net spindle-enable <= motion.spindle-on
  418. net spindle-cw <= motion.spindle-forward
  419. net spindle-ccw <= motion.spindle-reverse
  420. #net spindle-brake <= motion.spindle-brake
  421. net spindle-revs-right => motion.spindle-revs
  422. net up-to-speed => motion.spindle-at-speed
  423. net spindle-vel-fb => motion.spindle-speed-in
  424. net spindle-index-enable <=> motion.spindle-index-enable
  425. net spindle-inhibit <= motion.spindle-inhibit
  426.  
  427. #==============================================================================
  428.  
  429. # Spindle position resolver value reverse function
  430.  
  431. setp scale.5.gain -1.0
  432.  
  433. net spindle-revs-true => scale.5.in
  434. net spindle-revs-right => scale.5.out
  435.  
  436.  
  437. #==============================================================================
  438. # Gearchange
  439.  
  440. setp gearchange.0.min1 5
  441. setp gearchange.0.max1 400
  442. setp gearchange.0.min2 19.75
  443. setp gearchange.0.max2 2240
  444. setp gearchange.0.scale2 3.9
  445.  
  446. setp gearchange.0.sel 0
  447.  
  448. setp scale.3.gain 60
  449. setp lowpass.3.gain .01
  450.  
  451. net spindle-vel-fb => lowpass.0.in
  452. net spindle-fb-filtered-rps => abs.3.in
  453. net spindle-fb-filtered-abs-rps => scale.3.in
  454. net spindle-junk => gearchange.0.speed-in
  455. net spindle-vel-cmd <= gearchange.0.speed-out
  456. net spindle-running-in-high-range => gearchange.0.sel
  457. net spindle-vel <= lowpass.3.out
  458.  
  459. #==============================================================================
  460. # Setup spindle at speed signal
  461.  
  462. #sets spindle-at-speed true
  463.  
  464. setp scale.0.gain 60
  465. setp lowpass.0.gain .009
  466.  
  467. #net spindle-vel-fb lowpass.0.in
  468. net spindle-fb-filtered-rps <= lowpass.0.out => abs.0.in
  469. net spindle-fb-filtered-abs-rps <= abs.0.out => scale.0.in
  470. net scaled-spindle-vel scale.0.out
  471.  
  472.  
  473. #==============================================================================
  474. # HALUI signals
  475.  
  476. net joint-select-a halui.joint.0.select
  477. net x-is-homed halui.joint.0.is-homed
  478. net jog-x-pos halui.jog.0.plus
  479. net jog-x-neg halui.jog.0.minus
  480. net jog-x-analog halui.jog.0.analog
  481. net joint-select-c halui.joint.2.select
  482. net z-is-homed halui.joint.2.is-homed
  483. net jog-z-pos halui.jog.2.plus
  484. net jog-z-neg halui.jog.2.minus
  485. net jog-z-analog halui.jog.2.analog
  486. net jog-selected-pos halui.jog.selected.plus
  487. net jog-selected-neg halui.jog.selected.minus
  488. net spindle-manual-cw halui.spindle.forward
  489. net spindle-manual-ccw halui.spindle.reverse
  490. net spindle-manual-stop halui.spindle.stop
  491. net spindle-manual-start halui.spindle.start
  492. net machine-is-on halui.machine.is-on
  493. net jog-speed halui.jog-speed
  494. net MDI-mode halui.mode.is-mdi
  495.  
  496.  
  497. #==============================================================================
  498. # coolant signals
  499.  
  500. #net coolant-mist <= iocontrol.0.coolant-mist
  501. net coolant-flood <= iocontrol.0.coolant-flood
  502.  
  503.  
  504. #==============================================================================
  505. # probe signal
  506.  
  507. net probe-in => motion.probe-input
  508.  
  509.  
  510. #==============================================================================
  511. # jog button signals
  512.  
  513. sets jog-speed 1.000000
  514.  
  515.  
  516. #==============================================================================
  517. # connect feed overide increments - switches
  518.  
  519. setp halui.feed-override.count-enable true
  520. setp halui.feed-override.direct-value true
  521. setp halui.feed-override.scale .01
  522. net feedoverride-incr => halui.feed-override.counts
  523. #net fo-incr-a => foincr.sel0
  524. #net fo-incr-b => foincr.sel1
  525. #net fo-incr-c => foincr.sel2
  526. #net fo-incr-d => foincr.sel3
  527.  
  528. net feedrate-percent-d foincr.sel3
  529. net feedrate-percent-c foincr.sel2
  530. net feedrate-percent-b foincr.sel1
  531. net feedrate-percent-a foincr.sel0
  532.  
  533.  
  534. net feedoverride-incr <= foincr.out-s
  535. setp foincr.debounce-time 0.200000
  536. setp foincr.use-graycode False
  537. setp foincr.suppress-no-input False
  538. setp foincr.in00 100.000000
  539. setp foincr.in01 10.000000
  540. setp foincr.in02 20.000000
  541. setp foincr.in03 30.000000
  542. setp foincr.in04 40.000000
  543. setp foincr.in05 50.000000
  544. setp foincr.in06 60.000000
  545. setp foincr.in07 70.000000
  546. setp foincr.in08 80.000000
  547. setp foincr.in09 90.000000
  548.  
  549.  
  550. setp foincr.in10 140.000000
  551. setp foincr.in11 150.000000
  552. setp foincr.in12 165.000000
  553. setp foincr.in13 180.000000
  554. setp foincr.in14 190.000000
  555. setp foincr.in15 200.000000
  556.  
  557.  
  558. #==============================================================================
  559. # connect spindle overide increments
  560.  
  561. setp halui.spindle-override.count-enable true
  562. setp halui.spindle-override.direct-value true
  563. setp halui.spindle-override.scale .01
  564. net spindleoverride-incr => halui.spindle-override.counts
  565. net so-incr-a => soincr.sel0
  566. net so-incr-b => soincr.sel1
  567. net so-incr-c => soincr.sel2
  568. net so-incr-d => soincr.sel3
  569. net spindleoverride-incr <= soincr.out-s
  570. setp soincr.debounce-time 0.200000
  571. setp soincr.use-graycode False
  572. setp soincr.suppress-no-input False
  573. setp soincr.in00 0.000000
  574. setp soincr.in01 5.000000
  575. setp soincr.in02 10.000000
  576. setp soincr.in03 25.000000
  577. setp soincr.in04 50.000000
  578. setp soincr.in05 75.000000
  579. setp soincr.in06 90.000000
  580. setp soincr.in07 100.000000
  581. setp soincr.in08 110.000000
  582. setp soincr.in09 125.000000
  583. setp soincr.in10 140.000000
  584. setp soincr.in11 150.000000
  585. setp soincr.in12 165.000000
  586. setp soincr.in13 180.000000
  587. setp soincr.in14 190.000000
  588. setp soincr.in15 200.000000
  589.  
  590.  
  591. #==============================================================================
  592. # ---motion control signals---
  593.  
  594. net in-position <= motion.in-position
  595. net machine-is-enabled <= motion.motion-enabled
  596.  
  597.  
  598.  
  599. #==============================================================================
  600. # ---estop signals---
  601.  
  602. #net estop-out <= iocontrol.0.user-enable-out
  603. #net estop-out => iocontrol.0.emc-enable-in
  604.  
  605.  
  606. #==============================================================================
  607. # ---toolchange signals for custom tool changer---
  608.  
  609. net tool-number <= iocontrol.0.tool-prep-number
  610. net tool-change-request <= iocontrol.0.tool-change
  611. net tool-change-confirmed => iocontrol.0.tool-changed
  612. net tool-prepare-request <= iocontrol.0.tool-prepare
  613. net tool-prepare-confirmed => iocontrol.0.tool-prepared
  614.  
  615.  
  616.  
  617. #==============================================================================
  618.  
  619. loadusr classicladder --nogui 15CCgmoccapy.clp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement