# core HAL config file for simulation - 4 axis # load RT modules loadrt scarakins loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD traj_period_nsec=[EMCMOT]TRAJ_PERIOD key=[EMCMOT]SHMEM_KEY num_joints=[TRAJ]AXES loadrt ddt count=12 # add motion controller functions to servo thread addf motion-command-handler servo-thread addf motion-controller servo-thread 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 ddt.6 servo-thread addf ddt.7 servo-thread addf ddt.8 servo-thread # create HAL signals for position commands from motion module newsig J0pos float linksp J0pos <= axis.0.motor-pos-cmd newsig J1pos float linksp J1pos <= axis.1.motor-pos-cmd newsig J2pos float linksp J2pos <= axis.2.motor-pos-cmd newsig J3pos float linksp J3pos <= axis.3.motor-pos-cmd # loop position commands back to motion module feedback linksp J0pos => axis.0.motor-pos-fb linksp J1pos => axis.1.motor-pos-fb linksp J2pos => axis.2.motor-pos-fb linksp J3pos => axis.3.motor-pos-fb # send the position commands thru differentiators to # generate velocity and accel signals # define the signals, and hook them up newsig J0vel float newsig J0acc float linksp J0pos => ddt.0.in linkps ddt.0.out => J0vel linksp J0vel => ddt.1.in linkps ddt.1.out => J0acc newsig J1vel float newsig J1acc float linksp J1pos => ddt.2.in linkps ddt.2.out => J1vel linksp J1vel => ddt.3.in linkps ddt.3.out => J1acc newsig J2vel float newsig J2acc float linksp J2pos => ddt.4.in linkps ddt.4.out => J2vel linksp J2vel => ddt.5.in linkps ddt.5.out => J2acc newsig J3vel float newsig J3acc float linksp J3pos => ddt.6.in linkps ddt.6.out => J3vel linksp J3vel => ddt.7.in linkps ddt.7.out => J3acc # estop loopback net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in # 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 # amp control newsig xena bit linksp xena axis.0.amp-enable-out newsig yena bit linksp yena axis.1.amp-enable-out newsig zena bit linksp zena axis.2.amp-enable-out newsig aena bit linksp aena axis.3.amp-enable-out newsig xflt bit linksp xflt axis.0.amp-fault-in newsig yflt bit linksp yflt axis.1.amp-fault-in newsig zflt bit linksp zflt axis.2.amp-fault-in newsig aflt bit linksp aflt axis.3.amp-fault-in loadusr -W scaragui net j0 axis.0.joint-pos-fb scaragui.joint0 net j1 axis.1.joint-pos-fb scaragui.joint1 net j2 axis.2.joint-pos-fb scaragui.joint2 net j3 axis.3.joint-pos-fb scaragui.joint3