forked from jedediah/hacklab-engraver
-
Notifications
You must be signed in to change notification settings - Fork 1
/
custom_postgui.hal
75 lines (67 loc) · 2.8 KB
/
custom_postgui.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
# Include your customized HAL commands here
# The commands in this file are run after the AXIS GUI (including PyVCP panel)
# starts
# This file will not be overwritten when you run stepconf again
## Logitech Dual Action pendant
## Implemented by sarahemm - 2010-06-06
## Buttons:
## 1 - input.0.btn-trigger
## 2 - input.0.btn-thumb
## 3 - input.0.btn-thumb2
## 4 - input.0.btn-top
## 5 - input.0.btn-top2
## 6 - input.0.btn-pinkie
## 7 - input.0.btn-base
## 8 - input.0.btn-base2
## 9 - input.0.btn-base3
## 10 - input.0.btn-base4
# Right middle button enables/disables the machine
# All this stuff just implements a simple toggle...
net machine-is-on halui.machine.is-on => and2-machineoff.in0
net machine-is-on halui.machine.is-on => not-machinetoggle.in
net not-machine-is-on not-machinetoggle.out => and2-machineon.in0
net button10 input.0.btn-base4 => and2-machineoff.in1
net button10 input.0.btn-base4 => and2-machineon.in1
net machineOff and2-machineoff.out => halui.machine.off
net machineOn and2-machineon.out => halui.machine.on
addf and2-machineoff servo-thread
addf and2-machineon servo-thread
addf not-machinetoggle servo-thread
# Buttons 6 and 8 enable jogging and set the jog speed range
# Button 5 enables jogging and sets a focus-appropriate speed
loadrt mux8 names=mux8-jogspeed
addf mux8-jogspeed servo-thread
setp mux8-jogspeed.in0 0
setp mux8-jogspeed.in1 50
setp mux8-jogspeed.in2 150
setp mux8-jogspeed.in3 300
setp mux8-jogspeed.in4 5
setp mux8-jogspeed.in5 50
setp mux8-jogspeed.in6 150
setp mux8-jogspeed.in7 300
net jog-low mux8-jogspeed.sel0 <= input.0.btn-pinkie
net jog-high mux8-jogspeed.sel1 <= input.0.btn-base2
net jog-focus mux8-jogspeed.sel2 <= input.0.btn-top2
net jog-speed halui.jog-speed <= mux8-jogspeed.out
# Right joystick left/right controls X axis
net joy-x-jog halui.jog.0.analog <= input.0.abs-z-position
# Right joystick up/down controls Y axis (needs reversing to match lazzor)
loadrt sum2 names=sum2-reversey,sum2-reversew,sum2-focusslowly
addf sum2-reversey servo-thread
setp sum2-reversey.gain0 -1
net reverse-y sum2-reversey.in0 <= input.0.abs-rz-position
net joy-y-jog halui.jog.1.analog <= sum2-reversey.out
# Left joystick up/down controls W axis (table up/down)
addf sum2-reversew servo-thread
setp sum2-reversew.gain0 -1
net reverse-w sum2-reversew.in0 <= input.0.abs-y-position
net joy-w-jog halui.jog.8.analog <= sum2-reversew.out
# D-pad up/down single-steps W axis (table height)
# well, it will once i can figure out how to make this work -sarahemm
#addf sum2-focusslowly servo-thread
#setp sum2-focusslowly.gain0 0.5
#net dpad-focus sum2-focusslowly.in0 <= input.0.abs-hat0y-position
#net dpad-w-jog halui.jog.8.analog <= sum2-focusslowly.out
#setp axis.8.jog-scale 0.1
#setp axis.8.jog-enable TRUE
#net dpad-w-jog axis.8.jog-counts <= input.0.abs-hat0y-counts