System hangs repeatedly with certain combinations of operations
- Jonathan_H
- Offline
- Junior Member
-
- Posts: 32
- Thank you received: 0
Denford 2600 Pro, linuxcnc conversion using Mesa board
So, I have two scripts which are linked to UI buttons.
The first does a spindle warmup. This consists of moving the spindle to the middle of the bed (location is arbitrary) and then running the spindle for a few minutes at an increasing speed.
The second is a tool change script, it moves the spindle front and centre, prompts the operator to change the tool and then click "continue", then moves to the front left and probes the length of the tool with a switch fixed to the bed, then moves carriage back to front centre.
So on a freshly started linuxcnc, I can run the tool change repeatedly, does exactly what is expected.
Now I run the spindle warmup, does what is expected.
But now I run a tool change again... it hangs
Toggle power off and on again from the UI, and try tool change again. It moves front and centre, prompts and waits for tool change, then moves to the front left to probe the tool length... and hangs
Also if I run a job with tool changes when it gets to the tool change the carriage moves front and centre, tool change prompt, moves front left... and hangs. Now this is actually worse than pre update, I used to be able to get through a full multi tool job without it hanging.
Configuration and script files are in this repository
github.com/londonhackspace/Denford-2600-Pro
I'm really rather stuck as to what to do next. I'm a software engineer so debugging software and systems is something I am used to, but linuxcnc is currently a bit of a black box to me. It seems that running the spindle warmup script must leave linuxcnc in a different state to when it is started, one that is somehow incompatible with the tool change script (whether this is correct functionality and the issue is my script or it is a bug in linuxcnc I don't know), but I don't know how to ascertain what is changing. How can I get useful diagnostic information?
Any pointers to how to proceed would be greatly appreciated
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
- Posts: 19047
- Thank you received: 5256
halcmd show all > good.txt
(when running OK) and:
halcmd show all > bad.txt
when hung
( and posting good.txt and bad.txt here )
_May_ help find the reason it's hung.
Please Log in or Create an account to join the conversation.
- Hakan
- Offline
- Platinum Member
-
- Posts: 798
- Thank you received: 273
Please Log in or Create an account to join the conversation.
- Jonathan_H
- Offline
- Junior Member
-
- Posts: 32
- Thank you received: 0
Please Log in or Create an account to join the conversation.
- Jonathan_H
- Offline
- Junior Member
-
- Posts: 32
- Thank you received: 0
I need to refresh my g-code understanding, but I am scratching my head as to what I was trying to achieve when I made that mistake. And also why much of the time it actually works fine (more so with an earlier version of linuxcnc).
I will do as PCW suggested first, then see if cleaning up that bit of code makes a difference.
Please Log in or Create an account to join the conversation.
- Jonathan_H
- Offline
- Junior Member
-
- Posts: 32
- Thank you received: 0
I tried fixing my endsub as pointed out by hakan, it made no difference
Please Log in or Create an account to join the conversation.
- Jonathan_H
- Offline
- Junior Member
-
- Posts: 32
- Thank you received: 0
Tonight I had some time to isolate where the problem is happening, and I can bring it down to just a couple of commands.
I start up Linux CNC, toggle the CNC on and home it, this is my start point.
Now in the MDI window I type the following
I can repeat the above multiple times, the carriage moves up and down as expected.G53 G1 F4000 Z-10 ; This works, carriage moves down
G53 G1 F4000 Z0 ; This works, carriage moves up
BUT, if I type the following (either after typing the above or after a clean start)
M3 S10000 ; works, spindle starts and spins up
M5 ; works, spindle stops
G53 G1 F4000 Z-10 ; Spindle does not move and GCode interpreter seems to be hung!
On the console I see the following output
mdi_execute_hook: MDI command 'M5' done (remaining: 0)
Issuing EMC_TASK_PLAN_EXECUTE -- ( +509,+280, +23,G53\032G1\032F4000\032Z-10,)
emcTaskPlanLevel() returned 0
NML_INTERP_LIST(0x55afd11daa60)::append(nml_msg_ptr{size=208,type=EMC_TRAJ_LINEAR_MOVE}) : list_size=1, line_number=0
emcTaskPlanExecute(G53 G1 F4000 Z-10) returned 0
emcTaskPlanLevel() returned 0
NML_INTERP_LIST(0x55afd11daa60)::get(): {size=208, type=EMC_TRAJ_LINEAR_MOVE}, list_size=0
emcTaskPlanLevel() returned 0
Issuing EMC_TRAJ_LINEAR_MOVE -- ( +220,+208, +0,605.000000,400.000000,-10.000000,0.000000,0.000000,0.000000,0.000000,0.000000,0.000000, +2,25.000000,25.000000,750.000000, +0, -1,)
I've attached the full console output from the linuxcnc command
Attachments:
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
- Posts: 20553
- Thank you received: 6994
See PCW's reply below
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
- Posts: 19047
- Thank you received: 5256
M5 ; works, spindle stops
G53 G1 F4000 Z-10 ; Spindle does not move and GCode interpreter seems to be hung!
Is spindle-at-speed true? if not, pretty sure this will hang waiting for spindle-at-speed to be true.
Please Log in or Create an account to join the conversation.
- tommylight
-
- Away
- Moderator
-
- Posts: 20553
- Thank you received: 6994
Please Log in or Create an account to join the conversation.