POSITION_FILE and index
- mark-v-d
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 3
24 Oct 2025 22:28 #337100
by mark-v-d
POSITION_FILE and index was created by mark-v-d
I would like to use the POSITION_FILE in combination with the index pulse
of the encoder to home my lathe. The idea is that you know approximately
where you are when starting up, and once you pass the first index pulse
you know the exact position. Has anyone done this... and if so can you
explain how?
of the encoder to home my lathe. The idea is that you know approximately
where you are when starting up, and once you pass the first index pulse
you know the exact position. Has anyone done this... and if so can you
explain how?
Please Log in or Create an account to join the conversation.
- andypugh
-
- Offline
- Moderator
-
Less
More
- Posts: 19703
- Thank you received: 4565
26 Oct 2025 16:54 #337222
by andypugh
Replied by andypugh on topic POSITION_FILE and index
I did something a bit like this using resolvers (with the difference being that resolvers are single-turn absolute)
wiki.linuxcnc.org/cgi-bin/wiki.pl?Psuedo-Absolute_Encoders
You probably need a realtime HAL component (or set of standard components) that zeros the absolute portion of your adder when the index is seen. This is because of the way that the joint position feedback is used in the home offset calcuations.
wiki.linuxcnc.org/cgi-bin/wiki.pl?Psuedo-Absolute_Encoders
You probably need a realtime HAL component (or set of standard components) that zeros the absolute portion of your adder when the index is seen. This is because of the way that the joint position feedback is used in the home offset calcuations.
Please Log in or Create an account to join the conversation.
- mark-v-d
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 3
27 Oct 2025 18:37 #337305
by mark-v-d
Replied by mark-v-d on topic POSITION_FILE and index
OK, thanks. Time to start coding.
Please Log in or Create an account to join the conversation.
- mark-v-d
- Offline
- New Member
-
Less
More
- Posts: 10
- Thank you received: 3
28 Oct 2025 19:14 #337362
by mark-v-d
Replied by mark-v-d on topic POSITION_FILE and index
I've written the realtime component I needed. When linuxcnc is started
you can jog the axis and as soon as the index is passed, the position
is corrected using that index. The axis is then also homed.
If the encoder had already seen an index (for example, linuxcnc was
quit and then started again without turning off the encoders) The axis
is homed as soon as the amplifier is enabled.
After homing the distance between the actual position and what was in
the POSITION_FILE is made available on the "offset" pin.
This is tested using a Fanuc encoder which has an index every 65536
increments. This encoder resets the counter by itself as soon as it
encounters the index for the first time since powerup.
I've made the information if the index has been seen available using an
index pin, which is 0 if the index has not been seen and 1 if it has.
The first cycle with index==1 should present the last counter _before_
the reset. (This is how the Fanuc encoder works)
The component can be found at:
github.com/mark-v-d/motor_control/blob/f...l/absolute_index.cpp
you can jog the axis and as soon as the index is passed, the position
is corrected using that index. The axis is then also homed.
If the encoder had already seen an index (for example, linuxcnc was
quit and then started again without turning off the encoders) The axis
is homed as soon as the amplifier is enabled.
After homing the distance between the actual position and what was in
the POSITION_FILE is made available on the "offset" pin.
This is tested using a Fanuc encoder which has an index every 65536
increments. This encoder resets the counter by itself as soon as it
encounters the index for the first time since powerup.
I've made the information if the index has been seen available using an
index pin, which is 0 if the index has not been seen and 1 if it has.
The first cycle with index==1 should present the last counter _before_
the reset. (This is how the Fanuc encoder works)
The component can be found at:
github.com/mark-v-d/motor_control/blob/f...l/absolute_index.cpp
The following user(s) said Thank You: tommylight, onceloved
Please Log in or Create an account to join the conversation.
Time to create page: 0.107 seconds