Advertisement
Guest User

Untitled

a guest
Sep 19th, 2015
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 26.35 KB | None | 0 0
  1. nitial file was generated in PNCconf then edited to line up the PINS along each TB on the MESA 7i77 & 7i84. Was just easier for cataloguing on the back end of things.
  2.  
  3. # Generated by PNCconf at Mon Sep 14 12:03:23 2015
  4. # If you make changes to this file, they will be
  5. # overwritten when you run PNCconf again
  6.  
  7. ###Statistics
  8. ###INPUTS =
  9.  
  10.  
  11. loadrt trivkins
  12. loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  13. loadrt hostmot2
  14. loadrt hm2_pci config=" num_encoders=6 num_pwmgens=0 num_stepgens=0 sserial_port_0=000xxx"
  15. setp hm2_5i25.0.watchdog.timeout_ns 5000000
  16. loadrt pid names=pid.x,pid.y,pid.z,pid.a,pid.s
  17. loadrt abs names=abs.spindle
  18. loadrt lowpass names=lowpass.spindle
  19. loadrt scale names=scale.spindle
  20. loadrt classicladder_rt numPhysInputs=15 numPhysOutputs=15 numS32in=10 numS32out=10 numFloatIn=10 numFloatOut=10 numBits=50 numWords=50
  21.  
  22. addf hm2_5i25.0.read servo-thread
  23. addf motion-command-handler servo-thread
  24. addf motion-controller servo-thread
  25. addf pid.x.do-pid-calcs servo-thread
  26. addf pid.y.do-pid-calcs servo-thread
  27. addf pid.z.do-pid-calcs servo-thread
  28. addf pid.a.do-pid-calcs servo-thread
  29. addf pid.s.do-pid-calcs servo-thread
  30. addf classicladder.0.refresh servo-thread
  31. addf scale.spindle servo-thread
  32. addf abs.spindle servo-thread
  33. addf lowpass.spindle servo-thread
  34. addf hm2_5i25.0.write servo-thread
  35.  
  36. # 7i77 i/o
  37. #TB8
  38. ####INPUTS
  39. #-----------------------------------------------------------------------------------------
  40. # 01 Signal Source- VFD; Output=Volts, rate 3amp/volt
  41. # net spindle_current <= hm2_5i25.0.7i77.0.0.input-00
  42. # <NOT ABLE TO READ THE VOLTAGE OUT FROM CARD>
  43.  
  44. # 02 Signal Source- dial potentiometer on the physical machine panel, 0-24V; 50-150%
  45. net sso <= hm2_5i25.0.7i77.0.0.input-01
  46. # <NOT ABLE TO READ VOLTAGE OUT, ONLY ACTIVE/INACTIVE IN HAL> <INTEGRATE WITH PYVCP FOR OVERRIDE PERCENTAGE>
  47.  
  48. # 03 Signal Source- dial potentiometer on the physical machine panel, 0-24V; 0-200% <NOT CONNECTED TO READ VOLTAGE OUT>
  49. net fro <= hm2_5i25.0.7i77.0.0.input-02
  50. # <NOT ABLE TO READ VOLTAGE OUT, ONLY ACTIVE/INACTIVE IN HAL> <INTEGRATE WITH PYVCP FOR OVERRIDE PERCENTAGE>
  51.  
  52. # 04 Signal Source- Toggle Button on the physical machine panel, shared with Off, On = +24V, Off = +0V
  53. net power-on-button hm2_5i25.0.7i77.0.0.input-03
  54. # <BUTTON OPERATIONAL> <WRITE HAL CODE TO TOGGLE ON>
  55.  
  56. # 05 Signal Source- Toggle Button on the physical machine panel, shared with Off, On = +24V, Off = +0V, connected and pin read
  57. net power-off-button <= hm2_5i25.0.7i77.0.0.input-04-not
  58. # <BUTTON OPERATIONAL> <WRITE HAL CODE TO TOGGLE OFF>
  59.  
  60. # 06 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-05
  61.  
  62. # 07 Signal Source- E-Stop Button on the physical machine panel, Button Out = +24v, Button In = +0v
  63. net estop-ext <= hm2_5i25.0.7i77.0.0.input-06
  64. # <FULLY OPERATIONAL>
  65.  
  66. # 08 Signal Source- Toggle button labeled "Platter Up/Down" on the physical machine panel, Button Out = +24v, Button In = +0v
  67. net spindle-up-down <= hm2_5i25.0.7i77.0.0.input-07-not
  68. # <BUTTON OPERATIONAL> <INTEGRATE WITH MOVING THE MACHINE HEAD BETWEEN HOME HALL DETECTOR AND CURRENT POSITION>
  69.  
  70. # 09 Signal Source- Toggle button labeled "Index Platter" on the physical machine panel, Button Out = +24v, Button In = +0v
  71. net spindle-index <= hm2_5i25.0.7i77.0.0.input-08-not
  72. # <BUTTON OPERATIONAL> <INTEGRATE TO MOVE THE SPINDLE TO THE PRESCRIBED INDEXED POINT>
  73.  
  74. # 10 Signal Source- Toggle button labeled "Drawbar Clamp/Unclamp" on the physical machine panel, Button Out = +24v, Button In = +0v
  75. net open-drawbar <= hm2_5i25.0.7i77.0.0.input-09-not
  76. # <FULLY OPERATIONAL>
  77.  
  78. # 11 Signal Source- Hall Effect Sensor on the Power Drawbar Pneumatic Motor, untested sensor
  79. # <NOT CONNECTED> net drawbar_sensor <= hm2_5i25.0.7i77.0.0.input-10
  80. # <TEST SWITCH> <CONNECT SWITCH TO MESA> <SIGNAL IS USED WITH ATC TO INDICATE DRAWBAR IS OPEN/CLOSED>
  81.  
  82. # 12 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-011
  83.  
  84. # 13 Signal Source- Toggle button labeled "Cycle Start" on the physical machine panel, Button Out = +0v, Button In = +24v
  85. net cycle-start halui.program.run <= hm2_5i25.0.7i77.0.0.input-12
  86. # <FULLY OPERATIONAL>
  87.  
  88. # 14 Signal Source- Toggle button labeled "Cycle Stop" on the physical machine panel, Button Out = +24v, Button In = +0v
  89. net abort halui.abort <= hm2_5i25.0.7i77.0.0.input-13-not
  90. # <FULLY OPERATIONAL>
  91.  
  92. # 15 Signal Source - Moellar electric door lock, Door Locked = +24V, Door Unlocked = +0v, PYVCP, LOCKED = GREEN, UNLOCKED = RED
  93. net door-locked-indicator <= hm2_5i25.0.7i77.0.0.input-14
  94. # <SIGNAL OPERATIONAL> <SET TO LOCK WHEN HALUI.PROGRAM-RUN = TRUE>
  95.  
  96. # 16 Signal Source - Moellar electric door lock, Door Closed = +24V, Door Open = +0V, PYVCP, DOOR CLOSED = GREEN, OPEN = RED
  97. net door-closed-indicator hm2_5i25.0.7i77.0.0.input-15
  98. # <FULLY OPERATIONAL>
  99.  
  100. #-----------------------------------------------------------------------------------------
  101. #OUTPUTS
  102. # 17 Signal Destination- X Axis Servo Amplifier, Fault Reset, Pullup Used
  103. net x-reset => hm2_5i25.0.7i77.0.0.output-00
  104. # <SIGNAL OPERATIONAL> <CURRENTLY PYVCP BUTTON>
  105.  
  106. # 18 Signal Destination- Y Axis Servo Amplifier, Fault Reset, Pullup Used, untested
  107. net y-reset => hm2_5i25.0.7i77.0.0.output-01
  108. # <SIGNAL OPERATIONAL> <CURRENTLY PYVCP BUTTON>
  109.  
  110. # 19 Signal Destination- Z Axis Servo Amplifier, Fault Reset, Pullup Used, untested
  111. net z-reset => hm2_5i25.0.7i77.0.0.output-02
  112. # <SIGNAL OPERATIONAL> <CURRENTLY PYVCP BUTTON>
  113.  
  114. # 20 Signal Destination- A Axis Servo Amplifier, Fault Reset, Pullup Used, untested
  115. net a-reset => hm2_5i25.0.7i77.0.0.output-03
  116. # <SIGNAL OPERATIONAL> <CURRENTLY PYVCP BUTTON>
  117.  
  118. # 21 Signal Destination- X Axis Servo Amplifier - Enable
  119. net x-enable => hm2_5i25.0.7i77.0.0.output-04
  120. # <FULLY OPERATIONAL>
  121.  
  122. # 22 Signal Destination- Y Axis Servo Amplifier - Enable
  123. net y-enable => hm2_5i25.0.7i77.0.0.output-05
  124. # <FULLY OPERATIONAL>
  125.  
  126. # 23 Signal Destination- Z Axis Servo Amplifier - Enable
  127. net z-enable => hm2_5i25.0.7i77.0.0.output-06
  128. # <FULLY OPERATIONAL>
  129.  
  130. # 24 Signal Destination- A Axis Servo Amplifier - Enable
  131. net a-enable => hm2_5i25.0.7i77.0.0.output-07
  132. # <FULLY OPERATIONAL>
  133.  
  134. #TB7
  135. ####INPUTS
  136. #-----------------------------------------------------------------------------------------
  137.  
  138. # 01 Signal Source - X MAX/HOME ENDSTOP (Table Right), +24v thru Endstop
  139. net x-min-home <= hm2_5i25.0.7i77.0.0.input-16-not
  140. # <FULLY OPERATIONAL>
  141.  
  142. # 02 Signal Source - X MIN ENDSTOP (Table Left), +24v thru Endstop
  143. net x-max <= hm2_5i25.0.7i77.0.0.input-17-not
  144. # <FULLY OPERATIONAL>
  145.  
  146. # 03 Signal Source - Y MIN/HOME (Table Front), +24v thru Endstop
  147. net y-min-home <= hm2_5i25.0.7i77.0.0.input-18-not
  148. # <Cannot get the signal>
  149.  
  150. # 04 Signal Source - Y MAX (Table Back), +24v thru Endstop
  151. net y-max <= hm2_5i25.0.7i77.0.0.input-19-not
  152. # <FULLY OPERATIONAL>
  153.  
  154. # 05 Signal Source - Z MAX (Mast UP), +24v thru Endstop, untested
  155. net z-max-home <= hm2_5i25.0.7i77.0.0.input-20-not
  156. #
  157.  
  158. # 06 Signal Source - Z MIN (Mast Down), +24v thru Endstop, untested
  159. net z-min <= hm2_5i25.0.7i77.0.0.input-21-not
  160. # <FULLY OPERATIONAL>
  161.  
  162. # 07 Signal Source - Hall Effect Sensor on Mast - tool change height?, untested sensor
  163. # <NOT CONNECTED> net z-home <= hm2_5i25.0.7i77.0.0.input-22
  164.  
  165. # 08 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-23
  166.  
  167. # 09 Signal Source - X Amplifier - fault notification - active = drive fault, untested
  168. net x-fault-indicator <= hm2_5i25.0.7i77.0.0.input-24
  169. #net x-fault-indicator axis.0.amp-fault-in <= hm2_5i25.0.7i77.0.0.input-24
  170.  
  171. # 10 Signal Source - Y Amplifier - fault notification - active = drive fault, untested
  172. net y-fault-indicator <= hm2_5i25.0.7i77.0.0.input-25
  173. #net y-fault-indicator axis.1.amp-fault-in <= hm2_5i25.0.7i77.0.0.input-25
  174.  
  175. # 11 Signal Source - Z Amplifier - fault notification - active = drive fault, untested
  176. net z-fault-indicator <= hm2_5i25.0.7i77.0.0.input-26
  177. #net z-fault-indicator axis.2.amp-fault-in <= hm2_5i25.0.7i77.0.0.input-26
  178.  
  179. # 12 Signal Source - A Amplifier - fault notification - active = drive fault, untested
  180. net a-fault-indicator <= hm2_5i25.0.7i77.0.0.input-27
  181. #net a-fault-indicator axis.3.amp-fault-in <= hm2_5i25.0.7i77.0.0.input-27
  182.  
  183. # 13 Signal Source - VFD - fault notification - active = drive fault
  184. net spindle-fault-indicator <= hm2_5i25.0.7i77.0.0.input-28
  185. # <FULLY OPERATIONAL>
  186.  
  187. # 14 Signal Source - 4th Axis Loop - 4th Axis installed = +24V 4th Axis out = +0v, untested
  188. net a-axis-installed <= hm2_5i25.0.7i77.0.0.input-29
  189.  
  190. # 15 Signal Source - Renishaw PH6/TP2 Touch Probe, not sure about wiring, one constant connection between 2 pins.
  191. # <NOT CONNECTED> net probe-in <= hm2_5i25.0.7177.0.0.input-30
  192.  
  193. # 16 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-31
  194.  
  195. #-----------------------------------------------------------------------------------------
  196. #OUTPUTS
  197.  
  198. # 17 Signal Destination - VFD - Spindle Enable, active = enable, tested good
  199. net spindle-enable hm2_5i25.0.7i77.0.0.output-08
  200. # <FULLY OPERATIONAL>
  201.  
  202. # 18 Signal Destination - VFD - Spindle Fault Reset, active = fault reset; untested
  203. net spindle-reset => hm2_5i25.0.7i77.0.0.output-09
  204. # <FULLY OPERATIONAL>
  205.  
  206. # 19 Signal Destination - VFD - Spindle Drive Select Mode // Active = Torque Mode Inactive = Velocity Mode, untested
  207. net spindle-mode => hm2_5i25.0.7i77.0.0.output-10
  208. # <SIGNAL CONNECTED>
  209.  
  210. # 20 Signal Destination - Safety Door Lock // output to relay // relay sends +24v to the EM door lock, untested
  211. net door-locked => hm2_5i25.0.7i77.0.0.output-11
  212. # <FULLY OPERATIONAL>
  213.  
  214. # 21 <EMPTY PIN> hm2_5i25.0.7i77.0.0.output-12
  215.  
  216. # 22 <EMPTY PIN> hm2_5i25.0.7i77.0.0.output-13
  217.  
  218. # 23 <EMPTY PIN> hm2_5i25.0.7i77.0.0.output-14
  219.  
  220. # 24 <EMPTY PIN> hm2_5i25.0.7i77.0.0.output-15
  221.  
  222. # 7i84 i/o
  223. #TB3
  224. ####INPUTS
  225. #-----------------------------------------------------------------------------------------
  226. # 01 <EMPTY PIN> hm2_5i25.0.7i84.0.2.input-00
  227.  
  228. # 02 <EMPTY PIN> hm2_5i25.0.7i84.0.2.input-01
  229.  
  230. # 03 Signal Source - AIR PRESSURE SENSOR - LOW AIR = +24v
  231. net low-air <= hm2_5i25.0.7i84.0.2.input-02
  232. # <SIGNAL CONNECTED BUT READS HIGH>
  233.  
  234. # 04 Signal Source - ATC Pneumatic Actuator 1 Endstop 1 (CARRIAGE HOME/UP, PV1 = FALSE)
  235. net act1-a <= hm2_5i25.0.7i84.0.2.input-03
  236. # <SIGNAL OPERATIONAL>
  237.  
  238. # 05 Signal Source - ATC Pneumatic Actuator 1 Endstop 2, (CARRIAGE DOWN; PV1 = TRUE)
  239. net act1-b <= hm2_5i25.0.7i84.0.2.input-04
  240. # <SIGNAL OPERATIONAL>
  241.  
  242. # 06 Signal Source - ATC Pneumatic Actuator 2 Endstop 1 (CARRIAGE HOME/IN, PV2 = FALSE)
  243. net act2-a <= hm2_5i25.0.7i84.0.2.input-05
  244. # <SIGNAL OPERATIONAL>
  245.  
  246. # 07 Signal Source - ATC Pneumatic Actuator 2 Endstop 2, (CARRIAGE OUT = UNDER SPINDLE, PV2 = TRUE)
  247. net act2-b <= hm2_5i25.0.7i84.0.2.input-06
  248. # <SIGNAL OPERATIONAL>
  249.  
  250. # 08 Signal Source - ATC Pneumatic Actuator 3 Endstop 1 (TOOL HOLDER HOME/DOWN; PV3 = FALSE)
  251. net act3-a <= hm2_5i25.0.7i84.0.2.input-07
  252. # <SIGNAL OPERATIONAL>
  253.  
  254. # 09 Signal Source - ATC Pneumatic Actuator 3 Endstop 2, (TOOL HOLDER UP = LOAD TOOL; PV3 = TRUE)
  255. net act3-b <= hm2_5i25.0.7i84.0.2.input-08
  256. # <SIGNAL OPERATIONAL>
  257.  
  258. # 10 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-09
  259.  
  260. # 11 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-10
  261.  
  262. # 12 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-11
  263.  
  264. # 13 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-12
  265.  
  266. # 14 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-13
  267.  
  268. # 15 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-14
  269.  
  270. # 16 <EMPTY PIN> hm2_5i25.0.7i77.0.0.input-15
  271.  
  272. #TB3
  273. ####OUTPUTS
  274. #-----------------------------------------------------------------------------------------
  275. # 17 Signal Destination - ATC Carousel DC Motor // +24v common bar to relay to Motor, Active rotates CW untested
  276. net atc_motor => hm2_5i25.0.7i84.0.2.output-00
  277. # <SIGNAL OPERATIONAL> <CURRENTLY A PYVCP BUTTON TO ROTATE><INTEGRATE WITH CLASSIC LADDER>
  278.  
  279. # 18 Signal Destination - ATC Pneumatic Valve 1 - operates Actuator 1, active = valve open
  280. net pv1 => hm2_5i25.0.7i84.0.2.output-01
  281. # <SIGNAL OPERATIONAL> <CURRENTLY A PYVCP BUTTON TO ROTATE><INTEGRATE WITH CLASSIC LADDER>
  282.  
  283. # 19 Signal Destination - ATC Pneumatic Valve 2 - operates Actuator 2, active = valve open
  284. net pv2 => hm2_5i25.0.7i84.0.2.output-02
  285. # <SIGNAL OPERATIONAL> <CURRENTLY A PYVCP BUTTON TO ROTATE><INTEGRATE WITH CLASSIC LADDER>
  286.  
  287. # 20 Signal Destination - ATC Pneumatic Valve 3 - operates Actuator 3, active = valve open
  288. net pv3 => hm2_5i25.0.7i84.0.2.output-03
  289. # <SIGNAL OPERATIONAL> <CURRENTLY A PYVCP BUTTON TO ROTATE><INTEGRATE WITH CLASSIC LADDER>
  290.  
  291. # 21 Signal Destination - ATC Pneumatic Valve 4 - operates Actuator 4, active = valve open
  292. net open-drawbar => hm2_5i25.0.7i84.0.2.output-04
  293. # <FULLY OPERATIONAL> <INTEGRATE WITH CLASSIC LADDER>
  294.  
  295. # 22 Signal Destination - Compartment Light Relay - +24v LED, active = light on
  296. net light => hm2_5i25.0.7i84.0.2.output-05
  297. # <FULLY OPERATIONAL> <NEED REPLACEMENT BULB>
  298.  
  299. # 23 Signal Destination - Flood Coolant Relay +220v Pump, active = pump on
  300. net flood-coolant => hm2_5i25.0.7i84.0.2.output-06
  301. # <FULLY OPERATIONAL> <TEST WITH M08/M09 CMD>
  302.  
  303. # 24 Signal Destination - Z Axis Brake Relay, +24v brake, active = brake off
  304. net zbrake => hm2_5i25.0.7i84.0.2.output-07
  305. # <FULLY OPERATIONAL> <SET BRAKE OFF WHEN MACHINE IS POWERED ON>
  306.  
  307. # no connections are made for TB2
  308.  
  309. # 01 <EMPTY PIN> hm2_5i25.0.7i84.0.2.input-16 - reserved for MPG
  310.  
  311. # 02 <EMPTY PIN> hm2_5i25.0.7i84.0.2.input-17 - reserved for MPG
  312.  
  313. # 03 <EMPTY PIN> hm2_5i25.0.7i84.0.2.input-18 - reserved for MPG
  314.  
  315. # 04 <EMPTY PIN> hm2_5i25.0.7i84.0.2.input-19 - reserved for MPG
  316.  
  317. #*******************
  318. # AXIS X
  319. #*******************
  320.  
  321. setp pid.x.Pgain [AXIS_0]P
  322. setp pid.x.Igain [AXIS_0]I
  323. setp pid.x.Dgain [AXIS_0]D
  324. setp pid.x.bias [AXIS_0]BIAS
  325. setp pid.x.FF0 [AXIS_0]FF0
  326. setp pid.x.FF1 [AXIS_0]FF1
  327. setp pid.x.FF2 [AXIS_0]FF2
  328. setp pid.x.deadband [AXIS_0]DEADBAND
  329. setp pid.x.maxoutput [AXIS_0]MAX_OUTPUT
  330. setp pid.x.error-previous-target true
  331. setp pid.x.maxerror .0005
  332.  
  333. net x-index-enable <=> pid.x.index-enable
  334. net x-enable => pid.x.enable
  335. net x-pos-cmd => pid.x.command
  336. net x-vel-cmd => pid.x.command-deriv
  337. net x-pos-fb => pid.x.feedback
  338. net x-output => pid.x.output
  339.  
  340. # ---PWM Generator signals/setup---
  341.  
  342. setp hm2_5i25.0.7i77.0.1.analogout0-scalemax [AXIS_0]OUTPUT_SCALE
  343. setp hm2_5i25.0.7i77.0.1.analogout0-minlim [AXIS_0]OUTPUT_MIN_LIMIT
  344. setp hm2_5i25.0.7i77.0.1.analogout0-maxlim [AXIS_0]OUTPUT_MAX_LIMIT
  345.  
  346. net x-output => hm2_5i25.0.7i77.0.1.analogout0
  347. net x-pos-cmd axis.0.motor-pos-cmd
  348. net x-enable axis.0.amp-enable-out
  349.  
  350. # enable _all_ sserial pwmgens
  351. net x-enable hm2_5i25.0.7i77.0.1.analogena
  352.  
  353. # ---Encoder feedback signals/setup---
  354.  
  355. setp hm2_5i25.0.encoder.00.counter-mode 0
  356. setp hm2_5i25.0.encoder.00.filter 1
  357. setp hm2_5i25.0.encoder.00.index-invert 0
  358. setp hm2_5i25.0.encoder.00.index-mask 0
  359. setp hm2_5i25.0.encoder.00.index-mask-invert 0
  360. setp hm2_5i25.0.encoder.00.scale [AXIS_0]ENCODER_SCALE
  361.  
  362. net x-pos-fb <= hm2_5i25.0.encoder.00.position
  363. net x-vel-fb <= hm2_5i25.0.encoder.00.velocity
  364. net x-pos-fb => axis.0.motor-pos-fb
  365. net x-index-enable axis.0.index-enable <=> hm2_5i25.0.encoder.00.index-enable
  366. net x-pos-rawcounts <= hm2_5i25.0.encoder.00.rawcounts
  367.  
  368. # ---setup home / limit switch signals---
  369.  
  370. net x-home-sw => axis.0.home-sw-in
  371. net min-x => axis.0.neg-lim-sw-in
  372. net x-pos-limit => axis.0.pos-lim-sw-in
  373.  
  374. #*******************
  375. # AXIS Y
  376. #*******************
  377.  
  378. setp pid.y.Pgain [AXIS_1]P
  379. setp pid.y.Igain [AXIS_1]I
  380. setp pid.y.Dgain [AXIS_1]D
  381. setp pid.y.bias [AXIS_1]BIAS
  382. setp pid.y.FF0 [AXIS_1]FF0
  383. setp pid.y.FF1 [AXIS_1]FF1
  384. setp pid.y.FF2 [AXIS_1]FF2
  385. setp pid.y.deadband [AXIS_1]DEADBAND
  386. setp pid.y.maxoutput [AXIS_1]MAX_OUTPUT
  387. setp pid.y.error-previous-target true
  388. setp pid.y.maxerror .0005
  389.  
  390. net y-index-enable <=> pid.y.index-enable
  391. net y-enable => pid.y.enable
  392. net y-pos-cmd => pid.y.command
  393. net y-vel-cmd => pid.y.command-deriv
  394. net y-pos-fb => pid.y.feedback
  395. net y-output => pid.y.output
  396.  
  397. # ---PWM Generator signals/setup---
  398.  
  399. setp hm2_5i25.0.7i77.0.1.analogout1-scalemax [AXIS_1]OUTPUT_SCALE
  400. setp hm2_5i25.0.7i77.0.1.analogout1-minlim [AXIS_1]OUTPUT_MIN_LIMIT
  401. setp hm2_5i25.0.7i77.0.1.analogout1-maxlim [AXIS_1]OUTPUT_MAX_LIMIT
  402.  
  403. net y-output => hm2_5i25.0.7i77.0.1.analogout1
  404. net y-pos-cmd axis.1.motor-pos-cmd
  405. net y-enable axis.1.amp-enable-out
  406.  
  407. # ---Encoder feedback signals/setup---
  408.  
  409. setp hm2_5i25.0.encoder.01.counter-mode 0
  410. setp hm2_5i25.0.encoder.01.filter 1
  411. setp hm2_5i25.0.encoder.01.index-invert 0
  412. setp hm2_5i25.0.encoder.01.index-mask 0
  413. setp hm2_5i25.0.encoder.01.index-mask-invert 0
  414. setp hm2_5i25.0.encoder.01.scale [AXIS_1]ENCODER_SCALE
  415.  
  416. net y-pos-fb <= hm2_5i25.0.encoder.01.position
  417. net y-vel-fb <= hm2_5i25.0.encoder.01.velocity
  418. net y-pos-fb => axis.1.motor-pos-fb
  419. net y-index-enable axis.1.index-enable <=> hm2_5i25.0.encoder.01.index-enable
  420. net y-pos-rawcounts <= hm2_5i25.0.encoder.01.rawcounts
  421.  
  422. # ---setup home / limit switch signals---
  423.  
  424. net max-home-y => axis.1.home-sw-in
  425. net min-y => axis.1.neg-lim-sw-in
  426. net max-home-y => axis.1.pos-lim-sw-in
  427.  
  428. #*******************
  429. # AXIS Z
  430. #*******************
  431.  
  432. setp pid.z.Pgain [AXIS_2]P
  433. setp pid.z.Igain [AXIS_2]I
  434. setp pid.z.Dgain [AXIS_2]D
  435. setp pid.z.bias [AXIS_2]BIAS
  436. setp pid.z.FF0 [AXIS_2]FF0
  437. setp pid.z.FF1 [AXIS_2]FF1
  438. setp pid.z.FF2 [AXIS_2]FF2
  439. setp pid.z.deadband [AXIS_2]DEADBAND
  440. setp pid.z.maxoutput [AXIS_2]MAX_OUTPUT
  441. setp pid.z.error-previous-target true
  442. setp pid.z.maxerror .0005
  443.  
  444. net z-index-enable <=> pid.z.index-enable
  445. net z-enable => pid.z.enable
  446. net z-pos-cmd => pid.z.command
  447. net z-vel-cmd => pid.z.command-deriv
  448. net z-pos-fb => pid.z.feedback
  449. net z-output => pid.z.output
  450.  
  451. # ---PWM Generator signals/setup---
  452.  
  453. setp hm2_5i25.0.7i77.0.1.analogout2-scalemax [AXIS_2]OUTPUT_SCALE
  454. setp hm2_5i25.0.7i77.0.1.analogout2-minlim [AXIS_2]OUTPUT_MIN_LIMIT
  455. setp hm2_5i25.0.7i77.0.1.analogout2-maxlim [AXIS_2]OUTPUT_MAX_LIMIT
  456.  
  457. net z-output => hm2_5i25.0.7i77.0.1.analogout2
  458. net z-pos-cmd axis.2.motor-pos-cmd
  459. net z-enable axis.2.amp-enable-out
  460.  
  461. # ---Encoder feedback signals/setup---
  462.  
  463. setp hm2_5i25.0.encoder.02.counter-mode 0
  464. setp hm2_5i25.0.encoder.02.filter 1
  465. setp hm2_5i25.0.encoder.02.index-invert 0
  466. setp hm2_5i25.0.encoder.02.index-mask 0
  467. setp hm2_5i25.0.encoder.02.index-mask-invert 0
  468. setp hm2_5i25.0.encoder.02.scale [AXIS_2]ENCODER_SCALE
  469.  
  470. net z-pos-fb <= hm2_5i25.0.encoder.02.position
  471. net z-vel-fb <= hm2_5i25.0.encoder.02.velocity
  472. net z-pos-fb => axis.2.motor-pos-fb
  473. net z-index-enable axis.2.index-enable <=> hm2_5i25.0.encoder.02.index-enable
  474. net z-pos-rawcounts <= hm2_5i25.0.encoder.02.rawcounts
  475.  
  476. # ---setup home / limit switch signals---
  477.  
  478. net max-home-z => axis.2.home-sw-in
  479. net min-z => axis.2.neg-lim-sw-in
  480. net max-home-z => axis.2.pos-lim-sw-in
  481.  
  482. #*******************
  483. # AXIS A
  484. #*******************
  485.  
  486. setp pid.a.Pgain [AXIS_3]P
  487. setp pid.a.Igain [AXIS_3]I
  488. setp pid.a.Dgain [AXIS_3]D
  489. setp pid.a.bias [AXIS_3]BIAS
  490. setp pid.a.FF0 [AXIS_3]FF0
  491. setp pid.a.FF1 [AXIS_3]FF1
  492. setp pid.a.FF2 [AXIS_3]FF2
  493. setp pid.a.deadband [AXIS_3]DEADBAND
  494. setp pid.a.maxoutput [AXIS_3]MAX_OUTPUT
  495. setp pid.a.error-previous-target true
  496. setp pid.a.maxerror .0005
  497.  
  498. net a-index-enable <=> pid.a.index-enable
  499. net a-enable => pid.a.enable
  500. net a-pos-cmd => pid.a.command
  501. net a-vel-cmd => pid.a.command-deriv
  502. net a-pos-fb => pid.a.feedback
  503. net a-output => pid.a.output
  504.  
  505. # ---PWM Generator signals/setup---
  506.  
  507. setp hm2_5i25.0.7i77.0.1.analogout3-scalemax [AXIS_3]OUTPUT_SCALE
  508. setp hm2_5i25.0.7i77.0.1.analogout3-minlim [AXIS_3]OUTPUT_MIN_LIMIT
  509. setp hm2_5i25.0.7i77.0.1.analogout3-maxlim [AXIS_3]OUTPUT_MAX_LIMIT
  510.  
  511. net a-output => hm2_5i25.0.7i77.0.1.analogout3
  512. net a-pos-cmd axis.3.motor-pos-cmd
  513. net a-enable axis.3.amp-enable-out
  514.  
  515. # ---Encoder feedback signals/setup---
  516.  
  517. setp hm2_5i25.0.encoder.05.counter-mode 0
  518. setp hm2_5i25.0.encoder.05.filter 1
  519. setp hm2_5i25.0.encoder.05.index-invert 0
  520. setp hm2_5i25.0.encoder.05.index-mask 0
  521. setp hm2_5i25.0.encoder.05.index-mask-invert 0
  522. setp hm2_5i25.0.encoder.05.scale [AXIS_3]ENCODER_SCALE
  523.  
  524. net a-pos-fb <= hm2_5i25.0.encoder.05.position
  525. net a-vel-fb <= hm2_5i25.0.encoder.05.velocity
  526. net a-pos-fb => axis.3.motor-pos-fb
  527. net a-index-enable axis.3.index-enable <=> hm2_5i25.0.encoder.05.index-enable
  528. net a-pos-rawcounts <= hm2_5i25.0.encoder.05.rawcounts
  529.  
  530. # ---setup home / limit switch signals---
  531.  
  532. net max-home-a => axis.3.home-sw-in
  533. net a-neg-limit => axis.3.neg-lim-sw-in
  534. net max-home-a => axis.3.pos-lim-sw-in
  535.  
  536. #*******************
  537. # SPINDLE S
  538. #*******************
  539.  
  540. setp pid.s.Pgain [SPINDLE_9]P
  541. setp pid.s.Igain [SPINDLE_9]I
  542. setp pid.s.Dgain [SPINDLE_9]D
  543. setp pid.s.bias [SPINDLE_9]BIAS
  544. setp pid.s.FF0 [SPINDLE_9]FF0
  545. setp pid.s.FF1 [SPINDLE_9]FF1
  546. setp pid.s.FF2 [SPINDLE_9]FF2
  547. setp pid.s.deadband [SPINDLE_9]DEADBAND
  548. setp pid.s.maxoutput [SPINDLE_9]MAX_OUTPUT
  549. setp pid.s.error-previous-target true
  550. setp pid.s.maxerror .0005
  551.  
  552. net spindle-index-enable <=> pid.s.index-enable
  553. net spindle-enable => pid.s.enable
  554. net spindle-vel-cmd-rpm => pid.s.command
  555. net spindle-vel-fb-rpm => pid.s.feedback
  556. net spindle-output <= pid.s.output
  557.  
  558. # ---PWM Generator signals/setup---
  559.  
  560. setp hm2_5i25.0.7i77.0.1.analogout4-scalemax [SPINDLE_9]OUTPUT_SCALE
  561. setp hm2_5i25.0.7i77.0.1.analogout4-minlim [SPINDLE_9]OUTPUT_MIN_LIMIT
  562. setp hm2_5i25.0.7i77.0.1.analogout4-maxlim [SPINDLE_9]OUTPUT_MAX_LIMIT
  563.  
  564. net spindle-output => hm2_5i25.0.7i77.0.1.analogout4
  565.  
  566. # ---Encoder feedback signals/setup---
  567.  
  568. setp hm2_5i25.0.encoder.04.counter-mode 0
  569. setp hm2_5i25.0.encoder.04.filter 1
  570. setp hm2_5i25.0.encoder.04.index-invert 0
  571. setp hm2_5i25.0.encoder.04.index-mask 0
  572. setp hm2_5i25.0.encoder.04.index-mask-invert 0
  573. setp hm2_5i25.0.encoder.04.scale [SPINDLE_9]ENCODER_SCALE
  574.  
  575. net spindle-revs <= hm2_5i25.0.encoder.04.position
  576. net spindle-vel-fb-rps <= hm2_5i25.0.encoder.04.velocity
  577. net spindle-index-enable <=> hm2_5i25.0.encoder.04.index-enable
  578.  
  579. # ---setup spindle control signals---
  580.  
  581. net spindle-vel-cmd-rps <= motion.spindle-speed-out-rps
  582. net spindle-vel-cmd-rps-abs <= motion.spindle-speed-out-rps-abs
  583. net spindle-vel-cmd-rpm <= motion.spindle-speed-out
  584. net spindle-vel-cmd-rpm-abs <= motion.spindle-speed-out-abs
  585. #net spindle-enable <= motion.spindle-on
  586. net spindle-cw <= motion.spindle-forward
  587. net spindle-ccw <= motion.spindle-reverse
  588. net spindle-brake <= motion.spindle-brake
  589. net spindle-revs => motion.spindle-revs
  590. net spindle-at-speed => motion.spindle-at-speed
  591. net spindle-vel-fb-rps => motion.spindle-speed-in
  592. net spindle-index-enable <=> motion.spindle-index-enable
  593.  
  594. # ---Setup spindle at speed signals---
  595.  
  596. sets spindle-at-speed true
  597.  
  598. # Use ACTUAL spindle velocity from spindle encoder
  599. # spindle-velocity bounces around so we filter it with lowpass
  600. # spindle-velocity is signed so we use absolute component to remove sign
  601. # ACTUAL velocity is in RPS not RPM so we scale it.
  602.  
  603. setp scale.spindle.gain 60
  604. setp lowpass.spindle.gain 1.000000
  605. net spindle-vel-fb-rps => scale.spindle.in
  606. net spindle-fb-rpm scale.spindle.out => abs.spindle.in
  607. net spindle-fb-rpm-abs abs.spindle.out => lowpass.spindle.in
  608. net spindle-fb-rpm-abs-filtered lowpass.spindle.out
  609.  
  610. #******************************
  611. # connect miscellaneous signals
  612. #******************************
  613.  
  614. # ---HALUI signals---
  615.  
  616. net joint-select-a halui.joint.0.select
  617. net x-is-homed halui.joint.0.is-homed
  618. net jog-x-pos halui.jog.0.plus
  619. net jog-x-neg halui.jog.0.minus
  620. net jog-x-analog halui.jog.0.analog
  621. net joint-select-b halui.joint.1.select
  622. net y-is-homed halui.joint.1.is-homed
  623. net jog-y-pos halui.jog.1.plus
  624. net jog-y-neg halui.jog.1.minus
  625. net jog-y-analog halui.jog.1.analog
  626. net joint-select-c halui.joint.2.select
  627. net z-is-homed halui.joint.2.is-homed
  628. net jog-z-pos halui.jog.2.plus
  629. net jog-z-neg halui.jog.2.minus
  630. net jog-z-analog halui.jog.2.analog
  631. net joint-select-d halui.joint.3.select
  632. net a-is-homed halui.joint.3.is-homed
  633. net jog-a-pos halui.jog.3.plus
  634. net jog-a-neg halui.jog.3.minus
  635. net jog-a-analog halui.jog.3.analog
  636. net jog-selected-pos halui.jog.selected.plus
  637. net jog-selected-neg halui.jog.selected.minus
  638. net spindle-manual-cw halui.spindle.forward
  639. net spindle-manual-ccw halui.spindle.reverse
  640. net spindle-manual-stop halui.spindle.stop
  641. net jog-speed halui.jog-speed
  642. net MDI-mode halui.mode.is-mdi
  643. net machine-is-on halui.machine.is-on
  644.  
  645. # ---coolant signals---
  646.  
  647. #net coolant-mist <= iocontrol.0.coolant-mist
  648. net coolant-flood <= iocontrol.0.coolant-flood
  649.  
  650. # ---probe signal---
  651.  
  652. net probe-in => motion.probe-input
  653.  
  654. # ---motion control signals---
  655.  
  656. net in-position <= motion.in-position
  657. net machine-is-enabled <= motion.motion-enabled
  658.  
  659. # ---estop signals---
  660.  
  661. net estop-out <= iocontrol.0.user-enable-out
  662. net estop-ext => iocontrol.0.emc-enable-in
  663.  
  664. # ---toolchange signals for custom tool changer---
  665.  
  666. net tool-number <= iocontrol.0.tool-prep-number
  667. net tool-change-request <= iocontrol.0.tool-change
  668. net tool-change-confirmed => iocontrol.0.tool-changed
  669. net tool-prepare-request <= iocontrol.0.tool-prepare
  670. net tool-prepare-confirmed => iocontrol.0.tool-prepared
  671.  
  672.  
  673. # Load Classicladder without GUI (can reload LADDER GUI in AXIS GUI
  674.  
  675. loadusr classicladder --nogui custom.clp
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement