Current Feed F-code in Active G Codes

More
26 Oct 2017 20:26 #100852 by n81641
In version 2.7.0~pre0 The F would reflect the current feed in the g-code as the program was running. Shown in in Active G Codes box in Axis. In 2.8.0~pre1 the F stays at 0 no matter what the feed currently is.

In both, entering an F feed speed in MDI does result in the F speed being displayed correctly.

I see that Axis gets this value from stat.settings[1]. I am working on a custom GUI, and I need to keep track of the current F. Is there a reason that stat.settings[1] is not updated while running in version 2.8.0? Thanks.

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

More
26 Oct 2017 23:04 #100863 by andypugh

In version 2.7.0~pre0 The F would reflect the current feed in the g-code as the program was running. .


I just checked in 2.7.11 and it doesn't appear to update there if the program is ended with an M2, but shows the last value is the program starts and ends with %. This is because it is showing the feedrate in "interpreter" space and the interpreter has already parsed the G-code and queued the moves.

I think that there might be a fundamental problem that the motion controller has no concept of the current feedrate, that is part of the interpreter state while the program is being parsed, and each queued command has an embedded speed element that is derived from the F-command active at the time that is was queued, but is in different units. (especially in feed-per-rev mode or inverse-time)

github.com/LinuxCNC/linuxcnc/blob/c1affd...motion/motion.c#L361

Is the HAL pin motion.current-vel any help?

(I don't see why a GUI needs to know the F-command that was active at the point that the currently executing move was queued)
The following user(s) said Thank You: n81641

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

More
27 Oct 2017 17:23 #100889 by n81641
Thank You AndyPugh. Yes, M2 is the reason, not the version. I was not testing with the same program, one had M2 and the other not.

You brought up a key issue for my purposes, though. The F reported, even without the M2, is not the current running motion line, but the last F read by the interpreter, probably the last one in the program. All the Current Codes are probably this way too.

What I'm trying to do is record the state and Abort a running program, go to MDI mode, update the state with the current feed and codes, then feed subsequent lines in as MDI commands.

Why I'm doing this: the machinists don't like Step, it isn't acting like Single Block on non-motion lines.

That's OK, I will have to pre-parse the file and determine the active codes, feed, etc. I had a feeling this was going to be necessary.

Again, Thanks for your help.

--Karl

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

More
28 Oct 2017 00:05 #100902 by skunkworks
There is a state tags branch that supposedly helps this.

github.com/LinuxCNC/linuxcnc/tree/feature/state-tags-master

If we could have some people test this - maybe we could get it into master.

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

More
28 Oct 2017 02:23 #100907 by n81641
Interesting. This is in the master of machinekit, yes?

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

More
28 Oct 2017 10:28 #100916 by cmorley

There is a state tags branch that supposedly helps this.

github.com/LinuxCNC/linuxcnc/tree/feature/state-tags-master

If we could have some people test this - maybe we could get it into master.


I too would be very interested in state tags in master.
I keep hearing about needing testers yet never have heard what in particular needs tested.
Are we shaking out a few bugs or seeing if it works at all?

Chris M

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

More
28 Oct 2017 16:14 #100940 by n81641
It seems to be in Machinekit. Would that count as tested?

github.com/machinekit/machinekit/blob/ma...c/motion/state_tag.h

Although anything called "massive overhaul" seems scary:

github.com/LinuxCNC/linuxcnc/commit/1dda...9e6bfef7bad8ae368532

But if it's been running on Tormach machines for a few years now, then maybe it's OK?

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

More
28 Oct 2017 16:28 #100942 by andypugh

github.com/LinuxCNC/linuxcnc/commit/1dda...9e6bfef7bad8ae368532

But if it's been running on Tormach machines for a few years now, then maybe it's OK?


What makes you think it has been running on Tormach? I think that they are still on 2.6.

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

More
28 Oct 2017 16:49 #100944 by n81641
From here: forum.linuxcnc.org/pathpilot/29983-notes...ot-1-8-2-source-code

I looked for state_tag.h, and it is in there. Written by Robert W. Ellenberg, (c) 2015.

/********************************************************************
* Description: state_tag.h
*
* A "tag" struct that is used to add interpreter state information to
* a given motion line. This state info isn't actually used by motion
* directly, but indicates the motion state.
*
* Author: Robert W. Ellenberg
* License: GPL Version 2
* System: Linux
*
* Copyright (c) 2015 All rights reserved
********************************************************************/

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

Time to create page: 0.094 seconds
Powered by Kunena Forum