Advertisement
Guest User

XK7130 HAL first Try

a guest
May 10th, 2018
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 19.29 KB | None | 0 0
  1. # Generated by PNCconf at Thu Nov 9 12:55:45 2017
  2. # If you make changes to this file, they will be
  3. # overwritten when you run PNCconf again
  4.  
  5. loadrt trivkins
  6. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES num_dio=16
  7. loadrt hostmot2
  8. loadrt hm2_eth board_ip="10.10.10.10" config=" num_encoders=6 num_pwmgens=0 num_stepgens=5 sserial_port_0=00000x"
  9. setp hm2_7i92.0.watchdog.timeout_ns 5000000
  10. loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s
  11. loadrt abs names=abs.spindle
  12. loadrt lowpass names=lowpass.spindle
  13. loadrt scale names=scale.spindle
  14. loadrt near
  15. loadrt xor2 count=4
  16.  
  17. addf hm2_7i92.0.read servo-thread
  18. addf motion-command-handler servo-thread
  19. addf motion-controller servo-thread
  20. addf pid.x.do-pid-calcs servo-thread
  21. addf pid.y.do-pid-calcs servo-thread
  22. addf pid.z.do-pid-calcs servo-thread
  23. addf pid.a.do-pid-calcs servo-thread
  24. addf pid.s.do-pid-calcs servo-thread
  25. addf scale.spindle servo-thread
  26. addf abs.spindle servo-thread
  27. addf lowpass.spindle servo-thread
  28. addf near.0 servo-thread
  29. addf hm2_7i92.0.write servo-thread
  30. addf xor2.0 servo-thread
  31. addf xor2.1 servo-thread
  32.  
  33.  
  34. # external output signals
  35.  
  36.  
  37. # --- DIGITAL OUTPUT ---
  38. net atc-out hm2_7i92.0.7i76.0.3.output-07 <= motion.digital-out-00
  39.  
  40. net atc-in hm2_7i92.0.7i76.0.3.output-08 <= motion.digital-out-01
  41.  
  42.  
  43. # --- INCLUDES MANUAL TOOL RELEASE BUTTON INPUT BELOW ---
  44. net unclamp-tool-button xor2.0.in0 <= hm2_7i92.0.7i76.0.3.input-06
  45. net unclamp-tool-toolchange xor2.0.in1 <= motion.digital-out-02
  46. net drawbar-release hm2_7i92.0.7i76.0.3.output-03 <= xor2.0.out
  47.  
  48. net atc-fwd hm2_7i92.0.7i76.0.3.output-05 <= motion.digital-out-03
  49.  
  50. net atc-rev hm2_7i92.0.7i76.0.3.output-06 <= motion.digital-out-04
  51.  
  52.  
  53. # --- SPINDLE OREINT BEGIN ---
  54. net spindle-orient-start motion.spindle-orient hm2_7i92.0.7i77.0.0.output-08
  55.  
  56.  
  57.  
  58. # --- X-ENABLE ---
  59. net x-enable hm2_7i92.0.7i76.0.3.output-12
  60.  
  61. # --- Y-ENABLE ---
  62. net y-enable hm2_7i92.0.7i76.0.3.output-13
  63.  
  64. # --- Z-ENABLE ---
  65. net z-enable hm2_7i92.0.7i76.0.3.output-14
  66.  
  67. # --- A-ENABLE ---
  68. net a-enable hm2_7i92.0.7i76.0.3.output-15
  69.  
  70.  
  71. # --- FLOOD COOLANT ---
  72. net coolant-flood hm2_7i92.0.7i76.0.3.output-04 <= xor2.1.out
  73.  
  74.  
  75. # external input signals
  76.  
  77.  
  78.  
  79.  
  80. # --- SPINDLE ORIENT ENDED ---
  81. net spindle-orient-end motion.spindle-is-oriented hm2_7i92.0.7i77.0.0.input-31
  82.  
  83.  
  84. # --- ESTOP-EXT ---
  85. net estop-ext <= hm2_7i92.0.7i76.0.3.input-21-not
  86.  
  87. # --- PROBE-IN ---
  88. net probe-in <= hm2_7i92.0.7i77.0.0.input-15
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100. # --- DIGITAL INPUTS ---
  101. net atc-is-out hm2_7i92.0.7i76.0.3.input-00 <= motion.digital-in-00
  102.  
  103. net atc-is-in hm2_7i92.0.7i76.0.3.input-01 <= motion.digital-in-01
  104.  
  105. net Tool-Released hm2_7i92.0.7i76.0.3.input-05 <= motion.digital-in-02
  106.  
  107. net Atc-Zero hm2_7i92.0.7i76.0.3.input-03 <= motion.digital-in-03
  108.  
  109. net Atc-Index hm2_7i92.0.7i76.0.3.input-02 <= motion.digital-in-04
  110.  
  111. net Tool-Clamped hm2_7i92.0.7i76.0.3.input-07 <= motion.digital-in-05
  112.  
  113.  
  114.  
  115. # --- MIN-Z ---
  116. net min-z <= hm2_7i92.0.7i77.0.0.input-06-not
  117.  
  118. # --- HOME-Z ---
  119. net home-z <= hm2_7i92.0.7i77.0.0.input-07-not
  120.  
  121. # --- MAX-Z ---
  122. net max-z <= hm2_7i92.0.7i77.0.0.input-08-not
  123.  
  124. # --- HOME-Y ---
  125. net home-y <= hm2_7i92.0.7i77.0.0.input-04-not
  126.  
  127. # --- MIN-Y ---
  128. net min-y <= hm2_7i92.0.7i77.0.0.input-03-not
  129.  
  130. # --- MAX-Y ---
  131. net max-y <= hm2_7i92.0.7i77.0.0.input-05-not
  132.  
  133. # --- HOME-X ---
  134. net home-x <= hm2_7i92.0.7i77.0.0.input-01-not
  135.  
  136. # --- MAX-X ---
  137. net max-x <= hm2_7i92.0.7i77.0.0.input-02-not
  138.  
  139. # --- MIN-X ---
  140. net min-x <= hm2_7i92.0.7i77.0.0.input-00-not
  141.  
  142. #*******************
  143. # AXIS X
  144. #*******************
  145.  
  146. setp pid.x.Pgain [AXIS_0]P
  147. setp pid.x.Igain [AXIS_0]I
  148. setp pid.x.Dgain [AXIS_0]D
  149. setp pid.x.bias [AXIS_0]BIAS
  150. setp pid.x.FF0 [AXIS_0]FF0
  151. setp pid.x.FF1 [AXIS_0]FF1
  152. setp pid.x.FF2 [AXIS_0]FF2
  153. setp pid.x.deadband [AXIS_0]DEADBAND
  154. setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
  155. setp pid.x.error-previous-target true
  156. setp pid.x.maxerror .0005
  157.  
  158. net x-index-enable <=> pid.x.index-enable
  159. net x-enable => pid.x.enable
  160. net x-pos-cmd => pid.x.command
  161. net x-vel-cmd => pid.x.command-deriv
  162. net x-pos-fb => pid.x.feedback
  163. net x-output => pid.x.output
  164.  
  165. # Step Gen signals/setup
  166.  
  167. setp hm2_7i92.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
  168. setp hm2_7i92.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
  169. setp hm2_7i92.0.stepgen.00.steplen [AXIS_0]STEPLEN
  170. setp hm2_7i92.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
  171. setp hm2_7i92.0.stepgen.00.position-scale [AXIS_0]STEP_SCALE
  172. setp hm2_7i92.0.stepgen.00.step_type 0
  173. setp hm2_7i92.0.stepgen.00.control-type 1
  174. setp hm2_7i92.0.stepgen.00.maxaccel [AXIS_0]STEPGEN_MAXACCEL
  175. setp hm2_7i92.0.stepgen.00.maxvel [AXIS_0]STEPGEN_MAXVEL
  176.  
  177. # ---closedloop stepper signals---
  178.  
  179. net x-pos-cmd <= axis.0.motor-pos-cmd
  180. net x-vel-cmd <= axis.0.joint-vel-cmd
  181. net x-output <= hm2_7i92.0.stepgen.00.velocity-cmd
  182. net x-pos-fb <= hm2_7i92.0.stepgen.00.position-fb
  183. net x-pos-fb => axis.0.motor-pos-fb
  184. net x-enable <= axis.0.amp-enable-out
  185. net x-enable => hm2_7i92.0.stepgen.00.enable
  186.  
  187.  
  188.  
  189. # ---Encoder feedback signals/setup---
  190.  
  191. setp hm2_7i92.0.encoder.01.counter-mode 0
  192. setp hm2_7i92.0.encoder.01.filter 1
  193. setp hm2_7i92.0.encoder.01.index-invert 0
  194. setp hm2_7i92.0.encoder.01.index-mask 0
  195. setp hm2_7i92.0.encoder.01.index-mask-invert 0
  196. setp hm2_7i92.0.encoder.01.scale [AXIS_0]ENCODER_SCALE
  197.  
  198. net x-encpos-fb <= hm2_7i92.0.encoder.01.position
  199. ##net x-vel-fb <= hm2_7i92.0.encoder.01.velocity
  200. ##net x-encpos-fb => axis.0.motor-pos-fb
  201. net x-index-enable axis.0.index-enable <=> hm2_7i92.0.encoder.01.index-enable
  202. net x-pos-rawcounts <= hm2_7i92.0.encoder.01.rawcounts
  203.  
  204.  
  205.  
  206. # ---setup home / limit switch signals---
  207.  
  208. net home-x => axis.0.home-sw-in
  209. net min-x => axis.0.neg-lim-sw-in
  210. net max-x => axis.0.pos-lim-sw-in
  211.  
  212. #*******************
  213. # AXIS Y
  214. #*******************
  215.  
  216. setp pid.y.Pgain [AXIS_1]P
  217. setp pid.y.Igain [AXIS_1]I
  218. setp pid.y.Dgain [AXIS_1]D
  219. setp pid.y.bias [AXIS_1]BIAS
  220. setp pid.y.FF0 [AXIS_1]FF0
  221. setp pid.y.FF1 [AXIS_1]FF1
  222. setp pid.y.FF2 [AXIS_1]FF2
  223. setp pid.y.deadband [AXIS_1]DEADBAND
  224. setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
  225. setp pid.y.error-previous-target true
  226. setp pid.y.maxerror .0005
  227.  
  228. net y-index-enable <=> pid.y.index-enable
  229. net y-enable => pid.y.enable
  230. net y-pos-cmd => pid.y.command
  231. net y-vel-cmd => pid.y.command-deriv
  232. net y-pos-fb => pid.y.feedback
  233. net y-output => pid.y.output
  234.  
  235. # Step Gen signals/setup
  236.  
  237. setp hm2_7i92.0.stepgen.01.dirsetup [AXIS_1]DIRSETUP
  238. setp hm2_7i92.0.stepgen.01.dirhold [AXIS_1]DIRHOLD
  239. setp hm2_7i92.0.stepgen.01.steplen [AXIS_1]STEPLEN
  240. setp hm2_7i92.0.stepgen.01.stepspace [AXIS_1]STEPSPACE
  241. setp hm2_7i92.0.stepgen.01.position-scale [AXIS_1]STEP_SCALE
  242. setp hm2_7i92.0.stepgen.01.step_type 0
  243. setp hm2_7i92.0.stepgen.01.control-type 1
  244. setp hm2_7i92.0.stepgen.01.maxaccel [AXIS_1]STEPGEN_MAXACCEL
  245. setp hm2_7i92.0.stepgen.01.maxvel [AXIS_1]STEPGEN_MAXVEL
  246.  
  247. # ---closedloop stepper signals---
  248.  
  249. net y-pos-cmd <= axis.1.motor-pos-cmd
  250. net y-vel-cmd <= axis.1.joint-vel-cmd
  251. net y-output <= hm2_7i92.0.stepgen.01.velocity-cmd
  252. net y-pos-fb <= hm2_7i92.0.stepgen.01.position-fb
  253. net y-pos-fb => axis.1.motor-pos-fb
  254. net y-enable <= axis.1.amp-enable-out
  255. net y-enable => hm2_7i92.0.stepgen.01.enable
  256.  
  257. # ---Encoder feedback signals/setup---
  258.  
  259. setp hm2_7i92.0.encoder.02.counter-mode 0
  260. setp hm2_7i92.0.encoder.02.filter 1
  261. setp hm2_7i92.0.encoder.02.index-invert 0
  262. setp hm2_7i92.0.encoder.02.index-mask 0
  263. setp hm2_7i92.0.encoder.02.index-mask-invert 0
  264. setp hm2_7i92.0.encoder.02.scale [AXIS_1]ENCODER_SCALE
  265.  
  266. net y-encpos-fb <= hm2_7i92.0.encoder.02.position
  267. ##net y-vel-fb <= hm2_7i92.0.encoder.02.velocity
  268. ##net y-pos-fb => axis.1.motor-pos-fb
  269. net y-index-enable axis.1.index-enable <=> hm2_7i92.0.encoder.02.index-enable
  270. net y-pos-rawcounts <= hm2_7i92.0.encoder.02.rawcounts
  271.  
  272.  
  273.  
  274. # ---setup home / limit switch signals---
  275.  
  276. net home-y => axis.1.home-sw-in
  277. net min-y => axis.1.neg-lim-sw-in
  278. net max-y => axis.1.pos-lim-sw-in
  279.  
  280. #*******************
  281. # AXIS Z
  282. #*******************
  283.  
  284. setp pid.z.Pgain [AXIS_2]P
  285. setp pid.z.Igain [AXIS_2]I
  286. setp pid.z.Dgain [AXIS_2]D
  287. setp pid.z.bias [AXIS_2]BIAS
  288. setp pid.z.FF0 [AXIS_2]FF0
  289. setp pid.z.FF1 [AXIS_2]FF1
  290. setp pid.z.FF2 [AXIS_2]FF2
  291. setp pid.z.deadband [AXIS_2]DEADBAND
  292. setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
  293. setp pid.z.error-previous-target true
  294. setp pid.z.maxerror .0005
  295.  
  296. net z-index-enable <=> pid.z.index-enable
  297. net z-enable => pid.z.enable
  298. net z-pos-cmd => pid.z.command
  299. net z-vel-cmd => pid.z.command-deriv
  300. net z-pos-fb => pid.z.feedback
  301. net z-output => pid.z.output
  302.  
  303. # Step Gen signals/setup
  304.  
  305. setp hm2_7i92.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
  306. setp hm2_7i92.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
  307. setp hm2_7i92.0.stepgen.02.steplen [AXIS_2]STEPLEN
  308. setp hm2_7i92.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
  309. setp hm2_7i92.0.stepgen.02.position-scale [AXIS_2]STEP_SCALE
  310. setp hm2_7i92.0.stepgen.02.step_type 0
  311. setp hm2_7i92.0.stepgen.02.control-type 1
  312. setp hm2_7i92.0.stepgen.02.maxaccel [AXIS_2]STEPGEN_MAXACCEL
  313. setp hm2_7i92.0.stepgen.02.maxvel [AXIS_2]STEPGEN_MAXVEL
  314.  
  315. # ---closedloop stepper signals---
  316.  
  317. net z-pos-cmd <= axis.2.motor-pos-cmd
  318. net z-vel-cmd <= axis.2.joint-vel-cmd
  319. net z-output <= hm2_7i92.0.stepgen.02.velocity-cmd
  320. net z-pos-fb <= hm2_7i92.0.stepgen.02.position-fb
  321. net z-pos-fb => axis.2.motor-pos-fb
  322. net z-enable <= axis.2.amp-enable-out
  323. net z-enable => hm2_7i92.0.stepgen.02.enable
  324.  
  325.  
  326. # ---Encoder feedback signals/setup---
  327.  
  328. setp hm2_7i92.0.encoder.04.counter-mode 0
  329. setp hm2_7i92.0.encoder.04.filter 1
  330. setp hm2_7i92.0.encoder.04.index-invert 0
  331. setp hm2_7i92.0.encoder.04.index-mask 0
  332. setp hm2_7i92.0.encoder.04.index-mask-invert 0
  333. setp hm2_7i92.0.encoder.04.scale [AXIS_2]ENCODER_SCALE
  334.  
  335. net z-encpos-fb <= hm2_7i92.0.encoder.04.position
  336. ##net z-vel-fb <= hm2_7i92.0.encoder.04.velocity
  337. ##net z-pos-fb => axis.2.motor-pos-fb
  338. net z-index-enable axis.2.index-enable <=> hm2_7i92.0.encoder.04.index-enable
  339. net z-pos-rawcounts <= hm2_7i92.0.encoder.04.rawcounts
  340.  
  341.  
  342.  
  343. # ---setup home / limit switch signals---
  344.  
  345. net home-z => axis.2.home-sw-in
  346. net min-z => axis.2.neg-lim-sw-in
  347. net max-z => axis.2.pos-lim-sw-in
  348.  
  349. #*******************
  350. # AXIS A
  351. #*******************
  352.  
  353. setp pid.a.Pgain [AXIS_3]P
  354. setp pid.a.Igain [AXIS_3]I
  355. setp pid.a.Dgain [AXIS_3]D
  356. setp pid.a.bias [AXIS_3]BIAS
  357. setp pid.a.FF0 [AXIS_3]FF0
  358. setp pid.a.FF1 [AXIS_3]FF1
  359. setp pid.a.FF2 [AXIS_3]FF2
  360. setp pid.a.deadband [AXIS_3]DEADBAND
  361. setp pid.a.maxoutput [AXIS_3]MAX_OUTPUT
  362. setp pid.a.error-previous-target true
  363. setp pid.a.maxerror .0005
  364.  
  365. net a-index-enable <=> pid.a.index-enable
  366. net a-enable => pid.a.enable
  367. net a-pos-cmd => pid.a.command
  368. net a-vel-cmd => pid.a.command-deriv
  369. net a-pos-fb => pid.a.feedback
  370. net a-output => pid.a.output
  371.  
  372. # Step Gen signals/setup
  373.  
  374. setp hm2_7i92.0.stepgen.03.dirsetup [AXIS_3]DIRSETUP
  375. setp hm2_7i92.0.stepgen.03.dirhold [AXIS_3]DIRHOLD
  376. setp hm2_7i92.0.stepgen.03.steplen [AXIS_3]STEPLEN
  377. setp hm2_7i92.0.stepgen.03.stepspace [AXIS_3]STEPSPACE
  378. setp hm2_7i92.0.stepgen.03.position-scale [AXIS_3]STEP_SCALE
  379. setp hm2_7i92.0.stepgen.03.step_type 0
  380. setp hm2_7i92.0.stepgen.03.control-type 1
  381. setp hm2_7i92.0.stepgen.03.maxaccel [AXIS_3]STEPGEN_MAXACCEL
  382. setp hm2_7i92.0.stepgen.03.maxvel [AXIS_3]STEPGEN_MAXVEL
  383.  
  384. # ---closedloop stepper signals---
  385.  
  386. net a-pos-cmd <= axis.3.motor-pos-cmd
  387. net a-vel-cmd <= axis.3.joint-vel-cmd
  388. net a-output <= hm2_7i92.0.stepgen.03.velocity-cmd
  389. net a-pos-fb <= hm2_7i92.0.stepgen.03.position-fb
  390. net a-pos-fb => axis.3.motor-pos-fb
  391. net a-enable <= axis.3.amp-enable-out
  392. net a-enable => hm2_7i92.0.stepgen.03.enable
  393.  
  394. # ---Encoder feedback signals/setup---
  395.  
  396. setp hm2_7i92.0.encoder.05.counter-mode 0
  397. setp hm2_7i92.0.encoder.05.filter 1
  398. setp hm2_7i92.0.encoder.05.index-invert 0
  399. setp hm2_7i92.0.encoder.05.index-mask 0
  400. setp hm2_7i92.0.encoder.05.index-mask-invert 0
  401. setp hm2_7i92.0.encoder.05.scale [AXIS_3]ENCODER_SCALE
  402.  
  403. net a-encpos-fb <= hm2_7i92.0.encoder.05.position
  404. ##net a-vel-fb <= hm2_7i92.0.encoder.05.velocity
  405. ##net a-pos-fb => axis.3.motor-pos-fb
  406. net a-index-enable axis.3.index-enable <=> hm2_7i92.0.encoder.05.index-enable
  407. net a-pos-rawcounts <= hm2_7i92.0.encoder.05.rawcounts
  408.  
  409.  
  410.  
  411. # ---setup home / limit switch signals---
  412.  
  413. net a-home-sw => axis.3.home-sw-in
  414. net a-neg-limit => axis.3.neg-lim-sw-in
  415. net a-pos-limit => axis.3.pos-lim-sw-in
  416.  
  417. #*******************
  418. # SPINDLE S
  419. #*******************
  420.  
  421. setp pid.s.Pgain [SPINDLE_9]P
  422. setp pid.s.Igain [SPINDLE_9]I
  423. setp pid.s.Dgain [SPINDLE_9]D
  424. setp pid.s.bias [SPINDLE_9]BIAS
  425. setp pid.s.FF0 [SPINDLE_9]FF0
  426. setp pid.s.FF1 [SPINDLE_9]FF1
  427. setp pid.s.FF2 [SPINDLE_9]FF2
  428. setp pid.s.deadband [SPINDLE_9]DEADBAND
  429. setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
  430. setp pid.s.error-previous-target true
  431.  
  432. net spindle-index-enable <=> pid.s.index-enable
  433. net spindle-enable => pid.s.enable
  434. net spindle-vel-cmd-rpm-abs => pid.s.command
  435. net spindle-vel-fb-rpm-abs => pid.s.feedback
  436. net spindle-output <= pid.s.output
  437.  
  438. # ---PWM Generator signals/setup---
  439.  
  440. setp hm2_7i92.0.7i77.0.1.analogout0-scalemax [SPINDLE_9]OUTPUT_SCALE
  441. setp hm2_7i92.0.7i77.0.1.analogout0-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
  442. setp hm2_7i92.0.7i77.0.1.analogout0-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
  443.  
  444. net spindle-output => hm2_7i92.0.7i77.0.1.analogout0
  445. net spindle-enable hm2_7i92.0.7i77.0.1.analogena
  446.  
  447. # ---Encoder feedback signals/setup---
  448.  
  449. setp hm2_7i92.0.encoder.00.counter-mode 0
  450. setp hm2_7i92.0.encoder.00.filter 1
  451. setp hm2_7i92.0.encoder.00.index-invert 0
  452. setp hm2_7i92.0.encoder.00.index-mask 0
  453. setp hm2_7i92.0.encoder.00.index-mask-invert 0
  454. setp hm2_7i92.0.encoder.00.scale [SPINDLE_9]ENCODER_SCALE
  455.  
  456. net spindle-revs <= hm2_7i92.0.encoder.00.position
  457. net spindle-vel-fb-rps <= hm2_7i92.0.encoder.00.velocity
  458. net spindle-index-enable <=> hm2_7i92.0.encoder.00.index-enable
  459.  
  460. # ---setup spindle control signals---
  461.  
  462. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  463. net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
  464. net spindle-vel-cmd-rpm <= motion.spindle-speed-out
  465. net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
  466. net spindle-enable <= motion.spindle-on
  467. net spindle-cw <= motion.spindle-forward
  468. net spindle-ccw <= motion.spindle-reverse
  469. net spindle-brake <= motion.spindle-brake
  470. net spindle-revs => motion.spindle-revs
  471. net spindle-at-speed => motion.spindle-at-speed
  472. net spindle-vel-fb-rps => motion.spindle-speed-in
  473. net spindle-index-enable <=> motion.spindle-index-enable
  474.  
  475. # ---Setup spindle at speed signals---
  476.  
  477. net spindle-vel-cmd-rps => near.0.in1
  478. net spindle-vel-fb-rps => near.0.in2
  479.  
  480. ##########################
  481. net spindle-at-speed <= near.0.out
  482. ##########################
  483. setp near.0.scale 1.000000
  484. ##########################
  485. setp near.0.difference 5
  486.  
  487. ##sets spindle-at-speed true
  488.  
  489. # Use ACTUAL spindle velocity from spindle encoder
  490. # spindle-velocity bounces around so we filter it with lowpass
  491. # spindle-velocity is signed so we use absolute component to remove sign
  492. # ACTUAL velocity is in RPS not RPM so we scale it.
  493.  
  494. setp scale.spindle.gain 60
  495. setp lowpass.spindle.gain 1.000000
  496. net spindle-vel-fb-rps => scale.spindle.in
  497. net spindle-fb-rpm scale.spindle.out => abs.spindle.in
  498. net spindle-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
  499. net spindle-fb-rpm-abs-filtered lowpass.spindle.out
  500.  
  501. #******************************
  502. # connect miscellaneous signals
  503. #******************************
  504.  
  505. # ---HALUI signals---
  506. ## BELOW COMMENTED OUT FOR PENDANT TO WORK
  507. net joint-select-a halui.joint.0.select
  508. net x-is-homed halui.joint.0.is-homed
  509. ##net jog-x-pos halui.jog.0.plus
  510. ##net jog-x-neg halui.jog.0.minus
  511. net jog-x-analog halui.jog.0.analog
  512. net joint-select-b halui.joint.1.select
  513. net y-is-homed halui.joint.1.is-homed
  514. ##net jog-y-pos halui.jog.1.plus
  515. ##net jog-y-neg halui.jog.1.minus
  516. net jog-y-analog halui.jog.1.analog
  517. net joint-select-c halui.joint.2.select
  518. net z-is-homed halui.joint.2.is-homed
  519. ##net jog-z-pos halui.jog.2.plus
  520. ##net jog-z-neg halui.jog.2.minus
  521. net jog-z-analog halui.jog.2.analog
  522. net joint-select-d halui.joint.3.select
  523. net a-is-homed halui.joint.3.is-homed
  524. ##net jog-a-pos halui.jog.3.plus
  525. ##net jog-a-neg halui.jog.3.minus
  526. net jog-a-analog halui.jog.3.analog
  527. net jog-selected-pos halui.jog.selected.plus
  528. net jog-selected-neg halui.jog.selected.minus
  529. net spindle-manual-cw halui.spindle.forward
  530. net spindle-manual-ccw halui.spindle.reverse
  531. net spindle-manual-stop halui.spindle.stop
  532.  
  533. ## BELOW COMMENTED OUT FOR PENDANT TO WORK
  534. ##net machine-is-on halui.machine.is-on
  535. net jog-speed halui.jog-speed
  536. net MDI-mode halui.mode.is-mdi
  537.  
  538.  
  539. # ---tool release---
  540.  
  541.  
  542.  
  543. # ---coolant signals---
  544.  
  545. net coolant-mist <= iocontrol.0.coolant-mist
  546.  
  547.  
  548. # ---probe signal---
  549.  
  550. net probe-in => motion.probe-input
  551.  
  552. # ---motion control signals---
  553.  
  554. ## BELOW COMMENTED OUT FOR PENDANT TO WORK
  555.  
  556. ##net in-position <= motion.in-position
  557. net machine-is-enabled <= motion.motion-enabled
  558.  
  559. # ---digital in / out signals---
  560.  
  561.  
  562. # ---estop signals---
  563.  
  564. net estop-out <= iocontrol.0.user-enable-out
  565. net estop-ext => iocontrol.0.emc-enable-in
  566.  
  567. # ---manual tool change signals---
  568.  
  569. #loadusr -W hal_manualtoolchange
  570. #net tool-change-request iocontrol.0.tool-change => hal_manualtoolchange.change
  571. #net tool-change-confirmed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  572. #net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  573.  
  574.  
  575. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
  576.  
  577. net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement