Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 1. # standard pinout config file for 3-axis steppers
- 2. # with encoders using a parport for I/O
- 3. #
- 4. # first load the parport driver
- 5. loadrt hal_parport cfg="0x0378"
- 6. loadrt encoder num_chan=1
- 7. #
- 8. # next connect the parport functions to threads
- 9. # read inputs first
- 10. addf parport.0.read base-thread 1
- 11. addf encoder.update-counters base-thread
- 12. # write outputs last
- 13. addf parport.0.write base-thread -1
- 14. addf encoder.capture-position servo-thread
- 15. #
- 16. # hook stuff together
- 17. newsig Zpos-fb float
- 18.
- 19. setp encoder.0.position-scale [AXIS_0]INPUT_SCALE
- 20.
- 21. linkpp encoder.0.phase-A <= parport.0.pin-12-in
- 22. linkpp encoder.0.phase-B <= parport.0.pin-15-in
- 23.
- 24. linksp Zpos-fb <= encoder.0.position
- 25.
- 26. # finally connect physical pins to the signals
- 27. linksp Xstep => parport.0.pin-03-out
- 28. linksp Xdir => parport.0.pin-02-out
- 29. linksp Ystep => parport.0.pin-05-out
- 30. linksp Ydir => parport.0.pin-04-out
- 31. linksp Zstep => parport.0.pin-07-out
- 32. linksp Zdir => parport.0.pin-06-out
- 33.
- 34. # create a signal for the estop loopback
- 35. ## linkpp parport.0.pin-10-in iocontrol.0.emc-enable-in
- 36.
- 37. # create signal for external estop
- 38. newsig ext-estop bit
- 39. linksp ext-estop parport.0.pin-10-in
- 40. linksp ext-estop iocontrol.0.emc-enable-in
- 41.
- 42.
- 43. # create signals for tool loading loopback
- 44. linkpp iocontrol.0.tool-prepare iocontrol.0.tool-prepared
- 45. linkpp iocontrol.0.tool-change iocontrol.0.tool-changed
- 46.
- 47.
- 48. # create a signal for "spindle on"
- 49. newsig spindle-on bit
- 50. # connect the controller to it
- 51. linkps motion.spindle-on => spindle-on
- 52. # connect it to a physical pin
- 53. linksp spindle-on => parport.0.pin-09-out
- 54.
- 55.
- 56. # spindle signals "spindle forw,rev"
- 57. # spindle status has not been resolved
- 58. # a simple loop through is set here
- 59. linkpp motion.spindle-forward parport.0.pin-16-out
- 60. # linkpp motion.spindle-reverse parport.0.pin-17-out
- 61.
- 62.
- 63.
- 64. # Home/Limit Shared Switch on Same Pin
- 65.
- 66. newsig Xswitches bit
- 67. linkps parport.0.pin-11-in-not => Xswitches
- 68. linksp Xswitches => axis.0.home-sw-in
- 69. linksp Xswitches => axis.0.neg-lim-sw-in
- 70. linksp Xswitches => axis.0.pos-lim-sw-in
- 71.
- 72. #newsig Yswitches bit
- 73. #linkps parport.0.pin-12-in-not => Yswitches
- 74. #linksp Yswitches => axis.1.home-sw-in
- 75. #linksp Yswitches => axis.1.neg-lim-sw-in
- 76. #linksp Yswitches => axis.1.pos-lim-sw-in
- 77.
- 78. newsig Zswitches bit
- 79. linkps parport.0.pin-13-in-not => Zswitches
- 80. linksp Zswitches => axis.2.home-sw-in
- 81. linksp Zswitches => axis.2.neg-lim-sw-in
- 82. linksp Zswitches => axis.2.pos-lim-sw-in
- 83.
- 84.
- 85. # coolant signals
- 86. # note that these do NOT represent proper IO signals from iocontrol
- 87. # should separate command and status for production versions
- 88. # and run these through CL to test conditions
- 89. linkpp iocontrol.0.coolant-flood parport.0.pin-08-out
- 90. # linkpp iocontrol.0.coolant-mist parport.0.pin-09-out
- 91.
- 92. loadrt pwmgen output_type=1
- 93. addf pwmgen.update servo-thread
- 94. addf pwmgen.make-pulses base-thread
- 95. net spindle-speed-cmd motion.spindle-speed-out => pwmgen.0.value
- 96. net spindle-on motion.spindle-on => pwmgen.0.enable
- 97. net spindle-pwm pwmgen.0.pwm => parport.0.pin-09-out
- 98. setp pwmgen.0.scale 2000 # Change to your spindle & # 8217;s top speed in RPM
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement