Advertisement
Guest User

Untitled

a guest
Dec 15th, 2016
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.82 KB | None | 0 0
  1. # core HAL config file for simulation
  2.  
  3. # first load all the RT modules that will be needed
  4. # kinematics
  5. loadrt trivkins
  6. # motion controller, get name and thread periods from ini file
  7. loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
  8. # load 6 differentiators (for velocity and accel signals
  9. loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv
  10. # load additional blocks
  11. loadrt hypot names=vel_xy,vel_xyz
  12.  
  13. # add motion controller functions to servo thread
  14. addf motion-command-handler servo-thread
  15. addf motion-controller servo-thread
  16. # link the differentiator functions into the code
  17. addf ddt_x servo-thread
  18. addf ddt_xv servo-thread
  19. addf ddt_y servo-thread
  20. addf ddt_yv servo-thread
  21. addf ddt_z servo-thread
  22. addf ddt_zv servo-thread
  23. addf vel_xy servo-thread
  24. addf vel_xyz servo-thread
  25.  
  26. # create HAL signals for position commands from motion module
  27. # loop position commands back to motion module feedback
  28. net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt_x.in
  29. net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt_y.in
  30. net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt_z.in
  31.  
  32. # send the position commands thru differentiators to
  33. # generate velocity and accel signals
  34. net Xvel ddt_x.out => ddt_xv.in vel_xy.in0
  35. net Xacc <= ddt_xv.out
  36. net Yvel ddt_y.out => ddt_yv.in vel_xy.in1
  37. net Yacc <= ddt_yv.out
  38. net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0
  39. net Zacc <= ddt_zv.out
  40.  
  41. # Cartesian 2- and 3-axis velocities
  42. net XYvel vel_xy.out => vel_xyz.in1
  43. net XYZvel <= vel_xyz.out
  44.  
  45. # estop loopback
  46. net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
  47.  
  48. # create signals for tool loading loopback
  49. net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
  50. net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement