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