Advertisement
Guest User

mevon sim_core.hal

a guest
Nov 21st, 2012
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.30 KB | None | 0 0
  1. # core HAL config file for simulation
  2.  
  3. #First load the Python user module named /user/bin/9axis_arduino with the name 'arduino'
  4. loadusr -Wn arduino /usr/bin/9axis_arduino
  5.  
  6. # first load all the RT modules that will be needed
  7. # kinematics
  8. loadrt trivkins
  9. # motion controller, get name and thread periods from ini file
  10. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  11. # load 6 differentiators (for velocity and accel signals
  12. loadrt ddt count=6
  13. # load additional blocks
  14. loadrt hypot count=2
  15. loadrt comp count=3
  16. loadrt or2 count=1
  17.  
  18. # add motion controller functions to servo thread
  19. addf motion-command-handler servo-thread
  20. addf motion-controller servo-thread
  21. # link the differentiator functions into the code
  22. addf ddt.0 servo-thread
  23. addf ddt.1 servo-thread
  24. addf ddt.2 servo-thread
  25. addf ddt.3 servo-thread
  26. addf ddt.4 servo-thread
  27. addf ddt.5 servo-thread
  28. addf hypot.0 servo-thread
  29. addf hypot.1 servo-thread
  30.  
  31. # create HAL signals for position commands from motion module
  32. # loop position commands back to motion module feedback
  33. #net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt.0.in
  34. #net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt.2.in
  35. #net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt.4.in
  36.  
  37. #net Xpos arduino.axis0-pos => axis.0.motor-pos-fb ddt.0.in
  38. #net Ypos arduino.axis1-pos => axis.1.motor-pos-fb ddt.2.in
  39. #net Zpos arduino.axis2-pos => axis.2.motor-pos-fb ddt.4.in
  40.  
  41.  
  42. net Xpos axis.0.motor-pos-cmd => arduino.axis0-cmd
  43. net Xpos-fb arduino.axis0-pos => axis.0.motor-pos-fb ddt.0.in
  44. net Ypos axis.1.motor-pos-cmd => arduino.axis1-cmd
  45. net Ypos-fb arduino.axis1-pos => axis.1.motor-pos-fb ddt.2.in
  46. net Zpos axis.2.motor-pos-cmd => arduino.axis2-cmd
  47. net Zpos-fb arduino.axis2-pos => axis.2.motor-pos-fb ddt.4.in
  48.  
  49.  
  50. # send the position commands thru differentiators to
  51. # generate velocity and accel signals
  52. net Xvel ddt.0.out => ddt.1.in hypot.0.in0
  53. net Xacc <= ddt.1.out
  54. net Yvel ddt.2.out => ddt.3.in hypot.0.in1
  55. net Yacc <= ddt.3.out
  56. net Zvel ddt.4.out => ddt.5.in hypot.1.in0
  57. net Zacc <= ddt.5.out
  58.  
  59. # Cartesian 2- and 3-axis velocities
  60. net XYvel hypot.0.out => hypot.1.in1
  61. net XYZvel <= hypot.1.out
  62.  
  63. # estop loopback
  64. net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
  65.  
  66. # Control panel switches
  67. # E-Stop
  68. #unlinkp iocontrol.0.user-enable-out
  69. #unlinkp iocontrol.0.emc-enable-in
  70. #net eStop iocontrol.0.user-enable-out => arduino.eStop
  71. #net eStop iocontrol.0.emc-enable-in <= arduino.eStop
  72.  
  73. # Power
  74. #unlinkp halui.machine.is-on
  75. #unlinkp halui.machine.on
  76. #unlinkp halui.machine.off
  77. #net machstate arduino.machine-state <= halui.machine.is-on
  78. #net turnoff halui.machine.off <= arduino.switch-off
  79. #net turnon halui.machine.on <= arduino.switch-on
  80.  
  81. # Start/Run
  82. #unlinkp halui.program.run
  83. #net ProgramStart arduino.start => halui.program.run
  84.  
  85. # Stop
  86. #unlinkp halui.program.stop
  87. #net ProgramStop arduino.stop => halui.program.stop
  88.  
  89. # Pause
  90. #unlinkp halui.program.pause
  91. #net ProgramPause arduino.pause => halui.program.pause
  92.  
  93. # Resume
  94. #unlinkp halui.program.resume
  95. #net ProgramResume arduino.resume => halui.program.resume
  96.  
  97. # Program step
  98. #unlinkp halui.program.step
  99. #net ProgramStep arduino.step => halui.program.step
  100.  
  101. # Touch probe
  102. #unlinkp motion.probe-input
  103. #net probe arduino.probe => motion.probe-input
  104.  
  105. # Spindle power
  106. #unlinkp motion.spindle-on
  107. #net spindle-On arduino.spindleEnable <= motion.spindle-on
  108.  
  109. # Spindle direction
  110. #unlinkp motion.spindle-reverse
  111. #net spindle-Dir arduino.spindleDirection <= motion.spindle-reverse
  112.  
  113. # Spindle at speed
  114. #unlinkp motion.spindle-at-speed
  115. #net spindle-at-speed arduino.spindleAtSpeed => motion.spindle-at-speed
  116.  
  117. # Coolant flood
  118. #unlinkp iocontrol.0.coolant-flood
  119. #net flood arduino.coolantFlood <= iocontrol.0.coolant-flood
  120.  
  121. # Coolant mist
  122. #unlinkp iocontrol.0.coolant-mist
  123. #net mist arduino.coolantMist <= iocontrol.0.coolant-mist
  124.  
  125. # create signals for tool loading loopback
  126. net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
  127. net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
  128.  
  129.  
  130. ###############################################################################
  131. ##### Now on to the axies, if you don't have a given axis comment out the #####
  132. ##### related section entirely. If you don't, EMC will crash on load. #####
  133. ##### (But will give you useful debug info to guide you.) #####
  134. ###############################################################################
  135. ##### If you just want the switches for an axis, comment out the lines #####
  136. ##### containing the word 'motor' in them for the axies you DO have. #####
  137. ###############################################################################
  138.  
  139. ### X-axis (axis.0) ###
  140. #unlinkp axis.0.home-sw-in
  141. #net home-X arduino.xHome => axis.0.home-sw-in
  142.  
  143. #unlinkp axis.0.neg-lim-sw-in
  144. net min-home-X arduino.xMinLmt => axis.0.neg-lim-sw-in axis.0.home-sw-in
  145. #net min-X arduino.xMinLmt => axis.0.neg-lim-sw-in
  146.  
  147. #unlinkp axis.0.pos-lim-sw-in
  148. net max-X arduino.xMaxLmt => axis.0.pos-lim-sw-in
  149.  
  150. #unlinkp axis.0.motor-pos-cmd
  151. #net Xpos-cmd axis.0.motor-pos-cmd => arduino.axis0-cmd
  152. #net Xpos => arduino.axis0-cmd
  153.  
  154.  
  155. ### Y-axis (axis.1) ###
  156. #unlinkp axis.1.home-sw-in
  157. #net home-Y arduino.yHome => axis.1.home-sw-in
  158.  
  159. #unlinkp axis.1.neg-lim-sw-in
  160. net min-home-Y arduino.yMinLmt => axis.1.neg-lim-sw-in axis.1.home-sw-in
  161. #net min-Y arduino.yMinLmt => axis.1.neg-lim-sw-in
  162.  
  163. #unlinkp axis.1.pos-lim-sw-in
  164. net max-Y arduino.yMaxLmt => axis.1.pos-lim-sw-in
  165.  
  166. #unlinkp axis.1.motor-pos-cmd
  167. #net Ypos-cmd axis.1.motor-pos-cmd => arduino.axis1-cmd
  168. #net Ypos => arduino.axis1-cmd
  169.  
  170.  
  171. ### Z-axis (axis.2) ###
  172. #unlinkp axis.2.home-sw-in
  173. #net home-Z arduino.zHome => xis.2.home-sw-in
  174.  
  175. #unlinkp axis.2.neg-lim-sw-in
  176. net min-home-Z => arduino.zMinLmt => axis.2.neg-lim-sw-in axis.2.home-sw-in
  177. #net min-Z => arduino.zMinLmt => axis.2.neg-lim-sw-in
  178.  
  179. #unlinkp axis.2.pos-lim-sw-in
  180. net max-Z => arduino.zMaxLmt => axis.2.pos-lim-sw-in
  181.  
  182. #unlinkp axis.2.motor-pos-cmd
  183. #net Zpos-cmd axis.2.motor-pos-cmd => arduino.axis2-cmd
  184. #net Zpos => arduino.axis2-cmd
  185.  
  186.  
  187. ### A-axis (axis.3) ###
  188. #unlinkp axis.3.home-sw-in
  189. #net home-A arduino.aHome => axis.3.home-sw-in
  190.  
  191. #unlinkp axis.3.neg-lim-sw-in
  192. #net min-A => arduino.aMinLmt => axis.3.neg-lim-sw-in
  193.  
  194. #unlinkp axis.3.pos-lim-sw-in
  195. #net max-A => arduino.aMaxLmt => axis.3.pos-lim-sw-in
  196.  
  197. #unlinkp axis.3.motor-pos-cmd
  198. #net apos-cmd axis.3.motor-pos-cmd => arduino.axis3-cmd
  199.  
  200.  
  201. ### B-axis (axis.4) ###
  202. #unlinkp axis.4.home-sw-in
  203. #net home-B arduino.bHome => axis.4.home-sw-in
  204.  
  205. #unlinkp axis.4.neg-lim-sw-in
  206. #net min-B => arduino.bMinLmt => axis.4.neg-lim-sw-in
  207.  
  208. #unlinkp axis.4.pos-lim-sw-in
  209. #net max-B => arduino.bMaxLmt => axis.4.pos-lim-sw-in
  210.  
  211. #unlinkp axis.4.motor-pos-cmd
  212. #net bpos-cmd axis.4.motor-pos-cmd => arduino.axis4-cmd
  213.  
  214.  
  215. ### C-axis (axis.5) ###
  216. #unlinkp axis.5.home-sw-in
  217. #net home-C arduino.cHome => axis.5.home-sw-in
  218.  
  219. #unlinkp axis.5.neg-lim-sw-in
  220. #net min-C => arduino.cMinLmt => axis.5.neg-lim-sw-in
  221.  
  222. #unlinkp axis.5.pos-lim-sw-in
  223. #net max-C => arduino.cMaxLmt => axis.5.pos-lim-sw-in
  224.  
  225. #unlinkp axis.5.motor-pos-cmd
  226. #net cpos-cmd axis.5.motor-pos-cmd => arduino.axis5-cmd
  227.  
  228.  
  229. ### U-axis (axis.6) ###
  230. #unlinkp axis.6.home-sw-in
  231. #net home-U arduino.uHome => axis.6.home-sw-in
  232.  
  233. #unlinkp axis.6.neg-lim-sw-in
  234. #net min-U => arduino.uMinLmt => axis.6.neg-lim-sw-in
  235.  
  236. #unlinkp axis.6.pos-lim-sw-in
  237. #net max-U => arduino.uMaxLmt => axis.6.pos-lim-sw-in
  238.  
  239. #unlinkp axis.6.motor-pos-cmd
  240. #net upos-cmd axis.6.motor-pos-cmd => arduino.axis6-cmd
  241.  
  242.  
  243. ### V-axis (axis.7) ###
  244. #unlinkp axis.7.home-sw-in
  245. #net home-V arduino.vHome => axis.7.home-sw-in
  246.  
  247. #unlinkp axis.7.neg-lim-sw-in
  248. #net min-V => arduino.vMinLmt => axis.7.neg-lim-sw-in
  249.  
  250. #unlinkp axis.7.pos-lim-sw-in
  251. #net max-V => arduino.vMaxLmt => axis.7.pos-lim-sw-in
  252.  
  253. #unlinkp axis.7.motor-pos-cmd
  254. #net vpos-cmd axis.7.motor-pos-cmd => arduino.axis7-cmd
  255.  
  256.  
  257. ### W-axis (axis.8) ###
  258. #unlinkp axis.8.home-sw-in
  259. #net home-W arduino.wHome => axis.8.home-sw-in
  260.  
  261. #unlinkp axis.8.neg-lim-sw-in
  262. #net min-W => arduino.wMinLmt => axis.8.neg-lim-sw-in
  263.  
  264. #unlinkp axis.8.pos-lim-sw-in
  265. #net max-W => arduino.wMaxLmt => axis.8.pos-lim-sw-in
  266.  
  267. #unlinkp axis.8.motor-pos-cmd
  268. #net wpos-cmd axis.8.motor-pos-cmd => arduino.axis8-cmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement