LinuxCNC / linuxcnc

LinuxCNC controls CNC machines. It can drive milling machines, lathes, 3d printers, laser cutters, plasma cutters, robot arms, hexapods, and more.
http://linuxcnc.org/
GNU General Public License v2.0
1.75k stars 1.14k forks source link

DB_PROGRAM abnormal exit status on tool change #2830

Open byunchov opened 7 months ago

byunchov commented 7 months ago

The Tool DB Interface for LinuxCNC seems to be broken (still). A few months ago I have submitted #2719 but the problem seems to be solved partially. I have created a custom DB interface and at first thought that it was the underlying issue, however I have done dozen of test configs to make sure that what I was doing was not wrong and I came to the conclusion that the issue is caused by my M6 remapping (most probably). When I remove the M6 remap it seems to work properly.

Test scenarios

The DB interfaces loads normally and LCNC seems to fetch the tools properly:

====Waiting for v2.1 version reply from db/sim_db.py
====Connected to db/sim_db.py
!!line=<g>
!!get_tools()=<({},)>
GET:   T2201 P301 D19.7 Z199.588 ;20mm z3
GET:   T2202 P302 D10.0 Z135.472 ;holker d10 z3
GET:   T2204 P303 D16.0 Z169.295 ;grub  d16 z4
GET:   T1501 P315 D12.0 Z97.423 ;d12 mdf z12+1
GET:   T1502 P316 D6.0 Z119.25 ;d6 z3 mdf
GET:   T2205 P304 D16.0 Z158.66 ;gladykd16 z4
GET:   T1801 P310 D7.5 Z125.32 ;d7.5 z2
GET:   T2501 P410 D51.0 Z141.244 ;v-kanal d51
GET:   T2203 P409 D12.0 Z144.355 ;d12 z3 hss
GET:   T2206 P405 D19.1 Z158.317 ;d19 z4
GET:   T4101 P407 D32.0 Z116.105 ;double r3 th20 LT115.1
GET:   T2502 P318 D87.5 Z129.85 ;v-kanal 120*
GET:   T2503 P418 D6.0 Z105.429 ;v-kanal 30* d6 tlo 104.65
GET:   T1000 P308 D6.0 Z167.682 ;borgia d6 + faska wz45mm
GET:   T1001 P307 D8.0 Z124.05 ;trough drill d8
GET:   T2230 P402 D60.0 Z127.5 ;added 20231002
GET:   T2207 P305 D19.8 Z159.923 ;rough d20 z3
GET:   T2209 P455 D10.0 Z142.085 ;fine d10 z3
GET:   T2210 P309 D10.0 Z141.068 ;rough d10 z3 i52
GET:   T5101 P311 D178.0 Z113.345 ;garga t6 d180 z16
GET:   T1002 P312 D8.0 Z123.504 ;blind drill d8 i47
GET:   T9501 P404 D16.0 Z180.55 ;aggregat d16 lt137.12
GET:   T2211 P406 D19.7 Z195.24 ;Fine d20 Z2+2
GET:   T2504 P408 D96.5 Z134.766 ;V-Groover d96 a150*
GET:   T5102 P306 D62.0 Z137.11 ;Frezova glava CMT d62 H80
GET:   FINI
!!line=<g>
!!get_tools()=<({},)>

I don't know if the STDOUT is messing things up, but I see the output for g command twice.

When I issue Tn M6 or try to run my custom procedure to measure TLO i get error along the lines:

61462 ===db/sim_db.py normal exit status=0

When I run M61 Qn it seems to work properly and invokes the methods connected to l and u.

!!line=<u T0   P0>
!!unload_spindle()=<{'T': 0, 'P': 0}>
!!line=<l T1501 P0>
!!load_spindle()=<{'T': 1501, 'P': 0}>

When I run G10 L1 Pn <Axes> nothing gets printed in the console.

Sample files

Here is a gist with some of my config files.