Advertisement
LAIR82

10VC Rotary Hal file

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