Advertisement
Guest User

Untitled

a guest
Apr 27th, 2010
186
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.19 KB | None | 0 0
  1. loadrt trivkins
  2. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  3. loadrt probe_parport
  4. loadrt hal_parport cfg="0x378 out "
  5. setp parport.0.reset-time 5000
  6. loadrt stepgen step_type=0,0,0,0 ctrl_type=p,v,p,p
  7. loadrt charge_pump
  8.  
  9. ###############NEW#################
  10. loadrt and2 count=2
  11. loadrt xor3 count=2
  12. loadrt or2 count=2
  13. ###################################
  14. net charge-pump <= charge-pump.out
  15.  
  16. addf parport.0.read base-thread
  17. addf stepgen.make-pulses base-thread
  18. addf parport.0.write base-thread
  19. addf parport.0.reset base-thread
  20. addf charge-pump base-thread
  21. ###############NEW##############
  22. addf and2.0 servo-thread
  23. addf and2.1 servo-thread
  24. addf xor2.0 servo-thread
  25. addf xor2.1 servo-thread
  26. addf or2.0 servo-thread
  27. addf or2.1 servo-thread
  28. ###############################
  29.  
  30. addf stepgen.capture-position servo-thread
  31. addf motion-command-handler servo-thread
  32. addf motion-controller servo-thread
  33. addf stepgen.update-freq servo-thread
  34.  
  35. net estop-out <= iocontrol.0.user-enable-out
  36. net estop-ext <= parport.0.pin-10-in
  37. net estop-ext => iocontrol.0.emc-enable-in
  38.  
  39. net charge-pump => parport.0.pin-09-out
  40.  
  41. net xstep => parport.0.pin-02-out
  42. setp parport.0.pin-02-out-reset 1
  43. net xdir => parport.0.pin-03-out
  44.  
  45. net zstep => parport.0.pin-04-out
  46. setp parport.0.pin-04-out-reset 1
  47. net zdir => parport.0.pin-05-out
  48. net astep => parport.0.pin-06-out
  49. setp parport.0.pin-06-out-reset 1
  50. net adir => parport.0.pin-07-out
  51. setp parport.0.pin-17-out-invert 1
  52. net xenable => parport.0.pin-17-out
  53.  
  54. setp stepgen.0.position-scale [AXIS_0]SCALE
  55. setp stepgen.0.steplen 1
  56. setp stepgen.0.stepspace 0
  57. setp stepgen.0.dirhold 35000
  58. setp stepgen.0.dirsetup 35000
  59. setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
  60. net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
  61. net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
  62. net xstep <= stepgen.0.step
  63. net xdir <= stepgen.0.dir
  64. net xenable axis.0.amp-enable-out => stepgen.0.enable
  65.  
  66. addf scale.0 servo-thread
  67. net spindle-cmd-rpm <= motion.spindle-speed-out => scale.1.in
  68. setp scale.1.gain 0.01666667
  69. net spindle-cmd-rps <= scale.1.out => stepgen.1.velocity-cmd
  70. setp stepgen.1.position-scale 200
  71. setp stepgen.1.maxvel 5
  72. setp stepgen.1.maxaccel 2
  73. ##############NEW######################
  74. net spindle-step <= stepgen.1.step => and2.0.in0
  75. net spindle-dir <= stepgen.1.dir => and2.1.in0
  76. #######################################
  77.  
  78.  
  79.  
  80. setp stepgen.2.position-scale [AXIS_2]SCALE
  81. setp stepgen.2.steplen 1
  82. setp stepgen.2.stepspace 0
  83. setp stepgen.2.dirhold 35000
  84. setp stepgen.2.dirsetup 35000
  85. setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
  86. net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
  87. net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
  88. net zstep <= stepgen.2.step
  89. net zdir <= stepgen.2.dir
  90. net zenable axis.2.amp-enable-out => stepgen.2.enable
  91.  
  92. setp stepgen.3.position-scale [AXIS_3]SCALE
  93. setp stepgen.3.steplen 1
  94. setp stepgen.3.stepspace 0
  95. setp stepgen.3.dirhold 35000
  96. setp stepgen.3.dirsetup 35000
  97. setp stepgen.3.maxaccel [AXIS_3]STEPGEN_MAXACCEL
  98. net apos-cmd axis.3.motor-pos-cmd => stepgen.3.position-cmd
  99. net apos-fb stepgen.3.position-fb => axis.3.motor-pos-fb
  100. #############NEW#####################
  101. net astep <= stepgen.3.step => xor2.0.in0
  102. net adir <= stepgen.3.dir => xor2.1.in0
  103. #####################################
  104. net aenable axis.3.amp-enable-out => stepgen.3.enable
  105.  
  106. #######NEW LOGIC STUFF##################
  107. net spindle_on <= motion.spindle-on => stepgen.1.enable and2.0.in1 and2.1.in1 xor2.0.in1 xor2.1.in1
  108. net masked-spindle-step and2.0.out => or2.0.in0
  109. net masked-spindle-dir and2.1.out => or2.1.in0
  110. net masked-astep xor2.0.out => or2.0in1
  111. net masked-adir xor2.1.out => or2.1.in1
  112. net chosen-step or2.0.out => parport.0.pin-14-out
  113. net chosen-dir or2.1.out => parport.0.pin-16-out
  114. ###########################################
  115.  
  116. loadusr -W hal_manualtoolchange
  117. net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
  118. net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
  119. net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
  120. net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement