- Configuring LinuxCNC
- Advanced Configuration
- I get a tracking error. the scale of my encoder is correct on my B axis display
I get a tracking error. the scale of my encoder is correct on my B axis display
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18841
- Thank you received: 5202
12 Apr 2025 20:17 #326192
by PCW
Replied by PCW on topic I get a tracking error. the scale of my encoder is correct on my B axis display
Can you post a plot that shows this oscillation, including the velocity and the ferror?
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 212
- Thank you received: 14
15 Jun 2025 19:45 #330320
by JackRay
Replied by JackRay on topic I get a tracking error. the scale of my encoder is correct on my B axis display
hello,I've managed to set my PID.I've mounted an encoder directly on my machine B axis. My encoder is of the phase type A+,A-;B+,B-;Z+,Z-.the feedback is correct on my axis position. However, it's impossible to detect my Z0. I have a 7i96s and I've connected my two Z+,Z- wires to pins 13 & 14 of TB2 on my card. My .hal file is correctly configured for homing with this Z phase. I've tested 5 encoders of the same type. but I can't find the Z pulse.Is there a trick? Can anyone help me? Thanks
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18841
- Thank you received: 5202
15 Jun 2025 21:18 #330321
by PCW
Replied by PCW on topic I get a tracking error. the scale of my encoder is correct on my B axis display
To check, in halcmd:
sets b-index-enable true
and watch b-index-enable in halshow
Then move the axis past an index mark
b-index-enable should go false when the index is detected
sets b-index-enable true
and watch b-index-enable in halshow
Then move the axis past an index mark
b-index-enable should go false when the index is detected
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 212
- Thank you received: 14
17 Jun 2025 19:42 #330412
by JackRay
Replied by JackRay on topic I get a tracking error. the scale of my encoder is correct on my B axis display
yes, I checked all that with 4 encoders but I never saw any change in the Z signal. I think my .hal is compliant. Could there be a connection subtlety on the 7i96s card?
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18841
- Thank you received: 5202
17 Jun 2025 20:48 - 17 Jun 2025 20:52 #330416
by PCW
Replied by PCW on topic I get a tracking error. the scale of my encoder is correct on my B axis display
You are not guaranteed to see any change in the Z signal
as its a short pulse and quite hard to catch at the 1 KHz servo thread.
(especially with higher resolution scales)
This is why the actual index event is captured in hardware.
The index (Z) signal is only provided as a hal signal for debugging
or using it as a GP input. It's normally not of any other use.
If index enable goes false on an index event, the index was detected.
as its a short pulse and quite hard to catch at the 1 KHz servo thread.
(especially with higher resolution scales)
This is why the actual index event is captured in hardware.
The index (Z) signal is only provided as a hal signal for debugging
or using it as a GP input. It's normally not of any other use.
If index enable goes false on an index event, the index was detected.
Last edit: 17 Jun 2025 20:52 by PCW. Reason: clarify
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 212
- Thank you received: 14
18 Jun 2025 19:19 #330466
by JackRay
Replied by JackRay on topic I get a tracking error. the scale of my encoder is correct on my B axis display
I don't quite understand, but that means I could never use it as a homing device? my encoders are 2500 pulses/ 10000 pulses quadrature hole.
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18841
- Thank you received: 5202
18 Jun 2025 19:45 - 18 Jun 2025 19:49 #330469
by PCW
Replied by PCW on topic I get a tracking error. the scale of my encoder is correct on my B axis display
No, homing to index is common and fully supported.
I'm just saying that the actual index hal pin is not useful
for homing. The index-enable pin is what's used to communicate
index information from the hardware/driver to LinuxCNC
That is, this hal statement:
net phaseZ [HMOT](CARD0).encoder.00.input-index
Doesn't do anything useful.
But this hal statement:
net b-index-enable joint.3.index-enable <=> [HMOT](CARD0).encoder.00.index-enable
Allows LinuxCNC to enable index detection AND allows the driver to inform LinuxCNC
when the index has been detected.
To test whether the index hardware is working (assuming you can move the axis past
an index mark), you would:
With LinuxCNC running, use halshow to watch the signal b-index-enable
and then with either halshow or halcmd, set b-index-enable true"
halcmd sets b-index-enable true
halshow should now show b-index-enable true
now, if you move the axis past an index mark, b-index-enable should go false.
This is how you test for correct index operation.
I'm just saying that the actual index hal pin is not useful
for homing. The index-enable pin is what's used to communicate
index information from the hardware/driver to LinuxCNC
That is, this hal statement:
net phaseZ [HMOT](CARD0).encoder.00.input-index
Doesn't do anything useful.
But this hal statement:
net b-index-enable joint.3.index-enable <=> [HMOT](CARD0).encoder.00.index-enable
Allows LinuxCNC to enable index detection AND allows the driver to inform LinuxCNC
when the index has been detected.
To test whether the index hardware is working (assuming you can move the axis past
an index mark), you would:
With LinuxCNC running, use halshow to watch the signal b-index-enable
and then with either halshow or halcmd, set b-index-enable true"
halcmd sets b-index-enable true
halshow should now show b-index-enable true
now, if you move the axis past an index mark, b-index-enable should go false.
This is how you test for correct index operation.
Last edit: 18 Jun 2025 19:49 by PCW.
The following user(s) said Thank You: tommylight
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 212
- Thank you received: 14
19 Jun 2025 17:02 #330520
by JackRay
Replied by JackRay on topic I get a tracking error. the scale of my encoder is correct on my B axis display
what do you think of my configuration:
# --- Encodeur configuration ---
setp [HMOT](CARD0).encoder.00.counter-mode 0
setp [HMOT](CARD0).encoder.00.filter 0
setp [HMOT](CARD0).encoder.00.scale [JOINT_3]ENCODER_B_SCALE
#setp [HMOT](CARD0).encoder.00.index-enable true
setp [HMOT](CARD0).encoder.00.index-mask 1
setp [HMOT](CARD0).encoder.00.index-invert 0
setp [HMOT](CARD0).encoder.00.index-mask-invert 0
# --- Feedback position/velocity via encodeur ---
net b-pos-fb <= [HMOT](CARD0).encoder.00.position
net b-pos-fb => pid.b.feedback
net b-pos-fb => joint.3.motor-pos-fb
net b-vel-fb <= [HMOT](CARD0).encoder.00.velocity
# --- Index pour homing ---
net b-index-enable joint.3.index-enable <=> [HMOT](CARD0).encoder.00.index-enable
net phaseZ [HMOT](CARD0).encoder.00.input-index
# --- Raw counts (optionnel debug) ---
net b-pos-rawcounts <= [HMOT](CARD0).encoder.00.rawcounts
# --- Switches (home et fins de course) ---
net b-home-sw => joint.3.home-sw-in
net b-neg-limit => joint.3.neg-lim-sw-in
net b-pos-limit => joint.3.pos-lim-sw-in
# --- Encodeur configuration ---
setp [HMOT](CARD0).encoder.00.counter-mode 0
setp [HMOT](CARD0).encoder.00.filter 0
setp [HMOT](CARD0).encoder.00.scale [JOINT_3]ENCODER_B_SCALE
#setp [HMOT](CARD0).encoder.00.index-enable true
setp [HMOT](CARD0).encoder.00.index-mask 1
setp [HMOT](CARD0).encoder.00.index-invert 0
setp [HMOT](CARD0).encoder.00.index-mask-invert 0
# --- Feedback position/velocity via encodeur ---
net b-pos-fb <= [HMOT](CARD0).encoder.00.position
net b-pos-fb => pid.b.feedback
net b-pos-fb => joint.3.motor-pos-fb
net b-vel-fb <= [HMOT](CARD0).encoder.00.velocity
# --- Index pour homing ---
net b-index-enable joint.3.index-enable <=> [HMOT](CARD0).encoder.00.index-enable
net phaseZ [HMOT](CARD0).encoder.00.input-index
# --- Raw counts (optionnel debug) ---
net b-pos-rawcounts <= [HMOT](CARD0).encoder.00.rawcounts
# --- Switches (home et fins de course) ---
net b-home-sw => joint.3.home-sw-in
net b-neg-limit => joint.3.neg-lim-sw-in
net b-pos-limit => joint.3.pos-lim-sw-in
Please Log in or Create an account to join the conversation.
- PCW
-
- Away
- Moderator
-
Less
More
- Posts: 18841
- Thank you received: 5202
19 Jun 2025 22:36 #330535
by PCW
Replied by PCW on topic I get a tracking error. the scale of my encoder is correct on my B axis display
None of these are needed and the first will likely mean
that you never get an index.
setp [HMOT](CARD0).encoder.00.index-mask 1
setp [HMOT](CARD0).encoder.00.index-invert 0
setp [HMOT](CARD0).encoder.00.index-mask-invert 0
The index mask logic is intended for configurations
that have a index mask input pin which is typically used
for spindles where the encoder is on the motor and the
spindle is geared down from the motor.
that you never get an index.
setp [HMOT](CARD0).encoder.00.index-mask 1
setp [HMOT](CARD0).encoder.00.index-invert 0
setp [HMOT](CARD0).encoder.00.index-mask-invert 0
The index mask logic is intended for configurations
that have a index mask input pin which is typically used
for spindles where the encoder is on the motor and the
spindle is geared down from the motor.
The following user(s) said Thank You: JackRay
Please Log in or Create an account to join the conversation.
- JackRay
- Offline
- Elite Member
-
Less
More
- Posts: 212
- Thank you received: 14
21 Jun 2025 16:13 #330639
by JackRay
Replied by JackRay on topic I get a tracking error. the scale of my encoder is correct on my B axis display
I deleted the 3 lines without success Z undetectable.
My axis turns at slow speed during the homing phase but never stops.
Should it stop when it finds the puls index?
My axis turns at slow speed during the homing phase but never stops.
Should it stop when it finds the puls index?
Please Log in or Create an account to join the conversation.
- Configuring LinuxCNC
- Advanced Configuration
- I get a tracking error. the scale of my encoder is correct on my B axis display
Time to create page: 0.115 seconds