Advertisement
Guest User

Gantry Router EMC2 ini file with Mesa 5i23 and 7i47

a guest
Jul 19th, 2010
178
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 14.99 KB | None | 0 0
  1. HAL FILE:
  2. ###First Try file by John English, June 24, 2010
  3. ##Using hm2-stepper.hal as a reference file
  4.  
  5. # ###################################
  6. # BEGIN Core EMC/HAL Loads
  7. # ###################################
  8. # kinematics
  9. loadrt gantrykins
  10. #loadrt probe_parport
  11. setp gantrykins.joint-0 0
  12. setp gantrykins.joint-1 1
  13. setp gantrykins.joint-2 2
  14. setp gantrykins.joint-3 0
  15.  
  16. # This configuration uses classicladder for machine logic
  17. # (load the realtime portion)
  18. # these classicladder parameters need to be optimized after ladder completion
  19. loadrt classicladder_rt numRungs=12 numBits=20 numWords=4 numTimers=5 numMonostables=2 numPhysInputs=16 numPhysOutputs=16 numArithmExpr=4 numSections=4
  20.  
  21. # invoke the user part of CL to silently load the program
  22. # later we will need to add the clp file mentioned below
  23. # to the ini file so that we do not need to hardcode it here.
  24. loadusr -w classicladder --modmaster --nogui shopbot-ladder-1.clp
  25.  
  26. loadrt stepgen step_type=0,0,0,0
  27.  
  28. # motion controller, get name and thread periods from ini file
  29. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  30. # only the 7i43 needs this, but it doesnt hurt the others
  31. loadrt probe_parport
  32.  
  33. #loading this based on sim-xyyz.hal reference
  34. #load additional blocks
  35. loadrt hypot count=2
  36. loadrt comp count=3
  37. loadrt or2 count=1
  38.  
  39. # hostmot2 driver
  40. loadrt hostmot2
  41. # load low-level driver
  42. loadrt hm2_pci config="firmware=hm2/5i23/SVST2_4_7I47.BIT num_encoders=4 num_pwmgens=2 num_stepgens=4"
  43. setp hm2_5i23.0.pwmgen.pwm_frequency 100000
  44. setp hm2_5i23.0.pwmgen.pdm_frequency 100000
  45. setp hm2_5i23.0.watchdog.timeout_ns 10000000
  46.  
  47. ########################################
  48. #### END Core EMC/Hal Loads ############
  49. ########################################
  50.  
  51. # ################################################
  52. # THREADS
  53. # ################################################
  54. addf hm2_5i23.0.read servo-thread
  55. addf hm2_5i23.0.write servo-thread
  56. addf hm2_5i23.0.pet_watchdog servo-thread
  57.  
  58. addf motion-command-handler servo-thread
  59. addf motion-controller servo-thread
  60.  
  61. addf classicladder.0.refresh servo-thread
  62.  
  63. # ################################################
  64. # External Output Signals
  65. # ################################################
  66. #Contactor control for Stepper power
  67. #net contactor-stepper-control <= axis.0.amp-enable-out
  68. #net contactor-stepper-control => hm2_5i23.0.gpio.044.out
  69. #net contactor-stepper-control => hm2_5i23.0.stepgen.00.enable
  70. setp hm2_5i23.0.gpio.044.is_output 1
  71. setp hm2_5i23.0.gpio.044.is_opendrain 1
  72. setp hm2_5i23.0.gpio.044.invert_output 1
  73.  
  74. #Contactor control for Spindle power
  75. #net contactor-spindle-control <= axis.1.amp-enable-out
  76. #net contactor-spindle-control => hm2_5i23.0.gpio.046.out
  77. setp hm2_5i23.0.gpio.046.is_output 1
  78. setp hm2_5i23.0.gpio.046.is_opendrain 1
  79. setp hm2_5i23.0.gpio.046.invert_output 1
  80.  
  81. #Spindle Fan Control
  82. net spindle-fan-control => hm2_5i23.0.gpio.047.out
  83. setp hm2_5i23.0.gpio.047.is_output 1
  84.  
  85. #Mist Coolant Control
  86. net mist-control => hm2_5i23.0.gpio.043.out
  87. setp hm2_5i23.0.gpio.043.is_output 1
  88.  
  89. #Stepper Driver Digital I/O
  90. net alarm-clear-x1 => hm2_5i23.0.gpio.050.out
  91. setp hm2_5i23.0.gpio.050.is_output 1
  92. net alarm-clear-y => hm2_5i23.0.gpio.054.out
  93. setp hm2_5i23.0.gpio.054.is_output 1
  94. net alarm-clear-z => hm2_5i23.0.gpio.058.out
  95. setp hm2_5i23.0.gpio.058.is_output 1
  96. net alarm-clear-x2 => hm2_5i23.0.gpio.062.out
  97. setp hm2_5i23.0.gpio.056.is_output 1
  98. net stepper-windings-off-x1 => hm2_5i23.0.gpio.051.out
  99. setp hm2_5i23.0.gpio.051.is_output 1
  100. net stepper-windings-off-y => hm2_5i23.0.gpio.055.out
  101. setp hm2_5i23.0.gpio.055.is_output 1
  102. net stepper-windings-off-z => hm2_5i23.0.gpio.059.out
  103. setp hm2_5i23.0.gpio.059.is_output 1
  104. net stepper-windings-off-x2 => hm2_5i23.0.gpio.063.out
  105. setp hm2_5i23.0.gpio.063.is_output 1
  106.  
  107.  
  108. # ################################################
  109. # External Input Signals
  110. # ################################################
  111. #Contactor status for Stepper and Spindle power
  112. net contactor-stepper-status <= hm2_5i23.0.gpio.064.in
  113. net contactor-spindle-status <= hm2_5i23.0.gpio.066.in
  114. net contactor-spindle-status => classicladder.0.in-04
  115.  
  116. #Control Pendant
  117. net pendant-green-button <= hm2_5i23.0.gpio.065.in_not
  118. net pendant-green-button <= classicladder.0.in-03
  119. net pendant-blue-button <= hm2_5i23.0.gpio.067.in_not
  120. net pendant-blue-button => classicladder.0.in-02
  121.  
  122. #Remote E-Stop
  123. net estop-remote <= hm2_5i23.0.gpio.032.in_not
  124. net estop-remote => classicladder.0.in-01
  125.  
  126. #Spindle Key Switch
  127. net spindle-key-switch <= hm2_5i23.0.gpio.034.in_not
  128. net spindle-key-switch => classicladder.0.in-05
  129.  
  130. #Zero Plate
  131. #net probe-in => motion.probe-input
  132. #net probe-in <= hm2_5i23.0.gpio.068.in_not
  133.  
  134.  
  135.  
  136. #Prox Sensors
  137. net prox-x1 <= hm2_5i23.0.gpio.024.in_not
  138. net prox-x1 => axis.0.home-sw-in axis.0.neg-lim-sw-in axis.0.pos-lim-sw-in axis.0.home-sw-in axis.3.neg-lim-sw-in axis.3.pos-lim-sw-in axis.3.home-sw-in
  139. net prox-y <= hm2_5i23.0.gpio.026.in_not
  140. net prox-y => axis.1.home-sw-in axis.1.neg-lim-sw-in axis.1.pos-lim-sw-in axis.1.home-sw-in
  141. net prox-z <= hm2_5i23.0.gpio.028.in_not
  142. net prox-z => axis.2.home-sw-in axis.2.neg-lim-sw-in axis.2.pos-lim-sw-in axis.2.home-sw-in
  143. net prox-x2 <= hm2_5i23.0.gpio.030.in_not
  144.  
  145.  
  146. #Stepper Driver Digital I/O #run all of these into estop chain
  147. net alarm-x1 <= hm2_5i23.0.gpio.048.in
  148. #net alarm-x1 => classicladder.0.in-05
  149. net alarm-y <= hm2_5i23.0.gpio.052.in
  150. #net alarm-y => classicladder.0.in-06
  151. net alarm-z <= hm2_5i23.0.gpio.056.in
  152. #net alarm-z => classicladder.0.in-07
  153. net alarm-x2 <= hm2_5i23.0.gpio.060.in
  154. #net alarm-x2 => classicladder.0.in-08
  155.  
  156.  
  157. # ######################################################
  158. # Axis-of-motion Specific Configs (not the GUI)
  159. # ######################################################
  160.  
  161. # axis enable chain
  162. net axis-enable-chain-x1 axis.0.amp-enable-out => hm2_5i23.0.stepgen.00.enable hm2_5i23.0.gpio.044.out hm2_5i23.0.gpio.046.out
  163. net axis-enable-chain-y axis.1.amp-enable-out => hm2_5i23.0.stepgen.01.enable
  164. net axis-enable-chain-z axis.2.amp-enable-out => hm2_5i23.0.stepgen.02.enable
  165. net axis-enable-chain-x2 axis.3.amp-enable-out => hm2_5i23.0.stepgen.03.enable
  166.  
  167.  
  168. # position command and feedback
  169. net emcmot.00.pos-cmd <= axis.0.motor-pos-cmd
  170. net emcmot.01.pos-cmd <= axis.1.motor-pos-cmd
  171. net emcmot.02.pos-cmd <= axis.2.motor-pos-cmd
  172. net emcmot.03.pos-cmd <= axis.3.motor-pos-cmd
  173.  
  174. net emcmot.00.pos-cmd => hm2_5i23.0.stepgen.00.position-cmd
  175. net emcmot.01.pos-cmd => hm2_5i23.0.stepgen.01.position-cmd
  176. net emcmot.02.pos-cmd => hm2_5i23.0.stepgen.02.position-cmd
  177. net emcmot.03.pos-cmd => hm2_5i23.0.stepgen.03.position-cmd
  178.  
  179. net motor.00.pos-fb <= hm2_5i23.0.stepgen.00.position-fb
  180. net motor.01.pos-fb <= hm2_5i23.0.stepgen.01.position-fb
  181. net motor.02.pos-fb <= hm2_5i23.0.stepgen.02.position-fb
  182. net motor.03.pos-fb <= hm2_5i23.0.stepgen.03.position-fb
  183.  
  184. #net motor.00.pos-fb <= hm2_5i23.0.encoder.00.position
  185. #net motor.01.pos-fb <= hm2_5i23.0.encoder.01.position
  186. #net motor.02.pos-fb <= hm2_5i23.0.encoder.02.position
  187. #net motor.03.pos-fb <= hm2_5i23.0.encoder.03.position
  188.  
  189. net motor.00.pos-fb => axis.0.motor-pos-fb
  190. net motor.01.pos-fb => axis.1.motor-pos-fb
  191. net motor.02.pos-fb => axis.2.motor-pos-fb
  192. net motor.03.pos-fb => axis.3.motor-pos-fb
  193.  
  194.  
  195. # timing parameters
  196. setp hm2_5i23.0.stepgen.00.dirsetup [AXIS_0]DIRSETUP
  197. setp hm2_5i23.0.stepgen.01.dirsetup [AXIS_1]DIRSETUP
  198. setp hm2_5i23.0.stepgen.02.dirsetup [AXIS_2]DIRSETUP
  199. setp hm2_5i23.0.stepgen.03.dirsetup [AXIS_3]DIRSETUP
  200.  
  201. setp hm2_5i23.0.stepgen.00.dirhold [AXIS_0]DIRHOLD
  202. setp hm2_5i23.0.stepgen.01.dirhold [AXIS_1]DIRHOLD
  203. setp hm2_5i23.0.stepgen.02.dirhold [AXIS_2]DIRHOLD
  204. setp hm2_5i23.0.stepgen.03.dirhold [AXIS_3]DIRHOLD
  205.  
  206. setp hm2_5i23.0.stepgen.00.steplen [AXIS_0]STEPLEN
  207. setp hm2_5i23.0.stepgen.01.steplen [AXIS_1]STEPLEN
  208. setp hm2_5i23.0.stepgen.02.steplen [AXIS_1]STEPLEN
  209. setp hm2_5i23.0.stepgen.03.steplen [AXIS_3]STEPLEN
  210.  
  211.  
  212. setp hm2_5i23.0.stepgen.00.stepspace [AXIS_0]STEPSPACE
  213. setp hm2_5i23.0.stepgen.01.stepspace [AXIS_1]STEPSPACE
  214. setp hm2_5i23.0.stepgen.02.stepspace [AXIS_2]STEPSPACE
  215. setp hm2_5i23.0.stepgen.03.stepspace [AXIS_3]STEPSPACE
  216.  
  217. setp hm2_5i23.0.stepgen.00.position-scale [AXIS_0]SCALE
  218. setp hm2_5i23.0.stepgen.01.position-scale [AXIS_1]SCALE
  219. setp hm2_5i23.0.stepgen.02.position-scale [AXIS_2]SCALE
  220. setp hm2_5i23.0.stepgen.03.position-scale [AXIS_3]SCALE
  221.  
  222.  
  223. setp hm2_5i23.0.stepgen.00.maxaccel [AXIS_0]MAX_ACCELERATION
  224. setp hm2_5i23.0.stepgen.01.maxaccel [AXIS_1]MAX_ACCELERATION
  225. setp hm2_5i23.0.stepgen.02.maxaccel [AXIS_2]MAX_ACCELERATION
  226. setp hm2_5i23.0.stepgen.03.maxaccel [AXIS_3]MAX_ACCELERATION
  227.  
  228.  
  229. setp hm2_5i23.0.stepgen.00.step_type 0
  230. setp hm2_5i23.0.stepgen.01.step_type 0
  231. setp hm2_5i23.0.stepgen.02.step_type 0
  232. setp hm2_5i23.0.stepgen.03.step_type 0
  233.  
  234.  
  235. #setp hm2_5i23.0.stepgen.00.maxvel 0
  236. #setp hm2_5i23.0.stepgen.01.maxvel 0
  237. #setp hm2_5i23.0.stepgen.02.maxvel 0
  238. #setp hm2_5i23.0.stepgen.03.maxvel 0
  239.  
  240.  
  241.  
  242.  
  243. # ######################################################
  244. # Post-GUI / Classic Ladder
  245. # ######################################################
  246.  
  247. net gui-estop <= iocontrol.0.user-enable-out
  248. net gui-estop => classicladder.0.in-00
  249.  
  250. #E-stop Related
  251. net estop-all-ok <= classicladder.0.out-00
  252. net estop-all-ok => iocontrol.0.emc-enable-in
  253.  
  254. # ######################################################
  255. # Classic Ladder Zero-Plate Control
  256. # ######################################################
  257.  
  258. # set up the z-axis touchoff button
  259. #net remote-z-axis-touchoff classicladder.0.in-00 <= pyvcp.z-axis-touchoff
  260.  
  261. # set to mdi mode
  262. # show pin
  263. #net mode halui.mode.is-mdi => classicladder.0.in-07
  264.  
  265. # wait for motion to finish
  266. #net in_pos motion.in-position => classicladder.0.in-08
  267.  
  268. # mdi command 1 MDI_COMMAND = G38.2 Z-3 F16
  269. #net z-touchoff classicladder.0.out-05 => halui.mdi-command-00
  270.  
  271. # mdi command 2 MDI_COMMAND = G92 Z0.25
  272. #net z-zero classicladder.0.out-06 => halui.mdi-command-01
  273.  
  274. # mdi command 3 MDI_COMMAND = G0 Z1
  275. #net rapid-away classicladder.0.out-07 => halui.mdi-command-02
  276.  
  277. # mdi command 4 MDI_COMMAND = G0 X-2 Y1
  278. #net zero-x-y halui.mdi-command-03 <= pyvcp.x-y_zero
  279.  
  280.  
  281.  
  282.  
  283.  
  284. INI FILE:
  285. # Generated by PNCconf at Tue Jun 22 13:04:05 2010
  286. # If you make changes to this file, they will be
  287. # overwritten when you run PNCconf again
  288.  
  289. [EMC]
  290. MACHINE = shopbot-config-1
  291. DEBUG = 0
  292.  
  293. [DISPLAY]
  294. DISPLAY = axis
  295. # Cycle time, in seconds, that display will sleep between polls
  296. CYCLE_TIME = 0.200
  297. #- Initial display setting for position, RELATIVE or MACHINE
  298. POSITION_OFFSET = RELATIVE
  299. #- Initial display setting for position, COMMANDED or ACTUAL
  300. POSITION_FEEDBACK = ACTUAL
  301. #+ Highest value that will be allowed for feed override, 1.0 = 100%
  302. MAX_FEED_OVERRIDE = 2.000000
  303. MAX_SPINDLE_OVERRIDE = 1.000000
  304. MIN_SPINDLE_OVERRIDE = 0.500000
  305. INTRO_GRAPHIC = emc2.gif
  306. INTRO_TIME = 5
  307. PROGRAM_PREFIX = /home/bes/emc2/nc_files
  308. INCREMENTS = .1in .05in .01in .005in .001in .0005in .0001in
  309. POSITION_OFFSET = RELATIVE
  310. POSITION_FEEDBACK = ACTUAL
  311. DEFAULT_LINEAR_VELOCITY = 2
  312. MAX_LINEAR_VELOCITY = 12
  313. MIN_LINEAR_VELOCITY = 0.000833
  314. EDITOR = gedit
  315. GEOMETRY = xyz
  316. PYVCP = panel.xml
  317.  
  318. [FILTER]
  319. PROGRAM_EXTENSION = .png,.gif,.jpg Greyscale Depth Image
  320. PROGRAM_EXTENSION = .py Python Script
  321. png = image-to-gcode
  322. gif = image-to-gcode
  323. jpg = image-to-gcode
  324. py = python
  325.  
  326. [TASK]
  327. TASK = milltask
  328. CYCLE_TIME = 0.010
  329.  
  330. [RS274NGC]
  331. PARAMETER_FILE = emc.var
  332.  
  333. [EMCMOT]
  334. EMCMOT = motmod
  335. COMM_TIMEOUT = 1.0
  336. COMM_WAIT = 0.010
  337. BASE_PERIOD = 20000
  338. SERVO_PERIOD = 1000000
  339.  
  340. # [HOSTMOT2]
  341. # This is for info only
  342. # DRIVER0=hm2_pci
  343. # BOARD0=5i23
  344. # CONFIG0="firmware=hm2/5i23/SVST2_4_7I47.BIT num_encoders=4 num_pwmgens=2 num_stepgens=4"
  345.  
  346. [HAL]
  347. # The run script first uses halcmd to execute any HALFILE
  348. # files, and then to execute any individual HALCMD commands.
  349. #
  350.  
  351. # HALUI to interact with NML
  352. # Run before any other HALFILE
  353. HALUI = halui
  354. HALFILE = shopbot-config-1.hal
  355.  
  356. [HALUI]
  357. MDI_COMMAND = G38.2 Z-2 f16
  358. MDI_COMMAND = G92 Z0.25
  359. MDI_COMMAND = G0 Z0.75
  360. MDI_COMMAND = G92 x2 y-.5
  361.  
  362. [TRAJ]
  363. AXES = 4
  364. COORDINATES = X Y Z
  365. #HOME = 0 0 0
  366. LINEAR_UNITS = inch
  367. ANGULAR_UNITS = degree
  368. CYCLE_TIME = 0.010
  369. DEFAULT_VELOCITY = 2
  370. MAX_LINEAR_VELOCITY = 12
  371. NO_FORCE_HOMING = 1
  372.  
  373. [EMCIO]
  374. EMCIO = io
  375. CYCLE_TIME = 0.100
  376. TOOL_TABLE = tool.tbl
  377.  
  378. #********************
  379. # Axis X
  380. #********************
  381. [AXIS_0]
  382. TYPE = LINEAR
  383. SCALE = 2482.81711223357
  384. OUTPUT_SCALE = 1.0
  385. MAX_VELOCITY = 12
  386. MAX_ACCELERATION = 12
  387. OUTPUT_OFFSET = 0.0
  388. #INPUT_SCALE = 2000.0
  389. MIN_LIMIT = -0.25
  390. MAX_LIMIT = 96.0
  391. FERROR = 500
  392. MIN_FERROR = 01.00
  393. HOME = 1
  394. HOME_OFFSET = -0.25
  395. HOME_SEARCH_VEL = -0.50000
  396. HOME_LATCH_VEL = 0.16667
  397. HOME_FINAL_VEL = 0.16667
  398. HOME_USE_INDEX = No
  399. HOME_IGNORE_LIMITS = YES
  400. HOME_IS_SHARED = 1
  401. HOME_SEQUENCE = 1
  402. # these are in nanoseconds
  403. DIRSETUP = 1500
  404. DIRHOLD = 1500
  405. STEPLEN = 1500
  406. STEPSPACE = 2500
  407.  
  408.  
  409. #********************
  410. # Axis Y
  411. #********************
  412. [AXIS_1]
  413. TYPE = LINEAR
  414. SCALE = 2482.81711223357
  415. OUTPUT_SCALE = 1.0
  416. FERROR = 500
  417. MIN_FERROR = 01.00
  418. MAX_ACCELERATION = 12
  419. OUTPUT_OFFSET = 0.0
  420. MIN_LIMIT = -1
  421. MAX_LIMIT = 72.0
  422. HOME_OFFSET = -0.25
  423. HOME_SEARCH_VEL = -0.50000
  424. HOME_LATCH_VEL = 0.16667
  425. HOME_FINAL_VEL = 0.16667
  426. HOME_USE_INDEX = NO
  427. HOME_IGNORE_LIMITS = YES
  428. HOME_IS_SHARED = 1
  429. HOME_SEQUENCE = 0
  430. HOME = 1
  431. # these are in nanoseconds
  432. DIRSETUP = 1500
  433. DIRHOLD = 1500
  434. STEPLEN = 1500
  435. STEPSPACE = 2500
  436.  
  437. #********************
  438. # Axis Z
  439. #********************
  440. [AXIS_2]
  441. TYPE = LINEAR
  442. SCALE = 2979.38053468028
  443. OUTPUT_SCALE = 1.0
  444. FERROR = 500
  445. MIN_FERROR = 01.00
  446. MAX_ACCELERATION = 12
  447. OUTPUT_OFFSET = 0.0
  448. MIN_LIMIT = -6
  449. MAX_LIMIT = 0
  450. HOME = 0.125
  451. HOME_OFFSET = 0
  452. HOME_SEARCH_VEL = 0.50000
  453. HOME_LATCH_VEL = -0.16667
  454. HOME_FINAL_VEL = -0.16667
  455. HOME_USE_INDEX = NO
  456. HOME_IGNORE_LIMITS = YES
  457. HOME_IS_SHARED = 1
  458. HOME_SEQUENCE = 2
  459. # these are in nanoseconds
  460. DIRSETUP = 1500
  461. DIRHOLD = 1500
  462. STEPLEN = 1500
  463. STEPSPACE = 2500
  464.  
  465.  
  466. #********************
  467. # Axis X2
  468. #********************
  469. [AXIS_3]
  470. TYPE = LINEAR
  471. SCALE = 2482.81711223357
  472. OUTPUT_SCALE = 1.0
  473. MAX_VELOCITY = 12
  474. MAX_ACCELERATION = 12
  475. OUTPUT_OFFSET = 0.0
  476. MIN_LIMIT = -0.25
  477. MAX_LIMIT = 96.0
  478. FERROR = 500
  479. MIN_FERROR = 01.00
  480. HOME = 1
  481. HOME_OFFSET = -0.25
  482. HOME_SEARCH_VEL = -0.50000
  483. HOME_LATCH_VEL = 0.16667
  484. HOME_FINAL_VEL = 0.16667
  485. HOME_USE_INDEX = No
  486. HOME_IGNORE_LIMITS = YES
  487. HOME_IS_SHARED = 1
  488. HOME_SEQUENCE = 1
  489. # these are in nanoseconds
  490. DIRSETUP = 1500
  491. DIRHOLD = 1500
  492. STEPLEN = 1500
  493. STEPSPACE = 2500
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement