An ssi interface non-contact angular displacement sensor
By employing a general-purpose absolute magnetic encoder chip and microcontroller in an SSI interface non-contact angular displacement sensor, combined with hardware modules such as an SPI controller, the flexible construction and accuracy improvement of the SSI interface function are realized, the problem of fixed data frame format is solved, and the adaptability and market competitiveness of the sensor are enhanced.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SICHUAN YONGXING ELECTRONICS
- Filing Date
- 2026-02-10
- Publication Date
- 2026-05-05
AI Technical Summary
Existing SSI interface non-contact angular displacement sensors rely on dedicated SSI encoders, resulting in fixed data frame formats, poor configuration flexibility, and an inability to meet the communication protocol compatibility requirements of different application systems.
It adopts a general-purpose absolute magnetic encoder chip and microcontroller, combined with an SPI controller, TIMER timer, DMA controller and external interrupt controller. Through mechanical packaging structure and SSI interface hardware and software coordination mechanism, it realizes flexible construction of SSI interface function, and improves output accuracy through calibration method.
The SSI interface function has been flexibly configured, which has improved the output accuracy of the sensor and the flexibility of the system, reduced hardware costs, and enhanced the adaptability and market competitiveness of the product.
Smart Images

Figure CN121677537B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of sensor technology, and in particular to a non-contact angular displacement sensor with an SSI interface. Background Technology
[0002] The SSI interface is a synchronous serial communication interface composed of four differential signals. It is widely used in industrial automation, servo control, and precision measurement, especially as the standard output interface in non-contact angular displacement sensors. Non-contact angular displacement sensors detect rotation angles based on electromagnetic induction or optical principles, acquiring angle information without mechanical contact. This effectively avoids the shortened lifespan and decreased reliability problems caused by wear in traditional contact sensors, offering significant advantages in applications requiring high position feedback accuracy and long-term system stability.
[0003] Currently, most SSI interface non-contact angular displacement sensors on the market use encoder chips that directly integrate SSI output functionality. This means the sensor internally contains only a magnetic or optical encoder, and its output signal is transmitted directly to the outside via the SSI interface without processing. While this approach is simple in structure, it has significant technical limitations:
[0004] On the one hand, the overall output accuracy of the sensor depends on the resolution and linearity of the selected encoder chip itself, and errors such as mechanical eccentricity and air gap changes generated during the assembly process will further degrade the output accuracy.
[0005] On the other hand, since the SSI output frame format of encoder chips is usually a fixed structure, it is difficult to flexibly configure key parameters such as frame header, check bit, and data bit length, making it difficult to meet the communication protocol compatibility requirements of different application systems. Summary of the Invention
[0006] The purpose of this invention is to provide an SSI interface non-contact angular displacement sensor to solve the technical problems of fixed data frame format and poor configuration flexibility caused by the reliance on dedicated SSI encoders in existing SSI interface non-contact angular displacement sensors.
[0007] This invention provides an SSI interface non-contact angular displacement sensor, comprising at least a base, bearing, rotating shaft, magnet disk, magnet, lead wire, end cap, and circuit module; wherein,
[0008] The base is a cylindrical component with an inner cavity for accommodating and supporting internal components; the end cap is sealed and installed at the open end of the base, and the end cap and the base together form a closed cavity; the bearing is press-fitted into the inner hole of the base to support the rotating shaft; one end of the rotating shaft extends out of the base to connect to the rotating body under test, and the other end is rigidly connected to the magnet disk; the magnet is fixed at the top center of the magnet disk and rotates synchronously with the rotating shaft.
[0009] The circuit module is fixed to the stepped area inside the base cavity. The circuit module integrates a magnetic encoder chip U6, a microcontroller U3, an RS-422 serial data transceiver U4, and an inverter U2. The magnetic encoder chip U6 is positioned facing the magnet and is used to sense changes in the magnetic field and output the original absolute angle encoded signal. The microcontroller U3 reads the original angle encoded signal through the SPI bus and generates output data that conforms to the SSI protocol requirements. The lead wires extend from the side wall of the base and are electrically connected to the circuit module. The lead wires include differential clock signal lines CLK+ and CLK- and differential data signal lines DA+ and DA-.
[0010] In some embodiments, the microcontroller U3 configures SPI2 to slave mode, where CPOL=1 and CPHA=0, and its MISO pin outputs a single-ended data signal DATA. This signal is conditioned by the inverter U2 and sent to the RS-422 serial data transceiver U4, where it is converted into differential data signals DA+ and DA- for output.
[0011] In some embodiments, the differential clock signal lines CLK+ and CLK- are converted into a single-ended clock signal CLOCK by the RS-422 serial data transceiver U4 and input to the microcontroller U3. The microcontroller U3 detects the falling edge of the single-ended clock signal CLOCK through the TIMER timer, triggers the DMA controller, and moves the pre-stored angle-encoded data to the SPI data register.
[0012] In some embodiments, the microcontroller U3 starts a timeout timer TIM1, which operates in slave mode reset mode and is continuously cleared by the rising and falling edges of the single-ended clock signal CLOCK. If a clock timeout occurs, the SPI data register and the DMA controller are reset in an overflow interrupt, the timeout timer TIM1 is turned off, and external interrupts are re-enabled.
[0013] In some embodiments, the magnetic encoder chip U6 is a general-purpose absolute magnetic encoder, and its output interface is connected to the microcontroller U3 to transmit the original angle encoded signal.
[0014] In some embodiments, the circuit module is further provided with silicone rubber on its upper and lower surfaces and at the end cap lead positions to protect component solder joints and leads, and to improve insulation.
[0015] In some embodiments, an epoxy resin is also included, which is disposed on the upper surface of the magnet to improve the magnet's salt spray resistance.
[0016] Compared with the prior art, the present invention has the following beneficial effects:
[0017] This invention overcomes the traditional SSI sensor's dependence on a dedicated encoder by using an SPI controller, a TIMER timer, a DMA controller, and an external interrupt controller, along with a mechanical packaging structure and an SSI interface hardware and software coordination mechanism, thus enabling flexible construction of SSI interface functions. Attached Figure Description
[0018] To more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a structural diagram of the SSI interface non-contact angular displacement sensor of the present invention;
[0020] Figure 2 This is a schematic diagram of the SSI interface non-contact angular displacement sensor of the present invention.
[0021] Figure 3 This is a block diagram of the sensor SSI interface design for the present invention;
[0022] Figure 4 This is the SSI timing diagram of the present invention;
[0023] Figure 5 This is a flowchart of the program processing of the present invention.
[0024] In the picture:
[0025] 1-Base; 2-Bearing; 3-Shaft; 4-Magnetic disk; 5-Magnet; 6-Epoxy resin; 7-Silicone rubber; 8-Lead wire; 9-End cap; 10-Circuit module. Detailed Implementation
[0026] The following will be based on embodiments of the present invention. Figures 1-5The technical solutions in the embodiments of the present invention will be clearly and completely described together. Obviously, the described embodiments are only some embodiments of the present invention, and not all embodiments.
[0027] Definitions of some terms:
[0028] SSI: Synchronous Serial Interface;
[0029] RS-422: Differential Serial Communication Standard;
[0030] MCU: Microcontroller;
[0031] SPI: Peripheral for microcontrollers;
[0032] CPOL: Clock polarity, defines the level state of the clock signal in the idle state of the SPI bus;
[0033] CPHA: Clock Phase, defines the clock edge for data sampling and data updating in SPI communication;
[0034] MISO: SPI data output from device;
[0035] MOSI: SPI Slave Data Input;
[0036] DMA: A peripheral device for microcontrollers that provides direct memory access;
[0037] EXTI: Peripherals of the microcontroller, external interrupt controller;
[0038] TIM1: Microcontroller peripherals, advanced timers;
[0039] TIM2: A peripheral device for microcontrollers, a general-purpose timer;
[0040] TIM2_CH4: Channel 4 of the TIM2 timer;
[0041] TIM1_CH1: Channel 1 of TIM1 timer;
[0042] Flash: Flash memory for microcontrollers;
[0043] t MAS : Master clock signal period;
[0044] t MASh The duration of the high level of the master clock signal;
[0045] t MASl The duration of the low level of the master clock signal;
[0046] t tos Timeout period.
[0047] This embodiment provides an SSI interface non-contact angular displacement sensor, comprising at least a base 1, a bearing 2, a rotating shaft 3, a magnet disk 4, a magnet 5, a lead wire 8, an end cap 9, and a circuit module 10. The base 1 is a cylindrical component with an inner cavity for housing and supporting internal components. The end cap 9 is sealed to the open end of the base 1, forming a closed cavity with the base 1. The bearing 2 is press-fitted into the inner hole of the base 1 to support the rotating shaft 3. One end of the rotating shaft 3 extends out of the base 1 to connect to the rotating body being measured, and the other end is rigidly connected to the magnet disk 4. The magnet 5 is fixed to the top center of the magnet disk 4 and rotates synchronously with the rotating shaft 3. The circuit module... The circuit module 10 is fixed to the inner cavity of the base 1 at the stepped position. The circuit module 10 integrates a magnetic encoder chip U6, a microcontroller U3, an RS-422 serial data transceiver U4, and an inverter U2. The magnetic encoder chip U6 is positioned facing the magnet 5 to sense changes in the magnetic field and output the original absolute angle encoding signal. The microcontroller U3 reads the original angle encoding signal through the SPI bus and generates output data that conforms to the SSI protocol requirements. The lead wire 8 is led out from the side wall of the base 1 and electrically connected to the circuit module 10. The lead wire 8 includes differential clock signal lines CLK+ and CLK- and differential data signal lines DA+ and DA-.
[0048] To better understand this invention, the details are as follows:
[0049] first,
[0050] During actual assembly, bearing 2 is press-fitted into the inner hole of base 1, ensuring it is coaxial with base 1 and securely fixed. Shaft 3 passes through bearing 2, with one end extending out of base 1 to connect to the external rotating component being measured, while the other end is rigidly connected to magnet disk 4 via threads and adhesive. Magnet 5 is installed at the top center of magnet disk 4 and is positioned using adhesive to prevent misalignment when rotating synchronously with shaft 3.
[0051] Next, the circuit module 10 is fixed to the central area at the bottom of the inner cavity of the base 1, so that the magnetic encoder chip U6 faces the magnet 5 directly below, with an air gap of about 0.8mm-1.2mm between them to ensure magnetic field sensing sensitivity and linearity.
[0052] The end cap 9 is fixed to the open end of the base 1 by dispensing adhesive, forming a closed cavity together with the base 1, which effectively prevents external particulate matter and other contaminants from entering the internal sensitive components.
[0053] then,
[0054] like Figure 2As shown, circuit module 10 integrates a microcontroller U3, a magnetic encoder chip U6, an RS-422 serial data transceiver U4, and an inverter U2. Among them, the magnetic encoder chip U6 is a high-resolution absolute magnetic encoder, such as the AS5048A from a certain company, whose output interface is compatible with the SPI protocol and has a resolution of 14 bits (i.e., 0.022°).
[0055] The microcontroller U3 uses the MM32F0 series MCU from Lingdong Microelectronics. This chip has a built-in high-speed SPI controller, a multi-channel DMA controller, advanced timers (TIM1, TIM2) and abundant GPIO resources, which can meet the strict timing requirements of the SSI protocol.
[0056] External differential clock signals CLK+ and CLK- are connected to the receiver of RS-422 serial data transceiver U4 via pin 8. After being converted to a single-ended clock signal CLOCK, it is sent to pin PA3 of microcontroller U3, which is multiplexed as the TIM2_CH4 capture channel. Simultaneously, the CLOCK signal is also connected to pin PA8, configured as the EXTI external interrupt source and the reset source for the timeout timer (TIM1_CH1). Additionally, the CLOCK signal is connected to pin PA10, configured as the SPI2 clock. Microcontroller U3 configures SPI2 in slave mode, with CPOL=1 (SCK remains high in idle state) and CPHA=0 (data is sampled on the first clock edge). Its MISO pin (PA12) outputs the single-ended data signal DATA to the input of inverter U2. The output of inverter U2 is connected to the driver of RS-422 serial data transceiver U4, ultimately generating differential data signals DA+ and DA-, which are output via pin 8.
[0057] When the single-ended data signal DATA is low in the idle state, it needs to be flipped to high level by inverter U2 to conform to the idle high level characteristic specified by the SSI protocol. The design of using an external inverter U2 instead of the internal comparator of microcontroller U3 is to reduce signal delay and improve communication speed and stability.
[0058] Then,
[0059] like Figure 3 As shown, the SSI interface function is implemented collaboratively by multiple hardware modules inside the microcontroller U3: the SPI controller is responsible for data transmission, the DMA controller is used to automatically transfer pre-stored angle-encoded data to the SPI2 data register, the TIMER timer (TIM2) is used as a capture device to trigger DMA, the TIMER timer (TIM1) is used for CLOCK timeout detection, and the external interrupt controller is used for timeout timer enable, etc.
[0060] The operation process is as follows: When the external master device sends a differential clock signal CLK+ / CLK-, the RS-422 serial data transceiver U4 converts it into a single-ended CLOCK signal and inputs it into the microcontroller U3; the falling edge of CLOCK first triggers the EXTI external interrupt on the PA8 pin, and in the interrupt service routine, the TIM1 timeout timer is enabled and its own interrupt is disabled to prevent repeated triggering.
[0061] Simultaneously, the falling edge of CLOCK is also captured by TIM2_CH4, triggering a DMA request. The DMA controller moves the angle-encoded data stored in the microcontroller's memory at a fixed address to the data register of SPI2. Subsequently, when the rising edge of CLOCK arrives, SPI2 outputs the corresponding data bits on the MISO pin according to the set CPOL and CPHA parameters. During this period, TIM1 operates in slave mode reset mode, and each rising or falling edge of CLOCK will clear the counter and restart the timing. If no new clock edge is received within the set time ttos, TIM1 will experience an overflow interrupt. In this interrupt, the SPI controller and DMA controller will be reset, the TIM1 timeout timer will be disabled, and the EXTI external interrupt will be re-enabled, thus completing a complete SSI communication cycle.
[0062] Then,
[0063] like Figure 4 As shown, the SSI communication timing strictly follows the standard SSI protocol, including the frame header, data bits, parity bit, and idle interval. It should be noted that this invention supports flexible configuration of the SSI frame format. For example, one start bit, 13 to 25 data bits, one parity bit, and several end bits can be set. Users can adjust these by modifying the software parameters in the microcontroller U3 according to actual application requirements without replacing the hardware.
[0064] Then,
[0065] like Figure 5 As shown, the program processing flow includes an initialization phase and a running phase. In the initialization phase, peripherals such as SPI, DMA, TIMER, and EXTI are configured, and calibration parameters are loaded. In the running phase, the microcontroller U3 continuously reads the raw angle value output by the magnetic encoder chip U6, performs lookup interpolation calculations in conjunction with the pre-stored calibration mapping table, obtains the high-precision calibrated angle value, and packages it according to the currently configured SSI frame format before waiting for DMA to transfer and output it.
[0066] To further improve the sensor output accuracy of this invention, a calibration method is also used to compensate the original angle data. The implementation steps are as follows:
[0067] The sensor is coaxially mounted with the high-precision optical turntable to ensure that their rotation centers are aligned.
[0068] The turntable is controlled to rotate sequentially to multiple known angular positions (e.g., collecting data at each 10° or 1° point), and the actual angle θ of the turntable is recorded synchronously after each position stabilizes. true Compared with the sensor's original output angle θ raw ;
[0069] Establish θ true With θ raw The mapping relationship between them is linearly fitted using the least squares method to calculate the calibration coefficients k (proportion factor) and b (offset), or a piecewise lookup table model is constructed.
[0070] Write the calibration parameters into the Flash or EEPROM of the microcontroller U3;
[0071] During normal operation of the sensor, the microcontroller U3 reads the raw angle value θ output by the magnetic encoder chip U6 in real time. raw Through the formula θ calibrated = k × θ raw + b or interpolation from a table to obtain the calibrated angle value θ calibrated It is then converted into a data frame format conforming to the SSI protocol and output.
[0072] Through the aforementioned process, the sensor's angle output accuracy can reach ±0.05°, which is far superior to the typical error in the uncalibrated state, which is ±0.2° to ±0.5°.
[0073] It is understandable that in some practical application scenarios, such as aerospace control systems, industrial robot joint feedback, or precision machine tool position detection, the SSI interface non-contact angular displacement sensor provided by this invention can replace the traditional solution that relies on a dedicated SSI encoder, which not only reduces hardware costs but also enhances the flexibility and adaptability of the system.
[0074] The combination architecture of a general-purpose magnetic encoder chip and a microcontroller makes the product easy to upgrade and maintain, supports remote firmware updates and parameter reconfiguration, and greatly enhances the product's market competitiveness.
[0075] The foregoing has shown and described the basic principles, main features, and advantages of the present invention. It will be apparent to those skilled in the art that the invention is not limited to the details of the exemplary embodiments described above, and that the invention can be implemented in other specific forms without departing from its spirit or essential characteristics. Therefore, the embodiments should be considered illustrative and non-limiting in all respects, and the scope of the invention is defined by the appended claims rather than the foregoing description. Thus, all variations falling within the meaning and scope of equivalents of the claims are intended to be included within the scope of the invention. No reference numerals in the claims should be construed as limiting the scope of the claims.
[0076] Furthermore, it should be understood that although this specification describes embodiments, not every embodiment contains only one independent technical solution. This narrative style is merely for clarity. Those skilled in the art should consider the specification as a whole, and the technical solutions in each embodiment can also be appropriately combined to form other embodiments that can be understood by those skilled in the art.
Claims
1. A non-contact angular displacement sensor with an SSI interface, characterized in that, It includes at least a base (1), a bearing (2), a rotating shaft (3), a magnet disk (4), a magnet (5), a lead wire (8), an end cap (9), and a circuit module (10); among which, The base (1) is a cylindrical part, and its inner cavity is used to accommodate and support the internal components; the end cap (9) is sealed and installed on the open end of the base (1), and the end cap (9) and the base (1) form a closed cavity; the bearing (2) is pressed into the inner hole of the base (1) to support the rotating shaft (3); one end of the rotating shaft (3) extends out of the base (1) to connect to the rotating body under test, and the other end is rigidly connected to the magnet disk (4); the magnet (5) is fixed at the top center of the magnet disk (4) and rotates synchronously with the rotating shaft (3); The circuit module (10) is fixed at the inner cavity step of the base (1). The circuit module (10) integrates a magnetic encoder chip U6, a microcontroller U3, an RS-422 serial data transceiver U4, and an inverter U2. The magnetic encoder chip U6 is positioned facing the magnet (5) and is used to sense changes in the magnetic field and output the original absolute angle encoding signal. The microcontroller U3 reads the original angle encoding signal through the SPI bus and generates output data that meets the requirements of the SSI protocol. The lead wire (8) is led out from the side wall of the base (1) and electrically connected to the circuit module (10). The lead wire (8) includes differential clock signal lines CLK+ and CLK- and differential data signal lines DA+ and DA-. Among them, the external differential clock signals CLK+ and CLK- are connected to the receiving end of RS-422 serial data transceiver U4 through lead-out line (8), and after being converted into single-ended clock signal CLOCK, they are sent to the PA3 pin of microcontroller U3. This pin is multiplexed as TIM2_CH4 capture channel. At the same time, the CLOCK signal is also connected to the PA8 pin and configured as the external interrupt source of EXTI and the reset source of the timeout timer. At the same time, the CLOCK signal is also connected to the PA10 pin and configured as SPI2 clock. Microcontroller U3 configures SPI2 to slave mode, CPOL=1, CPHA=0, and its MISO pin PA12 outputs single-ended data signal DATA to the input end of inverter U2. The output end of inverter U2 is connected to the driving end of RS-422 serial data transceiver U4, and finally generates differential data signals DA+ and DA- and outputs them through lead-out line (8). When the single-ended data signal DATA is low in the idle state, it needs to be flipped to high level by inverter U2 to conform to the idle high level characteristic specified by the SSI protocol. Meanwhile, the SSI interface function is implemented collaboratively by multiple hardware modules within the microcontroller U3: the SPI controller is responsible for data transmission, the DMA controller is used to automatically transfer pre-stored angle-encoded data to the SPI2 data register, the TIMER timer TIM2 acts as a capture device to trigger DMA, the TIMER timer TIM1 acts as a CLOCK timeout detection device, and the external interrupt controller is used to enable the timeout timer. Its operation is as follows: when the external master device sends a differential clock signal CLK+ / CLK-, the RS-422 serial data transceiver U4 converts it into a single-ended CLOCK signal and inputs it to the microcontroller U3; the falling edge of the CLOCK first triggers the EXTI external interrupt on the PA8 pin, and in the interrupt service routine, the TIM1 timeout timer is enabled and its own interrupt is disabled to prevent repeated triggering; C The falling edge of LOCK is also captured by TIM2_CH4, triggering a DMA request. The DMA controller moves the angle-encoded data stored in the microcontroller's memory at a fixed address to the SPI2's data register. Subsequently, when the rising edge of CLOCK arrives, SPI2 outputs the corresponding data bits on the MISO pin according to the set CPOL and CPHA parameters. During this period, TIM1 operates in slave mode reset mode. Each rising or falling edge of CLOCK will clear the counter and restart the timing. If no new clock edge is received within the set time ttos, TIM1 will experience an overflow interrupt. In this interrupt, the SPI controller and DMA controller will be reset, the TIM1 timeout timer will be disabled, and the EXTI external interrupt will be re-enabled, thus completing a complete SSI communication cycle. When configuring the SSI frame format, users can adjust it by modifying the software parameters in the microcontroller U3 according to actual application needs, without replacing the hardware.
2. The sensor according to claim 1, characterized in that, The magnetic encoder chip U6 is a general-purpose absolute magnetic encoder, and its output interface is connected to the microcontroller U3 to transmit the original angle encoding signal.
3. The sensor according to claim 1, characterized in that, It also includes silicone rubber (7), which is laid on the upper and lower surfaces of the circuit module (10) and the lead wire position of the end cap (9) to protect the component solder joints and leads, and to improve insulation.
4. The sensor according to claim 3, characterized in that, It also includes epoxy resin (6), which is disposed on the upper surface of the magnet (5) to improve the salt spray resistance of the magnet (5).
Citation Information
Patent Citations
Integrated circuit, an encoder / decoder architecture, and a method for processing a media stream
US20080120676A1
Dual absolute encoder
WO2020117237A1