hostmot2 encoder documentation

More
27 Jan 2021 17:54 #196790 by jtrantow
I have some mesa boards(7i92, 7i85S, 7C80) which support encoders. I have one damaged glass scale (and I know how I damaged it) that doesn't give me encoder values over a certain travel range. Fortunately, I was able to shift the scale to cover the range of possible movement without using the damaged section.

But, it bothered me that I didn't get an encoder error when this happened. Seems likely that the damaged pattern would generate a quadrature error??? I've also been following along with the MetalMusing
and his encoder problems.

Halmeter shows 17 pins and 9 parameters for each encoder. I would like to detect encoder quadrature state transition errors and the quad-error pin seems like a good place to start. However when I go to the linuxcnc.org/docs/html/drivers/hostmot2.html docs (both 2.8 and dev) I only see 6 pins and 7 parameters for the encoder documented.

I think I could set the undocumented quad-error-enable true and connect the quad-error to an e-stop action. I'd like to know more about these pins and verify conditions when quad-error goes true. My guess is an invalid quad state transition would trigger quad-error. This would be helpful to detect dirty or damaged scales if it occurs at certain positions or noise at random locations. It seems like default configurations simply ignore quad-errors? Is there better documentation for the mesa encoders somewhere?

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

More
27 Jan 2021 19:03 - 27 Jan 2021 19:15 #196797 by PCW
Replied by PCW on topic hostmot2 encoder documentation
The encoder error pins are documented in the hostmot2 manual page.
The html documentation is at least a couple years out-of-date.

The quad error detection is not very sophisticated, it basically just checks for
illegal transitions (A,B changing simultaneously). Checking is disabled by default
and even if enabled the error pins must be connected in hal have any effect.

Gross encoder errors should normally be caught via following errors. The encoder
errors detection is good at detecting noise issues that may cause miscounts.
Last edit: 27 Jan 2021 19:15 by PCW.

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

More
27 Jan 2021 19:21 #196798 by jtrantow
#
# Enable and connect the XYZ encoder quadrature error detection.
#
setp hm2_7i92.0.encoder.01.quad-error-enable true
setp hm2_7i92.0.encoder.02.quad-error-enable true
setp hm2_7i92.0.encoder.03.quad-error-enable true

The first time I ran this, I got the quad error dialog for all three encoders at startup. The next time, I ran it, I did not get the error dialog. I mechanically connected the Y scale slider and ran it over the section I know to be damaged. It correctly indicated a quad error fault and the error dialog popped up!!! Now I just need to figure out what I want to happen on the quad-error and figure out how to clear it once it happens.

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

More
27 Jan 2021 19:28 #196799 by jtrantow
"mechanically disconnected the Y scale slider"

I do not see any documentation for the encode quad-error pins. I looked at the 2,8 and dev documentation??? I don't see any information on the encoder error pins?

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

More
27 Jan 2021 20:52 - 27 Jan 2021 20:53 #196809 by PCW
Replied by PCW on topic hostmot2 encoder documentation
man hostmot2

Since there may be startup transients that trigger errors at power up,
I would wire the quad error enable to a machine-on type signal in hal.
Last edit: 27 Jan 2021 20:53 by PCW.

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

More
22 Jan 2024 19:04 - 22 Jan 2024 19:06 #291356 by jtrantow
Enabling quad error with machine-on signals won't work. I believe there is an error in the encoder implementation. It is detecting quadrature errors even when quad-error-enable is false. This bug was confusing because quad faults don't trigger until until you set quad-error-enable true. 

I setup a halrun_encoder_test.hal that illustrates this problem. This file will start up an encoder and display the quad-error, quad-error-enable, count.

Next use the input-a, input-b to cause a quad error. (I have a bad glass scale that I connect, but connecting a & b inputs together and toggling should also cause a quad error.)

This fault will be ignored (since quad-error-enable is FALSE). BUT when you "sets encoder-quad-enable TRUE", the error which should have been cleared triggers. This means you can not ignore spurious quad errors at startup. You will have to close the quad error dialog. Seems like this is a fpga bug? If there is a way to disable the quad error dialog I could toggle the enable before the machine starts.

Is there any way to:
  • Fix this bug(fpga?)
  • Disable the dialog (hostmot2)

    Should I open up an issue somewhere?


