Conversation
|
If an integer offset makes no sense, does that also apply to The s32 type comes from the MPG world: a handwheel emits integer pulses, counts*scale turns them into distance. Natively float sources needing conv_float_s32 is ugly, agreed. But is the answer to retype the pin, or to feed it better? Every plasma config in the wild that nets an s32 signal into Your own updown.comp change adds a And once the pin is float, what does "counts" still count? Would a separate float input (counts left untouched) reach the same goal with zero breakage? |
Jog-counts is typically scaled by a step-size under UI or separate switch control, so makes sense there. Almost every use I have seen for external offsets has to jump through hoops to force the output of the calculations into counts+scale. I think the original application was offsetting a path either an MPG but I can't recall what unusual application that was. Subsequent applications, like Sam's hexagonal boring would be better (and more accurately) served by a float pin rather than fixed-point. |
|
The step-size switch sets jog-scale from the UI instead of HAL. Underneath it is the same counts times scale. What distinguishes them? On accuracy: resolution is the scale value, range is 2^31 times the scale, and motion diffs the pin against its previous value and accumulates in double, so source-side rounding never accumulates. You said a float pin would serve applications like Sam's hexagonal boring better, and more accurately. More accurately how? Is there a concrete case where s32 counts at a chosen scale lose to a float, or is that assertion? The integer-width question came up before with 64-bit encoder counts, and the answer was the new HAL API in #4247. I would rather Bertho weigh in on how this fits that track than settle it piecemeal here. Still open: the migration story for existing configs, and what a retype achieves that an added float input does not. |
Thank you for requesting this. If you can tag me next time, I have a much higher chance of seeing it as I don't check pull requests every day. I much prefer this over popping in, dropping a huge change, and then having to figure out how to fix what it broke, etc. ... ... This pull request no longer cleanly applies. At any rate, I applied it and looked at it with respect to QtPlasmaC/PlasmaC.
I don't think there's another component/GUI that uses eoffsets like PlasmaC does. EDIT: I think eoffsets are actually OK and I might have spoke too soon. At any rate, if you can update this commit so it applies, I'll try it out on my actual plasma machine. |
3f5c935 to
d175eac
Compare
|
I rebased on master, and removed all the plasmac related changes, some plasmac developer should look into this. looks like they do everythting in integer, should be a seperate PR. |
Will do, but I don't follow what the need for the change is. Could you explain it to me, bearing in mind I am not a software engineer/master programmer? |
|
@snowgoer540 my reading, and rene can correct me: no bug is being fixed. rene's view (see #4099) is that physical quantities should be float pins and HAL rarely needs integer ones; this PR applies that to PlasmaC already converts distances to counts inside plasmac.comp (dividing by Note the rebased commit still touches |
grandixximo
left a comment
There was a problem hiding this comment.
@andypugh I owe you a correction. I went through public configs that use external offsets (GitHub, forum): outside plasma, sources converting a float into counts outnumber native integer ones roughly 11 designs to 4, and most of those conversions are copies of in-tree recipes this PR removes. Plasma does the same conversion inside plasmac.comp. So "jump through hoops" holds, and I withdraw my objection to the retype.
@rene-dev I built the PR and checked the nets in halrun: the stock plasmac net and conv_sint_real into the float pin link fine. A few sim configs still create sint pins for this net and fail to load with Signal 'eoffset_count' of type 'sint' cannot add pin 'axis.z.eoffset-counts' of type 'real':
share/qtvcp/screens/woodpecker/woodpecker_handler.py:261(eoffset-count), netted inconfigs/sim/woodpecker/woodpecker_postgui.halandwoodpecker_postgui_ya.hal: all woodpecker sims.configs/sim/qtvcp_screens/qtdragon/qtvcp/screens/qtdragon/qtdragon_handler.py:353(eoffset-spindle-count), used byqtdragon_mpg.ini.- For consistency:
configs/sim/woodpecker/compensate.py:125(counts, which its help file nets to the now realwoodpecker.comp-count) andconfigs/sim/woodpecker/woodpecker_/woodpecker_handler.py:166.
Could you also add a line to "Updating Configuration Files for 2.10.y" in updating-linuxcnc.adoc: axis.L.eoffset-counts is now real, and a config feeding it from an integer signal needs conv_sint_real in between.
Optional: conv_sint_real already covers what updown.count-f adds, and scaled_sint_sums already has a float out-f, so updown.comp could stay untouched.
change external offset to float, having an offset as integer makes absoluteley no sense.
in one place(eoffset_per_angle.comp) it is actually used as a fixed point integer, calculating the reverse scale!
please, someone check the plasmac changes.