Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for SSI and BiSS encoder modules to correctly detect encoder loss #194

Merged
merged 1 commit into from
Oct 7, 2024

Conversation

glennchid
Copy link
Contributor

  • Encoder loss deduced from serial data from encoder not clock
  • Loss detection common to master and sniffer
  • For BiSS, just check for clock at startup as CRC will check data
  • integrity. Serial clock is needed to interpret data frame.

CONN signal for SSI and BISS sniffer modules was showing as 1 (connected) when nothing was plugged into DB9 connectors.
This was because the 'serial_link_detect' module was looking for the clock signal staying high for 5us to verify the link, and then checking for rising edges during the active period, following the first falling edge. The RS-485 line drivers read high on the line when nothing is connected, so it satisfied the first condition and the initial falling edge for the frame never arrives.

For SSI_master the CONN signal was previously hard-wired to '0'.

Changed both SSI_master and SSI_sniffer to look at the data signal (not the clock) and check for initial high level, and subsequent low approximately mid-way through the 20 us timeout period. Unfortunately, this still requires the serial clock (to define the frame), so if the clock goes away, CONN will stay high. This is not a problem for the SSI_master as the clock is generated by the FPGA (so can't go away) and for the sniffer this would represent the PMAC being disconnected (so it can not be controlling anything).

For BISS_sniffer, we now just check for the serial clock going low at the start of a frame (avoiding CONN falsely reading high when disconnected). The data integrity is checked by the CRC. If the clock later goes away, CONN will remain high but the same argument as for SSI_sniffer applies.

I would like to have this checked with actual encoders. I have only been able to check behaviour when nothing is connected.

Closes #89

* Encoder loss deduced from serial data from encoder not clock
* Loss detection common to master and sniffer
* For BiSS, just check for clock at startup as CRC will check data
* integrity. Serial clock is needed to interpret data frame.
@tomtrafford tomtrafford merged commit 4b7a35b into master Oct 7, 2024
24 checks passed
@tomtrafford tomtrafford deleted the encoder_los branch October 7, 2024 10:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

INENC SSI on a Control card shows connected when it isn't
2 participants