CN-121677537-B - SSI interface non-contact angular displacement sensor
Abstract
The invention relates to the technical field of sensors, in particular to an SSI interface non-contact angular displacement sensor which comprises a base, a bearing, a rotating shaft, a magnet disc, a magnet, a circuit module and an end cover, wherein the circuit module integrates a general magnetic encoder chip, a microcontroller and an RS-422 transceiver, realizes SSI protocol communication through the cooperation of SPI, DMA and a timer of the microcontroller and external interruption, supports frame format configuration as required, and can also be combined with a high-precision calibration method, and the output angle precision can reach +/-0.05 degrees.
Inventors
- WANG HUACHANG
- ZHONG ZHIYU
- Liao Jinfei
- LI LIYING
- PU CHENG
- CHEN FULEI
- LI XIANG
- MA PEIZHI
- JIANG LINNA
- LIU BENJI
Assignees
- 四川永星电子有限公司
Dates
- Publication Date
- 20260505
- Application Date
- 20260210
Claims (4)
- 1. A non-contact angular displacement sensor with an SSI interface is characterized by at least comprising a base (1), a bearing (2), a rotating shaft (3), a magnet disc (4), a magnet (5), an outgoing line (8), an end cover (9) and a circuit module (10), The device comprises a base (1), an end cover (9), a bearing (2), a magnet (5) and a rotating shaft (3), wherein the base (1) is a cylindrical part, an inner cavity of the base is used for accommodating and supporting an internal component, the end cover (9) is arranged at an opening end of the base (1) in a sealing way, the end cover (9) and the base (1) are encircled to form a closed cavity, the bearing (2) is pressed into the inner hole of the base (1) and is used for supporting the rotating shaft (3), one end of the rotating shaft (3) extends out of the base (1) and is used for connecting a tested rotating body, the other end of the rotating shaft is rigidly connected with the magnet disc (4), and the magnet (5) is fixed at the center of the top of the magnet disc (4) and synchronously rotates along with the rotating shaft (3); the circuit module (10) is fixed at the step of the inner cavity of the base (1), the circuit module (10) is integrated with 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 opposite to the magnet (5) and is used for inducing magnetic field change and outputting an original absolute angle coding signal, the microcontroller U3 reads the original angle coding signal through an SPI bus and generates output data meeting the requirement of an SSI protocol, the outgoing line (8) is led out from the side wall of the base (1) and is electrically connected with the circuit module (10), and the outgoing line (8) comprises a differential clock signal line CLK+, CLK-and a differential data signal line DA+, DA-; The external differential CLOCK signal CLK+ and CLK-is connected to the receiving end of the RS-422 serial DATA transceiver U4 through an outgoing line (8), converted into a single-ended CLOCK signal CLOCK and then sent to the PA3 pin of the microcontroller U3, and the PA3 pin is multiplexed into a TIM2_CH4 capturing channel; simultaneously, the CLOCK signal is also connected to a PA8 pin and configured as EXTI an external interrupt source and a reset source of a timeout timer, and is also connected to a PA10 pin and configured as an SPI2 CLOCK, the microcontroller U3 configures SPI2 into a slave mode, CPOL=1 and CPHA=0, the MISO pin PA12 of the microcontroller outputs a single-ended DATA signal DATA to the input end of the inverter U2, the output end of the inverter U2 is connected to the driving end of the RS-422 serial DATA transceiver U4, and finally differential DATA signals DA+ and DA-are generated and output through an outgoing line (8); When the single-ended DATA signal DATA is in the low level in the idle state, the single-ended DATA signal DATA needs to be turned to the high level by using the inverter U2 so as to accord with the idle high level characteristic specified by the SSI protocol; Simultaneously, the SSI interface function is cooperatively realized by a plurality of hardware modules in the microcontroller U3, wherein the SPI controller is responsible for data transmission, the DMA controller is used for automatically carrying pre-stored angle coding data to an SPI2 data register, the TIMER TIMER TIM2 is used as a capturer for triggering DMA, the TIMER TIMER TIM1 is used as CLOCK timeout detection, the external interrupt controller is used for enabling the timeout TIMER, and the operation flow is that when the external main control equipment sends out a differential CLOCK signal CLK+/CLK-, the RS-422 serial data transceiver U4 converts the differential CLOCK signal into a single-ended CLOCK signal to be input into the microcontroller U3; the method comprises the steps of firstly triggering EXTI external interrupt on a PA8 pin by a CLOCK falling edge, starting a TIM1 overtime TIMER in an interrupt service program and closing self interrupt to prevent repeated triggering, capturing the CLOCK falling edge by TIM2_CH4, triggering a DMA request, moving angle coding data stored in a memory fixed address of a microcontroller to a data register of SPI2 by a DMA controller, then outputting corresponding data bits at a MISO pin by the SPI2 according to set CPOL and CPHA parameters when the CLOCK rising edge arrives, wherein during the period, the TIM1 works in a slave mode reset mode, clearing a counter and restarting timing every time the rising edge or the falling edge of the CLOCK, if a new CLOCK edge is not received in a set time ttos, overflowing interrupt occurs by the TIM1, resetting the SPI controller and the DMA controller, closing the TIM1 overtime TIMER and restarting EXTI external interrupt, and thus completing a complete SSI communication cycle; when the SSI frame format is configured, a user can adjust the SSI frame format by modifying software parameters in the microcontroller U3 according to actual application requirements, and hardware does not need to be replaced.
- 2. The sensor of claim 1, wherein the magnetic encoder chip U6 is a universal absolute magnetic encoder, and an output interface thereof is connected to the microcontroller U3 to transmit the original angle encoded signal.
- 3. The sensor according to claim 1, further comprising silicone rubber (7), wherein the silicone rubber (7) is disposed on the upper and lower surfaces of the circuit module (10) and at the lead-out positions of the end caps (9) for protecting the component pads and leads and improving the insulation.
- 4. A sensor according to claim 3, further comprising an epoxy resin (6), said epoxy resin (6) being arranged on the upper surface of said magnet (5) for improving the salt spray resistance of said magnet (5).
Description
SSI interface non-contact angular displacement sensor Technical Field The invention relates to the technical field of sensors, in particular to an SSI interface non-contact type angular displacement sensor. Background The SSI interface is a synchronous serial communication interface composed of four-wire differential signals, and is widely applied to the fields of industrial automation, servo control, precision measurement and the like, and is widely adopted as a standard output interface in a non-contact angular displacement sensor. The non-contact type angular displacement sensor detects the rotation angle based on electromagnetic induction or optical principle, and can acquire the angle information without mechanical contact, so that the problems of shortened service life and reduced reliability caused by abrasion of the traditional contact type sensor are effectively avoided, and the non-contact type angular displacement sensor has remarkable advantages in application scenes with high requirements on position feedback precision and long-term stability of the system. Currently, commonly-used SSI interface non-contact angular displacement sensors in the market mostly adopt encoder chips with SSI output functions directly integrated, namely, the sensor comprises only a magnetic or optical encoder, and output signals of the encoder chips are directly transmitted to the outside through the SSI interface without being processed. The scheme has simple structure, but obvious technical limitation: on the one hand, the overall output accuracy of the sensor depends on the resolution and linearity of the selected encoder chip, and errors such as mechanical eccentricity, air gap change and the like generated in the assembly process further deteriorate the output accuracy; On the other hand, because the SSI output frame format of the encoder chip is usually a fixed structure, key parameters such as a frame header, a check bit, a data bit length and the like cannot be flexibly configured, and the compatibility requirements of different application systems on a communication protocol are difficult to meet. Disclosure of Invention The invention aims to provide an SSI interface non-contact type angular displacement sensor, which solves the technical problems of fixed data frame format and poor configuration flexibility caused by the fact that the existing SSI interface non-contact type angular displacement sensor depends on a special SSI encoder. The invention provides an SSI interface non-contact angular displacement sensor, which at least comprises a base, a bearing, a rotating shaft, a magnet disc, a magnet, an outgoing line, an end cover and a circuit module, The base is a cylindrical piece, and the inner cavity of the base is used for accommodating and supporting the internal components; the end cover is arranged at the opening end of the base in a sealing way, and the end cover and the base are enclosed to form a closed cavity; the bearing is pressed in an inner hole of the base and used for supporting the rotating shaft, one end of the rotating shaft extends out of the base and is used for connecting a tested rotating body, and the other end of the rotating shaft is rigidly connected with the magnet disc; The circuit module is fixed at the step of the inner cavity of the base and is integrated with 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 opposite to the magnet and is used for inducing magnetic field change and outputting an original absolute angle coding signal, the microcontroller U3 reads the original angle coding signal through an SPI bus and generates output data meeting the requirement of an SSI protocol, and the outgoing line is led out from the side wall of the base and is electrically connected with the circuit module and comprises differential clock signal lines CLK+, CLK-and differential data signal lines DA+, DA-. In some embodiments, the microcontroller U3 configures the SPI2 into a slave mode, wherein cpol=1, cpha=0, and its MISO pin outputs a single-ended DATA signal DATA that is conditioned by the inverter U2 and sent to the RS-422 serial DATA transceiver U4 for conversion to differential DATA signals da+, DA-output. In some embodiments, the differential CLOCK signal lines clk+ and CLK-are converted into single-ended CLOCK signal CLOCK via the RS-422 serial data transceiver U4 and input to the microcontroller U3, and the microcontroller U3 detects the falling edge of the single-ended CLOCK signal CLOCK via a TIMER, triggering the DMA controller to move the pre-stored angle encoded data to the SPI data register. In some embodiments, the microcontroller U3 starts a timeout timer TIM1, which operates in a slave mode reset mode, continuously clears by rising and falling edges of a single-ended CLOCK signal CLOCK, resets the SPI data register and the DMA controller in an overflow interrupt if a CLOCK timeou