Multi-incremental encoder phase synchronization signal splicing method
Through the multi-incremental encoder phase synchronization signal splicing method, the encoder signal is processed using FIFO buffering and the first-in-first-out principle, which solves the position loss problem of the incremental encoder during position switching and achieves the integrity and accuracy of the output data. sex.
Patent Information
- Application Number
- CN202410846960.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-27
- Publication Date
- 2024-09-13
AI Technical Summary
The existing technology fails to effectively solve the problem of position loss of the incremental encoder during position switching.
Through the multi-incremental encoder phase synchronization signal splicing method, the FIFO cache is used to store and read waveform data to ensure the integrity and sequence of signal output and avoid position loss. Specific steps include judging the validity of the encoder waveform output and the integrity of the A/B signal, and processing the data according to the FIFO first-in-first-out principle.
It effectively avoids position loss, ensures the processing integrity of output data when adjacent encoders switch, and ensures accurate feedback of target position information.
Smart Images

Figure CN118640945A
Abstract
Description
Technical Field
[0001] The invention belongs to the field of annular magnetic drive pipelines, and in particular relates to a method for splicing phase synchronization signals of a multi-incremental encoder. Background Art
[0002] The invention patent application with the publication number of CN108061564A and the subject name of the invention patent application is a method for identifying and synchronizing a single-wire transmission of an incremental encoder phase signal. Its IPC classification number is G01D5 / 244 and G01D5 / 245. Its technical solution discloses that "the incremental encoder comprises three signal lines, namely, an A-phase signal line, a B-phase signal line, and a Z-phase signal line; the A-phase signal line is configured for phase counting; the B-phase signal line is configured for determining the forward and reverse rotation of the encoder; the Z-phase signal line is configured for phase clearing; the incremental encoder phase signal single-wire transmission identification and synchronization method, A controller and a control component are used, and the controller and the control component are connected by an electrical wire. The specific steps include: Step 1: The forward, reverse and reset signals of the encoder are transmitted using signals of two frequencies; the high-frequency signal has a small pulse width, and the low-frequency signal has a large pulse width, and different frequency signals are identified by measuring the pulse width; Step 2: The controller transmits the encoder signal to the control component through an electrical wire, and the MCU in the control component measures, identifies and counts the pulse width of the encoder signal transmitted by the controller to determine the type of the transmitted signal; Step 3: Realize the reset synchronization of the Z-phase signal.
[0003] It can be seen that the above invention patent application has disclosed one of the phase signal recognition and synchronization solutions of the incremental encoder. However, the technical solution disclosed in the above invention patent application does not further solve the problem of how to avoid position loss, and needs to be further improved. Summary of the invention
[0004] The present invention aims at the prior art, overcomes the above defects and provides a method for splicing phase synchronization signals of a multi-incremental encoder.
[0005] The present invention adopts the following technical scheme, a multi-incremental encoder phase synchronization signal splicing method, comprising the following steps:
[0006] Step S1: Determine whether the waveform output of the Nth incremental encoder is valid. If the determination is successful, execute step S2. Otherwise, repeat step S1 until the determination is successful.
[0007] Step S2: store the waveform data into FIFO_1;
[0008] Step S3: Determine whether the A / B signal output of the N-1th incremental encoder is complete. If the determination is successful, execute step S4. Otherwise, repeat step S3 until the determination is successful.
[0009] Step S4: Read out the waveform data temporarily stored in FIFO_1.
[0010] As a further preferred technical solution of the above technical solution, in step S4, when the waveform data temporarily stored in FIFO_1 is read out, the FIFO first-in-first-out principle is followed.
[0011] As a further preferred technical solution of the above technical solution, in step S3, the input waveform of the N-1th incremental encoder includes A_0, B_0, Z_0, R_0, out_flag0, W_req0, and R_req0; in step S1, the input waveform of the Nth incremental encoder includes A_1, B_1, Z_1, R_1, out_flag1, W_req1, and R_req1.
[0012] As a further preferred technical solution of the above technical solution, in step S3, the output waveform of the N-1th incremental encoder includes out_A, out_B, out_Z, and out_R; in step S1, the output waveform of the Nth incremental encoder includes out_A, out_B, out_Z, and out_R.
[0013] As a further preferred technical solution of the above technical solution, the A signal and the B signal (out_A, out_B) are used to feedback the target position information; the Z signal (out_Z) is used for position calibration; and the R signal (out_R) is used to feedback whether there is a target object on the encoder.
[0014] The multi-incremental encoder phase synchronization signal splicing method disclosed in the present invention has the beneficial effect that when multiple encoders are used to feedback the target position, in order to avoid position loss, the output data is processed when adjacent encoders are switched. BRIEF DESCRIPTION OF THE DRAWINGS
[0015] Figure 1 It is a data input and output schematic diagram of the present invention.
[0016] Figure 2 This is a schematic diagram of determining the moving position of a target object in the present application.
[0017] Figure 3 It is a timing diagram of the signal splicing principle of this application. DETAILED DESCRIPTION
[0018] The present invention discloses a method for splicing phase synchronization signals of a multi-incremental encoder. Figure 1-3 , the specific implementation modes of the present invention are further described.
[0019] Example 1.
[0020] Preferably, the multi-incremental encoder phase synchronization signal splicing method comprises the following steps:
[0021] Step S1: Determine whether the waveform output of the Nth incremental encoder is valid. If the determination is successful (the waveform output is valid), execute step S2. Otherwise (the waveform output is invalid), repeat step S1 until the determination is successful (the waveform output is valid).
[0022] Step S2: store the waveform data into FIFO_1;
[0023] Step S3: Determine whether the A / B (forward A, reverse B) signal output of the N-1th incremental encoder is complete. If the determination is successful (the A / B signal output is complete), execute step S4; otherwise (the A / B signal output is incomplete), repeat step S3 until the determination is successful (the A / B signal output is complete);
[0024] Step S4: Read out the waveform data temporarily stored in FIFO_1 to avoid position loss.
[0025] Among them, in step S4, when the waveform data temporarily stored in FIFO_1 is read out, the FIFO first-in-first-out principle is followed.
[0026] Among them, in step S3, the input waveform of the N-1th incremental encoder includes A_0, B_0, Z_0, R_0, out_flag0, W_req0, and R_req0; in step S1, the input waveform of the Nth incremental encoder includes A_1, B_1, Z_1, R_1, out_flag1, W_req1, and R_req1.
[0027] Wherein, in step S3, the output waveform of the N-1th incremental encoder includes out_A, out_B, out_Z, and out_R; in step S1, the output waveform of the Nth incremental encoder includes out_A, out_B, out_Z, and out_R.
[0028] Among them, the A signal and the B signal (out_A, out_B) are used to feedback the target position information; the Z signal (out_Z) is used for position calibration; and the R signal (out_R) is used to feedback whether there is a target object on the encoder.
[0029] The working principle of the multi-incremental encoder phase synchronization signal splicing method of this embodiment is described below.
[0030] Specifically, see the accompanying drawings Figure 1, the incremental encoder 1 and the incremental encoder 2 respectively perform signal input (data input), and then perform incremental encoder signal output (data output).
[0031] Specifically, see the accompanying drawings Figure 1-2 , the input signals of incremental encoder 1 include:
[0032] A signal and B signal: used to feedback target position information.
[0033] Z signal: used for position calibration.
[0034] R signal: used to feedback whether there is a target object on the encoder.
[0035] The following data (information) are obtained based on the encoder signal:
[0036] Determine the moving direction of the target object: when the target object moves forward, phase A leads phase B by 90°; when the target object moves reversely, phase B leads phase A by 90°.
[0037] Determine the moving speed of the target object: The signal frequencies output by A and B are the same, and the frequencies output by A and B depend on the speed of the target object. The faster the speed, the higher the frequency, and the slower the speed, the lower the frequency.
[0038] Determine the moving position of the target object: for every 500 A signal marks generated, the target object moves 5mm.
[0039] Specifically, how to determine the direction:
[0040] Positive direction: When the encoder outputs the rising edge of signal A, it corresponds to the high level of signal B.
[0041] Reverse: When the encoder outputs the rising edge of the B signal, it corresponds to the high level of the A signal.
[0042] Specifically, see the accompanying drawings Figure 3 Signal description in:
[0043] Z signal: A and B signals are pulled high for one cycle after 500 cycles. When the encoder output signal is forward, the rising edge of the Z signal is synchronized with the rising edge of the A signal; when reverse, it is synchronized with the rising edge of the B signal.
[0044] R_0: Whether there is a permanent magnet mover on the current encoder.
[0045] out_flag0: Encoder data output valid signal. When the R signal is valid and the first rising edge of the Z signal is detected, it is pulled high; when the R signal is 0, it is pulled low.
[0046] W_req0: FIFO write request. When out_flag is valid, pull high to store the waveform data of encoder 0 into FIFO_0; when out_flag is low, pull low.
[0047] R_req0: FIFO read request. When W_req0 is detected to be pulled high and valid, it is pulled high after two clock cycles; when the read empty signal of FIFO_0 is valid (no data in FIFO), it is pulled low.
[0048] R_req1: When the out_flag1 signal is detected to be valid and the rising edge of the A / B data (forward A, reverse B) is read from FIFO_1, it is pulled high; when the read empty signal of FIFO_1 is valid (no data in FIFO), it is pulled low.
[0049] Among them, R, out_flag, and W_req of encoder 0 and encoder 1 are consistent.
[0050] The working principle of the incremental encoder 2 is consistent with that of the incremental encoder 1.
[0051] Specifically, as an explanation: see the accompanying drawings Figure 3 The wrong switching method is to directly output the data of the B signal at the leading edge of the red background, which will result in incomplete waveform output at the switching point. Therefore, after waiting for the waveform output of the second encoder to be valid, the data is first stored in FIFO_1, and after waiting for the A / B (forward A, reverse B) signal output of the previous encoder to be complete, the waveform data temporarily stored in FIFO_1 is read out according to the FIFO first-in, first-out principle.
[0052] It is worth mentioning that the specific model and other technical features of the incremental encoder involved in the patent application of this invention should be regarded as the prior art. The specific structure, working principle and possible control method and spatial layout method of these technical features can be selected according to the conventional methods in the field, and should not be regarded as the inventive point of the patent of this invention. The patent of this invention will not be further elaborated.
[0053] For those skilled in the art, it is still possible to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.
Claims
1. A method for splicing phase synchronization signals of multiple incremental encoders, It is characterized in that The following steps are involved: Step S1: Determine whether the waveform output of the Nth incremental encoder is valid. If the determination is successful, execute step S2. Otherwise, repeat step S1 until the determination is successful. Step S2: store the waveform data into FIFO_1; Step S3: Determine whether the A / B signal output of the N-1th incremental encoder is complete. If the determination is successful, execute step S4. Otherwise, repeat step S3 until the determination is successful. Step S4: Read out the waveform data temporarily stored in FIFO_1.
2. The multi-incremental encoder phase synchronization signal splicing method according to claim 1, It is characterized in that In step S4, the waveform data temporarily stored in FIFO_1 is read out according to the FIFO first-in-first-out principle.
3. The multi-incremental encoder phase synchronization signal splicing method according to claim 1, It is characterized in that In step S3, the input waveform of the N-1th incremental encoder includes A_0, B_0, Z_0, R_0, out_flag0, W_req0, and R_req0; in step S1, the input waveform of the Nth incremental encoder includes A_1, B_1, Z_1, R_1, out_flag1, W_req1, and R_req1.
4. The method for splicing phase synchronization signals of multiple incremental encoders according to claim 3, It is characterized in that In step S3, the output waveform of the N-1th incremental encoder includes out_A, out_B, out_Z, and out_R; in step S1, the output waveform of the Nth incremental encoder includes out_A, out_B, out_Z, and out_R.
5. The method for splicing phase synchronization signals of multiple incremental encoders according to claim 4, It is characterized in that The A and B signals (out_A, out_B) are used to feedback the target position information; the Z signal (out_Z) is used for position calibration; and the R signal (out_R) is used to feedback whether there is a target object on the encoder.
