Advertisement
Guest User

5axes

a guest
Jan 11th, 2013
155
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 3.84 KB | None | 0 0
  1. # core HAL config file for simulation - 5 axis
  2. # load RT modules: first one the 5-axis kinematics
  3. loadrt 5axiskins
  4.  
  5. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  6. loadrt ddt count=9
  7. loadrt probe_parport
  8. loadrt pwmgen output_type=0
  9.  
  10. # add motion controller functions to servo thread
  11. addf motion-command-handler servo-thread
  12. addf motion-controller servo-thread
  13. addf ddt.0 servo-thread
  14. addf ddt.1 servo-thread
  15. addf ddt.2 servo-thread
  16. addf ddt.3 servo-thread
  17. addf ddt.4 servo-thread
  18. addf ddt.5 servo-thread
  19. addf ddt.6 servo-thread
  20. addf ddt.7 servo-thread
  21. addf ddt.8 servo-thread
  22.  
  23.  
  24.  
  25. # create HAL signals for position commands from motion module
  26. newsig J0pos float
  27. linksp J0pos <= axis.0.motor-pos-cmd
  28. newsig J1pos float
  29. linksp J1pos <= axis.1.motor-pos-cmd
  30. newsig J2pos float
  31. linksp J2pos <= axis.2.motor-pos-cmd
  32. newsig J3pos float
  33. linksp J3pos <= axis.3.motor-pos-cmd
  34. newsig J5pos float
  35. linksp J5pos <= axis.5.motor-pos-cmd
  36.  
  37.  
  38. # loop position commands back to motion module feedback
  39. linksp J0pos => axis.0.motor-pos-fb
  40. linksp J1pos => axis.1.motor-pos-fb
  41. linksp J2pos => axis.2.motor-pos-fb
  42. linksp J3pos => axis.3.motor-pos-fb
  43. linksp J5pos => axis.5.motor-pos-fb
  44.  
  45. # send the position commands thru differentiators to
  46. # generate velocity and accel signals
  47. # define the signals, and hook them up
  48. newsig J0vel float
  49. newsig J0acc float
  50. linksp J0pos => ddt.0.in
  51. linkps ddt.0.out => J0vel
  52. linksp J0vel => ddt.1.in
  53. linkps ddt.1.out => J0acc
  54.  
  55. newsig J1vel float
  56. newsig J1acc float
  57. linksp J1pos => ddt.2.in
  58. linkps ddt.2.out => J1vel
  59. linksp J1vel => ddt.3.in
  60. linkps ddt.3.out => J1acc
  61.  
  62. newsig J2vel float
  63. newsig J2acc float
  64. linksp J2pos => ddt.4.in
  65. linkps ddt.4.out => J2vel
  66. linksp J2vel => ddt.5.in
  67. linkps ddt.5.out => J2acc
  68.  
  69. newsig J3vel float
  70. newsig J3acc float
  71. linksp J3pos => ddt.6.in
  72. linkps ddt.6.out => J3vel
  73. linksp J3vel => ddt.7.in
  74. linkps ddt.7.out => J3acc
  75.  
  76.  
  77.  
  78. # amp control
  79. newsig xena bit
  80. linksp xena axis.0.amp-enable-out
  81. newsig yena bit
  82. linksp yena axis.1.amp-enable-out
  83. newsig zena bit
  84. linksp zena axis.2.amp-enable-out
  85. newsig aena bit
  86. linksp aena axis.3.amp-enable-out
  87. newsig cena bit
  88. linksp cena axis.5.amp-enable-out
  89.  
  90. newsig xflt bit
  91. linksp xflt axis.0.amp-fault-in
  92. newsig yflt bit
  93. linksp yflt axis.1.amp-fault-in
  94. newsig zflt bit
  95. linksp zflt axis.2.amp-fault-in
  96. newsig aflt bit
  97. linksp aflt axis.3.amp-fault-in
  98. newsig cflt bit
  99. linksp cflt axis.5.amp-fault-in
  100.  
  101. # affichage du GUI
  102. loadusr -W 5axisgui
  103. #loadusr -Wn simple_arduino /usr/bin/simple_arduino
  104. # Liaison entre le GUI et la definition des axes
  105. # axes X
  106. #net j0 axis.0.joint-pos-fb simple_arduino.axis0-cmd
  107. net j0 axis.0.joint-pos-fb 5axisgui.joint0
  108. # axes Y
  109. net j1 axis.1.joint-pos-fb 5axisgui.joint1
  110. # axes Z
  111. net j2 axis.2.joint-pos-fb 5axisgui.joint2
  112. # axes A
  113. net j3 axis.3.joint-pos-fb 5axisgui.joint3
  114. # axes C
  115. net j5 axis.5.joint-pos-fb 5axisgui.joint5
  116.  
  117. #unlinkp halui.machine.is-on
  118. #unlinkp halui.machine.on
  119. #unlinkp halui.machine.off
  120. #net machstate simple_arduino.machine-state <= halui.machine.is-on
  121. #net turnoff halui.machine.off <= simple_arduino.switch-off
  122. #net turnon halui.machine.on <= simple_arduino.switch-on
  123.  
  124.  
  125. # Longueur pivot + la longueur outil
  126. #setp 5axiskins.pivot-length
  127. #setp 5axiskins.tooloffset.z 100
  128. # Affichage outil dans le gui
  129. net tool-len motion.tooloffset.w 5axisgui.tool_length
  130.  
  131.  
  132. # Arret d'urgence
  133. net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
  134.  
  135. #Changement outils
  136.  
  137. loadusr -W hal_manualtoolchange
  138.  
  139. net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
  140. net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  141. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  142. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement