Advertisement
Guest User

5axes real .hal

a guest
Jan 11th, 2013
100
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 4.87 KB | None | 0 0
  1. # Généré par Stepconf le Thu Nov  3 16:18:15 2011
  2. # Si vous modifiez ce fichier, il sera
  3. # écrasé quand vous relancerez Stepconf
  4. loadrt 5axiskins
  5. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  6. loadrt probe_parport
  7. loadrt hal_parport cfg="0xcc00 out  "
  8. setp parport.0.reset-time 5000
  9. loadrt stepgen step_type=0,0,0,0,0,0
  10.  
  11. addf parport.0.read base-thread
  12. addf stepgen.make-pulses base-thread
  13. addf parport.0.write base-thread
  14. addf parport.0.reset base-thread
  15.  
  16. addf stepgen.capture-position servo-thread
  17. addf motion-command-handler servo-thread
  18. addf motion-controller servo-thread
  19. addf stepgen.update-freq servo-thread
  20. net spindle-cmd <= motion.spindle-speed-out
  21. net spindle-on <= motion.spindle-on
  22.  
  23. #Connection vers axes
  24. net xenable => parport.0.pin-01-out
  25.  
  26. setp parport.0.pin-02-out-invert 1
  27. net xstep => parport.0.pin-02-out
  28.  
  29. setp parport.0.pin-03-out-invert 1
  30. net ydir => parport.0.pin-03-out
  31.  
  32. net bstep => parport.0.pin-04-out
  33. setp parport.0.pin-04-out-reset 1
  34.  
  35. net adir => parport.0.pin-05-out
  36.  
  37. net astep => parport.0.pin-06-out
  38. setp parport.0.pin-06-out-reset 1
  39.  
  40. setp parport.0.pin-07-out-invert 1
  41. net zstep => parport.0.pin-07-out
  42.  
  43. setp parport.0.pin-08-out-invert 1
  44. net zdir => parport.0.pin-08-out
  45.  
  46. net spindle-on => parport.0.pin-09-out
  47.  
  48. setp parport.0.pin-14-out-invert 1
  49. net xdir => parport.0.pin-14-out
  50.  
  51. setp parport.0.pin-16-out-invert 1
  52. net ystep => parport.0.pin-16-out
  53.  
  54. net bdir => parport.0.pin-17-out
  55.  
  56. # arrêt d'urgence
  57. #net estop-loop parport.0.pin-13-in iocontrol.0.emc-enable-in
  58. net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
  59.  
  60.  
  61. #Prise d'origine machine (POM)
  62. net Xhome parport.0.pin-10-in => axis.0.home-sw-in
  63. net Yhome parport.0.pin-11-in => axis.1.home-sw-in
  64. net Zhome parport.0.pin-12-in => axis.2.home-sw-in
  65.  
  66.  
  67. #Contrôle moteur
  68.  
  69. #AXES X
  70.  
  71. setp stepgen.0.position-scale [AXIS_0]SCALE
  72. setp stepgen.0.steplen 1
  73. setp stepgen.0.stepspace 0
  74. setp stepgen.0.dirhold 41000
  75. setp stepgen.0.dirsetup 41000
  76. setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
  77. net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
  78. net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
  79. net xstep <= stepgen.0.step
  80. net xdir <= stepgen.0.dir
  81. net xenable axis.0.amp-enable-out => stepgen.0.enable
  82.  
  83.  
  84. #AXES Y
  85.  
  86. setp stepgen.1.position-scale [AXIS_1]SCALE
  87. setp stepgen.1.steplen 1
  88. setp stepgen.1.stepspace 0
  89. setp stepgen.1.dirhold 41000
  90. setp stepgen.1.dirsetup 41000
  91. setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
  92. net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
  93. net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
  94. net ystep <= stepgen.1.step
  95. net ydir <= stepgen.1.dir
  96. net yenable axis.1.amp-enable-out => stepgen.1.enable
  97.  
  98.  
  99. #AXES Z
  100.  
  101. setp stepgen.2.position-scale [AXIS_2]SCALE
  102. setp stepgen.2.steplen 1
  103. setp stepgen.2.stepspace 0
  104. setp stepgen.2.dirhold 41000
  105. setp stepgen.2.dirsetup 41000
  106. setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
  107. net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
  108. net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
  109. net zstep <= stepgen.2.step
  110. net zdir <= stepgen.2.dir
  111. net zenable axis.2.amp-enable-out => stepgen.2.enable
  112.  
  113.  
  114. #AXES A
  115.  
  116. setp stepgen.3.position-scale [AXIS_3]SCALE
  117. setp stepgen.3.steplen 1
  118. setp stepgen.3.stepspace 0
  119. setp stepgen.3.dirhold 41000
  120. setp stepgen.3.dirsetup 41000
  121. setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
  122. net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
  123. net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
  124. net astep <= stepgen.3.step
  125. net adir <= stepgen.3.dir
  126. net aenable axis.3.amp-enable-out => stepgen.3.enable
  127.  
  128.  
  129. #AXES C
  130.  
  131. setp stepgen.5.position-scale [AXIS_5]SCALE
  132. setp stepgen.5.steplen 1
  133. setp stepgen.5.stepspace 0
  134. setp stepgen.5.dirhold 41000
  135. setp stepgen.5.dirsetup 41000
  136. setp stepgen.5.maxaccel [AXIS_4]STEPGEN_MAXACCEL
  137. net bpos-cmd axis.5.motor-pos-cmd => stepgen.5.position-cmd
  138. net bpos-fb stepgen.5.position-fb => axis.5.motor-pos-fb
  139. net bstep <= stepgen.5.step
  140. net bdir <= stepgen.5.dir
  141. net benable axis.5.amp-enable-out => stepgen.5.enable
  142.  
  143.  
  144. #Changement outils
  145.  
  146. loadusr -W hal_manualtoolchange
  147.  
  148. net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
  149. net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  150. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  151. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
  152.  
  153.  
  154. #### écran graphique de la machine 5 axes ####
  155.  
  156. loadusr -W 5axisgui
  157.  
  158. net j0 axis.0.joint-pos-fb 5axisgui.joint0
  159. net j1 axis.1.joint-pos-fb 5axisgui.joint1
  160. net j2 axis.2.joint-pos-fb 5axisgui.joint2
  161. net j3 axis.3.joint-pos-fb 5axisgui.joint3
  162. net j5 axis.5.joint-pos-fb 5axisgui.joint5
  163.  
  164. # Longueur pivot + la longueur outil
  165. setp 5axiskins.pivot-length 450
  166.  
  167. net tool-len motion.tooloffset.w 5axisgui.tool_length
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement