Advertisement
pkm

hexapod.hal

pkm
Apr 9th, 2012
777
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.75 KB | None | 0 0
  1. # EMC2 hexapod DMM servos step mode
  2. loadrt genhexkins
  3. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  4. loadrt probe_parport
  5. loadrt hal_parport cfg="0x378 out 0xc880 out"
  6. setp parport.0.reset-time 3000
  7. loadrt stepgen step_type=0,0,0,0,0,0
  8.  
  9. addf parport.0.read base-thread
  10. addf parport.1.read base-thread
  11. addf stepgen.make-pulses base-thread
  12. addf parport.0.write base-thread
  13. addf parport.0.reset base-thread
  14. addf parport.1.write 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.  
  22. net ydir => parport.0.pin-06-out
  23. setp parport.0.pin-07-out-invert 1
  24. net ystep => parport.0.pin-07-out
  25. setp parport.0.pin-07-out-reset 1
  26. net adir => parport.0.pin-08-out
  27. setp parport.0.pin-09-out-invert 1
  28. net astep => parport.0.pin-09-out
  29. setp parport.0.pin-09-out-reset 1
  30. net zdir => parport.0.pin-16-out
  31. setp parport.0.pin-17-out-invert 1
  32. net zstep => parport.0.pin-17-out
  33. setp parport.0.pin-17-out-reset 1
  34.  
  35. net cdir => parport.0.pin-04-out
  36. setp parport.0.pin-05-out-invert 1
  37. net cstep => parport.0.pin-05-out
  38. setp parport.0.pin-05-out-reset 1
  39. net xdir => parport.0.pin-02-out
  40. setp parport.0.pin-03-out-invert 1
  41. net xstep => parport.0.pin-03-out
  42. setp parport.0.pin-03-out-reset 1
  43. net bdir => parport.0.pin-14-out
  44. setp parport.0.pin-01-out-invert 1
  45. net bstep => parport.0.pin-01-out
  46. setp parport.0.pin-01-out-reset 1
  47.  
  48.  
  49. #net home-x <= parport.0.pin-10-in
  50. #net home-y <= parport.0.pin-11-in
  51. #net home-z <= parport.0.pin-12-in
  52. #net estop-ext <= parport.0.pin-13-in
  53.  
  54. #net home-a <= parport.1.pin-10-in
  55. #net home-b <= parport.1.pin-11-in
  56. #net home-c <= parport.1.pin-12-in
  57.  
  58. setp stepgen.0.position-scale [AXIS_0]SCALE
  59. setp stepgen.0.steplen 1
  60. setp stepgen.0.stepspace 0
  61. setp stepgen.0.dirhold 25000
  62. setp stepgen.0.dirsetup 25000
  63. setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
  64. net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
  65. net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
  66. net xstep <= stepgen.0.step
  67. net xdir <= stepgen.0.dir
  68. net xenable axis.0.amp-enable-out => stepgen.0.enable
  69. #net home-x => axis.0.home-sw-in
  70.  
  71. setp stepgen.1.position-scale [AXIS_1]SCALE
  72. setp stepgen.1.steplen 1
  73. setp stepgen.1.stepspace 0
  74. setp stepgen.1.dirhold 25000
  75. setp stepgen.1.dirsetup 25000
  76. setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
  77. net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
  78. net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
  79. net ystep <= stepgen.1.step
  80. net ydir <= stepgen.1.dir
  81. net yenable axis.1.amp-enable-out => stepgen.1.enable
  82. #net home-y => axis.1.home-sw-in
  83.  
  84. setp stepgen.2.position-scale [AXIS_2]SCALE
  85. setp stepgen.2.steplen 1
  86. setp stepgen.2.stepspace 0
  87. setp stepgen.2.dirhold 25000
  88. setp stepgen.2.dirsetup 25000
  89. setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
  90. net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
  91. net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
  92. net zstep <= stepgen.2.step
  93. net zdir <= stepgen.2.dir
  94. net zenable axis.2.amp-enable-out => stepgen.2.enable
  95. #net home-z => axis.2.home-sw-in
  96.  
  97. setp stepgen.3.position-scale [AXIS_3]SCALE
  98. setp stepgen.3.steplen 1
  99. setp stepgen.3.stepspace 0
  100. setp stepgen.3.dirhold 25000
  101. setp stepgen.3.dirsetup 25000
  102. setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
  103. net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
  104. net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
  105. net astep <= stepgen.3.step
  106. net adir <= stepgen.3.dir
  107. net aenable axis.3.amp-enable-out => stepgen.3.enable
  108. #net home-a => axis.3.home-sw-in
  109.  
  110. setp stepgen.4.position-scale [AXIS_4]SCALE
  111. setp stepgen.4.steplen 1
  112. setp stepgen.4.stepspace 0
  113. setp stepgen.4.dirhold 25000
  114. setp stepgen.4.dirsetup 25000
  115. setp stepgen.4.maxaccel [AXIS_4]STEPGEN_MAXACCEL
  116. net bpos-cmd axis.4.motor-pos-cmd => stepgen.4.position-cmd
  117. net bpos-fb stepgen.4.position-fb => axis.4.motor-pos-fb
  118. net bstep <= stepgen.4.step
  119. net bdir <= stepgen.4.dir
  120. net benable axis.4.amp-enable-out => stepgen.4.enable
  121. #net home-b => axis.4.home-sw-in
  122.  
  123. setp stepgen.5.position-scale [AXIS_5]SCALE
  124. setp stepgen.5.steplen 1
  125. setp stepgen.5.stepspace 0
  126. setp stepgen.5.dirhold 25000
  127. setp stepgen.5.dirsetup 25000
  128. setp stepgen.5.maxaccel [AXIS_5]STEPGEN_MAXACCEL
  129. net cpos-cmd axis.5.motor-pos-cmd => stepgen.5.position-cmd
  130. net cpos-fb stepgen.5.position-fb => axis.5.motor-pos-fb
  131. net cstep <= stepgen.5.step
  132. net cdir <= stepgen.5.dir
  133. net cenable axis.5.amp-enable-out => stepgen.5.enable
  134. #net home-c => axis.5.home-sw-in
  135.  
  136. net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
  137. #net estop-out <= iocontrol.0.user-enable-out
  138. #net estop-ext => iocontrol.0.emc-enable-in
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement