core_sim.hal
1 # core HAL config file for simulation 2 3 # first load all the RT modules that will be needed 4 # kinematics 5 loadrt [KINS]KINEMATICS 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=[KINS]JOINTS 8 # load 6 differentiators (for velocity and accel signals 9 loadrt ddt count=6 10 # load additional blocks 11 loadrt hypot count=2 12 loadrt comp count=3 13 loadrt or2 count=1 14 15 # add motion controller functions to servo thread 16 addf motion-command-handler servo-thread 17 addf motion-controller servo-thread 18 # link the differentiator functions into the code 19 addf ddt.0 servo-thread 20 addf ddt.1 servo-thread 21 addf ddt.2 servo-thread 22 addf ddt.3 servo-thread 23 addf ddt.4 servo-thread 24 addf ddt.5 servo-thread 25 addf hypot.0 servo-thread 26 addf hypot.1 servo-thread 27 28 # create HAL signals for position commands from motion module 29 # loop position commands back to motion module feedback 30 net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt.0.in 31 net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt.2.in 32 net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt.4.in 33 34 # send the position commands thru differentiators to 35 # generate velocity and accel signals 36 net Xvel ddt.0.out => ddt.1.in hypot.0.in0 37 net Xacc <= ddt.1.out 38 net Yvel ddt.2.out => ddt.3.in hypot.0.in1 39 net Yacc <= ddt.3.out 40 net Zvel ddt.4.out => ddt.5.in hypot.1.in0 41 net Zacc <= ddt.5.out 42 43 # Cartesian 2- and 3-axis velocities 44 net XYvel hypot.0.out => hypot.1.in1 45 net XYZvel <= hypot.1.out 46 47 # estop loopback 48 net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in 49 50 # create signals for tool loading loopback 51 net tool-prepare <= iocontrol.0.tool-prepare 52 net tool-prepared => iocontrol.0.tool-prepared 53 54 net tool-change <= iocontrol.0.tool-change 55 net tool-changed => iocontrol.0.tool-changed 56 57 net tool-number <= iocontrol.0.tool-number 58 net tool-prep-number <= iocontrol.0.tool-prep-number 59 net tool-prep-pocket <= iocontrol.0.tool-prep-pocket