-
Notifications
You must be signed in to change notification settings - Fork 0
/
bernardo.hal
161 lines (133 loc) · 5.23 KB
/
bernardo.hal
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
# Generated by stepconf at Sun May 1 20:57:25 2011
# If you make changes to this file, they will be
# overwritten when you run stepconf again
loadrt trivkins
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[TRAJ]AXES
loadrt probe_parport
loadrt hal_parport cfg="0x378 out "
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0
loadrt abs count=1
addf parport.0.read base-thread
addf stepgen.make-pulses base-thread
addf parport.0.write base-thread
addf parport.0.reset base-thread
addf stepgen.capture-position servo-thread
addf motion-command-handler servo-thread
addf motion-controller servo-thread
addf stepgen.update-freq servo-thread
addf abs.0 servo-thread
loadrt not names=machine-is-on-low
addf machine-is-on-low servo-thread
net machine-is-on halui.machine.is-on => machine-is-on-low.in
net machine-is-on-low-out machine-is-on-low.out => parport.0.pin-08-out
net spindle-cmd <= motion.spindle-speed-out
net probe-in => motion.probe-input
net zstep => parport.0.pin-02-out
setp parport.0.pin-02-out-reset 1
setp parport.0.pin-03-out-invert 1
net zdir => parport.0.pin-03-out
net ystep => parport.0.pin-04-out
setp parport.0.pin-04-out-reset 1
setp parport.0.pin-05-out-invert 1
net ydir => parport.0.pin-05-out
net xstep => parport.0.pin-06-out
setp parport.0.pin-06-out-reset 1
setp parport.0.pin-07-out-invert 1
net xdir => parport.0.pin-07-out
#estop turn off drivers power
net estop-out => parport.0.pin-17-out
setp parport.0.pin-17-out-reset 1
setp parport.0.pin-17-out-invert 1
#limits
loadrt lut5
addf lut5.0 servo-thread
net all-limit-home <= parport.0.pin-10-in-not
setp lut5.0.function 0x10000
net all-limit-home => lut5.0.in-4
net all-limit <= lut5.0.out
net homing-x <= axis.0.homing => lut5.0.in-0
net homing-y <= axis.1.homing => lut5.0.in-1
net homing-z <= axis.2.homing => lut5.0.in-2
net all-limit-home => axis.0.home-sw-in
net all-limit => axis.0.neg-lim-sw-in
net all-limit => axis.0.pos-lim-sw-in
net all-limit-home => axis.1.home-sw-in
net all-limit => axis.1.neg-lim-sw-in
net all-limit => axis.1.pos-lim-sw-in
net all-limit-home => axis.2.home-sw-in
net all-limit => axis.2.neg-lim-sw-in
net all-limit => axis.2.pos-lim-sw-in
#net both-home-x <= parport.0.pin-10-in
#net both-home-y <= parport.0.pin-11-in
#probe
loadrt debounce cfg=1
addf debounce.0 base-thread
setp debounce.0.delay 10
net probe-raw parport.0.pin-13-in-not => debounce.0.0.in
net probe-in <= debounce.0.0.out
setp stepgen.0.position-scale [AXIS_0]SCALE
setp stepgen.0.steplen 1
setp stepgen.0.stepspace 0
setp stepgen.0.dirhold 30000
setp stepgen.0.dirsetup 30000
setp stepgen.0.maxaccel [AXIS_0]STEPGEN_MAXACCEL
net xpos-cmd axis.0.motor-pos-cmd => stepgen.0.position-cmd
net xpos-fb stepgen.0.position-fb => axis.0.motor-pos-fb
net xstep <= stepgen.0.step
net xdir <= stepgen.0.dir
net xenable axis.0.amp-enable-out => stepgen.0.enable
#net both-home-x => axis.0.home-sw-in
#net both-home-x => axis.0.neg-lim-sw-in
#net both-home-x => axis.0.pos-lim-sw-in
setp stepgen.1.position-scale [AXIS_1]SCALE
setp stepgen.1.steplen 1
setp stepgen.1.stepspace 0
setp stepgen.1.dirhold 30000
setp stepgen.1.dirsetup 30000
setp stepgen.1.maxaccel [AXIS_1]STEPGEN_MAXACCEL
net ypos-cmd axis.1.motor-pos-cmd => stepgen.1.position-cmd
net ypos-fb stepgen.1.position-fb => axis.1.motor-pos-fb
net ystep <= stepgen.1.step
net ydir <= stepgen.1.dir
net yenable axis.1.amp-enable-out => stepgen.1.enable
#net both-home-y => axis.1.home-sw-in
#net both-home-y => axis.1.neg-lim-sw-in
#net both-home-y => axis.1.pos-lim-sw-in
setp stepgen.2.position-scale [AXIS_2]SCALE
setp stepgen.2.steplen 1
setp stepgen.2.stepspace 0
setp stepgen.2.dirhold 30000
setp stepgen.2.dirsetup 30000
setp stepgen.2.maxaccel [AXIS_2]STEPGEN_MAXACCEL
net zpos-cmd axis.2.motor-pos-cmd => stepgen.2.position-cmd
net zpos-fb stepgen.2.position-fb => axis.2.motor-pos-fb
net zstep <= stepgen.2.step
net zdir <= stepgen.2.dir
net zenable axis.2.amp-enable-out => stepgen.2.enable
net estop-out <= iocontrol.0.user-enable-out
net estop-out => iocontrol.0.emc-enable-in
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-prepae-loopback iocontrol.0.tool-prepare => iocontrol.0.tool-prepared
#spindle speed
loadrt encoder names=encoder_spindle
loadrt scale names=scale_encoder_to_rpm
addf encoder.update-counters base-thread
addf encoder.capture-position servo-thread
addf scale_encoder_to_rpm servo-thread
setp scale_encoder_to_rpm.gain 60
setp encoder_spindle.position-scale 16
setp encoder_spindle.counter-mode true
#setp encoder_spindle.min-velocity-estimate 5
net encoder_spindle_velocity scale_encoder_to_rpm.in <= encoder_spindle.velocity
net spindle-position encoder_spindle.position => motion.spindle-revs
net spindle-velocity scale_encoder_to_rpm.out => motion.spindle-speed-in
net spindle-index-enable encoder_spindle.index-enable <=> motion.spindle-index-enable
net spindle-phase-a encoder_spindle.phase-A
net spindle-phase-b encoder_spindle.phase-B
net spindle-index encoder_spindle.phase-Z
net spindle-phase-a <= parport.0.pin-12-in
#net spindle-index <= parport.0.pin-12-in