Run from line problem

More
25 Jun 2019 23:42 #137838 by andypugh
Replied by andypugh on topic Run from line problem
If you put [code](DEBUG, Task Mode = #<_task>) in the G-code subroutines what do you see? And is that different between normal use and run-from-line?
(I am wondering if the graphical preview and run-from-line are causing bother together)

Please Log in or Create an account to join the conversation.

More
26 Jun 2019 22:18 #137935 by MaHa
Replied by MaHa on topic Run from line problem
Did some testing this evening, the result is the same for both, value returned=1.
I also did hal watch the pins for spindle. If i do run from line, there are no pin changes at all, spindle-brake is the only yellow marker but the machine is running the program, without M3.Start the spindle in MDI, and then run from line is possible.

Please Log in or Create an account to join the conversation.

More
27 Jun 2019 22:01 #138037 by andypugh
Replied by andypugh on topic Run from line problem
I need to find the time to look over this in more detail, as in what you see, what should happen, etc.

It's hard enough to work out what _should_ happen without then trying to make it happen.
The following user(s) said Thank You: MaHa

Please Log in or Create an account to join the conversation.

More
28 Jun 2019 01:53 #138077 by Todd Zuercher
Replied by Todd Zuercher on topic Run from line problem
Most industrial controls have configuration options for restarting that involve choosing certain G, M, and other codes that are skipped or executed ahead of the restart point.

Please Log in or Create an account to join the conversation.

More
28 Jun 2019 09:39 #138103 by MaHa
Replied by MaHa on topic Run from line problem
When I was confronted with this problem time ago, my solution was using a copy of the file and deleting the not required parts. That was a pretty awful thing. My cam is not very good to output one project to several 1-tool single files. And there is still the tool probing, after manual toolchange. It is good integrated, but only when running the file from start to end.
On the Sinumerik machine $P_SEARCH is true while run from line. Having this it's very easy collecting states of code, exclude parts of the code or do anything programmable. As something similar is not in Linuxcnc, i think there is a reason for.
For machine accurate depth or width i need to do pre fine machining, alter tooltable entry and then restart continue. And there are so many other reasons to abort program. Tu use the .py Filter is ok at the moment, to keep the file composition as is, but still needs good focus on what's done to set the labels, which I had to make more unique.
I say thank you already, if someone has the knowledge and time to work on this.
The following user(s) said Thank You: HalaszAttila

Please Log in or Create an account to join the conversation.

More
28 Jun 2019 18:09 #138132 by pl7i92
Replied by pl7i92 on topic Run from line problem
did you set the startup code in INI

RS274NGC] Section


RS274NGC_STARTUP_CODE = G17 G20 G40 G49 G64 P0.001 G80 G90 G92 G94 G97 G98 - A string of NC codes that the interpreter is initialized with. This is not a substitute for specifying modal g-codes at the top of each ngc file, because the modal codes of machines differ, and may be changed by g-code interpreted earlier in the session.

and a default spindle speed in display
be aware that gmoccapy and other GUI work different on this behavior run_from_line

Please Log in or Create an account to join the conversation.

More
29 Jun 2019 19:42 - 29 Jun 2019 19:42 #138189 by MaHa
Replied by MaHa on topic Run from line problem
After spending hours working on this problem, I have found something, that I understand what I can do, what I have to and what is possible.
My configuration uses TIMEDELAY to give spindle time to speed up before G1 move. And LINCURVE is used to set minimum speed to 6000rpm.
I don't know how deep LINCURVE is involved, but at least TIMEDELAY leaves spindelcontrol pins disregarded when run from line, but comes back with M3 applied.

About this problem:
When run from line, even motion.spindle-at-speed is not true, machine makes feedmotions.

Action:
MDI, Start spindle, then run from line and everything looks correct, also motion.**** pins for spindle are correct then, or edit the .ngc file, insert M3 after run from line line.


The more complicated problem Run from line and Subroutines is much more complex, and not really understandable:
Some subroutines are skipped, others are executed, depending on content, when run from line. If they contain M66 E0 L0, chance raises, they get executed.
Subroutines for Log, or display (msg )or (debug) some information do not really harm,even they are executed.
Subroutine used for a certain machining operation may get executed with wrong tool in spindle, if there are Toolchange before the targetline.
If subroutines doing calculations, setting or shifting ofsets or toolparameter, are before the target line and in case the get executed, trouble begins. If you are lucky and get kicked out of working area, there is at least an error.
If by fault a subroutine is executed after run from line, motion.program.line and as well the line in text display in axis pointing to a line in main program.

Action:
Tough there is need to edit the .ngc file and spoil it in a way for further use, i would comment all subroutines before target line, and take care spindle starts, then run from line should work fine.


