Advertisement
Guest User

MacGalempsy

a guest
Nov 13th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. # Basic 5i25/7i77 configuration
  2.  
  3. # kinematics
  4. loadrt trivkins
  5.  
  6. # motion controller
  7. loadrt motmod servo_period_nsec=1000000 num_joints=[TRAJ]AXES
  8.  
  9. # hostmot2 driver
  10. # if you have any firmware trouble, enable the debug flags here and see what's going on in the syslog
  11. #loadrt hostmot2 debug_idrom=1 debug_module_descriptors=1 debug_pin_descriptors=1 debug_modules=1
  12. loadrt hostmot2
  13.  
  14. # load low-level driver
  15. loadrt hm2_pci config="num_encoders=6 sserial_port_0=003xxx"
  16.  
  17. # pid
  18. loadrt pid num_chan=3
  19.  
  20. setp hm2_5i25.0.watchdog.timeout_ns 10000000
  21.  
  22. # Threads
  23. addf hm2_5i25.0.read servo-thread
  24. addf motion-command-handler servo-thread
  25. addf motion-controller servo-thread
  26. addf pid.0.do-pid-calcs servo-thread
  27. addf pid.1.do-pid-calcs servo-thread
  28. addf pid.2.do-pid-calcs servo-thread
  29. addf hm2_5i25.0.write servo-thread
  30. addf hm2_5i25.0.pet_watchdog servo-thread
  31.  
  32. # X Axis
  33. setp hm2_5i25.0.encoder.00.scale [AXIS_0]INPUT_SCALE
  34. setp pid.0.Pgain [AXIS_0]P
  35. setp pid.0.Igain [AXIS_0]I
  36. setp pid.0.Dgain [AXIS_0]D
  37. setp pid.0.FF0 [AXIS_0]FF0
  38. setp pid.0.FF1 [AXIS_0]FF1
  39. setp pid.0.FF2 [AXIS_0]FF2
  40.  
  41. net x-axis-enable pid.0.enable <= axis.0.amp-enable-out
  42. net x-axis-enable hm2_5i25.0.7i77.0.1.analogena
  43. net x-axis-fb pid.0.feedback <= hm2_5i25.0.encoder.00.position
  44. net x-axis-fb axis.0.motor-pos-fb
  45. net x-axis-pos-cmd axis.0.motor-pos-cmd => pid.0.command
  46. net x-axis-command pid.0.output => hm2_5i25.0.7i77.0.1.analogout0
  47.  
  48. net x-amp-fault <= hm2_5i25.0.7i77.0.0.input-01
  49. net x-amp-fault => axis.0.amp-fault-in
  50.  
  51. #net x-jog-select axis.0.jog-enable <= hm2_5i25.0.7i77.0.0.input-00
  52. net x-minlimit <= hm2_5i25.0.7i77.0.0.input-09-not
  53. net x-minlimit => axis.0.home-sw-in
  54. net x-minlimit => axis.0.neg-lim-sw-in
  55. net x-maxlimit <= hm2_5i25.0.7i77.0.0.input-08-not
  56. net x-maxlimit => axis.0.pos-lim-sw-in
  57.  
  58. # Y Axis
  59. setp hm2_5i25.0.encoder.01.scale [AXIS_1]INPUT_SCALE
  60. setp pid.1.Pgain [AXIS_1]P
  61. setp pid.1.Igain [AXIS_1]I
  62. setp pid.1.Dgain [AXIS_1]D
  63. setp pid.1.FF0 [AXIS_1]FF0
  64. setp pid.1.FF1 [AXIS_1]FF1
  65. setp pid.1.FF2 [AXIS_1]FF2
  66.  
  67. net y-axis-enable pid.1.enable <= axis.1.amp-enable-out
  68. net y-axis-fb axis.1.motor-pos-fb <= hm2_5i25.0.encoder.01.position
  69. net y-axis-fb pid.1.feedback <= hm2_5i25.0.encoder.01.position
  70. net y-axis-fb axis.1.motor-pos-fb
  71. net y-axis-pos-cmd axis.1.motor-pos-cmd => pid.1.command
  72. net y-axis-command pid.1.output => hm2_5i25.0.7i77.0.1.analogout1
  73.  
  74. #net y-jog-select axis.1.jog-enable <= hm2_5i25.0.7i77.0.0.input-##
  75. net y-minlimit <= hm2_5i25.0.7i77.0.0.input-11-not
  76. net y-minlimit => axis.1.home-sw-in
  77. net y-minlimit => axis.1.neg-lim-sw-in
  78. net y-maxlimit <= hm2_5i25.0.7i77.0.0.input-10-not
  79. net y-maxlimit => axis.1.pos-lim-sw-in
  80.  
  81. # Z Axis
  82. setp hm2_5i25.0.encoder.02.scale [AXIS_2]INPUT_SCALE
  83. setp pid.2.Pgain [AXIS_2]P
  84. setp pid.2.Igain [AXIS_2]I
  85. setp pid.2.Dgain [AXIS_2]D
  86. setp pid.2.FF0 [AXIS_2]FF0
  87. setp pid.2.FF1 [AXIS_2]FF1
  88. setp pid.2.FF2 [AXIS_2]FF2
  89.  
  90. net z-axis-enable pid.2.enable <= axis.2.amp-enable-out
  91. net z-axis-fb axis.2.motor-pos-fb <= hm2_5i25.0.encoder.02.position
  92. net z-axis-fb pid.2.feedback <= hm2_5i25.0.encoder.02.position
  93. net z-axis-fb axis.2.motor-pos-fb
  94. net z-axis-pos-cmd axis.2.motor-pos-cmd => pid.2.command
  95. net z-axis-command pid.2.output => hm2_5i25.0.7i77.0.1.analogout2
  96.  
  97. #net z-jog-select axis.1.jog-enable <= hm2_5i25.0.7i77.0.0.input-###
  98. net z-minlimit <= hm2_5i25.0.7i77.0.0.input-13-not
  99. net z-minlimit => axis.2.home-sw-in
  100. net z-minlimit => axis.2.neg-lim-sw-in
  101. net z-maxlimit <= hm2_5i25.0.7i77.0.0.input-12-not
  102. net z-maxlimit => axis.2.pos-lim-sw-in
  103.  
  104. # Standard I/O Block - EStop, Etc
  105.  
  106. # create a signal for the estop loopback
  107. net estop-loop iocontrol.0.user-enable-out => iocontrol.0.emc-enable-in
  108.  
  109. # create signals for tool loading loopback
  110. net tool-prep-loop iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
  111. net tool-change-loop iocontrol.0.tool-change => iocontrol.0.tool-changed
  112.  
  113. # estop
  114. loadrt estop_latch
  115. addf estop-latch.0 servo-thread
  116. #net estop-loopout iocontrol.0.emc-enable-in <= estop-latch.0.ok-out
  117. #net estop-loopin iocontrol.0.user-enable-out => estop-latch.0.ok-in
  118. net estop-reset iocontrol.0.user-request-enable => estop-latch.0.reset
  119. net remote-estop estop-latch.0.fault-in <= hm2_5i25.0.7i77.0.0.input-00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement