Hi everyone,I am a Master's student currently working on my thesis, which involves designing a custom, low-voltage FOC Servo Driver to control a Mitsubishi MR-J3 motor (equipped with the 18-bit absolute encoder, model J-A22/J-A24).My goal is to achieve full closed-loop control (current, speed, and position) using a custom control board. I am determined to implement the encoder decoder myself rather than using commercial converter modules, as the academic board requires a deep dive into the firmware.
What I have done so far:
- Hardware Interface: I designed a custom PCB utilizing a high-speed RS-485 transceiver (MAX3485) connected to the USART peripheral of an STM32G4 MCU. The differential lines (MR/MRR) are properly terminated with a 120-ohm resistor.
- Signal Capture: I have configured the MCU's USART to run at 2.5 Mbps (8N1), utilizing DMA to handle the high-speed RX buffer without blocking the CPU.
- Prior Research: I have deeply analyzed open-source projects like STMBL and various threads on the LinuxCNC forum regarding the "Mit-A/Mit-B" protocols.
The Roadblock: While I can physically capture the serial stream, I am currently struggling with the deterministic behavior of the protocol:
- The Request Command: I am trying to identify the exact initialization/request byte sequence that the Master needs to send to "wake up" or poll the encoder continuously. I tried sending
and
based on some older J2S documentation, but the encoder response is inconsistent.
- Frame Parsing & CRC: Once the encoder responds, I receive an 7-to-9 byte packet. I am trying to figure out how the 18-bit position data is packed across these bytes (Little-Endian shifting vs. Scrambled bits), and what specific CRC-8 polynomial (and initial value) is used to validate the frame.
I am
not looking for ready-made code or copy-paste libraries. I want to understand the underlying data structure and state machine of this specific encoder protocol so I can write my own robust driver.If anyone has any documentation, logic analyzer captures, or insights regarding the J-A22/J-A24 protocol frame format, your guidance would be an absolute lifesaver for my thesis progress.Thank you so much for your time and expertise!Best regards,
lap
Master's Student in Mechatronics Engineering