Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

linuxcncrsh config cleanup as test prep. #3188

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

JTrantow
Copy link
Contributor

Use local instead of LIB:core_sim.hal and define EMC_MOT num_spindles=[TRAJ]SPINDLES based on test config.
Fix [JOINT_0] velocity and accel. Add [EMC]MACHINE to reduce warnings.
Add [TRAJ]SPINDLES to tighten tests.

JTrantow added 3 commits November 22, 2024 10:41
…st config.

Fix [JOINT_0] velocity and accel. Add [EMC]MACHINE to reduce warnings.
Add [TRAJ]SPINDLES to tighten tests.
@andypugh
Copy link
Collaborator

Can you explain the purpose of this PR?
(I am not likely to refuse it, but there seems to be almost no context about what this is for)

… to linuxcnc set mdi. May still need to trap some of the M codes and homing.
@JTrantow
Copy link
Contributor Author

JTrantow commented Nov 26, 2024

I should have referenced #3180 in the title. During investigation into linuxcncrsh seg fault (and working on a LightBurn translator) I was running more sim tests of linuxcncrsh.

I noticed linuxcnc complains with a few warnings that could be cleaned up in the config. [EMC]MACHINE= needs to be added and [JOINT_0]MAX accel and velocity have LINEAR. The [JOINT_0] changes are fixed in the 2.9 branch but not the master.

cncbox@debian:~/linuxcnc-LCNC/tests/linuxcncrsh$ ../../scripts/rip-environment ./test.sh
trying to connect to linuxcncrsh TOGO=80
Machine configuration file is 'linuxcncrsh-test.ini'

check_config:
  Unspecified [JOINT_0]MAX_VELOCITY,     default used: 1.0
  Unspecified [JOINT_0]MAX_ACCELERATION, default used: 1.0

Starting LinuxCNC...
linuxcncsvr (14211) emcsvr: machine 'unknown'  version '1.1'
config file "/home/cncbox/linuxcnc-LCNC/tests/linuxcncrsh/linuxcncrsh-test.ini" loaded successfully.

The seg faults occur in when the number of spindles is not specified specified in the get/set spindle/brake/override commands. Instead of modifying LIB:core_sim.hal, I made it local and explicitly defined the [TRAJ]SPINDLES=2 to make it easier to test multiple spindles in the get/set spindle/brake commands.

 # Existing spindle test commands.
set spindle forward 0  # Well specified command.
set spindle forward -1 # All spindles
set spindle forward 99 # illegal spindle.
 # Additional spindle command tests (Especially, relevant with a laser as secondary spindle.)
set spindle off 1         # Laser as spindle
set spindle forward    # Missing spindle number.
set spindle off 2         # illegal spindle (tighter limits for this simulation).

My interest in linuxcncrsh is driven by the desire to use the LightBurn interface to setup my linuxcnc router for laser cutting. LightBurn has some nice laser tests and positioning features relative to laser cutting. The *.ngc files are typical laser adjustment files generated by LightBurn that I want to run through linuxcncrsh prior to downloading the entire .ngc and running within linuxcnc. I can create a separate test directory that only tests the .ngc files if that makes more sense? These files need more work to ensure they fit within the sim config dimensions. I do think all the linuxcncrsh-test.ini/core_lib.hal changes belong in all linuxcncrsh tests in 2.9 and master.

Looking through the issues mentioning linuxcncrsh, I noticed reports of tool table init problems when .tbl wasn't used. Adding a known tool table allows better testing. (Complete testing would still test table not specified.)

I learned years ago that testing is important. One critical lesson was once an issue occurs in released code, a test case should be added to make sure the issue doesn't creep in again.

@JTrantow
Copy link
Contributor Author

Slight rethink. I show four commits for this PR. Could you accept the first two commits and I will redo the last two commits adding LightBurn .ngc testing as a separate test case? Or I could figure out how to retract those commits if that's easier.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants