Skip to content

Commit 4385e9c

Browse files
committed
re-added probe basic lathe file to folder
1 parent d5733a1 commit 4385e9c

File tree

276 files changed

+92579
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

276 files changed

+92579
-0
lines changed

probe_basic_latc/__init__.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
2+
__version__ = '0.0.1'
3+
4+
import os
5+
import qtpyvcp
6+
7+
VCP_DIR = os.path.realpath(os.path.dirname(__file__))
8+
VCP_CONFIG_FILE = os.path.join(VCP_DIR, 'probe_basic.yml')
9+
10+
11+
def main(opts=None):
12+
13+
if opts is None:
14+
from qtpyvcp.utilities.opt_parser import parse_opts
15+
opts = parse_opts(vcp_cmd='probebasic',
16+
vcp_name='Probe Basic',
17+
vcp_version=__version__)
18+
19+
qtpyvcp.run_vcp(opts, VCP_CONFIG_FILE)
20+
21+
22+
if __name__ == '__main__':
23+
main()
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# core HAL config file for simulation
2+
3+
# first load all the RT modules that will be needed
4+
# kinematics
5+
loadrt [KINS]KINEMATICS
6+
# motion controller, get name and thread periods from ini file
7+
loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS unlock_joints_mask=16
8+
# load 6 differentiators (for velocity and accel signals)
9+
loadrt ddt names=ddt_x,ddt_xv,ddt_y,ddt_yv,ddt_z,ddt_zv
10+
# load additional blocks
11+
loadrt hypot names=vel_xy,vel_xyz
12+
13+
# add motion controller functions to servo thread
14+
addf motion-command-handler servo-thread
15+
addf motion-controller servo-thread
16+
# link the differentiator functions into the code
17+
addf ddt_x servo-thread
18+
addf ddt_xv servo-thread
19+
addf ddt_y servo-thread
20+
addf ddt_yv servo-thread
21+
addf ddt_z servo-thread
22+
addf ddt_zv servo-thread
23+
addf vel_xy servo-thread
24+
addf vel_xyz servo-thread
25+
26+
# create HAL signals for position commands from motion module
27+
# loop position commands back to motion module feedback
28+
net Xpos joint.0.motor-pos-cmd => joint.0.motor-pos-fb ddt_x.in
29+
net Ypos joint.1.motor-pos-cmd => joint.1.motor-pos-fb ddt_y.in
30+
net Zpos joint.2.motor-pos-cmd => joint.2.motor-pos-fb ddt_z.in
31+
net Apos joint.3.motor-pos-cmd => joint.3.motor-pos-fb
32+
net Bpos joint.4.motor-pos-cmd => joint.4.motor-pos-fb
33+
#net Cpos joint.5.motor-pos-cmd => joint.5.motor-pos-fb
34+
#net Upos joint.6.motor-pos-cmd => joint.6.motor-pos-fb
35+
#net Vpos joint.7.motor-pos-cmd => joint.7.motor-pos-fb
36+
#net Wpos joint.8.motor-pos-cmd => joint.8.motor-pos-fb
37+
38+
# send the position commands thru differentiators to
39+
# generate velocity and accel signals
40+
net Xvel ddt_x.out => ddt_xv.in vel_xy.in0
41+
net Xacc <= ddt_xv.out
42+
net Yvel ddt_y.out => ddt_yv.in vel_xy.in1
43+
net Yacc <= ddt_yv.out
44+
net Zvel ddt_z.out => ddt_zv.in vel_xyz.in0
45+
net Zacc <= ddt_zv.out
46+
47+
# Cartesian 2- and 3-axis velocities
48+
net XYvel vel_xy.out => vel_xyz.in1
49+
net XYZvel <= vel_xyz.out
50+
51+
# estop loopback
52+
net estop-loop iocontrol.0.user-enable-out iocontrol.0.emc-enable-in
53+
54+
# create signals for tool loading loopback
55+
net tool-prep-loop iocontrol.0.tool-prepare iocontrol.0.tool-prepared
56+
net tool-change-loop iocontrol.0.tool-change iocontrol.0.tool-changed
57+
58+
net spindle-fwd spindle.0.forward
59+
net spindle-rev spindle.0.reverse
60+
#net spindle-speed spindle.0.speed-out
61+
62+
net lube iocontrol.0.lube
63+
net flood iocontrol.0.coolant-flood
64+
net mist iocontrol.0.coolant-mist
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
# simulated spindle encoder (for spindle-synced moves)
2+
loadrt sim_spindle names=sim_spindle
3+
setp sim_spindle.scale 0.01666667
4+
5+
loadrt limit2 names=limit_speed
6+
loadrt lowpass names=spindle_mass
7+
loadrt near names=near_speed
8+
9+
# this limit doesnt make any sense to me:
10+
setp limit_speed.maxv 5000.0 # rpm/second
11+
12+
# encoder reset control
13+
# hook up motion controller's sync output
14+
net spindle-index-enable spindle.0.index-enable <=> sim_spindle.index-enable
15+
16+
# report our revolution count to the motion controller
17+
net spindle-pos sim_spindle.position-fb => spindle.0.revs
18+
19+
# simulate spindle mass
20+
setp spindle_mass.gain .07
21+
22+
# spindle speed control
23+
net spindle-speed-cmd spindle.0.speed-out => limit_speed.in
24+
net spindle-speed-limited limit_speed.out => sim_spindle.velocity-cmd spindle_mass.in
25+
26+
# for spindle velocity estimate
27+
net spindle-rpm-filtered spindle_mass.out spindle.0.speed-in near_speed.in2
28+
29+
# at-speed detection
30+
setp near_speed.scale 1.1
31+
setp near_speed.difference 10
32+
33+
net spindle-speed-cmd => near_speed.in1
34+
net spindle-at-speed near_speed.out spindle.0.at-speed
35+
36+
addf limit_speed servo-thread
37+
addf spindle_mass servo-thread
38+
addf near_speed servo-thread
39+
addf sim_spindle servo-thread
127 KB
127 KB
126 KB
111 KB
108 KB
109 KB
110 KB

0 commit comments

Comments
 (0)