Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # core HAL config file for simulation - 5 axis
- # load RT modules: first one the 5-axis kinematics
- loadrt 5axiskins
- loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
- loadrt ddt count=9
- loadrt probe_parport
- loadrt pwmgen output_type=0
- # 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
- newsig J5pos float
- linksp J5pos <= axis.5.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
- linksp J5pos => axis.5.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
- # 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 cena bit
- linksp cena axis.5.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
- newsig cflt bit
- linksp cflt axis.5.amp-fault-in
- # affichage du GUI
- loadusr -W 5axisgui
- #loadusr -Wn simple_arduino /usr/bin/simple_arduino
- # Liaison entre le GUI et la definition des axes
- # axes X
- #net j0 axis.0.joint-pos-fb simple_arduino.axis0-cmd
- net j0 axis.0.joint-pos-fb 5axisgui.joint0
- # axes Y
- net j1 axis.1.joint-pos-fb 5axisgui.joint1
- # axes Z
- net j2 axis.2.joint-pos-fb 5axisgui.joint2
- # axes A
- net j3 axis.3.joint-pos-fb 5axisgui.joint3
- # axes C
- net j5 axis.5.joint-pos-fb 5axisgui.joint5
- #unlinkp halui.machine.is-on
- #unlinkp halui.machine.on
- #unlinkp halui.machine.off
- #net machstate simple_arduino.machine-state <= halui.machine.is-on
- #net turnoff halui.machine.off <= simple_arduino.switch-off
- #net turnon halui.machine.on <= simple_arduino.switch-on
- # Longueur pivot + la longueur outil
- #setp 5axiskins.pivot-length
- #setp 5axiskins.tooloffset.z 100
- # Affichage outil dans le gui
- net tool-len motion.tooloffset.w 5axisgui.tool_length
- # Arret d'urgence
- net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
- #Changement outils
- loadusr -W hal_manualtoolchange
- net tool-change iocontrol.0.tool-change => hal_manualtoolchange.change
- net tool-changed iocontrol.0.tool-changed <= hal_manualtoolchange.changed
- net tool-number iocontrol.0.tool-prep-number => hal_manualtoolchange.number
- net tool-prepare-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement