M function during move

More
5 years 10 months ago - 5 years 10 months ago #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: 5 years 10 months ago by TheRoslyak.

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

More
5 years 10 months ago - 5 years 10 months ago #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: 5 years 10 months ago by Aciera.

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

More
5 years 10 months ago - 5 years 10 months ago #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: 5 years 10 months ago by TheRoslyak.

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

More
5 years 10 months ago #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.

More
5 years 10 months ago - 5 years 10 months ago #190865 by TheRoslyak
Replied by TheRoslyak on topic M function during move
That's what I wanted to do!
What about time variable?

UPD I can motion.distance-to-go div to motion.current-vel but isn't include aceleration
Last edit: 5 years 10 months ago by TheRoslyak.

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

Time to create page: 0.279 seconds
Powered by Kunena Forum