Skip to content

Commit 0e11895

Browse files
committed
db_demo sim db.py updates
1) Incorporate threads and demonstrate concurrent tasks: a) multiple modifications of a tool parameter b) multiple adds/removals of tool numbers 2) Implement synchronization of LinuxCNC tooldata with the sim database for toolno additions/removals and parameter changes 3) handle disallowed toolno additions if: interp not idle 4) handle disallowed toolno removals if: interp not idle toolno in spindle 5) handle disallowed toolno modifications if: toolno in spindle 6) Incorporate history logging to db file 7) handle SIGINT (ctrl-c) for standalone testing 8) handle SIGUSR[12] for starting tasks outside of application 9) Add detection/message for: unsupported letters in params unknown toolnos in commands 10) adapt base.inc to allow all coordinates 1l) misc code cleanups and notes Notes: 1) no api changes 2) When a db application adds or removes tool numbers (after initialization), a call to tooldb_tools() must be submitted with an updated user_tools list. The application can then synchronize LinuxCNC using the load_tool_command.
1 parent 0b8c3ac commit 0e11895

4 files changed

Lines changed: 531 additions & 159 deletions

File tree

configs/sim/axis/db_demo/README

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,17 +2,20 @@ db_ran.ini random_toolchanger
22
db_nonran.ini nonrandom_toolchanger
33

44
Each config starts with:
5-
tool numbers 10--19
6-
pockets numbers 11--20
5+
tool numbers 10--19
76

8-
tool 10 in pocket 11
9-
tool 11 in pocket 12
10-
...
7+
A number of tools are set with identical
8+
tool diameters to demonstrate tool selection
9+
based on accrued tool time.
10+
11+
The config runs separate tasks to
12+
a) modify a tool parameter
13+
b) add/remove tool numbers
1114

1215
Usage (for db_nonran.ini):
1316

1417
1) In a terminal, start as
15-
$ linuxcnc db_nonran.ini
18+
$ linuxcnc ./db_nonran.ini
1619
F1 --------- Estop off
1720
F2 --------- Machine On
1821
Ctrl-Home -- Home All
@@ -37,10 +40,11 @@ with each reload.
3740

3841
To watch the tool data changes and tool usage time
3942
accrual, use the following command in a separate
40-
terminal (source if rip_environment for RIP
41-
builds):
43+
terminal (source rip_environment for RIP builds):
4244

4345
$ watch -n 0.2 cat /tmp/db_nonran_file
46+
or
47+
$ watch -n 0.2 cat /tmp/db_ran_file
4448

4549
The M parameter in the /tmp/db_nonran_file
4650
accounts for tool time measured in minutes

configs/sim/axis/db_demo/base.inc

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,15 @@ POSTGUI_HALFILE = db_postgui.hal
2727
[TRAJ]
2828
NO_FORCE_HOMING = 1
2929

30-
COORDINATES = XYZ
30+
# Note:allow all coords for testing
31+
COORDINATES = XYZABCUVW
3132
LINEAR_UNITS = inch
3233
ANGULAR_UNITS = degree
34+
MAX_ANGULAR_VELOCITY=1000
3335

3436
[KINS]
35-
JOINTS = 3
36-
KINEMATICS = trivkins coordinates=XYZ
37+
JOINTS = 9
38+
KINEMATICS = trivkins coordinates=XYZABCUVW
3739

3840
[JOINT_0]
3941
TYPE = LINEAR
@@ -52,3 +54,34 @@ TYPE = LINEAR
5254
MAX_VELOCITY=1e99
5355
MAX_ACCELERATION=1e99
5456
HOME_SEQUENCE=0
57+
58+
[JOINT_3]
59+
TYPE = LINEAR
60+
MAX_VELOCITY=1e99
61+
MAX_ACCELERATION=1e99
62+
HOME_SEQUENCE=0
63+
[JOINT_4]
64+
TYPE = LINEAR
65+
MAX_VELOCITY=1e99
66+
MAX_ACCELERATION=1e99
67+
HOME_SEQUENCE=0
68+
[JOINT_5]
69+
TYPE = LINEAR
70+
MAX_VELOCITY=1e99
71+
MAX_ACCELERATION=1e99
72+
HOME_SEQUENCE=0
73+
[JOINT_6]
74+
TYPE = LINEAR
75+
MAX_VELOCITY=1e99
76+
MAX_ACCELERATION=1e99
77+
HOME_SEQUENCE=0
78+
[JOINT_7]
79+
TYPE = LINEAR
80+
MAX_VELOCITY=1e99
81+
MAX_ACCELERATION=1e99
82+
HOME_SEQUENCE=0
83+
[JOINT_8]
84+
TYPE = LINEAR
85+
MAX_VELOCITY=1e99
86+
MAX_ACCELERATION=1e99
87+
HOME_SEQUENCE=0

0 commit comments

Comments
 (0)