Advertisement
Guest User

Hardinge-1

a guest
Aug 13th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 15.21 KB | None | 0 0
  1. INI File:
  2.  
  3. # EMC controller parameters for generic controller. Make these what you need
  4. # for your system.
  5.  
  6. # General note: Comments can either be preceded with a # or ; - either is
  7. # acceptable, although # is in keeping with most linux config files.
  8.  
  9.  
  10. # General section -------------------------------------------------------------
  11. [EMC]
  12.  
  13. # Version of this INI file
  14. VERSION = $Revision$
  15.  
  16. # Name of machine, for use with display, etc.
  17. MACHINE = Hardinge 1
  18.  
  19. # Debug level, 0 means no messages. See src/emc/nml_int/emcglb.h for others
  20. DEBUG = 0
  21. # DEBUG = 0x00000007
  22. DEBUG = 0x7FFFFFFF
  23.  
  24. # Sections for display options ------------------------------------------------
  25. [DISPLAY]
  26.  
  27. # Name of display program, e.g., xemc
  28. DISPLAY = axis
  29.  
  30. LATHE = 1
  31.  
  32. EDITOR = gedit
  33. # DISPLAY = usrmot
  34. # DISPLAY = tkemc
  35.  
  36. # Cycle time, in seconds, that display will sleep between polls
  37. CYCLE_TIME = 0.100
  38.  
  39. # Path to help file
  40. HELP_FILE = tkemc.txt
  41.  
  42. # Initial display setting for position, RELATIVE or MACHINE
  43. POSITION_OFFSET = RELATIVE
  44.  
  45. # Initial display setting for position, COMMANDED or ACTUAL
  46. POSITION_FEEDBACK = ACTUAL
  47.  
  48. # Highest value that will be allowed for feed override, 1.0 = 100%
  49. MAX_FEED_OVERRIDE = 1.2
  50.  
  51. # Prefix to be used
  52. PROGRAM_PREFIX = /home/nick/linuxcnc/nc_files
  53. PROGRAM_PREFIX = /home/nick/linuxcnc/m_files
  54.  
  55. # Introductory graphic
  56. INTRO_GRAPHIC = emc2.gif
  57. INTRO_TIME = 2
  58.  
  59. PYVCP = spindle.xml
  60.  
  61. # Enable popup balloon help
  62. BALLOON_HELP = 1
  63.  
  64. # Task controller section -----------------------------------------------------
  65. [TASK]
  66.  
  67. # Name of task controller program, e.g., milltask
  68. TASK = milltask
  69.  
  70. # Cycle time, in seconds, that task controller will sleep between polls
  71. CYCLE_TIME = 0.010
  72.  
  73. # Part program interpreter section --------------------------------------------
  74. [RS274NGC]
  75.  
  76. # File containing interpreter variables
  77. PARAMETER_FILE = univpwm.var
  78. RS274NGC_STARTUP_CODE = G18 M9
  79. # Motion control section ------------------------------------------------------
  80. [EMCMOT]
  81.  
  82. EMCMOT = motmod
  83.  
  84. # Timeout for comm to emcmot, in seconds
  85. COMM_TIMEOUT = 1.0
  86.  
  87. # Interval between tries to emcmot, in seconds
  88. COMM_WAIT = 0.010
  89.  
  90. # Servo task period, in nanoseconds
  91. SERVO_PERIOD = 1000000
  92.  
  93. # Hardware Abstraction Layer section --------------------------------------------------
  94. [HAL]
  95.  
  96. # The run script first uses halcmd to execute any HALFILE
  97. # files, and then to execute any individual HALCMD commands.
  98. #
  99.  
  100. # list of hal config files to run through halcmd
  101. # files are executed in the order in which they appear
  102. HALFILE = univpwm_load.hal
  103. HALFILE = univpwm_servo.hal
  104. HALFILE = univpwm_motion.hal
  105. HALFILE = univpwm_io.hal
  106.  
  107. POSTGUI_HALFILE = post-gui.hal
  108.  
  109.  
  110. HALUI = halui
  111.  
  112.  
  113. [HALUI]
  114. # MDI commands
  115. MDI_COMMAND = T1 M6 G43
  116. MDI_COMMAND = T2 M6 G43
  117. MDI_COMMAND = T3 M6 G43
  118. MDI_COMMAND = T4 M6 G43
  119. MDI_COMMAND = T5 M6 G43
  120. MDI_COMMAND = T6 M6 G43
  121. MDI_COMMAND = T7 M6 G43
  122. MDI_COMMAND = T8 M6 G43
  123.  
  124. #MDI_COMMAND = M102
  125. #MDI_COMMAND = M103
  126.  
  127. #uncomment the following line to enable the pendant function
  128. #HALFILE = pendant.hal
  129. #uncomment the following line to enable the spindle speed display
  130. POSTGUI_HALFILE = spindle.hal
  131. #You need to remove axis 3 or provide another path for a spindle encoder to
  132. # feed into EMC for this to work.
  133.  
  134.  
  135.  
  136. # Trajectory planner section --------------------------------------------------
  137. [TRAJ]
  138.  
  139. AXES = 3
  140. # COORDINATES = X Y Z R P W
  141. COORDINATES = X Z
  142. HOME = 0 0 0 0
  143. LINEAR_UNITS = inch
  144. ANGULAR_UNITS = degree
  145. CYCLE_TIME = 0.010
  146. DEFAULT_VELOCITY = 0.5
  147. MAX_VELOCITY = 4.0
  148. DEFAULT_ACCELERATION = 3.0
  149. MAX_ACCELERATION = 3.0
  150.  
  151. # Axes sections ---------------------------------------------------------------
  152.  
  153. # Scaling: The OUTPUT_SCALE should be the speed
  154. # in UNITS/second (inches/sec or mm/sec) that would be
  155. # reached if the PWM duty cycle was 100%. It depends on
  156. # the power supply voltage, motor RPM/Volt factor, and
  157. # gearing/screw pitch. For example:
  158. #
  159. # Power supply voltage 50V
  160. # Motor RPM/V 1000RPM/24V
  161. # Gearing: 2 motor revs per 1 screw rev
  162. # Screw pitch: 0.2" per turn
  163. #
  164. # Max motor speed = 50V * 1000RPM/24V = 2083 RPM
  165. # Max screw speed = 2083RPM * 1(screw)/2(motor) = 1041RPM
  166. # Max table speed = 1041RPM * 0.2"/turn = 208 in/min
  167. # Max table speed = 208 in/min / 60 seconds = 3.47 inches/sec
  168. #
  169. # Since max speed is reached at 100% duty cycle, OUTPUT_SCALE
  170. # should be 3.47
  171.  
  172. # First axis X Axis
  173. [AXIS_0]
  174.  
  175. TYPE = LINEAR
  176. HOME = 0.0000
  177. MAX_VELOCITY = 3.0
  178. MAX_ACCELERATION = 3.0
  179. PID_MAX_VEL = 150
  180. BACKLASH = 0.000
  181. INPUT_SCALE = -40000
  182. OUTPUT_SCALE = 1
  183. MIN_LIMIT = -12.0
  184. MAX_LIMIT = 10.0
  185. FERROR = 0.2
  186. MIN_FERROR = 0.2
  187. HOME_OFFSET = 0.0
  188. HOME_SEARCH_VEL = -0.1
  189. HOME_LATCH_VEL = -0.1
  190. HOME_USE_INDEX = YES
  191. HOME_IGNORE_LIMITS = NO
  192. DEADBAND = 0
  193. P = 270
  194. I = 0
  195. D = 2
  196. BIAS = 0.0
  197. FF0 = 0
  198. FF1 = 0.26
  199. FF2 = 0.006
  200.  
  201.  
  202. # Second axis
  203. [AXIS_1]
  204.  
  205. TYPE = LINEAR
  206. HOME = 0.000
  207. MAX_VELOCITY = 3.0
  208. MAX_ACCELERATION = 20.0
  209. PID_MAX_VEL = 1.25
  210. BACKLASH = 0.000
  211. INPUT_SCALE = 4000
  212. OUTPUT_SCALE = 5.0
  213. MIN_LIMIT = -10.0
  214. MAX_LIMIT = 10.0
  215. FERROR = 0.010
  216. MIN_FERROR = 0.001
  217. HOME_OFFSET = 0.0
  218. HOME_SEARCH_VEL = 0.0
  219. HOME_LATCH_VEL = 0.0
  220. HOME_USE_INDEX = NO
  221. HOME_IGNORE_LIMITS = NO
  222. DEADBAND = 0.000126
  223. P = 175
  224. I = 100
  225. D = 0.1
  226. BIAS = 0.0
  227. FF0 = 0
  228. FF1 = 1
  229. FF2 = 0.0
  230.  
  231. # Third axis Z Axis
  232. [AXIS_2]
  233.  
  234. TYPE = LINEAR
  235. HOME = 0.0000
  236. MAX_VELOCITY = 3.0
  237. MAX_ACCELERATION = 3.0
  238. PID_MAX_VEL = 100
  239. BACKLASH = 0.000
  240. INPUT_SCALE = -40000
  241. OUTPUT_SCALE = 1
  242. MIN_LIMIT = -10.0
  243. MAX_LIMIT = 10.0
  244. FERROR = 0.250
  245. MIN_FERROR = 0.010
  246. HOME_OFFSET = 0.0
  247. HOME_SEARCH_VEL = -0.1
  248. HOME_LATCH_VEL = -0.1
  249. HOME_USE_INDEX = YES
  250. HOME_IGNORE_LIMITS = NO
  251. DEADBAND = 0
  252. P = 260
  253. I = 0
  254. D = 2
  255. BIAS = 0
  256. FF0 = 0
  257. FF1 = 0.275
  258. FF2 = 0.006
  259.  
  260. # Fourth axis
  261. #[AXIS_3]
  262.  
  263. #TYPE = ANGULAR
  264. #HOME = 0.0
  265. #MAX_VELOCITY = 65
  266. #MAX_ACCELERATION = 20.0
  267. #PID_MAX_VEL = 66
  268. #BACKLASH = 0.000
  269. #INPUT_SCALE = 11.11111111
  270. #OUTPUT_SCALE = 5.0
  271. #MIN_LIMIT = -3600.0
  272. #MAX_LIMIT = 3600.0
  273. #FERROR = 0.010
  274. #MIN_FERROR = 0.001
  275. #HOME_OFFSET = 0.0
  276. #HOME_SEARCH_VEL = 0.0
  277. #HOME_LATCH_VEL = 0.0
  278. #HOME_USE_INDEX = NO
  279. #HOME_IGNORE_LIMITS = NO
  280. #DEADBAND = 0.046
  281. #P = 150
  282. #I = 100
  283. #D = 0.1
  284. #BIAS = 0.0
  285. #FF0 = 0
  286. #FF1 = 1
  287. #FF2 = 0.0
  288.  
  289.  
  290. # section for main IO controller parameters -----------------------------------
  291. [EMCIO]
  292. TOOL_CHANGE_WITH_SPINDLE_ON = 1
  293.  
  294. # Name of IO controller program, e.g., io
  295. EMCIO = io
  296.  
  297. # cycle time, in seconds
  298. CYCLE_TIME = 0.100
  299.  
  300. # tool table file
  301. TOOL_TABLE = univpwm.tbl
  302.  
  303.  
  304. #Turret inserted Info
  305. [TURRET]
  306. STOP_SETTLE = 500
  307. PARK_SETTLE = 500
  308.  
  309.  
  310.  
  311.  
  312. HAL File:
  313. # HAL config file for Pico Systems USC board
  314. #
  315. # Connect motion controller I/Os
  316. #
  317.  
  318. # connect limit/home switch outputs to motion controller
  319. newsig Xminlim bit
  320. newsig Xmaxlim bit
  321. newsig Xhome bit
  322. linksp Xminlim <= ppmc.0.din.01.in-not
  323. linksp Xminlim => axis.0.neg-lim-sw-in
  324. linksp Xmaxlim <= ppmc.0.din.02.in-not
  325. linksp Xmaxlim => axis.0.pos-lim-sw-in
  326. linksp Xhome <= ppmc.0.din.00.in
  327. linksp Xhome => axis.0.home-sw-in
  328.  
  329. #newsig Yminlim bit
  330. #newsig Ymaxlim bit
  331. #newsig Yhome bit
  332. #linksp Yminlim <= ppmc.0.din.05.in
  333. #linksp Yminlim => axis.1.neg-lim-sw-in
  334. #linksp Ymaxlim <= ppmc.0.din.06.in
  335. #linksp Ymaxlim => axis.1.pos-lim-sw-in
  336. #linksp Yhome <= ppmc.0.din.04.in
  337. #linksp Yhome => axis.1.home-sw-in
  338.  
  339. newsig Zminlim bit
  340. newsig Zmaxlim bit
  341. newsig Zhome bit
  342. linksp Zminlim <= ppmc.0.din.04.in-not
  343. #linksp Zminlim <= ppmc.0.din.09.in
  344. linksp Zminlim => axis.2.neg-lim-sw-in
  345. linksp Zmaxlim <= ppmc.0.din.05.in-not
  346. #linksp Zmaxlim <= ppmc.0.din.10.in
  347. linksp Zmaxlim => axis.2.pos-lim-sw-in
  348. linksp Zhome <= ppmc.0.din.03.in
  349. #linksp Zhome <= ppmc.0.din.08.in
  350. linksp Zhome => axis.2.home-sw-in
  351.  
  352. #newsig Aminlim bit
  353. #newsig Amaxlim bit
  354. #newsig Ahome bit
  355. #linksp Aminlim <= ppmc.0.din.12.in
  356. #linksp Aminlim => axis.3.neg-lim-sw-in
  357. #linksp Amaxlim <= ppmc.0.din.13.in
  358. #linksp Amaxlim => axis.3.pos-lim-sw-in
  359. #linksp Ahome <= ppmc.0.din.11.in
  360. #linksp Ahome => axis.3.home-sw-in
  361.  
  362.  
  363. # connect index pulses to motion controller
  364. # uncomment these lines only if you have a Rev 3 UPC board
  365. # The ppmc.x.encoder.xx.index-enable pin is ONLY exported by the driver
  366. # if the UPC has rev 3 or above firmware
  367. newsig Xindex bit
  368. #newsig Yindex bit
  369. newsig Zindex bit
  370. linksp Xindex <= ppmc.0.encoder.00.index-enable
  371. linksp Xindex => axis.0.index-enable
  372. #linksp Yindex <= ppmc.0.encoder.01.index-enable
  373. #linksp Yindex => axis.1.index-enable
  374. linksp Zindex <= ppmc.0.encoder.02.index-enable
  375. linksp Zindex => axis.2.index-enable
  376.  
  377. #
  378. # Connect I/O controller I/Os
  379. #
  380.  
  381. # connect e-stop write/sense to I/O controller
  382. # and univpwm's fault with estop's output, so estop FF is reset, but
  383. # prevent continued estop signal from univpwm from holding FF cleared
  384. newsig ppmcEstop bit
  385. linksp ppmcEstop ppmc.0.din.15.in-not
  386. linksp ppmcEstop and2.0.in0
  387. newsig EstopOkIn bit
  388. linksp EstopOkIn estop-latch.0.fault-in
  389. linksp EstopOkIn and2.0.out
  390. newsig EstopOkOut bit
  391. linksp EstopOkOut <= ppmc.0.dout.07.out
  392. linksp EstopOkOut iocontrol.0.emc-enable-in
  393. linksp EstopOkOut estop-latch.0.ok-out
  394. linksp EstopOkOut and2.0.in1
  395. newsig emc-estop-out bit
  396. linksp emc-estop-out iocontrol.0.user-enable-out
  397. linksp emc-estop-out estop-latch.0.ok-in
  398. newsig emc-estop-reset bit
  399. linksp emc-estop-reset iocontrol.0.user-request-enable
  400. linksp emc-estop-reset estop-latch.0.reset
  401.  
  402. ### TURRET ###
  403. # create signals for tool loading loopback
  404. net ToolPrep iocontrol.0.tool-prepare iocontrol.0.tool-prepared
  405. net ToolChange iocontrol.0.tool-change turret.0.position-change
  406. net ToolChanged turret.0.position-changed iocontrol.0.tool-changed
  407.  
  408. # decode turret encoder inputs
  409. newsig ones bit
  410. newsig twos bit
  411. newsig fours bit
  412. newsig eights bit
  413.  
  414. linksp ones ppmc.0.din.06.in
  415.  
  416. linksp ones wsum.0.bit.0.in
  417. linksp twos ppmc.0.din.07.in
  418. linksp twos wsum.0.bit.1.in
  419. linksp fours ppmc.0.din.08.in
  420. linksp fours wsum.0.bit.2.in
  421. linksp eights ppmc.0.din.09.in
  422. linksp eights wsum.0.bit.3.in
  423. # wsum.N.hold bit in
  424.  
  425. newsig TurretCurrentPosition s32
  426. linksp TurretCurrentPosition wsum.0.sum
  427. linksp TurretCurrentPosition turret.0.position-current
  428.  
  429. newsig TurretRequestedPosition s32
  430. linksp TurretRequestedPosition iocontrol.0.tool-prep-number
  431. linksp TurretRequestedPosition turret.0.position-requested
  432.  
  433. setp turret.0.settle-stop [TURRET]STOP_SETTLE
  434. setp turret.0.settle-park [TURRET]PARK_SETTLE
  435.  
  436. # connect turret to parallel port
  437. newsig TurretSeek bit
  438. linksp TurretSeek turret.0.seek
  439. linksp TurretSeek ppmc.0.dout.05.out
  440.  
  441. newsig TurretStop bit
  442. linksp TurretStop turret.0.stop
  443. linksp TurretStop ppmc.0.dout.06.out
  444.  
  445. #addf turret.0 servo-thread
  446.  
  447. #Turret Info End
  448.  
  449.  
  450.  
  451.  
  452.  
  453. # connect spindle fwd/rev to I/O controller
  454. newsig SpindleFwd bit
  455. newsig SpindleRev bit
  456. linksp SpindleFwd <= ppmc.0.dout.00.out
  457. linksp SpindleFwd => motion.spindle-forward
  458. linksp SpindleRev <= ppmc.0.dout.01.out
  459. linksp SpindleRev => motion.spindle-reverse
  460.  
  461. # connect spindle brake to I/O controller
  462. newsig SpindleBrakeOn bit
  463. linksp SpindleBrakeOn <= ppmc.0.dout.02.out
  464. linksp SpindleBrakeOn => motion.spindle-brake
  465.  
  466. # connect mist/flood coolant to I/O controller
  467. newsig MistOn bit
  468. newsig FloodOn bit
  469. linksp MistOn <= ppmc.0.dout.03.out
  470. linksp MistOn => iocontrol.0.coolant-mist
  471. linksp FloodOn <= parport.0.pin-02-out
  472. setp parport.0.pin-02-out-invert 1
  473. linksp FloodOn => iocontrol.0.coolant-flood
  474. # Line 159 ppmc.0.dout.04.out
  475. #parport.0.pin-02-out
  476.  
  477. setp parport.0.pin-05-out-invert 1
  478. setp parport.0.pin-06-out-invert 1
  479.  
  480. #Connect Verticle Slide switch
  481. #setp parport.0.pin-10-in
  482. net slide-input motion.digital-in-00 <= parport.0.pin-10-in
  483.  
  484.  
  485. # pull the CR-1 relay in when the Power Button is on JT
  486. net machine-power <= motion.motion-enabled =>
  487. # CR-1 Control Power
  488. net machine-power => parport.0.pin-01-out
  489. setp parport.0.pin-01-out-invert 1
  490.  
  491. net brake-off => parport.0.pin-07-out
  492. #setp parport.0.pin-07-out-invert 1
  493.  
  494.  
  495.  
  496. #File from email
  497. #set scale for 5000 RPM MAX and connect spindle speed to USC DAC
  498. setp ppmc.0.DAC8.00.scale 410.0
  499. net spinspeed motion.spindle-speed-out ppmc.0.DAC8.00.value
  500.  
  501. #new info
  502. # These 3 lines from Andy
  503. net spindle-revs-in ppmc.0.encoder.03.velocity => motion.spindle-speed-in
  504.  
  505. net spindle-pos ppmc.0.encoder.03.position => motion.spindle-revs
  506.  
  507. net spindle-index-enable motion.spindle-index-enable <=> ppmc.0.encoder.03.index-enable
  508.  
  509.  
  510.  
  511. # 2 commented out lines from inputing 3 above lines
  512. #net spinraw ppmc.0.encoder.03.delta conv-s32-float.0.in
  513. net spinfloat conv-s32-float.0.out mult2.0.in0
  514. setp mult2.0.in1 0.273066667
  515. #net SpindleRPM mult2.0.out motion.spindle-speed-in
  516.  
  517.  
  518. # 4.096 0.06826667 0.273066667
  519.  
  520. #File from spin
  521. #set scale for 5000 RPM MAX and connect spindle speed to USC DAC
  522. #setp ppmc.0.DAC8.00.scale 500.0
  523. #newsig spinspeed float
  524. #linksp spinspeed <= motion.spindle-speed-out
  525. #linksp spinspeed => ppmc.0.DAC8.00.value
  526.  
  527. #File from 2.3.5
  528. #setp ppmc.0.DAC8.00.scale 390.0
  529. #net spinspeed motiom.spindle-speed-out ppmc.0.DAC8.00.value
  530. #newsig spinspeed float
  531. #linksp spinspeed <= motion.spindle-speed-out
  532. #linksp spinspeed => ppmc.0.DAC8.00.value
  533.  
  534.  
  535.  
  536. loadrt classicladder_rt
  537. addf classicladder.0.refresh servo-thread
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement