Advertisement
LAIR82

hal file

Sep 3rd, 2015
107
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 23.98 KB | None | 0 0
  1. # This file is loaded pre GUI
  2. # Hacked out on 4/6/15 First Version
  3.  
  4.  
  5.  
  6. loadrt trivkins
  7. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  8. loadrt hostmot2
  9. loadrt [HOSTMOT2](DRIVER) config=[HOSTMOT2](CONFIG)
  10. setp hm2_[HOSTMOT2](BOARD).0.watchdog.timeout_ns 25000000
  11.  
  12.  
  13. #setp hm2_7i80.0.pwmgen.pwm_frequency 24000
  14. #setp hm2_7i80.0.pwmgen.pdm_frequency 6000
  15. setp hm2_7i80.0.resolver.excitation-khz 2.5
  16.  
  17. loadrt classicladder_rt numRungs=200 numSections=20 numBits=50 numWords=50 numTimers=5 numMonostables=25 numCounters=30 numPhysInputs=100 numPhysOutputs=100 numS32in=20 numS32out=20 numFloatIn=20 numFloatOut=20 numTimersIec=50 numArithmExpr=200 numSymbols=600
  18.  
  19. loadrt pid names=pid.x,pid.y,pid.z
  20. loadrt abs count=5
  21. loadrt lowpass count=1
  22. loadrt scale count=4
  23. loadrt gearchange count=1
  24. loadrt mux2 count=1
  25. loadrt mux4 count=1
  26. loadrt mux16 count=2
  27. loadrt ilowpass count=1
  28. loadrt conv_float_s32 count=2
  29.  
  30. #========================================================================================
  31.  
  32. addf hm2_7i80.0.read servo-thread
  33.  
  34. addf motion-command-handler servo-thread
  35. addf motion-controller servo-thread
  36. addf classicladder.0.refresh servo-thread
  37.  
  38. addf pid.x.do-pid-calcs servo-thread
  39. addf pid.y.do-pid-calcs servo-thread
  40. addf pid.z.do-pid-calcs servo-thread
  41. addf mux2.0 servo-thread
  42. addf mux4.0 servo-thread
  43. addf mux16.0 servo-thread
  44. addf mux16.1 servo-thread
  45. addf lowpass.0 servo-thread
  46. addf abs.0 servo-thread
  47. addf abs.1 servo-thread
  48. addf abs.2 servo-thread
  49. addf abs.3 servo-thread
  50. addf abs.4 servo-thread
  51. addf scale.0 servo-thread
  52. addf scale.1 servo-thread
  53. addf scale.2 servo-thread
  54. addf scale.3 servo-thread
  55. addf gearchange.0 servo-thread
  56. addf ilowpass.0 servo-thread
  57. addf conv-float-s32.0 servo-thread
  58. addf hm2_7i80.0.write servo-thread
  59.  
  60.  
  61. #========================================================================================
  62.  
  63. # External Output signals
  64.  
  65. net hydraulic-pump => hm2_7i80.0.7i71.0.1.output-00
  66. # net => hm2_7i80.0.7i71.0.1.output-01
  67. net coolant-pump => hm2_7i80.0.7i71.0.1.output-02
  68. # net => hm2_7i80.0.7i71.0.1.output-03
  69. net drives => hm2_7i80.0.7i71.0.1.output-04
  70. net xyz-drive-power => hm2_7i80.0.7i71.0.1.output-05
  71. net tool-unclamp => hm2_7i80.0.7i71.0.1.output-06
  72. net orient-pin-in => hm2_7i80.0.7i71.0.1.output-07
  73. net low-gear => hm2_7i80.0.7i71.0.1.output-08
  74. net high-gear => hm2_7i80.0.7i71.0.1.output-09
  75. net mist-lube-air => hm2_7i80.0.7i71.0.1.output-10
  76. net external-coolant => hm2_7i80.0.7i71.0.1.output-11
  77. net mist-coolant => hm2_7i80.0.7i71.0.1.output-12
  78. net ta-down-to-head => hm2_7i80.0.7i71.0.1.output-13
  79. net ta-up-to-drum => hm2_7i80.0.7i71.0.1.output-14
  80. net ta-search-height => hm2_7i80.0.7i71.0.1.output-15
  81. net ta-storage-height => hm2_7i80.0.7i71.0.1.output-16
  82. net ta-to-head => hm2_7i80.0.7i71.0.1.output-17
  83. net ta-to-drum => hm2_7i80.0.7i71.0.1.output-18
  84. net shot-pin-out => hm2_7i80.0.7i71.0.1.output-19
  85. net rotate-drum-cw => hm2_7i80.0.7i71.0.1.output-20
  86. net rotate-drum-ccw => hm2_7i80.0.7i71.0.1.output-21
  87. net tca-to-park => hm2_7i80.0.7i71.0.1.output-22
  88. net tca-to-pos-1 => hm2_7i80.0.7i71.0.1.output-23
  89. net tca-to-pos-2 => hm2_7i80.0.7i71.0.1.output-24
  90. net tca-to-int => hm2_7i80.0.7i71.0.1.output-25
  91. net tca-in => hm2_7i80.0.7i71.0.1.output-26
  92. net tca-unclamp => hm2_7i80.0.7i71.0.1.output-27
  93. net ta-unclamp => hm2_7i80.0.7i71.0.1.output-28
  94. net air-blast => hm2_7i80.0.7i71.0.1.output-29
  95. # net => hm2_7i80.0.7i71.0.1.output-30
  96. # net => hm2_7i80.0.7i71.0.1.output-31
  97. # net => hm2_7i80.0.7i71.0.1.output-32
  98. # net => hm2_7i80.0.7i71.0.1.output-33
  99. # net => hm2_7i80.0.7i71.0.1.output-34
  100. # net => hm2_7i80.0.7i71.0.1.output-35
  101. net slides-dynamic-stop => hm2_7i80.0.7i71.0.1.output-36
  102. net slides-enable => hm2_7i80.0.7i71.0.1.output-37
  103. net spindle-enable => hm2_7i80.0.7i71.0.1.output-38
  104. net spindle-power-up => hm2_7i80.0.7i71.0.1.output-39
  105. # net => hm2_7i80.0.7i71.0.1.output-40
  106. # net z-axis-brake => hm2_7i80.0.7i71.0.1.output-41
  107. # net => hm2_7i80.0.7i71.0.1.output-42
  108. # net => hm2_7i80.0.7i71.0.1.output-43
  109. # net => hm2_7i80.0.7i71.0.1.output-44
  110. net in-cycle-led => hm2_7i80.0.7i71.0.1.output-45
  111. net feed-hold-led => hm2_7i80.0.7i71.0.1.output-46
  112. net mcr => hm2_7i80.0.7i71.0.1.output-47
  113.  
  114. #===============================================================================
  115.  
  116. # External Input signals
  117.  
  118. # net <= hm2_7i80.0.7i70.0.2.input-00
  119. # net <= hm2_7i80.0.7i70.0.2.input-01
  120. # net <= hm2_7i80.0.7i70.0.2.input-02
  121. net x-mtr-temp <= hm2_7i80.0.7i70.0.2.input-03
  122. net y-mtr-temp <= hm2_7i80.0.7i70.0.2.input-04
  123. net z-mtr-temp <= hm2_7i80.0.7i70.0.2.input-05
  124. net hydraulic-motor-ol <= hm2_7i80.0.7i70.0.2.input-06
  125. net oil-cooler-ol <= hm2_7i80.0.7i70.0.2.input-07
  126. net coolant-motor-ol <= hm2_7i80.0.7i70.0.2.input-08
  127. net spindle-fan-ol <= hm2_7i80.0.7i70.0.2.input-09
  128. # net <= hm2_7i80.0.7i70.0.2.input-10
  129. # net <= hm2_7i80.0.7i70.0.2.input-11
  130. # net hydraulic-pressure <= hm2_7i80.0.7i70.0.2.input-12
  131. net spindle-lube-pressure-ok <= hm2_7i80.0.7i70.0.2.input-13
  132. # net unclamp-tool-spdl-bttn <= hm2_7i80.0.7i70.0.2.input-14
  133. # net <= hm2_7i80.0.7i70.0.2.input-15
  134. net mpg-x <= hm2_7i80.0.7i70.0.2.input-16
  135. net mpg-y <= hm2_7i80.0.7i70.0.2.input-17
  136. net mpg-z <= hm2_7i80.0.7i70.0.2.input-18
  137. net mpg-4 <= hm2_7i80.0.7i70.0.2.input-19
  138. net scale0 <= hm2_7i80.0.7i70.0.2.input-20
  139. net scale1 <= hm2_7i80.0.7i70.0.2.input-21
  140. net scale2 <= hm2_7i80.0.7i70.0.2.input-22
  141. net e-stop-pb <= hm2_7i80.0.7i70.0.2.input-23
  142. net tool-clamped <= hm2_7i80.0.7i70.0.2.input-24
  143. net tool-absent <= hm2_7i80.0.7i70.0.2.input-25
  144. net tool-unclamped <= hm2_7i80.0.7i70.0.2.input-26
  145. net spindle-running-in-low-range <= hm2_7i80.0.7i70.0.2.input-27
  146. net spindle-in-neutral <= hm2_7i80.0.7i70.0.2.input-28
  147. net spindle-running-in-high-range <= hm2_7i80.0.7i70.0.2.input-29
  148. net orient-pin-in-ls <= hm2_7i80.0.7i70.0.2.input-30
  149. net orient-pin-out-ls <= hm2_7i80.0.7i70.0.2.input-31
  150. net shot-pin-in <= hm2_7i80.0.7i70.0.2.input-32
  151. net drum-position-strobe <= hm2_7i80.0.7i70.0.2.input-33
  152. net drum-home <= hm2_7i80.0.7i70.0.2.input-34
  153. net ta-up-at-search <= hm2_7i80.0.7i70.0.2.input-35
  154. net ta-up-at-drum <= hm2_7i80.0.7i70.0.2.input-36
  155. net ta-down-at-head <= hm2_7i80.0.7i70.0.2.input-37
  156. net ta-down-at-drum <= hm2_7i80.0.7i70.0.2.input-38
  157. net ta-rotate-at-drum <= hm2_7i80.0.7i70.0.2.input-39
  158. net ta-rotate-to-drum <= hm2_7i80.0.7i70.0.2.input-40
  159. net tca-at-park-1 <= hm2_7i80.0.7i70.0.2.input-41
  160. net tca-at-park-2 <= hm2_7i80.0.7i70.0.2.input-42
  161. net tca-at-int-1 <= hm2_7i80.0.7i70.0.2.input-43
  162. net tca-at-int-2 <= hm2_7i80.0.7i70.0.2.input-44
  163. net tca-in <= hm2_7i80.0.7i70.0.2.input-45
  164. net tca-out <= hm2_7i80.0.7i70.0.2.input-46
  165. net tool-door-open <= hm2_7i80.0.7i70.0.2.input-47
  166.  
  167. # feed-hold
  168. # z-servo-motor-overload
  169.  
  170.  
  171. # Second 7i70
  172.  
  173. net x-pos-overtravel <= hm2_7i80.0.7i70.0.3.input-00
  174. net x-neg-overtravel <= hm2_7i80.0.7i70.0.3.input-01
  175. net y-pos-overtravel <= hm2_7i80.0.7i70.0.3.input-02
  176. net y-neg-overtravel <= hm2_7i80.0.7i70.0.3.input-03
  177. net z-pos-overtravel <= hm2_7i80.0.7i70.0.3.input-04
  178. net z-neg-overtravel <= hm2_7i80.0.7i70.0.3.input-05
  179. net jog-drum <= hm2_7i80.0.7i70.0.3.input-06
  180. net spindle-fault <= hm2_7i80.0.7i70.0.3.input-07
  181. net zero-speed <= hm2_7i80.0.7i70.0.3.input-08
  182. net up-to-speed <= hm2_7i80.0.7i70.0.3.input-09
  183. net below-90-rpm <= hm2_7i80.0.7i70.0.3.input-10
  184. net carousel-estop <= hm2_7i80.0.7i70.0.3.input-11
  185. net x-servo-motor-overload <= hm2_7i80.0.7i70.0.3.input-12
  186. net y-servo-motor-overload <= hm2_7i80.0.7i70.0.3.input-13
  187.  
  188.  
  189.  
  190. #BULLSHIT
  191.  
  192. # Inputs
  193. # net tool-changer-recovery <= hm2_7i80.0.7i70.0.2.input-
  194. # net coolant-on <= hm2_7i80.0.7i70.0.2.input-
  195. # net spdl-mtr-temp <= hm2_7i80.0.7i70.0.2.input-
  196. # net mpg-4 <= hm2_7i80.0.7i70.0.2.input-
  197. # net oil-in-resevoir <= hm2_7i80.0.7i70.0.2.input-
  198.  
  199.  
  200. # Outputs
  201. # net way-lube => hm2_7i80.0.7i71.0.1.output-
  202. # net spindle-ccw => hm2_7i80.0.7i71.0.1.output-
  203. # net spindle-cw => hm2_7i80.0.7i71.0.1.output-
  204. # net spindle-alarm-reset => hm2_7i80.0.7i71.0.1.output-
  205. # net spindle-estop => hm2_7i80.0.7i71.0.1.output-
  206.  
  207. #===============================================================================
  208.  
  209. # 7I73 Input signals
  210.  
  211. net encoder-counts <= hm2_7i80.0.7i73.0.0.enc0.count
  212.  
  213. net arm-up <= hm2_7i80.0.7i73.0.0.input-10-not
  214. net arm-down <= hm2_7i80.0.7i73.0.0.input-11-not
  215. net arm-in <= hm2_7i80.0.7i73.0.0.input-12-not
  216. net arm-out <= hm2_7i80.0.7i73.0.0.input-13-not
  217. net arm-spindle <= hm2_7i80.0.7i73.0.0.input-14-not
  218. net arm-drum <= hm2_7i80.0.7i73.0.0.input-15-not
  219. net feedrate-percent-a <= hm2_7i80.0.7i73.0.0.input-16-not
  220. net feedrate-percent-b <= hm2_7i80.0.7i73.0.0.input-17-not
  221. net feedrate-percent-c <= hm2_7i80.0.7i73.0.0.input-18-not
  222. net feedrate-percent-d <= hm2_7i80.0.7i73.0.0.input-19-not
  223. net tool-unclamp-pb <= hm2_7i80.0.7i73.0.0.input-20-not
  224. net tool-changer-align <= hm2_7i80.0.7i73.0.0.input-21-not
  225. net spindle-start <= hm2_7i80.0.7i73.0.0.input-22-not
  226. net spindle-stop <= hm2_7i80.0.7i73.0.0.input-23-not
  227.  
  228. #======================= SRT ADDED =========================================
  229.  
  230. #net machine-is-enabled => hm2_7i80.0.7i71.0.3.output-12
  231. #net spindle-enable => hm2_7i80.0.7i71.0.3.output-13
  232.  
  233. net z-pos-overtravel => axis.2.pos-lim-sw-in axis.2.home-sw-in
  234. net z-neg-overtravel => axis.2.neg-lim-sw-in
  235. #net z-axis-homing => axis.2.homing
  236.  
  237. net x-neg-overtravel => axis.0.neg-lim-sw-in axis.0.home-sw-in
  238. net x-pos-overtravel => axis.0.pos-lim-sw-in
  239. #net x-axis-homing => axis.0.homing
  240.  
  241. net y-neg-overtravel => axis.1.neg-lim-sw-in axis.1.home-sw-in
  242. net y-pos-overtravel => axis.1.pos-lim-sw-in
  243. #net y-axis-homing => axis.1.homing
  244.  
  245.  
  246. #========================================================================================
  247.  
  248. # Program/Production related pins
  249.  
  250. # ---HALUI signals---
  251.  
  252. #net joint-select-a => halui.joint.0.select
  253. net x-is-homed <= halui.joint.0.is-homed
  254. net jog-x-pos => halui.jog.0.plus
  255. net jog-x-neg => halui.jog.0.minus
  256. net jog-x-analog => halui.jog.0.analog
  257.  
  258. net y-is-homed <= halui.joint.1.is-homed
  259. net jog-y-pos => halui.jog.1.plus
  260. net jog-y-neg => halui.jog.1.minus
  261. net jog-y-analog => halui.jog.1.analog
  262.  
  263. #net joint-select-c => halui.joint.2.select
  264. net z-is-homed <= halui.joint.2.is-homed
  265. net jog-z-pos => halui.jog.2.plus
  266. net jog-z-neg => halui.jog.2.minus
  267. net jog-z-analog => halui.jog.2.analog
  268.  
  269. net jog-selected-pos => halui.jog.selected.plus
  270. net jog-selected-neg => halui.jog.selected.minus
  271.  
  272. net lube-level => iocontrol.0.lube_level
  273.  
  274. net spindle-runs <= halui.spindle.runs-forward
  275. net program-running <= halui.program.is-running
  276. net cycle-stop <= halui.program.stop
  277. net program-is-paused <= halui.program.is-paused
  278. net mode-is-auto <= halui.mode.is-auto
  279. net MDI-mode <= halui.mode.is-mdi
  280. net machine-is-on <= halui.machine.is-on
  281.  
  282. net program-pause => halui.program.pause
  283. net program-run => halui.program.run
  284. net program-resume => halui.program.resume
  285. net mode-auto => halui.mode.auto
  286. net single-line => halui.program.step
  287.  
  288. net optional-stop-on => halui.program.optional-stop.on
  289. net optional-stop-is-on <= halui.program.optional-stop.is-on
  290. net optional-stop-off => halui.program.optional-stop.off
  291.  
  292. net jog-speed => halui.jog-speed
  293.  
  294. #========================================================================================
  295.  
  296. # Jog Pendant
  297.  
  298. # setp encoder.0.x4-mode 0
  299. # setp hm2_7i80.0.7i73.0.0.enc0.scale 1
  300. setp axis.0.jog-vel-mode 1
  301. setp axis.1.jog-vel-mode 1
  302. setp axis.2.jog-vel-mode 1
  303.  
  304. net smoothed-encoder-counts => axis.0.jog-counts
  305. net smoothed-encoder-counts => axis.1.jog-counts
  306. net smoothed-encoder-counts => axis.2.jog-counts
  307. net mpg-x <= axis.0.jog-enable
  308. net mpg-y <= axis.1.jog-enable
  309. net mpg-z <= axis.2.jog-enable
  310. net mpg-scale => axis.0.jog-scale
  311. net mpg-scale => axis.1.jog-scale
  312. net mpg-scale => axis.2.jog-scale
  313.  
  314. # ILOWPASS.0
  315. setp ilowpass.0.gain 0.02
  316. setp ilowpass.0.scale 100
  317. net encoder-counts => ilowpass.0.in
  318. net smoothed-encoder-counts <= ilowpass.0.out
  319.  
  320. # MUX4.0
  321. setp mux4.0.in0 0.0001
  322. setp mux4.0.in1 0.00001
  323. setp mux4.0.in2 0.000001
  324. #setp mux4.0.in3 0.0001
  325. net scale1 <= mux4.0.sel0
  326. net scale2 <= mux4.0.sel1
  327. net mpg-scale <= mux4.0.out
  328.  
  329. #========================================================================================
  330.  
  331. # X AXIS
  332.  
  333. setp pid.x.Pgain [AXIS_0]P
  334. setp pid.x.Igain [AXIS_0]I
  335. setp pid.x.Dgain [AXIS_0]D
  336. setp pid.x.bias [AXIS_0]BIAS
  337. setp pid.x.FF0 [AXIS_0]FF0
  338. setp pid.x.FF1 [AXIS_0]FF1
  339. setp pid.x.FF2 [AXIS_0]FF2
  340. setp pid.x.deadband [AXIS_0]DEADBAND
  341. setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
  342.  
  343. net x-index-enable <=> pid.x.index-enable
  344. net x-enable => pid.x.enable
  345. net x-output => pid.x.output
  346. net x-pos-cmd => pid.x.command
  347. net x-pos-fb => pid.x.feedback
  348.  
  349. # PWM Generator signals/setup
  350.  
  351. setp hm2_7i80.0.pwmgen.00.output-type 2
  352. setp hm2_7i80.0.pwmgen.00.scale [AXIS_0]OUTPUT_SCALE
  353.  
  354. net x-output => hm2_7i80.0.pwmgen.00.value
  355. net x-enable => hm2_7i80.0.pwmgen.00.enable axis.0.amp-enable-out
  356. net x-pos-cmd <= axis.0.motor-pos-cmd
  357.  
  358.  
  359. # Reslover feedback signals/setup
  360.  
  361. setp hm2_7i80.0.resolver.03.scale [AXIS_0]RESOLVER_SCALE
  362.  
  363. net x-pos-fb <= hm2_7i80.0.resolver.03.position
  364. net x-pos-fb => axis.0.motor-pos-fb
  365.  
  366. net x-output abs.2.in
  367. net x-output-abs abs.2.out
  368.  
  369.  
  370. setp scale.1.gain 1000
  371. net x-output-abs => scale.1.in
  372. net x-output-scaled <= scale.1.out
  373.  
  374.  
  375. #========================================================================================
  376.  
  377. # Y AXIS
  378.  
  379. setp pid.y.Pgain [AXIS_1]P
  380. setp pid.y.Igain [AXIS_1]I
  381. setp pid.y.Dgain [AXIS_1]D
  382. setp pid.y.bias [AXIS_1]BIAS
  383. setp pid.y.FF0 [AXIS_1]FF0
  384. setp pid.y.FF1 [AXIS_1]FF1
  385. setp pid.y.FF2 [AXIS_1]FF2
  386. setp pid.y.deadband [AXIS_1]DEADBAND
  387. setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
  388.  
  389. net y-index-enable <=> pid.y.index-enable
  390. net y-enable => pid.y.enable
  391. net y-output => pid.y.output
  392. net y-pos-cmd => pid.y.command
  393. net y-pos-fb => pid.y.feedback
  394.  
  395. # PWM Generator signals/setup
  396.  
  397. setp hm2_7i80.0.pwmgen.01.output-type 2
  398. setp hm2_7i80.0.pwmgen.01.scale [AXIS_1]OUTPUT_SCALE
  399.  
  400. net y-output => hm2_7i80.0.pwmgen.01.value
  401. net y-enable => hm2_7i80.0.pwmgen.01.enable axis.1.amp-enable-out
  402. net y-pos-cmd <= axis.1.motor-pos-cmd
  403.  
  404.  
  405. # Reslover feedback signals/setup
  406.  
  407. setp hm2_7i80.0.resolver.05.scale [AXIS_1]RESOLVER_SCALE
  408.  
  409. net y-pos-fb <= hm2_7i80.0.resolver.05.position
  410. net y-pos-fb => axis.1.motor-pos-fb
  411.  
  412.  
  413.  
  414. net y-output abs.3.in
  415. net y-output-abs abs.3.out
  416.  
  417. setp scale.2.gain 1500
  418. net y-output-abs => scale.2.in
  419. net y-output-scaled <= scale.2.out
  420.  
  421. #========================================================================================
  422.  
  423. # Z AXIS
  424.  
  425. setp pid.z.Pgain [AXIS_2]P
  426. setp pid.z.Igain [AXIS_2]I
  427. setp pid.z.Dgain [AXIS_2]D
  428. setp pid.z.bias [AXIS_2]BIAS
  429. setp pid.z.FF0 [AXIS_2]FF0
  430. setp pid.z.FF1 [AXIS_2]FF1
  431. setp pid.z.FF2 [AXIS_2]FF2
  432. setp pid.z.deadband [AXIS_2]DEADBAND
  433. setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
  434.  
  435. net z-index-enable <=> pid.z.index-enable
  436. net z-enable => pid.z.enable
  437. net z-output => pid.z.output
  438. net z-pos-cmd => pid.z.command
  439. net z-pos-fb => pid.z.feedback
  440.  
  441. # PWM Generator signals/setup
  442.  
  443. setp hm2_7i80.0.pwmgen.04.output-type 2
  444. setp hm2_7i80.0.pwmgen.04.scale [AXIS_2]OUTPUT_SCALE
  445.  
  446. net z-output => hm2_7i80.0.pwmgen.04.value
  447. net z-enable => hm2_7i80.0.pwmgen.04.enable axis.2.amp-enable-out
  448. net z-pos-cmd <= axis.2.motor-pos-cmd
  449.  
  450. # Resolver feedback signals/setup
  451.  
  452. setp hm2_7i80.0.resolver.04.scale [AXIS_2]RESOLVER_SCALE
  453.  
  454. net z-pos-fb <= hm2_7i80.0.resolver.04.position
  455. net z-pos-fb => axis.2.motor-pos-fb
  456.  
  457. net z-output abs.4.in
  458. net z-output-abs abs.4.out
  459.  
  460. setp scale.3.gain 1000
  461. net z-output-abs => scale.3.in
  462. net z-output-scaled <= scale.3.out
  463.  
  464. #========================================================================================
  465.  
  466. # SPINDLE S
  467.  
  468. # PWM Generator signals/setup
  469.  
  470. setp hm2_7i80.0.pwmgen.05.output-type 2
  471. setp hm2_7i80.0.pwmgen.05.scale [SPINDLE_9]OUTPUT_SCALE
  472.  
  473. net spindle-vel-cmd => hm2_7i80.0.pwmgen.05.value
  474. net spindle-enable => hm2_7i80.0.pwmgen.05.enable
  475.  
  476. # Encoder feedback signals/setup
  477.  
  478. setp hm2_7i80.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
  479.  
  480. net spindle-revs <= hm2_7i80.0.encoder.00.position
  481. net spindle-vel-fb <= hm2_7i80.0.encoder.00.velocity
  482. net spindle-index-enable <=> hm2_7i80.0.encoder.00.index-enable
  483.  
  484. # Spindle Control Signals
  485.  
  486. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  487. net spindle-speed-out <= motion.spindle-speed-out
  488. net spindle-enable <= motion.spindle-on
  489. net spindle-cmd-cw <= motion.spindle-forward
  490. net spindle-cmd-ccw <= motion.spindle-reverse
  491. net spindle-brake <= motion.spindle-brake
  492.  
  493. net spindle-revs => motion.spindle-revs
  494. # this signal must be hooked to the position pin of the spindle encoder
  495.  
  496. net up-to-speed => motion.spindle-at-speed
  497. net spindle-vel-fb => motion.spindle-speed-in
  498. net spindle-index-enable <=> motion.spindle-index-enable
  499. net spindle-manual-cw => halui.spindle.forward
  500. net spindle-manual-ccw => halui.spindle.reverse
  501. net spindle-manual-stop => halui.spindle.stop
  502. net spindle-manual-start => halui.spindle.start
  503. net spindle-brake-on <= halui.spindle.brake-is-on
  504.  
  505. #========================================================================================
  506.  
  507. # Sets spindle command rpm to an absolute value, then converts to an S32 value
  508.  
  509.  
  510. # ABS.1
  511. net spindle-speed-out => abs.1.in
  512. net spindle-speed-out-abs <= abs.1.out
  513.  
  514. # CONV-FLOAT-s32.0
  515. net spindle-speed-out-abs => conv-float-s32.0.in
  516. net spindle-speed-out-32 <= conv-float-s32.0.out
  517.  
  518. #========================================================================================
  519.  
  520. # Selects between CNC commanded spindle velocity, and manual spindle velocity for bumping spindle # during gearshifts
  521.  
  522. # MUX2.0
  523.  
  524. net spindle-bump => mux2.0.sel
  525. net spindle-vel-cmd <= mux2.0.out
  526. net manual-spindle-vel-cmd => mux2.0.in1
  527. net cnc-spindle-vel-cmd => mux2.0.in0
  528.  
  529.  
  530.  
  531. #========================================================================================
  532.  
  533. # Gearchange
  534.  
  535. # Gearchange.0
  536. setp gearchange.0.min1 40
  537. setp gearchange.0.max1 949
  538. setp gearchange.0.min2 950
  539. setp gearchange.0.max2 6000
  540. setp gearchange.0.scale2 6.325
  541. setp gearchange.0.sel 0
  542.  
  543. net spindle-speed-out-abs => gearchange.0.speed-in
  544. net cnc-spindle-vel-cmd <= gearchange.0.speed-out
  545. net spindle-high-gear => gearchange.0.sel
  546.  
  547. #========================================================================================
  548.  
  549. # Setup spindle at speed signal, sets spindle-at-speed true
  550.  
  551. # LOWPASS.0
  552. setp lowpass.0.gain .009
  553. net spindle-vel-fb => lowpass.0.in
  554. net spindle-fb-filtered-rps <= lowpass.0.out
  555.  
  556. # ABS.0
  557. net spindle-fb-filtered-rps => abs.0.in
  558. net spindle-fb-filtered-abs-rps <= abs.0.out
  559.  
  560. # SCALE.0
  561. setp scale.0.gain 60
  562. net spindle-fb-filtered-abs-rps => scale.0.in
  563. net scaled-spindle-vel <= scale.0.out
  564.  
  565. # CONV-FLOAT-s32.1
  566. net scaled-spindle-vel => conv-float-s32.1.in
  567. net scaled-spindle-vel-32 <= conv-float-s32.1.out
  568.  
  569. #========================================================================================
  570.  
  571. # Coolant Signals
  572.  
  573. net turn-flood-off => halui.flood.off
  574. net turn-flood-on => halui.flood.on
  575. net flood-is-on <= halui.flood.is-on
  576. net flood-on <= iocontrol.0.coolant-flood
  577.  
  578.  
  579. net turn-mist-off => halui.mist.off
  580. net turn-mist-on => halui.mist.on
  581. net mist-is-on <= halui.mist.is-on
  582. net mist-on <= iocontrol.0.coolant-mist
  583.  
  584. #========================================================================================
  585.  
  586. # Feed Overide Switch controlling both Feed Override and Max Velocity (Rapid) Overrride
  587.  
  588. net feedrate-percent-a => mux16.0.sel0 mux16.1.sel0
  589. net feedrate-percent-b => mux16.0.sel1 mux16.1.sel1
  590. net feedrate-percent-c => mux16.0.sel2 mux16.1.sel2
  591. net feedrate-percent-d => mux16.0.sel3 mux16.1.sel3
  592.  
  593. # Feed Override
  594.  
  595. setp halui.feed-override.count-enable true
  596. setp halui.feed-override.direct-value true
  597. setp halui.feed-override.scale .01
  598.  
  599. net feedoverride-incr => halui.feed-override.counts
  600. net feedoverride-incr <= mux16.0.out-s
  601.  
  602. # Mux16.0
  603.  
  604. setp mux16.0.debounce-time 0.200000
  605. setp mux16.0.use-graycode False
  606. setp mux16.0.suppress-no-input False
  607. setp mux16.0.in00 0.000000
  608. setp mux16.0.in01 10.000000
  609. setp mux16.0.in02 20.000000
  610. setp mux16.0.in03 30.000000
  611. setp mux16.0.in04 40.000000
  612. setp mux16.0.in05 50.000000
  613. setp mux16.0.in06 60.000000
  614. setp mux16.0.in07 70.000000
  615. setp mux16.0.in08 80.000000
  616. setp mux16.0.in09 90.000000
  617. setp mux16.0.in10 100.000000
  618. setp mux16.0.in11 120.000000
  619.  
  620. # Max Velocity (Rapid) Overrride
  621.  
  622. setp halui.max-velocity.count-enable true
  623. setp halui.max-velocity.direct-value true
  624. setp halui.max-velocity.scale .075
  625.  
  626. net maxvelocity-incr => halui.max-velocity.counts
  627. net maxvelocity-incr <= mux16.1.out-s
  628.  
  629. # Mux16.1
  630.  
  631. setp mux16.1.debounce-time 0.200000
  632. setp mux16.1.use-graycode False
  633. setp mux16.1.suppress-no-input False
  634. setp mux16.1.in00 0.000000
  635. setp mux16.1.in01 10.000000
  636. setp mux16.1.in02 20.000000
  637. setp mux16.1.in03 30.000000
  638. setp mux16.1.in04 40.000000
  639. setp mux16.1.in05 50.000000
  640. setp mux16.1.in06 60.000000
  641. setp mux16.1.in07 70.000000
  642. setp mux16.1.in08 80.000000
  643. setp mux16.1.in09 90.000000
  644. setp mux16.1.in10 100.000000
  645. setp mux16.1.in11 100.000000
  646.  
  647. #========================================================================================
  648.  
  649. # Motion Control Signals
  650.  
  651. net in-position <= motion.in-position
  652. net machine-is-enabled <= motion.motion-enabled
  653. net feed-inhibit => motion.feed-inhibit
  654.  
  655. #========================================================================================
  656.  
  657. # Toolchange Signals
  658.  
  659. net tool-number <= iocontrol.0.tool-prep-number
  660. net tool-change-request <= iocontrol.0.tool-change
  661. net tool-change-confirmed => iocontrol.0.tool-changed
  662. net tool-prepare-request <= iocontrol.0.tool-prepare
  663. net tool-prepare-confirmed => iocontrol.0.tool-prepared
  664. net current-tool <= iocontrol.0.tool-number
  665.  
  666. #========================================================================================
  667.  
  668. # ESTOP Chain
  669.  
  670. net estop-all-ok => iocontrol.0.emc-enable-in
  671. net emc-reset-estop => iocontrol.0.user-request-enable
  672. net emc-estop <= iocontrol.0.user-enable-out
  673.  
  674. #========================================================================================
  675.  
  676. # Load Classicladder
  677.  
  678. loadusr classicladder --nogui tommanualladder.clp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement