Conversation
This makes the `speed` property into a working array, instead of a broken scalar. The `interpreter.speed` property is intended to report the current spindle speed. It's been broken since the multi-spindle stuff went in: the code compiled but failed at runtime, as demonstrated by the `sim/axis/remap/getting-started/demo.ini` config.
|
Looks better than the current (broken) setup to me. (sorry about breaking it) One concern is that the interface only knows how to handle spindle.0. Did you look at adding the selected spindle into the logic? Even without that, though, it is at least less broken with this fix. |
I did not look into handling the selected spindle in the remap code, no. In fact, I didn't know there was even the concept of a selected spindle, or how to find out which one is selected... The interpmodule exports the full array of spindle speeds, so if some intrepid remapper wanted to, it would now be somewhat easier. There are also identical bugs in several more of interpmodule's spindle properties, which this PR does not address... So yeah, this is a definite fix, but there's plenty of other broken stuff in this particular neighborhood... |
It's a fairly weak concept, but it is needed to determine which spindle speed is being used for feed-per rev or spindle-synched motion https://github.com/LinuxCNC/linuxcnc/blob/master/src/emc/rs274ngc/interp_internal.hh#L746 |
jepler
left a comment
There was a problem hiding this comment.
Seems fine, though please finish talking through the default spindle aspect of it before merging.
|
What's a typical gcode sequence demonstrating the use of |
|
@andypugh I added |
|
I changed my mind on "active_spindle" a few times, eventually deciding that it probably shouldn't be modal in the conventional sense. (I am open to discussion on this point. In fact I would welcome it) But, I think it is soon enough in the history of the feature (like, there are few enough users) that we could consider making it more modal. So: M3 S100 $0 Would set spindle 1 to 1000, not spindle 0. (Without checking I don't actually remember which it does. It definitely sets one of them...) |
|
The G-code in your comment ends with spindle 0 at 1000 rpm and spindle 1 at 400 rpm. Since LinuxCNC (apparently) doesn't have a persistent/modal/default spindle, and defaults to spindle 0 unless the user specifies a different one with the I modified the config to have multiple spindles, but remap doesn't know about the Any objections to me merging this as it is? |
|
Thinking out loud... |
No, do it. |
I don't know what you mean by this. The spindle-synchronized moves currently accept an optional The non-synchronized commands that affect a spindle (e.g. M3/M4/M5/S) also all take an optional So I guess I don't understand what the current |
The multi-spindle support that went into 2.8 broke remap's ability to read the requested spindle speed. The error can be seen by running
sim/axis/remap/getting-started/demo.ini. The problem is that the interpreter doesn't have just one spindle speed now, it's got array of them, one for each spindle.Remap uses the interpreter's internal
interpreterpython module to access the interpreter's internal state, including spindle speed. The interpmodule source was changed so it compiles with the new multi-spindle code, but fails at runtime (as demonstrated by that config).This PR changes the interpmodule speed property from being a float to being an array, using the same infrastructure as the other arrays (
active_g_codes,active_m_codes, etc). The remap example that touches spindle speed now works.