summaryrefslogtreecommitdiff
path: root/configs/sim/axis/vismach/5axis/5axis_sim.hal
blob: cec6641459a2a4fe9427f37c8790b5bd5dbf01e7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
# core HAL config file for simulation - 4 axis

# load RT modules
loadrt 5axiskins
loadrt [EMCMOT]EMCMOT servo_period_nsec=[EMCMOT]SERVO_PERIOD 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
net J0pos <= axis.0.motor-pos-cmd
net J1pos <= axis.1.motor-pos-cmd
net J2pos <= axis.2.motor-pos-cmd
net J3pos <= axis.3.motor-pos-cmd
net J4pos <= axis.4.motor-pos-cmd
net J5pos <= axis.5.motor-pos-cmd
net J8pos <= axis.8.motor-pos-cmd


# loop position commands back to motion module feedback
net J0pos => axis.0.motor-pos-fb
net J1pos => axis.1.motor-pos-fb
net J2pos => axis.2.motor-pos-fb
net J3pos => axis.3.motor-pos-fb
net J4pos => axis.4.motor-pos-fb
net J5pos => axis.5.motor-pos-fb
net J8pos => axis.8.motor-pos-fb

# send the position commands thru differentiators to
# generate velocity and accel signals
# define the signals, and hook them up
net J0pos => ddt.0.in
net J0vel <= ddt.0.out
net J0vel => ddt.1.in
net J0acc <= ddt.1.out

net J1pos => ddt.2.in
net J1vel <= ddt.2.out
net J1vel => ddt.3.in
net J1acc <= ddt.3.out

net J2pos => ddt.4.in
net J2vel <= ddt.4.out
net J2vel => ddt.5.in
net J2acc <= ddt.5.out

net J3pos => ddt.6.in
net J3vel <= ddt.6.out
net J3vel => ddt.7.in
net J3acc <= ddt.7.out

# 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
net xena axis.0.amp-enable-out
net yena axis.1.amp-enable-out
net zena axis.2.amp-enable-out
net aena axis.3.amp-enable-out
net bena axis.4.amp-enable-out
net cena axis.5.amp-enable-out
net wena axis.8.amp-enable-out

net xflt axis.0.amp-fault-in
net yflt axis.1.amp-fault-in
net zflt axis.2.amp-fault-in
net aflt axis.3.amp-fault-in
net bflt axis.4.amp-fault-in
net cflt axis.5.amp-fault-in
net wflt axis.8.amp-fault-in

loadusr -W 5axisgui

net j0 axis.0.joint-pos-fb 5axisgui.joint0
net j1 axis.1.joint-pos-fb 5axisgui.joint1
net j2 axis.2.joint-pos-fb 5axisgui.joint2
net j3 axis.3.joint-pos-fb 5axisgui.joint3
net j4 axis.4.joint-pos-fb 5axisgui.joint4
net j5 axis.5.joint-pos-fb 5axisgui.joint5

net tool-len motion.tooloffset.w 5axisgui.tool_length