|
| 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 unlock_joints_mask=16 |
| 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 joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in |
| 29 | +net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in |
| 30 | +net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in |
| 31 | +net Apos joint.3.motor-pos-cmd => joint.3.motor-pos-fb |
| 32 | +net Bpos joint.4.motor-pos-cmd => joint.4.motor-pos-fb |
| 33 | +#net Cpos joint.5.motor-pos-cmd => joint.5.motor-pos-fb |
| 34 | +#net Upos joint.6.motor-pos-cmd => joint.6.motor-pos-fb |
| 35 | +#net Vpos joint.7.motor-pos-cmd => joint.7.motor-pos-fb |
| 36 | +#net Wpos joint.8.motor-pos-cmd => joint.8.motor-pos-fb |
| 37 | + |
| 38 | +# send the position commands thru differentiators to |
| 39 | +# generate velocity and accel signals |
| 40 | +net Xvel ddt_x.out => ddt_xv.in vel_xy.in0 |
| 41 | +net Xacc <= ddt_xv.out |
| 42 | +net Yvel ddt_y.out => ddt_yv.in vel_xy.in1 |
| 43 | +net Yacc <= ddt_yv.out |
| 44 | +net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0 |
| 45 | +net Zacc <= ddt_zv.out |
| 46 | + |
| 47 | +# Cartesian 2- and 3-axis velocities |
| 48 | +net XYvel vel_xy.out => vel_xyz.in1 |
| 49 | +net XYZvel <= vel_xyz.out |
| 50 | + |
| 51 | +# estop loopback |
| 52 | +net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in |
| 53 | + |
| 54 | +# create signals for tool loading loopback |
| 55 | +net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared |
| 56 | +net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed |
| 57 | + |
| 58 | +net spindle-fwd spindle.0.forward |
| 59 | +net spindle-rev spindle.0.reverse |
| 60 | +#net spindle-speed spindle.0.speed-out |
| 61 | + |
| 62 | +net lube iocontrol.0.lube |
| 63 | +net flood iocontrol.0.coolant-flood |
| 64 | +net mist iocontrol.0.coolant-mist |
0 commit comments