M function during move

More
02 Dec 2020 08:12 #190850 by TheRoslyak
Tell me how to implement the function while driving? It is desirable that it be recorded from the time or distance parameter to the end point.
Attachments:

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

More
02 Dec 2020 08:33 #190851 by Aciera
Replied by Aciera on topic M function during move
Hm, is this example taken from a document? If so can you provide a link to it?

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

More
02 Dec 2020 08:35 - 02 Dec 2020 08:39 #190852 by TheRoslyak
Replied by TheRoslyak on topic M function during move
No. I painted myself in Adobe Illustrator :laugh:
Last edit: 02 Dec 2020 08:39 by TheRoslyak.

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

More
02 Dec 2020 08:41 - 02 Dec 2020 08:44 #190853 by Aciera
Replied by Aciera on topic M function during move
I see. I don't think you will get this done with standard gcode.
Maybe with a python remap?

linuxcnc.org/docs/html/remap/remap.html#...ming-embedded-python

[edit]

There is a hal-pin that might be useful:

motion.distance−to−go OUT FLOAT

Distance remaining in the current move
Last edit: 02 Dec 2020 08:44 by Aciera.
The following user(s) said Thank You: TheRoslyak

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

More
02 Dec 2020 08:49 - 02 Dec 2020 08:49 #190855 by TheRoslyak
Replied by TheRoslyak on topic M function during move
Now I do that.
Using halcmd lcec.0.D2.dout-0 1
But may be I can use own new hal componet and any else for solving task?
Last edit: 02 Dec 2020 08:49 by TheRoslyak.

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

More
02 Dec 2020 08:54 #190856 by Aciera
Replied by Aciera on topic M function during move
sure, can't see why not. Do you need this for all moves or just for some?

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

More
02 Dec 2020 09:05 - 02 Dec 2020 09:06 #190858 by TheRoslyak
Replied by TheRoslyak on topic M function during move
Randomly. Now an external script is running that sends linuxcnc rsh command and switch output. To do this, I calculate the time at the script level. But if it is included in the G-code, it will be easier to calculate.
Last edit: 02 Dec 2020 09:06 by TheRoslyak.

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

More
02 Dec 2020 09:14 - 02 Dec 2020 09:15 #190860 by Aciera
Replied by Aciera on topic M function during move
What about the distance to the end of the path, is that a constant value or does that change?

[edit]
I mean the "t" or "S" value in your picture.
Last edit: 02 Dec 2020 09:15 by Aciera.

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

More
02 Dec 2020 09:25 - 02 Dec 2020 10:28 #190861 by TheRoslyak
Replied by TheRoslyak on topic M function during move
Constant value. But to find this value need to conduct an experiment to find an acceptable. If calculate in script level I need to change a lot of parameters. If calculate in G-code only one


UPD
motion.distance−to−go It's that me need!!!

Is there a similar variable for time?
Last edit: 02 Dec 2020 10:28 by TheRoslyak.

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

More
02 Dec 2020 10:30 #190863 by Aciera
Replied by Aciera on topic M function during move
So, if you write a hal component that constantly switches a pin at the desired distance before reaching the end point you could use M64 P0 with an and2 block to "enable that signal to go out and then M65 P0 to disable the output again. Maybe you could even find a way to automatically disable the output after motion.distance-to-go as reached 0.
Your S value could be defined in the INI or in the GUI.

Just an idea.

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

Time to create page: 0.094 seconds
Powered by Kunena Forum