High-speed bus encoder integrating magnetic induction signal processing and various feedback monitoring signals and upper computer system of high-speed bus encoder
By using a measuring magnetic ring and DSP chip processing, stable sine and cosine signals are generated and signal compensation is performed, which solves the accuracy and anti-interference problems of traditional encoders, and realizes high-precision position feedback and parameter monitoring, which is suitable for CNC machine tool industrial automation.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2026-01-08
- Publication Date
- 2026-03-13
Smart Images

Figure CN121655367A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of encoder signal processing technology, specifically relating to a non-contact rotation achieved through magnetic induction technology. Driven by a high-speed motor, it can perform digital signal processing through the internal DSP of the main control chip, and perform DC biasing, amplitude and phase difference correction, temperature detection, and output high-precision position feedback through a program. It can be widely used in the field of CNC machine tool industrial automation. Background Technology
[0002] Encoders, as commonly used and important position or speed detection sensors, play a crucial role in industrial automation machine tools or production lines, automotive R&D, and other fields requiring accurate position and speed detection. Traditional magnetic rotary encoders are typically based on Hall elements, with outputs of analog sine and cosine signals. These analog signals are susceptible to electromagnetic interference, cable attenuation, and noise during long-distance transmission, leading to a decrease in overall system accuracy and reliability. Existing technologies often employ incremental pulse output (A / B / Z) or analog output (1Vpp Sin / Cos) combined with external dedicated acquisition cards for signal processing. Analog signal output places stringent requirements on the circuit matching and anti-interference design of the receiving end. In contrast, bus encoders are highly immune to electromagnetic interference, noise, cable resistance, and cable length compared to analog or pulse output encoders, and can transmit not only position information but also a wealth of additional information simultaneously.
[0003] Due to inconsistencies in magnetic circuit design, installation misalignment, and the components themselves, the two output sine and cosine signals exhibit inherent errors such as unequal amplitudes, non-zero DC bias, and a phase difference that is not 90 degrees. These errors directly translate into nonlinear errors in angle calculation, severely limiting the encoder's ultimate accuracy. Currently, most bus encoders only transmit the final calculated digital angle value; their internal signal processing and compensation processes are not interfering with. Users cannot obtain the sensor's original operating status and health information, such as real-time temperature, signal amplitude, bias, and phase parameters, making rapid diagnosis and calibration difficult when accuracy deteriorates. Summary of the Invention
[0004] The purpose of this invention is to realize a non-contact bus encoder closed-loop operating system that can provide real-time position feedback for high-speed motors. It can also compensate for the original signal based on signal amplitude, bias, and phase parameters using an internal encoder algorithm. Furthermore, it can monitor multiple parameters beyond the position value to achieve better drive control. Based on this, it also provides a software system that can test and modify the encoder parameters via communication with a host computer, facilitating testing, verification, experimental development, and drive testing. This integrated solution achieves high-precision, real-time self-compensation of all parameters at the sensor end and seamlessly and reliably transmits the compensation results and key diagnostic data to the host control system via the bus.
[0005] To achieve the above functional effects, the technical solution of this invention is as follows:
[0006] In terms of hardware design, this invention adopts a method of acquiring analog signals by adding a measurement magnetic ring. The measurement magnetic ring is scanned non-contactly. By coaxially mounting the magnetic ring with the motor spindle, the reading head can generate stable and reliable sine and cosine quadrature signals and reference zero-point signals during the rotation of the spindle. To improve the resolution per revolution, multiple complete sine wave signals are generated during a complete rotation of the measurement magnetic ring. The number of these signals is recorded as the pole number of the measurement magnetic ring. At the same time, the signals are amplified and filtered by hardware to ensure that the amplitude of the analog signal can cover the acquisition range of the ADC of the digital signal processing chip as much as possible, thereby maximizing the effective acquisition accuracy of the signal. The bus encoder data is transmitted to the driver or host computer via the RS485 protocol.
[0007] The measurement magnetic ring is equipped with a sine-cosine quadrature differential signal output track and a reference zero-point differential signal output track. The read head encoder is divided into an induction front end and a digital back end. The induction front end includes magnetic induction components, a reference zero-point comparator, and an operational amplifier circuit. The read head encoder is installed tangentially to the circumference of the measurement magnetic ring. The magnetic induction components can generate sine-cosine quadrature signals and a reference zero-point signal non-contactly within the effective range of the measurement magnetic ring. After being amplified by the operational amplifier circuit to the acquisition range of the complete digital signal processing chip ADC, the signal is filtered and input to the digital processor of the digital back end for further signal processing.
[0008] To support RS485 communication, the power input is 5V, and the output is 3.3V after passing through a linear voltage regulator circuit, thereby achieving stable power supply to the DSP chip and the sensing front end and meeting the power supply requirements of RS485.
[0009] The digital signal processing chip, through software programming, enables the FLASH storage of important parameter information, such as encoder pole number, resolution, directional polarity, average DC level offset of the read head encoder, average amplitude information, phase difference, etc., which can be written into the storage in advance and modified and saved later. When the read head encoder is powered on, it reads the FLASH parameter storage area and processes some data in advance according to the relevant parameters before the program calculation loop, reducing the computational pressure of the main loop.
[0010] The digital signal processing chip uses an ADC to acquire the raw analog information at high frequency. It then distinguishes the acquired sine and cosine quadrature signals from the reference zero-point signal into three-phase signals (ABZ). Based on the read level offset and amplitude range, the sine and cosine quadrature signals are converted to a range of ±1, unifying the transformation intervals of the two signals. This is then used as a basis for phase correction calculations combined with the actual phase difference information.
[0011] The signal correction calculation aims to eliminate inherent errors in sine and cosine signals, such as unequal amplitudes, non-zero DC bias, and non-90-degree phase differences. The software program digitally calculates and shifts the center position of the digital values of the quadrature sine and cosine signals to zero based on the level offset, thus eliminating the DC bias. Amplitude modulation is then applied to both signals to ensure consistent amplitude range and level. Using the A-phase sine signal as a reference, phase difference correction is performed on the B-phase cosine signal. Trigonometric functions are used to calculate the corrected cosine value based on the digital values of the sine and cosine signals after bias elimination and the read phase difference. The digital values of the sine and cosine signals after bias elimination are known variables, allowing for the prior calculation of relevant parameters based on the read phase difference, thereby accelerating the calculation. This is detailed in the specific implementation section.
[0012] For the acquisition of real-time level, amplitude, and phase difference, the maximum and minimum values of the sine and cosine signals can be recorded by preset variables in the program. The current amplitude range and the center value position of the sine wave signal can be calculated. The true phase difference can be determined by the appearance of peak and trough values and the rising and falling areas of the signal.
[0013] After eliminating DC bias, unifying amplitude, and correcting phase difference in the original signal, the arc value of the current sine wave signal can be calculated using the arctangent. The entry into the next sine wave cycle can be determined by whether the sine and cosine signals pass through the zero point of the sine signal when the cosine signal value is negative and by whether there is a jump in the arc value calculated based on the arctangent. That is, whether there has been a change in the position of the measuring magnetic ring poles. The direction of the pole position update can be determined by the direction of the arc value jump calculated based on the arctangent.
[0014] By setting the position relative to the top pole number to 0 from the initial power-on and recording the changes in the magnetic ring pole number position, the current position relative to the power-on position can be obtained during rotation based on the calculated radian value and the current magnetic ring pole number position. Here, a single sine wave signal period is subdivided into 4096 units, meaning a single sine wave signal has 4096 unit position values. Therefore, the actual position value is the current period position value + the magnetic ring pole number position * 4096.
[0015] The measurement magnetic ring reference zero-point detection distinguishes between relative power-on position and absolute position. The digital signal processor detects the reference zero-point signal generated by the sensing front end during the rotation of the measurement magnetic ring. The sensing front end outputs a low level when it has not reached the reference zero-point and a high level when it is at the reference zero-point. This is used as a reference to determine whether it is at the reference zero-point. When the digital signal processor detects the zero-point for the first time, it records the pole number position information relative to the power-on position at the time of the first zero-point appearance. Based on this, a full rotation is completed. When the zero-point is detected again, the digital signal processor determines whether the two zero-points are the same position. Only after confirming that this signal trigger is the unique zero-point reference signal of the measurement magnetic ring will this zero-point be used as the absolute position zero point, which is also the absolute magnetic ring pole number zero point. Based on this, the pole number change continues to be recorded, and the absolute position information relative to this reference zero-point is calculated. At the same time, the position calculation information relative to the power-on position is also retained.
[0016] Temperature acquisition and calculation involves a built-in temperature sensor in the sensing front end, which is connected to the ADC of the digital signal processor through a voltage divider resistor. The ADC will periodically acquire the input voltage. In terms of programming, a preset voltage-temperature table will be established based on the voltage and temperature correspondence of the temperature sensor. After obtaining the input ADC conversion value, the current ambient temperature will be calculated by looking up the table and using the difference method.
[0017] The communication command protocol design of this invention enables the encoder to read data such as the original sine and cosine digital signals, current amplitude, level, phase difference, temperature, relative position at power-on, absolute position relative to the reference zero point, and related encoder parameters via a serial port. This facilitates actual debugging and testing. The communication commands are mainly divided into three categories: the first category is a pure position acquisition command, which facilitates high-speed feedback of the motor position. Upon receiving this command, the relative position at power-on and the absolute position relative to the reference zero point will be immediately fed back. The second category is a monitoring value acquisition command, which adds feedback of monitoring items to the position feedback. To ensure comprehensive feedback data and avoid data loss, a rotating monitoring item feedback method is adopted. For example, the first command feeds back the temperature, the second command feeds back the amplitude, the third command feeds back the phase difference, and so on. The third category is a parameter read / write command, which can be used to read or modify encoder parameters, such as modifying the number of poles and resolution.
[0018] The host computer debugging function is designed to facilitate the debugging, modification, and testing of the encoder. A separate debugging program is written for the host computer or PC, which can perform communication tests after production and before leaving the factory. It can obtain the original sine and cosine signals through high-frequency communication to test the quality of the sensing front end, and can calculate and pre-write DC bias, amplitude, and phase difference, modify encoder parameter information, and pre-store relevant parameters for the corresponding motor.
[0019] The novel beneficial effects of this invention are as follows:
[0020] (1) By measuring the magnetic ring and high-performance magnetic induction components and operational amplifier circuits and filtering, stable sine and cosine signals and reference zero signals are generated, and the signal can be adapted to the mainstream analog-to-digital conversion range.
[0021] (2) The original signal is DC biased, amplitude unified and phase difference corrected by the internal program of the digital processing chip, so as to simplify the signal processing hardware circuit and ensure a certain level of accuracy and stability while reducing hardware costs.
[0022] (3) By writing motor parameters, encoder parameters, DC bias, amplitude, phase difference, and interpolation table into FLASH in advance, the initialization preprocessing calculation parameters are achieved, making the main loop calculation quick, efficient and convenient for actual debugging.
[0023] (4) The RS485 bus communication transmission method achieves a long effective transmission distance and strong anti-interference ability; Attached Figure Description
[0024] Figure 1 Schematic diagram showing the relative positions of the measurement magnetic ring and the reader encoder.
[0025] Figure 2 Simplified structural diagram of the read head encoder
[0026] Figure 3 Schematic diagram of the digital back-end of the read head encoder
[0027] Figure 4 Schematic diagram of the front end of the encoder for the reader.
[0028] Figure 5 A panel displaying the calculation of encoder amplitude and phase difference parameters.
[0029] Figure 6 Display diagram of encoder motor parameter editing panel Detailed Implementation
[0030] To more intuitively illustrate the purpose, technical solutions, and advantages of the embodiments of the present invention, the specific technical solutions will be described in detail below with reference to the accompanying drawings of the embodiments of the invention. Of course, the embodiments described are only partial embodiments, in order to intuitively show the specific situation.
[0031] like Figure 1 As shown, this invention provides the relative installation positions of the measuring magnetic ring and the read head encoder. The magnetic ring is coaxially installed at the end of the motor spindle by a clamping device. The sensing surface of the read head is tangent to the circular surface of the magnetic ring. The screw hole fixing position on the top surface of the read head is level with the magnetized surface of the magnetic ring. The closest distance between the magnetic ring and the sensing surface of the read head is kept as close as possible to 0.15mm-0.2mm. The read head is installed by a fixing block. The protrusion on the fixing block corresponds to the groove on the ground of the read head and can be used as a reference for the installation position.
[0032] like Figure 2 As shown, the present invention provides a basic structure and housing of a readhead encoder. The sensing front end is located inside the sensing surface of the housing and is connected to the digital back end through a pin header. The top of the housing has two U-shaped screw fixing holes for fine adjustment of the front and rear distance, and the bottom has a U-shaped groove for reference of the mounting position of the fixing block.
[0033] like Figure 3 As shown, in the hardware of the digital back-end of this invention, the MAX14841 is selected as the TTL to 485 communication chip, which can support communication rates up to 10 Mbps. It uses four terminals—5V, ground, 485Data+, and 485Data-—as external connection terminals. Five pin headers (A-phase, B-phase, Z-phase, power, and ground) are reserved for connection to the front panel of the sensor. The TLV70233 is selected as the linear voltage regulator chip, with an input of 5V and an output of 3.3V. The MCXA156VFT is selected as the core for analog-to-digital conversion, data processing, and communication transmission and reception. This chip has a built-in DSP for digital signal calculation and is equipped with a 16-bit ADC with a maximum speed of 3.2Msps and a 12-bit ADC with a maximum speed of 4Msps, which can meet the high-frequency signal acquisition requirements of the motor under high-speed rotation.
[0034] Magnetic induction acquisition signal processing circuit, such as Figure 4As shown, the sensing front end utilizes the high-precision differential output characteristics of the CT310, outputting ±742.5mV with a swing range of 1.485V. The modulation signal needs to be close to the 0-3.3V analog-to-digital converter range of the MCXA156VFT, while its common-mode voltage is 1.65V. The median voltage of the 0-3.3V MCXA156VFT analog-to-digital converter range is used to leave sufficient margin to avoid saturation. Here, we adjust the preset output voltage range to 0.35-2.95V. Therefore, the negative full-scale magnetic field is 0.35V, the zero magnetic field is 1.65V, and the positive full-scale magnetic field is 2... The first stage uses a classic differential circuit with a single op-amp ADA4522-2 to amplify the output of the CT310 from ±742.5mV to ±1.3V, with a gain of 1.75. Only one op-amp is needed to meet the requirements and complete the differential-to-single-ended output conversion and gain adjustment to the required range. The zero-point reference signal is implemented by TMR1301. By separately magnetizing the zero-point reference point above the orthogonal signal track of the measurement magnetic ring, the two layers of signals do not conflict. The zero-point reference point is detected by sensing the high and low levels of the TMR1301 output.
[0035] The core of the MCXA156VFT is its internal software program, which performs DC bias, amplitude and phase difference correction, etc., saving the hardware cost of external signal processing circuits. The core of this program is the operating program of this digital signal processing chip. The following is a detailed introduction to the core program's operating logic.
[0036] When the encoder is powered on, the program enters initialization. After completing the settings for peripherals, clock, etc., it begins to read the FLASH parameter storage area. Here, 0x48000-0x4BFFF of the FLASH is selected as the parameter storage area. The level, amplitude, phase difference, number of poles, resolution, etc. of the encoder are pre-written. At the same time, some motor parameters can also be stored, such as the number of motor pole pairs, motor torque, motor rated speed, maximum speed, rated current, voltage and other basic motor parameters are pre-written for some drivers to read and rewrite.
[0037] After the FLASH parameters are read, the parameters that need to be used in the subsequent calculations will be preprocessed, such as the radian conversion parameters for position calculation, the parameters related to phase difference correction calculation, and the temperature difference table calculation. The relevant calculations will be explained in detail when these parameters are used later.
[0038] After completing parameter reading and partial preprocessing, the first position acquisition and calculation since power-on is performed. After the software triggers analog-to-digital conversion, the current radian value of the sine and cosine signals is recorded. At this time, the position of the magnetic ring pole number is recorded as 0, and the previous radian value is set to be equal to the current value for reference in subsequent position calculations.
[0039] After the first position recording is completed, the analog-to-digital (ADC) trigger is changed to timer completion trigger, and the timer's interrupt is disabled to avoid high-frequency interrupts causing the main program to loop and block. DMA settings are configured for transferring sine and cosine signal analog-to-digital conversion data. Upon completion of the ADC conversion, DMA is triggered to transfer the data from the ADC result register to the memory array. The sine and cosine signal digital values are stored in the corresponding array as their four most recent values. When the current sine and cosine signal digital values are needed, the corresponding array is summed and right-shifted by two bits to achieve a mean filtering effect. The number of mean filtering operations can be customized by modifying the mean filtering parameters stored in FLASH, but this parameter can only be set to 1, 2, 4, 8, 16, or 32. Setting it to 1 disables mean filtering.
[0040] The current level and amplitude are stored in four arrays, which store the maximum and minimum values of the current sine and cosine raw signals. The number of members in each array is equal to the number of poles of the measuring magnetic ring. For example, a 242-pole magnetic ring will generate 242 complete cycles of sine signals in one rotation, corresponding to 242 peak values and 242 trough values. The current amplitude is the difference between the current maximum and minimum values, and the level is the median. The sine and cosine raw signals can also be adjusted according to the calculated level position, with the median of the signal value moved to 0 and the amplitude reduced to within ±1.
[0041] Phase difference deviation calculation: The A and B signals generated by the magnetic fields of the two magnetic tracks of the magnetic induction ring inevitably result in the two signals not being exactly orthogonal during actual magnetization and production. That is, it is difficult to achieve an exact 90° phase difference in the waveform. In actual position value calculation, the values of these two signals are calculated by arctangent. This deviation from the 90° phase difference inevitably leads to calculation error. If a higher accuracy position feedback is to be achieved, the phase deviation needs to be corrected during software calculation.
[0042] For the current phase difference deviation, the actual calculation here uses the A-phase signal, i.e., the sine signal, as the reference. The B-phase cosine signal, although requiring phase correction, cannot be directly used in the calculation; instead, it serves as a reference value. This value can be combined with the sine signal to determine the current signal phase interval and is also used as a correction parameter. Two phase difference calculation schemes are provided: mean phase difference, which calculates the average phase difference of the signal generated by the magnetic ring rotating a full circle; and real-time phase difference, which calculates the phase difference using real-time acquired sine and cosine signals. The former stores a full circle of signal and calculates the phase deviation of a full circle based on the peak-to-valley interval of the sine wave signal throughout the entire cycle. Based on this deviation, the calculation parameters required for correction can be constantized, greatly improving the correction calculation speed, but sacrificing some accuracy. Real-time calculation, on the other hand, increases the computational load to ensure real-time accuracy, which greatly increases the calculation time but reduces stability. Here, the first scheme is selected to calculate the average phase difference of the signal generated by the magnetic ring rotating a full circle.
[0043] Phase difference correction calculation: Once the cosine phase difference deviation value relative to the sine signal has been obtained, the correction calculation can be performed based on the original data of the two signals. Let the original SIN signal acquisition value be Asin(x) + C1, and the original COS signal acquisition value be Bcos(x + σ) + C2, where σ is the phase deviation and x is the radian value at this time. Here, we modify the DC bias C1 and C2 of the two signals through amplitude and level correction, and unify the amplitude range to eliminate A and B, converting the signal range to ±1. Then, the sine signal sin(x) and the cosine signal cos(x + σ) = cosx*cosσ - sinx*sinσ.
[0044] Through trigonometric transformation, we can obtain cosx = (cos(x + σ) + sinx*sinσ) / (1-2*(sin(σ / 2))^2). The original B-phase signal cos(x+σ) and the original sinx signal A are known variables, and σ is a known constant. This means that the invariants in this formula, such as constants A1 = sinσ and A2 = 1-2*(sin(σ / 2))^2, can be calculated during encoder power-on initialization. Therefore, when calculating the corrected B-phase signal, only the formula: COS correction value = A2*(original COS value + A1*original SIN value) needs to be calculated. A1 and A2 are denoted as phase correction calculation parameters. This greatly reduces the computational burden on the program, improves efficiency, and ensures high stability.
[0045] The calculation of the current radian value of the sine wave period and the detection of changes in the number of poles in the sine wave period are performed. After the original sine and cosine signals are leveled, the amplitude is unified, and the phase is corrected, the current radian position is calculated using the arctangent function. The difference between the two radian values is calculated by comparing the current radian position with the previous radian position. Under the condition that the acquisition and calculation frequency is high enough, a variable threshold is set to detect whether a jump in radian value occurs. If a jump occurs, it means that the next sine wave period has begun, that is, the next pole position of the measuring magnetic ring. At the same time, the direction of the jump can also be used to determine the direction of the pole change. For example, if the jump threshold is set to pi, if the difference between the current radian value and the previous value is greater than pi, it is a negative pole change; if the difference between the current radian value and the previous value is less than -pi, it is a positive pole change. After calculation, the previous radian position is saved as the current radian value.
[0046] The reference zero-position detection uses the position at power-on as the zero position before the encoder confirms the reference zero-position of the measuring magnetic ring. The change of the magnetic ring pole number is also based on this. When the reference zero-position signal is triggered, it is confirmed that the measuring magnetic ring has completed a full rotation and is unique. The magnetic ring pole number relative to the power-on position is recorded on the first trigger. When the zero position is triggered again after the first trigger and the ring has rotated one full rotation, the magnetic ring pole number relative to the power-on position is compared with the first one. If the encoder pole number setting is inconsistent with the actual magnetic ring pole number, the magnetic ring pole number of the two zero positions relative to the power-on position will be inconsistent, and it will be considered that the zero position cannot be found. This situation can also be judged by multiple invalid zero-position attempts. When the magnetic ring pole number of the two zero positions relative to the power-on position is consistent, the position of this magnetic ring pole number will be used as the zero position, and the absolute pole number position will be recorded separately.
[0047] The calculation of the relative position value relative to the power-on zero position and the absolute position value relative to the reference zero position involves several steps. When calculating the position value, there is only one current radian value, while the magnetic ring pole number has two values: one for relative position and one for absolute position. Before finding the reference zero position, both values are the same. After finding the reference zero position, the absolute position pole number is reset to the reference zero position. If a sine wave signal is subdivided into 4096 subdivisions, the position value calculation formula is: Position value = 4096 * current radian value / 2 / pi + current pole number * 4096. Taking a 242-pole encoder as an example, the pole number ranges from 0 to 241, the position value ranges from 0 to 991231, and the resolution is 991232. Based on this, calculating the two pole positions will yield the relative position value relative to the power-on zero position and the absolute position value relative to the reference zero position.
[0048] Temperature calculation is performed by converting the temperature sensor voltage from analog to digital and then calculating the current temperature using a pre-set parameter difference table. Here, we use a KTY84, a type of temperature-sensing resistor whose resistance increases with temperature. Figure 3Here, we connect a 2000-ohm resistor in series for voltage division, and connect the analog-to-digital converter pin between the two. According to the electrical data provided by the KTY84 official website, since its temperature and voltage conversion curve is not completely linear, we pre-calculate the relevant parameters for temperature calculation during initialization. We establish a voltage acquisition value difference calculation table with 10°C intervals from 0 to 180°C, dividing the voltage digital value of the temperature sensor from 0 to 180°C into 18 equal parts. For example, 0°C corresponds to an analog-to-digital converter digital value of 500, and 180°C corresponds to an analog-to-digital converter digital value of 3992. Then, the unit interval value is 192, which is used for subsequent difference calculation. According to the electrical data provided by the KTY84 official website, we calculate the temperature change slope of each interval and record the minimum value of the temperature digital value of the electrical data corresponding to each interval. We can then quickly calculate the current temperature: Current temperature = (Current temperature sensor digital value - Minimum value of temperature digital value of the current temperature interval) * Slope of the current temperature interval + Minimum value of temperature digital value of the current temperature interval.
[0049] For high-speed motor drives in closed-loop systems, communication array encoding and communication commands require real-time acquisition of the current motor rotation position. The acquisition command is concise, such as 0x1A. Communication feedback primarily provides position information, while also carrying some status information. Because this encoder has two types of position information, the feedback data consists of a command header 0x1A + absolute position value + relative position value + a status bit indicating whether the reference zero position has been triggered. The numerical encoding conforms to the LBS format. The status bit is the criterion for determining whether the reference zero position has been found. Before the reference zero position is found, this flag is 0x02. At this time, the absolute and relative position values are equal, both relative to the zero position at power-on. After the reference zero position is found, the status bit changes to 0x00. The relative position value is still calculated relative to the zero position at power-on, while the absolute position value is calculated based on the reference zero position. For example, before the zero position is found, the feedback data for 1A is 1A 02 C3 2A 04 AA C3 2A 04 02 B0, at this point, the 2nd and 10th bit flags are 0x02, the relative and absolute position values are 0x042AC3 for bits 7 to 9 and 0x042AC3 for bits 3 to 5, the 6th bit 0xAA is the separator, and the 11th bit 0xB0 is the check bit; for example, after finding the zero bit, the feedback data is: 1A 00 3B 2F 00AA B3 CA 05 00 D8, the absolute and relative position values are no longer equal but both have reference value, 0x002F3B and 0x05CAB3 respectively; in addition to position information, some monitoring status information also needs to be acquired, such as temperature, amplitude, etc. Acquiring this type of data should not hinder the closed-loop system drive; that is, it is necessary to ensure timely acquisition of position information. Similarly, the acquisition command needs to be concise, for example, 0x02. The feedback data is the command header 0x02 + absolute position + monitoring item number + monitoring item value. Different monitoring data can be identified by rotating the monitoring item number. The same numerical encoding method conforms to the LBS format. To find the 02 feedback data after the zero position: 02 00 43 B2 02 02 40 01 Taking B2 as an example, the second bit 00 is the reference zero position trigger status bit, bits 3 to 5 are the absolute position value 0x02B243, the sixth bit is the monitoring item number 02 temperature, bits 7 and 8 are the value of monitoring item 02 0x0140, which is 320 (unit 0.1℃), and the ninth bit is the check bit.
[0050] Encoder parameter reading and modification is another aspect. These commands are typically used for system debugging and modification, requiring operation on a specified address location of the encoder. For example, modifying parameters stored in the defined FLASH segment 0x48000-0x4BFFF. These commands require explicit address selection, such as read command header + address, write command header + address + write value. The write command header is 0x32. The command 32 01 3C 0F writes the value 0x3C to the low address 0x01. 0x0F is a checksum. Since the number of stored parameters is large, 8 bits cannot fully represent all addresses, so a high address flag is set. At the same time, the command length must remain constant. Here, writing data to address 7E is set as a correction to the high address. For example, 32 7E 02 4E modifies the high address to 0x02. Entering the command 32 013C 0F again writes the data 0x3C to address 0x0201. However, if 32 7E 03 is entered first... Entering 32 01 3C 0F after 4F writes the data 0x3C to address 0x0301. The read instruction is a feedback request for a specified address. Its instruction header EA, such as EA01 EB, is a request to read the value of the lower address 0x01. Similarly, 32 7E modifies the higher address marker. For example, entering 32 7E 02 4E followed by EA 01 EB is a read request for address 0x0201, and the feedback data is EA 013C D7, indicating that the value of the lower address 0x01 is 3C. To ensure effective and error-free communication, a check bit is added at the end of each communication. Here, the check bit is defined as the bitwise XOR of all bits of the communication data except the check bit, for the receiver to identify and verify.
[0051] The encoder is debugged and tested using a host computer or PC software. To ensure more convenient and faster post-delivery debugging, this invention provides debugging and testing software for the encoder, allowing for parameter detection, calculation, and modification before shipment. This software enables the host computer to directly connect to the encoder via a 485 serial-to-USB or direct serial connection. Figure 5The software automatically detects whether the encoder is properly connected. After pressing the connection button, the software sends an identification command to the encoder. The encoder, upon receiving the identification command, sends some encoding parameters, such as the program version number and the number of encoder poles. After successful connection, the connection information will be displayed in the display box. The average DC bias, amplitude, and phase difference of the encoder can be calculated using the correction button and written using the button. After pressing the correction calculation button, the software first reads the current parameters of the encoder to obtain the number of encoder poles and displays them. After ensuring normal communication, it sends a high-frequency read request to the encoder, allowing the encoder to provide feedback on the digital quantity of the current original sine and cosine signals. At the same time, it records the sine wave cycle. By rotating the measuring magnetic ring, after the number of sine wave cycles matches the number of poles, it is confirmed that a complete rotation has been completed. The software then performs calculations based on the acquired original signal data. It calculates the DC bias and amplitude by taking the maximum, minimum, and average values of each sine wave cycle of the entire signal data, and uses this to calculate the average phase difference.
[0052] The storage, reading, writing, and modification of encoder and motor parameters are discussed. When introducing communication protocols and commands, we used the 0x32 and 0xEA commands to modify parameters stored in the FLASH segment 0x48000-0x4BFFF. These related numerical storage values, based on their correlation and range, require different address segments with varying sizes. For example, a small address segment, such as encoder direction polarity (using only 0 and 1 bits, represented by a single binary bit), can be used, while a larger address segment, such as resolution, requires at least 24 bits. Internally, this division results in extremely poor readability from an address mapping perspective. However, by pre-writing these parameters into modular code in software, such as… Figure 6 The motor parameter table editing page allows for pre-defined write addresses within the software. By simply modifying the decimal values in the graph, the software can write modifications to the encoder at the specified address and perform verification after writing. In the encoder program, due to the need for repeated parameter modifications during debugging and the requirement to maintain test settings for safety, certain protection measures are necessary when modifying parameters. To improve read speed, a modifiable parameter table mapping array is created in memory during program initialization. This array reads all parameters from the FLASH memory, allowing read and write operations to first save the corresponding memory address index. When modifications need to be saved, they are written to the flash memory all at once using specific instructions. This protects parameters and extends flash memory lifespan, avoiding repeated erasing and rewriting.
[0053] The above are basic application examples; actual operations can be adjusted according to the specific circumstances.
Claims
1. A high-speed bus encoder integrating magnetic induction signal processing and multiple feedback monitoring signals, and its host computer system, characterized in that, include: Measurement magnetic rings and magnetic induction read head encoders that can be installed in systems requiring precise positioning feedback, such as motor spindles; The measuring magnetic ring is equipped with sine and cosine output magnetic tracks and a zero-position reference magnetic induction point, which can generate multiple complete cycle orthogonal analog signals and a unique zero-position reference signal within one rotation. The readhead encoder has a front-end analog processing module that integrates a magnetic induction sensor, differential amplifier circuit, and signal conditioning circuit, as well as a back-end digital processing module that includes a linear voltage regulator circuit, digital processing circuit, and communication conversion circuit. It can perform real-time detection and calculation of signal level offset, amplitude range, phase deviation and ambient temperature, and can provide feedback through serial communication commands; The quadrature analog signal generated by the non-contact measurement magnetic ring is biased, amplitude and phase difference corrected and relative position calculated and encoded. The absolute position can be calculated and encoded based on the zero position signal detection and relative position calculation. The parameters of the zero-position signal and orthogonal analog signal generated by the measurement magnetic ring can be verified to ensure that the measurement magnetic ring parameters match the driving parameters.
2. The high-speed bus encoder and its host computer system integrating magnetic induction signal processing and multiple feedback monitoring signals as described in claim 1 are characterized in that... The measuring magnetic ring and the magnetic induction read head encoder can achieve non-contact position measurement by installation and locking, including: The measuring magnetic ring is mounted and fixed on the main shaft, and the two rotate coaxially. The readhead encoder is installed at a certain effective distance (0.15mm to 0.2mm) between the magnetic rings, which can effectively convert the magnetic field generated by the measuring magnetic ring into an analog quantity. The readhead encoder can clearly detect a unique zero-point reference point; The encoder housing has a position fixing slot for front-to-back position reference; The encoder housing has a fixed screw hole at a preset height position, and this plane is used as a reference for the height of the magnetic ring and the vertical position of the encoder.
3. The high-speed bus encoder and its host computer system integrating magnetic induction signal processing and multiple feedback monitoring signals as described in claim 1 are characterized in that... An analog processing module that can effectively generate stable orthogonal analog signals for the magnetic field of a measuring magnetic ring includes: A three-channel signal acquisition circuit based on a magnetic sensor is used to generate a cosine signal (channel A), a sine signal (channel B), and a zero-position reference signal (channel Z). A filtering circuit used to filter analog signals and remove noise; A temperature processing circuit that converts ambient temperature into an analog signal; Operational amplifier circuit used to amplify signals to a range of 0-3.3V.
4. The high-speed bus encoder and its host computer system integrating magnetic induction signal processing and multiple feedback monitoring signals as described in claim 1 are characterized in that... The back-end digital processing module, which acquires and processes analog signals, regulates power supply, and controls communication, includes: High-speed ADC analog-to-digital converter circuit, a digital signal processor chip that performs high-frequency acquisition and calculation of analog signals; A linear voltage regulator circuit that converts 5V to an external 3.3V for power supply; It can convert TTL signals sent from the serial port of a digital signal processor chip into RS485 protocol signals that can withstand strong interference and be transmitted over long distances.
5. The high-speed bus encoder and its host computer system integrating magnetic induction signal processing and multiple feedback monitoring signals according to claims 3 and 4 are characterized in that... Algorithms capable of high-frequency processing of analog signals include: The level bias, amplitude range, and phase difference are calculated for the original signal and the sine and cosine quadrature signal of one period. Real-time calculation of temperature-sensing analog signals; Level, amplitude, and phase corrections are applied to the original signal. The processed orthogonal signal is converted into radian value within one period by arctangent and the relative signal period position is recorded. This is used to calculate the relative position of the incremental signal with respect to the zero point at power-on. Monitor the zero-position reference signal, determine the zero-position reference period position, and calculate the absolute position based on this.
6. The high-speed bus encoder and its host computer system integrating magnetic induction signal processing and multiple feedback monitoring signals according to claims 3 and 4 are characterized in that... Communication protocols capable of obtaining different data feedback and modifying parameters through specific communication include: It can communicate to obtain position feedback relative to the zero point at power-on and absolute position feedback relative to the zero-position reference signal; It can communicate to obtain feedback on specific monitoring target parameters, such as the original sine and cosine signals, the level offset, amplitude and phase difference of the current signal, and the current ambient temperature. It can modify some encoder parameters through communication, such as setting the number of sine wave cycles generated by the default measurement magnetic ring rotation, encoder resolution, temperature calculation bias, etc., to modify the encoder calculation method.
7. The high-speed bus encoder and its host computer system integrating magnetic induction signal processing and multiple feedback monitoring signals as described in claim 1 are characterized in that... It can verify communication and check whether the single-lap position calculation conforms to the settings, including: Perform CRC check on the communication check bit to confirm correct communication, and also add the check bit during encoding for the receiver to verify and confirm. It can calculate the number of sinusoidal signal cycles that have passed when the trigger zero position is detected twice, and compare it with the set parameters to verify and confirm whether the zero position of the measured magnetic ring is the same and unique. It can calculate the verification error rate, perform communication status detection, and issue error alerts for communication anomalies.
Citation Information
Cited By
Magnetic scale testing method, magnetic scale testing device and storage medium
CN122305908A