Configure a non-motorized axis with a linear scale

More
02 Feb 2025 17:28 #320432 by TangentAudio
In my mill conversion, the quill is manually operated, but it has a magnetic scale, and the scale is connected to a Beckhoff EL5101 encoder input module in my EtherCAT chain.

I'd like it to behave like a simple DRO within LinuxCNC, simply allowing me to "home" it manually when it's retracted and then touch it off in each WCS and show me the relative reading on the DRO.  I have it halfway working by simply assigning the output pin of the encoder (which is configured to be in machine units) to joint.2 motor-pos-fb.  This lets me to see the value in AXIS and home it, so it shows 0.000 when retracted, and will read down to the max extension around -5.000 inches.
# it's a 5um scale, 5080 counts per inch, negative to swap direction so it reads negative on extension
setp lcec.0.5.enc-pos-scale -5080
net 2-pos-fb => joint.2.motor-pos-fb <= lcec.0.5.enc-pos

However, touch-off doesn't work.  It pops up the touch-off dialog in AXIS, but this never changes what the DRO for Z shows. 

Another issue is that I also have to crank up FERROR to more than the full travel so it doesn't think there's a follow error with the joint moving on its own when I use it.

I can also reset the EL5101's encoder counts with it's enc-reset input pin, and I tried setting up something with a HAL oneshot component triggered off of the joint homing signal to force the encoder to reset.  It did reset the counts to 0 when homing, but it didn't help otherwise.

I can't help but think there's a better approach to this, any suggestions?

thanks,
Steve

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

More
04 Feb 2025 01:05 #320550 by TangentAudio
Replied by TangentAudio on topic Configure a non-motorized axis with a linear scale
Digging in a bit more, I think I understand what's happening.

In the AXIS source code, the "Touch Off" dialog issues a G10 L20 via the MDI, for example G10 L20 P1 Z1.0 to touch off Z in WCS 1 to 1.0

I haven't yet gone digging into the G-Code parser part of LinuxCNC yet, but I imagine it uses the joint's COMMANDED position, not the ACTUAL position.  With my non-motorized axis, the commanded position is 0, even if the actual position changes via the magnetic scale.

Using the MDI manually, I can get the effect I'm looking for by applying the ACTUAL position plus the desired touchoff offset to the G10 L20 command.

So I see two potential approaches...
  • dig into the G-Code parser, extend G10 L20 so it can be told to use the actual position instead of the commanded
  • modify AXIS (or whatever GUI) so it applies the actual position plus whatever manual offset is entered by the user
I found a post from a few years ago that's at least in the same ballpark... but no real solution on offer.  It sounds like Probe Basic might do something like what I want out of the box though.
forum.linuxcnc.org/qtpyvcp/46910-g10-l20...s-offset-like-g10-l2
 

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

Time to create page: 0.081 seconds
Powered by Kunena Forum