cncbox@debian:~/linuxcnc/configs/Mill7i85s$ halrun -I halrun_encoder_test.hal
halrun_encoder_test.hal:6: Warning: File contains DOS-style line endings.
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 10.10.10.10: INFO: Hardware address (MAC): 00:60:1b:13:05:4e
hm2_eth: discovered 7I92
hm2/hm2_7i92.0: Low Level init 0.15
hm2/hm2_7i92.0: Smart Serial Firmware Version 43
hm2/hm2_7i92.0: 34 I/O Pins used:
hm2/hm2_7i92.0:     IO Pin 000 (P2-01): IOPort
hm2/hm2_7i92.0:     IO Pin 001 (P2-14): IOPort
hm2/hm2_7i92.0:     IO Pin 002 (P2-02): IOPort
hm2/hm2_7i92.0:     IO Pin 003 (P2-15): IOPort
hm2/hm2_7i92.0:     IO Pin 004 (P2-03): IOPort
hm2/hm2_7i92.0:     IO Pin 005 (P2-16): IOPort
hm2/hm2_7i92.0:     IO Pin 006 (P2-04): IOPort
hm2/hm2_7i92.0:     IO Pin 007 (P2-17): IOPort
hm2/hm2_7i92.0:     IO Pin 008 (P2-05): IOPort
hm2/hm2_7i92.0:     IO Pin 009 (P2-06): IOPort
hm2/hm2_7i92.0:     IO Pin 010 (P2-07): Muxed Encoder Select #0, pin Mux Select 0 (Output)
hm2/hm2_7i92.0:     IO Pin 011 (P2-08): Muxed Encoder #0, pin Muxed A (Input)
hm2/hm2_7i92.0:     IO Pin 012 (P2-09): Muxed Encoder #0, pin Muxed B (Input)
hm2/hm2_7i92.0:     IO Pin 013 (P2-10): Muxed Encoder #0, pin Muxed Shared Index (Input)
hm2/hm2_7i92.0:     IO Pin 014 (P2-11): IOPort
hm2/hm2_7i92.0:     IO Pin 015 (P2-12): IOPort
hm2/hm2_7i92.0:     IO Pin 016 (P2-13): IOPort
hm2/hm2_7i92.0:     IO Pin 017 (P1-01): IOPort
hm2/hm2_7i92.0:     IO Pin 018 (P1-14): IOPort
hm2/hm2_7i92.0:     IO Pin 019 (P1-02): IOPort
hm2/hm2_7i92.0:     IO Pin 020 (P1-15): IOPort
hm2/hm2_7i92.0:     IO Pin 021 (P1-03): IOPort
hm2/hm2_7i92.0:     IO Pin 022 (P1-16): IOPort
hm2/hm2_7i92.0:     IO Pin 023 (P1-04): IOPort
hm2/hm2_7i92.0:     IO Pin 024 (P1-17): IOPort
hm2/hm2_7i92.0:     IO Pin 025 (P1-05): IOPort
hm2/hm2_7i92.0:     IO Pin 026 (P1-06): IOPort
hm2/hm2_7i92.0:     IO Pin 027 (P1-07): IOPort
hm2/hm2_7i92.0:     IO Pin 028 (P1-08): IOPort
hm2/hm2_7i92.0:     IO Pin 029 (P1-09): IOPort
hm2/hm2_7i92.0:     IO Pin 030 (P1-10): IOPort
hm2/hm2_7i92.0:     IO Pin 031 (P1-11): IOPort
hm2/hm2_7i92.0:     IO Pin 032 (P1-12): IOPort
hm2/hm2_7i92.0:     IO Pin 033 (P1-13): IOPort
hm2/hm2_7i92.0: registered
FALSE
FALSE
0
halcmd: sets encoder-quad-enable TRUE
halcmd: hm2/hm2_7i92.0: Encoder 0: quadrature count error
Attachments:
Last edit: 22 Jan 2024 19:06 by jtrantow.

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

More
22 Jan 2024 19:28 - 22 Jan 2024 19:29 #291359 by PCW
Replied by PCW on topic hostmot2 encoder documentation
There seems to be a bug in the error message printout
so this is a driver bug.

(the actual error bit is not set in my testing)
Last edit: 22 Jan 2024 19:29 by PCW.

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

More
22 Jan 2024 19:44 #291362 by jtrantow
I started github.com/LinuxCNC/linuxcnc/issues/2860

I believe the quad-error does get set momentarily since I see my estop logic getting triggered by it. Does the fpga ignore faults when quad-error-enable is FALSE? Seems like it's catching the fault when it shouldn't but not updating the quad-error until the enable transition.

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

More
22 Jan 2024 20:09 - 22 Jan 2024 20:10 #291365 by PCW
Replied by PCW on topic hostmot2 encoder documentation
Yes, there's a race error in clearing the fault.

(The hardware fault is not cleared until the check enable is set true
but the fault is reported before the actual hardware clear is issued because
reads are always done before writes)

There needs to be a one servo thread period mask in the error reporting.
I will look into fixing this when I get a chance.
Last edit: 22 Jan 2024 20:10 by PCW.

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

More
22 Jan 2024 21:43 #291371 by jtrantow
Great, I'd be happy to help with any testing. Should be fairly easy to tell when it's fixed.

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

Moderators: PCWjmelson
Time to create page: 0.094 seconds
Powered by Kunena Forum