Finally also made a new Filter. On the first line of the .ngc file #<_rfl> = 1122 (startline) can be entered and it goes from line 1122 to EOF. From there should be easy to run from line and avoid subroutines hassling your workflow. I used #<_rfl> to set the startline, so it can be used for further anything if needed.
This is my final solution as a few times already. But now it is really quick and easy, as i require. As i think it gonna be very difficult to get rid of this superstrange behaviour run from line / subroutines, this is ok for me now, and the case is solved.


Machine idle, before run file


Program started, state timedelay, S4000 M3 is at line 23, but motion.program.line is still 0, even the spindle is at speeding up


Program running. Everything correct


Run from line, feed motion, spindle not active


Run from line, feed motion, M3 inserted on line 29, spindle active, everything correct
Attachments:
Last edit: 29 Jun 2019 19:42 by MaHa.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

More
10 Aug 2019 22:35 #141884 by MaHa
Replied by MaHa on topic Run from line problem
Even this was (amost) solved for me, there is always some headroom for improvement, keep up to date and a short conclusion about my workaround so far, and the most recent gcode filter I use now. Working with some setup for a while, finding various solutions, I made step by step improvement.
Starting with the shellscript was solid, I had a file as output, but the effort was too big for me, also to take modifications back to the source file.
Next, the first gcode filter, looking for labels named (rfl), was a good idea, but the name needs to be more unique and I didn't like editing the .ngc file, setting the marks at various positions, as the files are stored in an archive and get reused.
The next attempt, a new gcode filter, looking for an entry at the beginning of the file, containing just the targetline number. Working very good, fading out everything before this line. Easy to use, but for me not versatile enough, but still a good one. I think this is the one, just to skip a part of the program.

The most recent filter, now in use for a while, is almost, what I am looking for. Also here have to make an entry on top of the file:
(RUN_FROM_LINE_FILTER = 1) ; Turn Filter On / Off (1 / 0)
(RUN_FROM_LINE_TARGETLINE = 237) ; TargetLine Number as seen in GEANY
(ADDITIONAL_LINE_BEFORE_TARGET = 187,193,194,195) ; Additional added Lines, Numbers as seen in GEANY, BEFORE TargetLine, containing S, F etc....Divided by comma
(ADDITIONAL_CODE_BEFORE_TARGET = G0 G55 G43 X-24.3888 Y38.3571 F500 M3) ; Possible to add 1 line of specified code, added before Target line
(END_FILTER)


Header in .ngc file

Now able to turn filter on/off, have additional lines before targetline and also 1 line of gcode of choice can be added. I think, having the filter configuration in the gcode file, is the safest way. Even a panel or input box could be nice also.
When I start a Job, .ngc file is used. On occasion to restart from line, I make the entrys at the header, save file as, adding ending .rfl and run this file.
1st pass the Filter reads until (END_FILTER), then apply the various input, 2nd pass insert additional code and additional lines, then start file output at target line. All the inserted lines and target lines have a mark, to understand the source.


What you see when running with Filter applied...

Now I am used to this workflow, producing many parts this way. I always edit the .ngc file for modifications, then save as, add endig .rfl. For me it is a safe way, because ending .ngc the full file is running , alternative ending .rfl and (RUN_FROM_LINE_FILTER = 1) the filter is aplied.
Shure, need to doublecheck if physical tool and Tooldata are correct, G43, feed for Z position, offset, just what one needs to check anyway.
Info is also in the file "runfromline.py"
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Feb 2020 15:28 #156764 by MaHa
Replied by MaHa on topic Run from line problem
As i didn't like anymore to enter the data for run from line filter and probing positions on top of the .ngc routine, i made this slim sidepanel to control that. It fits the fhd screen and is working without problems. New, i can auto add the last F, S, Offset and much more, if desired. Which gives full control to restart in any situation. A message is displayed, about the required tool.
Mostly restart by: check add last F S G, check G43, enter Targetline, Run File. Occasionally enter X Y position, to have a controlled movement to near starting point.
Only one behaviour of motion.program-line, if a sequence is running single block and passing a subroutine, after motion.program-line is always zero. Releasing and starting sb again solves that.
Attachments:
The following user(s) said Thank You: andypugh, Todd Zuercher, HalaszAttila

Please Log in or Create an account to join the conversation.

More
04 Apr 2020 23:26 #162719 by MaHa
Replied by MaHa on topic Run from line problem
Did a lot of work, using the new sidepanel, it is perfect for my workflow, break, redo or continue is simple now. Only had to do some minor modifications.
I managed to always display the highest number of motion.program-line, and it stays displayed on break, reseted by reload file.
Toolchange and toolprobing position adjust by slider works fine. Now i save the values, after restart recover the selected positions.
Have the filter turned on and loading a new ngc file is no good. The filename is saved to a temp file now, when load a new file
compare with argv[0]. The message component is used to remind me, if the filter is on when loading a new file. I feel now, the air is getting thinner for more improvements.
The following user(s) said Thank You: tommylight

Please Log in or Create an account to join the conversation.

Time to create page: 0.238 seconds
Powered by Kunena Forum