Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # core HAL config file for simulation
- #First load the Python user module named /user/bin/9axis_arduino with the name 'arduino'
- loadusr -Wn arduino /usr/bin/9axis_arduino
- # first load all the RT modules that will be needed
- # kinematics
- loadrt trivkins
- # motion controller, get name and thread periods from ini file
- loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
- # load 6 differentiators (for velocity and accel signals
- loadrt ddt count=6
- # load additional blocks
- loadrt hypot count=2
- loadrt comp count=3
- loadrt or2 count=1
- # add motion controller functions to servo thread
- addf motion-command-handler servo-thread
- addf motion-controller servo-thread
- # link the differentiator functions into the code
- addf ddt.0 servo-thread
- addf ddt.1 servo-thread
- addf ddt.2 servo-thread
- addf ddt.3 servo-thread
- addf ddt.4 servo-thread
- addf ddt.5 servo-thread
- addf hypot.0 servo-thread
- addf hypot.1 servo-thread
- # create HAL signals for position commands from motion module
- # loop position commands back to motion module feedback
- #net Xpos axis.0.motor-pos-cmd => axis.0.motor-pos-fb ddt.0.in
- #net Ypos axis.1.motor-pos-cmd => axis.1.motor-pos-fb ddt.2.in
- #net Zpos axis.2.motor-pos-cmd => axis.2.motor-pos-fb ddt.4.in
- #net Xpos arduino.axis0-pos => axis.0.motor-pos-fb ddt.0.in
- #net Ypos arduino.axis1-pos => axis.1.motor-pos-fb ddt.2.in
- #net Zpos arduino.axis2-pos => axis.2.motor-pos-fb ddt.4.in
- net Xpos axis.0.motor-pos-cmd => arduino.axis0-cmd
- net Xpos-fb arduino.axis0-pos => axis.0.motor-pos-fb ddt.0.in
- net Ypos axis.1.motor-pos-cmd => arduino.axis1-cmd
- net Ypos-fb arduino.axis1-pos => axis.1.motor-pos-fb ddt.2.in
- net Zpos axis.2.motor-pos-cmd => arduino.axis2-cmd
- net Zpos-fb arduino.axis2-pos => axis.2.motor-pos-fb ddt.4.in
- # send the position commands thru differentiators to
- # generate velocity and accel signals
- net Xvel ddt.0.out => ddt.1.in hypot.0.in0
- net Xacc <= ddt.1.out
- net Yvel ddt.2.out => ddt.3.in hypot.0.in1
- net Yacc <= ddt.3.out
- net Zvel ddt.4.out => ddt.5.in hypot.1.in0
- net Zacc <= ddt.5.out
- # Cartesian 2- and 3-axis velocities
- net XYvel hypot.0.out => hypot.1.in1
- net XYZvel <= hypot.1.out
- # estop loopback
- net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
- # Control panel switches
- # E-Stop
- #unlinkp iocontrol.0.user-enable-out
- #unlinkp iocontrol.0.emc-enable-in
- #net eStop iocontrol.0.user-enable-out => arduino.eStop
- #net eStop iocontrol.0.emc-enable-in <= arduino.eStop
- # Power
- #unlinkp halui.machine.is-on
- #unlinkp halui.machine.on
- #unlinkp halui.machine.off
- #net machstate arduino.machine-state <= halui.machine.is-on
- #net turnoff halui.machine.off <= arduino.switch-off
- #net turnon halui.machine.on <= arduino.switch-on
- # Start/Run
- #unlinkp halui.program.run
- #net ProgramStart arduino.start => halui.program.run
- # Stop
- #unlinkp halui.program.stop
- #net ProgramStop arduino.stop => halui.program.stop
- # Pause
- #unlinkp halui.program.pause
- #net ProgramPause arduino.pause => halui.program.pause
- # Resume
- #unlinkp halui.program.resume
- #net ProgramResume arduino.resume => halui.program.resume
- # Program step
- #unlinkp halui.program.step
- #net ProgramStep arduino.step => halui.program.step
- # Touch probe
- #unlinkp motion.probe-input
- #net probe arduino.probe => motion.probe-input
- # Spindle power
- #unlinkp motion.spindle-on
- #net spindle-On arduino.spindleEnable <= motion.spindle-on
- # Spindle direction
- #unlinkp motion.spindle-reverse
- #net spindle-Dir arduino.spindleDirection <= motion.spindle-reverse
- # Spindle at speed
- #unlinkp motion.spindle-at-speed
- #net spindle-at-speed arduino.spindleAtSpeed => motion.spindle-at-speed
- # Coolant flood
- #unlinkp iocontrol.0.coolant-flood
- #net flood arduino.coolantFlood <= iocontrol.0.coolant-flood
- # Coolant mist
- #unlinkp iocontrol.0.coolant-mist
- #net mist arduino.coolantMist <= iocontrol.0.coolant-mist
- # create signals for tool loading loopback
- net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
- net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
- ###############################################################################
- ##### Now on to the axies, if you don't have a given axis comment out the #####
- ##### related section entirely. If you don't, EMC will crash on load. #####
- ##### (But will give you useful debug info to guide you.) #####
- ###############################################################################
- ##### If you just want the switches for an axis, comment out the lines #####
- ##### containing the word 'motor' in them for the axies you DO have. #####
- ###############################################################################
- ### X-axis (axis.0) ###
- #unlinkp axis.0.home-sw-in
- #net home-X arduino.xHome => axis.0.home-sw-in
- #unlinkp axis.0.neg-lim-sw-in
- net min-home-X arduino.xMinLmt => axis.0.neg-lim-sw-in axis.0.home-sw-in
- #net min-X arduino.xMinLmt => axis.0.neg-lim-sw-in
- #unlinkp axis.0.pos-lim-sw-in
- net max-X arduino.xMaxLmt => axis.0.pos-lim-sw-in
- #unlinkp axis.0.motor-pos-cmd
- #net Xpos-cmd axis.0.motor-pos-cmd => arduino.axis0-cmd
- #net Xpos => arduino.axis0-cmd
- ### Y-axis (axis.1) ###
- #unlinkp axis.1.home-sw-in
- #net home-Y arduino.yHome => axis.1.home-sw-in
- #unlinkp axis.1.neg-lim-sw-in
- net min-home-Y arduino.yMinLmt => axis.1.neg-lim-sw-in axis.1.home-sw-in
- #net min-Y arduino.yMinLmt => axis.1.neg-lim-sw-in
- #unlinkp axis.1.pos-lim-sw-in
- net max-Y arduino.yMaxLmt => axis.1.pos-lim-sw-in
- #unlinkp axis.1.motor-pos-cmd
- #net Ypos-cmd axis.1.motor-pos-cmd => arduino.axis1-cmd
- #net Ypos => arduino.axis1-cmd
- ### Z-axis (axis.2) ###
- #unlinkp axis.2.home-sw-in
- #net home-Z arduino.zHome => xis.2.home-sw-in
- #unlinkp axis.2.neg-lim-sw-in
- net min-home-Z => arduino.zMinLmt => axis.2.neg-lim-sw-in axis.2.home-sw-in
- #net min-Z => arduino.zMinLmt => axis.2.neg-lim-sw-in
- #unlinkp axis.2.pos-lim-sw-in
- net max-Z => arduino.zMaxLmt => axis.2.pos-lim-sw-in
- #unlinkp axis.2.motor-pos-cmd
- #net Zpos-cmd axis.2.motor-pos-cmd => arduino.axis2-cmd
- #net Zpos => arduino.axis2-cmd
- ### A-axis (axis.3) ###
- #unlinkp axis.3.home-sw-in
- #net home-A arduino.aHome => axis.3.home-sw-in
- #unlinkp axis.3.neg-lim-sw-in
- #net min-A => arduino.aMinLmt => axis.3.neg-lim-sw-in
- #unlinkp axis.3.pos-lim-sw-in
- #net max-A => arduino.aMaxLmt => axis.3.pos-lim-sw-in
- #unlinkp axis.3.motor-pos-cmd
- #net apos-cmd axis.3.motor-pos-cmd => arduino.axis3-cmd
- ### B-axis (axis.4) ###
- #unlinkp axis.4.home-sw-in
- #net home-B arduino.bHome => axis.4.home-sw-in
- #unlinkp axis.4.neg-lim-sw-in
- #net min-B => arduino.bMinLmt => axis.4.neg-lim-sw-in
- #unlinkp axis.4.pos-lim-sw-in
- #net max-B => arduino.bMaxLmt => axis.4.pos-lim-sw-in
- #unlinkp axis.4.motor-pos-cmd
- #net bpos-cmd axis.4.motor-pos-cmd => arduino.axis4-cmd
- ### C-axis (axis.5) ###
- #unlinkp axis.5.home-sw-in
- #net home-C arduino.cHome => axis.5.home-sw-in
- #unlinkp axis.5.neg-lim-sw-in
- #net min-C => arduino.cMinLmt => axis.5.neg-lim-sw-in
- #unlinkp axis.5.pos-lim-sw-in
- #net max-C => arduino.cMaxLmt => axis.5.pos-lim-sw-in
- #unlinkp axis.5.motor-pos-cmd
- #net cpos-cmd axis.5.motor-pos-cmd => arduino.axis5-cmd
- ### U-axis (axis.6) ###
- #unlinkp axis.6.home-sw-in
- #net home-U arduino.uHome => axis.6.home-sw-in
- #unlinkp axis.6.neg-lim-sw-in
- #net min-U => arduino.uMinLmt => axis.6.neg-lim-sw-in
- #unlinkp axis.6.pos-lim-sw-in
- #net max-U => arduino.uMaxLmt => axis.6.pos-lim-sw-in
- #unlinkp axis.6.motor-pos-cmd
- #net upos-cmd axis.6.motor-pos-cmd => arduino.axis6-cmd
- ### V-axis (axis.7) ###
- #unlinkp axis.7.home-sw-in
- #net home-V arduino.vHome => axis.7.home-sw-in
- #unlinkp axis.7.neg-lim-sw-in
- #net min-V => arduino.vMinLmt => axis.7.neg-lim-sw-in
- #unlinkp axis.7.pos-lim-sw-in
- #net max-V => arduino.vMaxLmt => axis.7.pos-lim-sw-in
- #unlinkp axis.7.motor-pos-cmd
- #net vpos-cmd axis.7.motor-pos-cmd => arduino.axis7-cmd
- ### W-axis (axis.8) ###
- #unlinkp axis.8.home-sw-in
- #net home-W arduino.wHome => axis.8.home-sw-in
- #unlinkp axis.8.neg-lim-sw-in
- #net min-W => arduino.wMinLmt => axis.8.neg-lim-sw-in
- #unlinkp axis.8.pos-lim-sw-in
- #net max-W => arduino.wMaxLmt => axis.8.pos-lim-sw-in
- #unlinkp axis.8.motor-pos-cmd
- #net wpos-cmd axis.8.motor-pos-cmd => arduino.axis8-cmd
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement