Encoding apparatus, detection apparatus, and terminal device
Patent Information
- Application Number
- PCT/CN2025/084333
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Filing Date
- 2025-03-24
- Publication Date
- 2026-10-01
Smart Images

Figure CN2025084333_01102026_PF_FP_ABST
Abstract
Description
An encoding device, a detection device and a terminal equipment Technical Field
[0001] This application relates to the field of detection technology, and in particular to an encoding device, a detection device, and a terminal device. Background Technology
[0002] LiDAR is an active range detection device that uses a laser as the emission light source and employs photoelectric detection technology. It has advantages such as small size, high measurement accuracy, and high ranging angle accuracy, and is widely used in fields such as autonomous driving, smart homes, robot navigation, and intelligent transportation.
[0003] As application scenarios become increasingly complex, the requirements for the angle accuracy of LiDAR are also increasing. LiDAR typically uses encoders to acquire angles. However, existing encoders are susceptible to interference due to changes in the external environment, damage or aging of their own components, etc., causing significant jumps in the encoder's output angle. This results in the scanning components in the LiDAR not rotating to the true angular position, leading to the premature or delayed start or end signals of the illumination frame. In the point cloud, this translates to point cloud offset or jitter, with jitter reaching tens of degrees. Such large jitter can easily cause misidentification of targets, increasing safety risks for autonomous or assisted driving systems. Simultaneously, encoder interference also increases noise, vibration, and harshness (NVH), negatively impacting the user experience.
[0004] Therefore, how to improve the anti-interference capability of the encoding device is a technical problem that urgently needs to be solved in lidar. Summary of the Invention
[0005] This application provides an encoding device, a detection device, and a terminal device to improve the anti-interference capability of the encoding device.
[0006] In a first aspect, this application provides an encoding device, including an encoding parsing unit and N encoders, where N is an integer greater than or equal to 2; the N encoders are used to generate N electrical signals during the synchronous rotation of the code disks of the N encoders and send them to the encoding parsing unit; the encoding parsing unit is used to switch from outputting a first encoded value to outputting a second encoded value based on the N electrical signals, wherein the first encoded value and the second encoded value are different.
[0007] Based on the above encoding device, by connecting multiple encoders to the same encoding and parsing unit, the output value of the encoding and parsing unit can switch according to the encoded values of multiple encoders. In this way, the encoding and parsing unit can avoid the encoded values of encoders in abnormal states, ensuring that it always outputs the correct encoded value, thereby improving the anti-interference capability of the encoding device. Therefore, when this encoding device is applied to LiDAR, even if one encoder is damaged or the code disk is interfered with, the encoding and parsing unit can still output the correct encoded value. This solves the problem of point cloud skew and jitter caused by incorrect output encoded values in LiDAR, improving the accuracy of point cloud construction, enhancing system stability, and thus improving the safety of assisted driving. Simultaneously, it also solves the impact of interference with the encoding device on motor control, reduces the NVH of the equipment where the detection device 1500 is located, avoids abnormal noise or motor stall, and improves the user experience.
[0008] In one possible design, if the encoding parsing unit determines that the state of at least one of the N encoders has changed, it switches from outputting a first encoded value to outputting a second encoded value, wherein the state change of at least one encoder affects the rotation control of the code disk synchronization.
[0009] Based on the above design, when the state of at least one encoder affecting the code disk rotation control changes, the output encoding value can be switched. After the switch, the output encoding value does not affect the rotation control of the code disk, thus ensuring the accuracy of the code disk rotation control at all times.
[0010] In one example of the above design, a state change includes at least one of the following:
[0011] Content 1: The encoder state corresponding to the first encoded value changes from a normal state to an abnormal state. Based on this, after the currently used encoder malfunctions, it can be switched to a normal encoder in a timely manner, thereby avoiding the erroneous encoded values of the abnormal encoder and ensuring that the normal encoded values of the normal encoder are always output.
[0012] Content 2: The encoder with higher precision than the encoder corresponding to the first encoded value changes from an abnormal state to a normal state. Based on this, once the higher-precision encoder recovers, it can be switched back to the higher-precision encoder in a timely manner to ensure that the highest precision encoder among all normal encoders is always output.
[0013] Content 3: The status of encoders other than the one corresponding to the first encoded value changes from an abnormal state to a normal state. Based on this, once at least one encoder recovers to normal, it can be promptly brought back into use to ensure that the most comprehensive range of normal encoders are always used to determine the output encoded value, thereby improving the accuracy of the encoded value output.
[0014] In further examples, abnormal states include one or more of the following: encoder damage, code disk aging, code disk dirt, code disk condensation, external strong magnetic field, and demagnetization.
[0015] Based on the above examples, encoder damage and code disk aging are abnormal conditions applicable to all encoders, code disk dirt and condensation are abnormal factors applicable to photoelectric encoders, while strong external magnetic fields and demagnetization are abnormal conditions applicable to magnetic encoders. By categorizing various encoder-applicable abnormal conditions together, even in multi-encoder scenarios, the abnormalities of each encoder can be accurately and comprehensively detected, providing support for encoders to avoid abnormal conditions. Simultaneously, by setting multiple abnormal conditions, the encoding device can detect various encoder abnormalities, thereby improving the encoding device's anti-interference characteristics. For example, based on the above-set abnormal conditions, the encoding device can resist not only condensation and dirt interference but also magnetic interference, exhibiting relatively strong anti-interference capabilities.
[0016] In one possible design, the second encoded value is the encoded value of the encoder with the highest accuracy among the encoders in normal condition; or, the second encoded value is calculated based on the encoded values of multiple encoders in normal condition.
[0017] Based on the above design, it can be ensured that the output encoding value is always related to the encoding value of a normal encoder, such as the encoding value of the encoder with the highest accuracy among normal encoders, or the average encoding value or weighted average encoding value of a normal encoder, avoiding the encoding value of an abnormal encoder, thereby improving the correctness of the output encoding value.
[0018] In one possible design, the encoding and parsing unit can also output a first encoded value when all N encoders are in normal condition. The first encoded value is the encoded value of the encoder with the highest accuracy among the N encoders, or it can be calculated based on the encoded values of the N encoders.
[0019] Based on the above design, when all encoders are functioning normally in the initial state, the output can be the encoder value with the highest accuracy, or the average or weighted average encoder value of all encoder values, to ensure the accuracy of the output encoder value in the initial state.
[0020] In one possible design, the encoding / parsing unit can begin switching its output at any of the following times:
[0021] Timing 1: When the state of at least one of the N encoders changes, the system switches to outputting the second encoded value. Based on this, the system can switch to the encoded value of another normal encoder when the currently used encoder is in an abnormal state, thereby achieving output switching at the transition point. By switching in real time during each encoding process, the system can ensure that the output encoded value is accurate in each encoding process.
[0022] Timing 2: After determining that the state of at least one of the N encoders has changed, at the start of the next encoding cycle, switch to outputting the second encoded value. Based on this, the encoder to be used in the next encoding cycle can be determined according to the encoder state in the current encoding cycle, thus switching to the encoded value of the normal encoder at the start of the next encoding cycle. By switching the output result at the start of each encoding cycle, it can be ensured that the encoded values of the same one or more encoders are always output during each encoding cycle, avoiding frequent output switching operations and reducing system power consumption.
[0023] In one possible design, the encoding parsing unit can also send at least one encoder state abnormality message to the mobile data center (MDC) when it determines that at least one encoder state abnormality exists.
[0024] Based on the above design, the abnormal status of the encoder can be notified to the MDC, so that the MDC can adjust the driving mode in a timely manner or perform other operations, such as reminding the user to perform quick maintenance.
[0025] In one example of the above design, if the MDC determines that all encoder states are abnormal, it will exit intelligent driving to ensure driving safety.
[0026] In one possible design, for each encoder, the encoder parsing unit can determine the encoder state in the following way: based on the electrical signal sent by the encoder, determine the correspondence between the encoder's encoded value and time; if the second derivative of the correspondence is less than or equal to a set threshold, the encoder state is determined to be normal; if the second derivative is greater than the set threshold, the encoder state is determined to be abnormal.
[0027] Based on the above design, the normal or abnormal state of the encoder can be determined by combining the logical operation expression corresponding to the second-order differential. This calculation method is simple and fast, which can reduce the difficulty of state determination while quickly determining the encoder state.
[0028] In one possible design, the N encoders include, but are not limited to, at least one of photoelectric encoders, magnetic encoders, and inductive encoders. For example, there can be N encoders of the same type, N encoders in combination of two types, or N encoders in combination of three or more types; there are no limitations.
[0029] Based on the above design, the encoding device can support various types of encoders, thus improving its versatility.
[0030] Secondly, this application provides a detection device, including an encoding device as described in any of the designs or examples of the first aspect above.
[0031] In one possible design, the detection device also includes a motor and a motor control unit. The code disks of N encoders are all mounted on the motor, and the motor control unit is used to control the rotation of the motor. The rotation of the motor drives the code disks of the N encoders to rotate synchronously.
[0032] Based on the above design, the rotation of the motor can be controlled by the motor control unit, and the code disks of N encoders can be rotated synchronously. The electrical signals output by the N encoders are used to characterize the rotation of the motor.
[0033] In one example of the design above, the motor control unit can also receive the encoded value output by the encoding parsing unit and adjust the motor rotation according to the encoded value. For example, the motor rotation can be adjusted when the encoded value does not match the desired motor rotation characteristics.
[0034] Based on the above examples, by combining the encoded values that characterize the actual rotation features of the motor to adjust the motor rotation, the motor rotation can be quickly adjusted to the desired motor rotation features, thus achieving accurate control of the motor rotation.
[0035] In one example of the above design, the detection device also includes a scanning component connected to the motor, which is used to scan the light signal into the detection space as the motor rotates.
[0036] Based on the above example, the rotation of the motor can drive the scanning component to rotate, thereby scanning the optical signal to every position in the detection space.
[0037] In a further example, the detection device also includes a transmitting component for emitting a beam of light to the scanning component.
[0038] Based on the above example, the scanning component can scan the beam incident from the emitting component into the detection space.
[0039] In a further example, the transmitting component is connected to the encoding and parsing unit, and the transmitting component is also used to receive the encoded value output by the encoding and parsing unit and adjust the transmitting beam according to the encoded value.
[0040] Based on the above example, the emitted beam can be adjusted by combining the encoded value that characterizes the actual rotation feature of the motor. The actual rotation feature of the motor corresponds one-to-one with the actual rotation position of the scanning component. Therefore, it is equivalent to adjusting the emitted beam by combining the actual scanning position of the scanning component, which can achieve the correspondence between the emitted beam and the scanning angle or the detection time.
[0041] In one possible design, the detection device also includes a receiving component for receiving the echo signal and resolving it into an electrical signal.
[0042] Based on the above design, the echo signal can be received and converted using the receiving component.
[0043] In one example of the above design, the detection device also includes a processing component for generating point cloud data based on electrical signals from the receiving component.
[0044] Based on the above design, target detection can be achieved through processing components, such as determining the target's speed and / or distance.
[0045] Thirdly, this application provides a terminal device, including an encoding device as described in any of the designs or examples of the first aspect above, or including a detection device as described in any of the designs or examples of the second aspect above.
[0046] The technical effects that can be achieved by the design of the second or third aspect mentioned above can be referred to the description of the beneficial effects in the first aspect mentioned above, and will not be repeated here. Attached Figure Description
[0047] Figure 1a illustrates a schematic diagram of a direct-fire photoelectric encoder.
[0048] Figure 1b illustrates a schematic diagram of a reflective photoelectric encoder.
[0049] Figure 1c illustrates a schematic diagram of a magnetic encoder;
[0050] Figure 1d illustrates a schematic diagram of an inductive encoder;
[0051] Figure 2 illustrates a possible application scenario provided by this application;
[0052] Figure 3 illustrates an exemplary architecture diagram of a lidar provided in this application;
[0053] Figure 4 illustrates a schematic diagram of the structure of an encoding device provided in this application;
[0054] Figure 5a illustrates an exemplary installation method for multiple encoders provided in this application;
[0055] Figure 5b illustrates an exemplary diagram of another method for installing multiple encoders provided in this application;
[0056] Figure 5c illustrates an exemplary installation method for multiple encoders provided in this application;
[0057] Figure 6a illustrates an exemplary flowchart of a process for switching output encoding values provided in this application;
[0058] Figure 6b illustrates an exemplary architecture diagram of an output result provided in this application;
[0059] Figure 7 illustrates an exemplary flowchart of another method for switching output encoded values provided in this application;
[0060] Figure 8 illustrates, exemplarily, another flowchart of switching output encoded values provided in this application;
[0061] Figure 9 illustrates, exemplarily, another flowchart of switching output encoded values provided in this application;
[0062] Figure 10 illustrates an exemplary flowchart of a switching output encoding value provided in Implementation Scheme 1;
[0063] Figure 11 illustrates, for example, the correspondence curves of an encoder provided in Implementation Scheme 1 under normal and abnormal states;
[0064] Figure 12 exemplarily illustrates the correspondence between the encoded values and time of three encoders in multiple scenarios provided by Implementation Scheme 1;
[0065] Figure 13 illustrates an exemplary flowchart of a switching output encoding value provided in Implementation Scheme 2;
[0066] Figure 14 illustrates, for example, a graph showing the correspondence between the encoded values and time of three encoders in multiple scenarios provided by Implementation Scheme 2;
[0067] Figure 15 illustrates a schematic diagram of the structure of a detection device provided in this application;
[0068] Figure 16 illustrates a schematic diagram of the structure of a terminal device provided in this application. Detailed Implementation
[0069] The embodiments of this application will now be described in detail with reference to the accompanying drawings.
[0070] The following provides explanations for some of the terms used in this application. It should be noted that these explanations are for the convenience of those skilled in the art and do not constitute a limitation on the scope of protection claimed in this application.
[0071] I. Photoelectric encoder.
[0072] An optical encoder is a sensor that converts the mechanical geometric displacement of an output shaft into pulses or digital signals through photoelectric conversion. An optical encoder mainly consists of a transmitter, a code disk, and a receiver, and is not limited to direct-type and reflective optical encoders. In a direct-type optical encoder, the transmitter and receiver are located on different sides of the code disk, as shown in Figure 1a. In a reflective optical encoder, the transmitter and receiver are located on the same side of the code disk, as shown in Figure 1b.
[0073] Referring to Figures 1a and 1b, the transmitting unit emits a light beam when the photoelectric encoder is working. The code disk is a circular structure with several rectangular holes evenly spaced on a circular plate of a certain diameter. The code disk is coaxial with the motor; therefore, it rotates at the same speed as the motor. As the code disk rotates, the light beam emitted by the transmitting unit can pass through the rectangular holes and be received by the receiving unit, or it can be blocked by the code disk. The receiving unit generates several pulse signals based on whether a light signal is received or not; it outputs "1" if a light signal is received and "0" if no light signal is received. This pulse signal is sent to subsequent components, and the current motor speed can be reflected by calculating the number of pulses output per second by the photoelectric encoder.
[0074] In some scenarios, to determine the direction of rotation, the encoder can also provide two pulse signals with a phase difference of 90°.
[0075] II. Magnetic encoder.
[0076] A magnetic encoder is a sensor that measures angle using changes in a magnetic field. It mainly consists of a rotor and a stator, as shown in Figure 1c. The rotor has magnetic poles, while the stator has a magnetic induction chip. The rotor is coaxial with the motor, and when the motor rotates, the rotor rotates at the same speed. As the rotor rotates, the strength and direction of the magnetic field between the rotor and the stator change. The magnetic induction chip in the stator detects these changes and converts them into electrical signals, which are then processed into digital signals, similar to a "0101..." pulse signal. The processed digital signal is transmitted to subsequent components through the magnetic encoder's output interface. By calculating the number of "1"s in the digital signal, the current motor speed can be determined.
[0077] III. Inductive encoder.
[0078] An inductive encoder, also known as an inductive encoder or inductive encoder, is a position sensor based on the principle of electromagnetic induction. Its structure, as shown in Figure 1d, mainly consists of two printed circuit boards (PCBs), PCB1 and PCB2. PCB2 has slots on which coils are wound. When the coils are energized, PCB1 interacts with the coils in the slots to generate a magnetic field. PCB2 is connected to a motor. As the motor rotates, PCB2 rotates accordingly. PCB1 senses the change in this magnetic field, generates an electrical signal, and transmits it to subsequent components. These components then determine the current motor speed based on this electrical signal.
[0079] IV. Noise, Vibration and Acoustic Roughness (NVH).
[0080] NVH (Noise, Vibration, and Harshness) is a crucial indicator for measuring automotive manufacturing quality, directly impacting passenger comfort and driving experience. Noise refers to the various sounds generated during vehicle operation, such as engine noise, exhaust noise, tire noise, and airflow noise. Vibration refers to the shaking or swaying of the vehicle body caused by uneven road surfaces and engine operation. Sound and vibration roughness is related to the transient nature of noise and vibration, primarily describing the user's subjective perception of vibration and noise, reflecting discomfort or impact experienced while riding in the vehicle; it cannot be directly measured objectively. The NVH performance of a car provides the most direct and immediate experience for the user, and improving this performance is crucial for maintaining overall vehicle quietness, enhancing user satisfaction, and improving market competitiveness.
[0081] 5. Second-order differential.
[0082] The second derivative, also known as the second differential, refers to the two differentiation operations performed on a function. For example, if the first derivative of a function y(x) with respect to x is y'(x), then the derivative of y'(x) with respect to x is y'(x), which is called the second derivative or second differential of y. It mainly represents the instantaneous rate of change of the function y(x) at a certain point, or the slope of the tangent line to the function curve at that point. If the second derivative at a certain point is greater than a certain value, it indicates that the slope of the tangent line at that point changes abruptly; that point is an inflection point.
[0083] The preceding text introduced some of the terms used in this application. The following text introduces the possible application scenarios of this application.
[0084] In one possible implementation, the encoding device provided in this application can be integrated into a detection device installed on a vehicle, such as, but not limited to, vehicles, ships, airplanes, drones, trains, subways, automated guided vehicles (AGVs), or unmanned vehicles. For example, please refer to Figure 2, which illustrates a possible application scenario of this application. In this scenario, the detection device is installed on the front bumper of a vehicle. This detection device can serve as an information source for path planning, assisting the driver in achieving or automatically achieving safe driving. It is understood that the detection device can also be installed in other locations on the vehicle, such as around the headlights, around the rearview mirrors, near the doors, on the rear bumper, behind the windshield, or on the roof, to capture information about the vehicle's surrounding environment. When the detection device is installed behind the windshield, the requirement for no gravel collision risk is lower, and it does not affect the vehicle's appearance. Furthermore, the windshield itself has window heating and defogging functions as well as wiper cleaning functions.
[0085] It should be understood that the above application scenarios are merely examples, and the detection device provided in this application can also be applied to other possible scenarios, and is not limited to those exemplified above. For example, the detection device can also be installed in a roadside unit (RSU) as a roadside traffic detection device to realize intelligent vehicle-road cooperative communication. For example, the detection device can also be installed in the cabin of a vehicle as a liveness detection device to detect and alert the user to children or pets left behind in the cabin. Furthermore, the detection device can also be applied to terminal devices or components installed in terminal devices, such as smartphones, smart home devices, smart manufacturing equipment, medical devices, industrial equipment, and robots. These will not be listed exhaustively here. It should be noted that the application scenarios described in this application are for the purpose of more clearly illustrating the technical solution of this application and do not constitute a limitation on the technical solution provided in this application.
[0086] In addition, the above-mentioned application scenarios can be applied to fields such as autonomous driving, assisted driving, intelligent driving, autonomous driving, connected vehicles, optical communication, security monitoring, biomedicine, surveying and mapping (such as 3D mapping and remote sensing mapping), meteorological research, biomass and vegetation research, air quality monitoring, and aviation and aerospace applications.
[0087] The detection devices mentioned above may include, but are not limited to, lidar (light detection and ranging, LiDAR), such as scanning LiDAR. Before introducing the specific solution provided in this application, a brief introduction to the system architecture and functional principles of scanning LiDAR will be given.
[0088] Please refer to Figure 3, which illustrates a schematic diagram of a scanning LiDAR system architecture provided in this application. This architecture includes an encoder, an encoding and parsing unit, a motor control unit, a motor, a lighting module, a scanning component, an echo detection module, and a point cloud generation module. The encoding and parsing unit is also referred to as an angle parsing unit. Optionally, other modules or units may be included, or these modules or units may have other names or be divided in other ways. For example, a module or unit may be divided into more components, or some modules or units may be located in one component while others are located in another component. In other words, the system architecture shown in Figure 3 is merely an example; scanning LiDARs may have other system architectures, and this application does not impose specific limitations on them.
[0089] Taking the system architecture shown in Figure 3 as an example, to achieve the rotation of the scanning component, the scanning component and the motor are fixed together, and the encoder's code disk is also mounted on the motor. When the scanning LiDAR is working, the motor control unit controls the motor to rotate, and the motor's rotation drives the scanning component and the encoder's code disk to rotate synchronously. The encoder generates real-time pulse signals for the motor's rotation based on the code disk's rotation and outputs them to the encoding and parsing unit. The encoding and parsing unit calculates the real-time pulse signals into corresponding angle values and sends these angle values to the motor control unit. The motor control unit determines the current position of the scanning component based on these angle values, and whether this position is the desired position. Based on this information, it adjusts the rotation direction and / or angle of the motor shaft to drive the scanning component to the desired position. The lighting module controls the laser to emit a beam for illumination; for example, it can directly illuminate the laser, or in some scenarios, it can receive the angle values sent by the encoding and parsing unit and determine the current lighting method based on these angle values. In a specific example, if it's a frequency-modulated continuous wave (FMCW) LiDAR, the illumination module can gradually increase its illumination power as the angle value increases to emit a linearly frequency-modulated signal. The beam emitted by the illumination module illuminates the scanning component. The scanning component rotates with the motor, reflecting the beam emitted by the illumination module to the corresponding position in the detection space, thus scanning the optical signal. The optical signal is reflected back to the scanning LiDAR after being reflected by the target in the detection space and is received by the echo detection module. The echo detection module calculates the distance based on the echo signal and sends the calculated distance value to the point cloud generation module. The point cloud generation module is mainly responsible for accumulating the calculated distances into a distance image. This distance image can be used to assist vehicle driving, for example, it can be sent to the vehicle control unit to assist the vehicle in achieving autonomous driving or assisted driving modes.
[0090] Currently, the encoders in scanning LiDAR systems are typically photoelectric encoders or magnetic encoders. The structure of a photoelectric encoder is shown in Figure 1a or 1b above, and the structure of a magnetic encoder is shown in Figure 1c above. When the encoder is functioning normally, the electrical signal it outputs is relatively accurate. However, if the encoder malfunctions, it will output an incorrect electrical signal. This malfunction may be due to damage to the encoder's components or interference. For example, for a photoelectric encoder, if it is in a humid environment causing condensation on its code disk, or if it accumulates dust, oil, or other dirt due to aging, the holes on the code disk will be blocked, leading to an incorrect electrical signal output. Similarly, for a magnetic encoder, if it is subjected to strong external magnetic field interference, or if it ages and demagnetizes due to prolonged use, the magnetic induction chip will sense an incorrect magnetic field, resulting in an incorrect electrical signal output. When an erroneous electrical signal from the encoder enters the encoding and parsing unit, it causes the unit to interpret an incorrect angle value. This angle value deviates from the true angle value, leading to misjudgment of the frame start position, premature or delayed frame signal transmission, and consequently, point cloud skew and jitter, increasing safety risks in assisted driving. Furthermore, erroneous encoder output also increases the motor's NVH (noise, vibration, and harshness), directly impacting the user's riding experience. Therefore, designing a correct encoding device with anti-interference capabilities is crucial for improving driving safety and the user's riding experience.
[0091] In view of this, this application provides an encoding device that mainly improves the hardware structure of the encoder and the software flow of the encoding and parsing unit. The hardware improvement involves connecting multiple encoders to the same encoding and parsing unit, while the software improvement involves switching the output value of the encoding and parsing unit between multiple encoded values. This allows the encoding and parsing unit to avoid encoding values from encoders in abnormal states, ensuring that it always outputs the correct encoded value. Based on this, when this encoding device is applied to LiDAR, even if one encoder is damaged or the code disk is interfered with, the encoding and parsing unit can still output the correct encoded value. This solves the problem of point cloud skew and jitter caused by incorrect output encoding values in LiDAR, improves the accuracy of point cloud construction, and thus improves the safety of assisted driving. Simultaneously, it can also reduce the NVH of the motor, improving the user's riding experience.
[0092] The coding device and related scheme proposed in this application will be described in detail below with reference to Figures 4 to 16.
[0093] Please refer to Figure 4, which shows a schematic diagram of an encoding device provided in this application. The encoding device 400 includes an encoding parsing unit 410 and N encoders, namely encoder 421, encoder 422, ..., encoder 42N, where N is an integer greater than or equal to 2. The N encoders 421 to 42N generate N electrical signals during the synchronous rotation of their code disks and send them to the encoding parsing unit 410. The encoding parsing unit 410 then switches from outputting a first encoded value to outputting a second encoded value based on the N electrical signals. The first encoded value and the second encoded value are different.
[0094] Optionally, the N encoders 421 to 42N can be any type of encoder, such as angle encoders, including but not limited to photoelectric encoders, magnetic encoders, inductive encoders, or one or more other types of angle encoders. For example, taking N as 3, it can be 3 photoelectric encoders, or 3 magnetic encoders, or 3 inductive encoders, or 1 photoelectric encoder, 1 magnetic encoder and 1 inductive encoder, or 2 photoelectric encoders and 1 magnetic encoder, or 1 photoelectric encoder and 2 magnetic encoders, or 2 magnetic encoders and 1 inductive encoder, etc., without limitation.
[0095] Optionally, the code disks of the N encoders 421-42N rotate synchronously. Specifically, the code disks of the N encoders can be mounted on the same motor shaft, so that the code disks of the N encoders 421-42N rotate with the rotation of the same motor shaft. The mounting position and arrangement order of the code disks of the N encoders 421-42N on the motor shaft are not limited. For example, when the N encoders 421-42N are a combination of one photoelectric encoder, one magnetic encoder, and one inductive encoder, the installation method can be shown in Figure 5a, with the inductive encoder mounted at the top, the magnetic encoder in the middle, and the photoelectric encoder at the bottom. When the N encoders 421-42N are a combination of two photoelectric encoders and one magnetic encoder, the installation method can be shown in Figure 5b, with the photoelectric encoder mounted at the top, the magnetic encoder in the middle, and the photoelectric encoder at the bottom. When the N encoders 421-42N are three photoelectric encoders, the installation method can be shown in Figure 5c, with one photoelectric encoder mounted at the top, one photoelectric encoder in the middle, and one photoelectric encoder at the bottom. In Figures 5a to 5c, (A) shows the front view and (B) shows the top view.
[0096] It should be noted that the placement and arrangement order shown in Figures 5a to 5c are merely examples. These encoders can have other placement and arrangement orders in actual encoding devices, and are not limited thereto. Furthermore, this application does not limit the size of each encoder. Figures 5a to 5c are only shown in a top view to illustrate the positions of different encoders, assuming the encoder at the bottom is the largest and the encoder at the top is the smallest. However, in reality, the encoders can be the same size, or one encoder can be larger or smaller than the others, etc., without affecting the encoder performance.
[0097] Understandably, since the code disks of N encoders 421-42N are mounted on the same motor shaft, when the motor shaft rotates, the code disks of the N encoders 421-42N also rotate, and their rotation direction and angle are the same as those of the motor shaft. Therefore, the rotation of the code disks of the N encoders 421-42N is synchronous. Based on this, when the electrical signals generated by the N encoders 421-42N are output to the encoding parsing unit 410, theoretically, N identical or similar encoded values should be parsed. However, if one of the encoders is in an abnormal state, such as due to damage to internal components or interference caused by environmental or internal factors, the electrical signal output by that encoder will be incorrect, and the corresponding parsed encoded value will also be incorrect. Therefore, to ensure the accuracy of the output encoded value, the encoded value of a normally functioning encoder should be output, or the encoded value to be output should be calculated based on the encoded value of a normally functioning encoder, such as using the average or weighted average encoded value of a normally functioning encoder as the encoded value to be output.
[0098] Based on this, after acquiring the N electrical signals output by the N encoders 421 to 42N, the encoding parsing unit 410 can first determine the state of the N encoders 421 to 42N based on the N electrical signals. If only one encoder among the N encoders 421 to 42N is in a normal state, while the others are abnormal, the encoded value of the encoder in a normal state is directly output. If multiple encoders among the N encoders 421 to 42N are in a normal state, such as all N encoders 421 to 42N being in a normal state, or at least two encoders among the N encoders 421 to 42N being in a normal state while the others are abnormal, one or more encoders can be randomly selected from the multiple encoders in a normal state, or selected according to a set rule, and the output encoded value can be determined based on the encoded values of these one or more encoders. For example, the encoded value of a normally functioning encoder can be randomly selected and output directly, or the encoded value of the encoder with the highest accuracy can be output, or the average or weighted average encoded value of the multiple normally functioning encoders can be output, etc.
[0099] Assuming the output encoded value is called the first encoded value, after outputting the first encoded value, the encoding parsing unit 410 will also receive new electrical signals from N encoders 421 to 42N. Based on the new electrical signals, if it is determined that the state of at least one encoder has changed, the output can be switched from the first encoded value to the second encoded value. The state change of at least one encoder affects the rotation control of the code disk synchronization. This can be understood as follows: if the output encoded value is not switched, the code disk rotation control will become inaccurate, or in other words, the motor shaft rotation control will become inaccurate, thus affecting the scanning accuracy of the scanning component fixed on the motor shaft. Specifically, this includes the following three scenarios.
[0100] Scenario 1: The encoder state corresponding to the first encoded value changes from a normal state to an abnormal state.
[0101] Here, the encoder corresponding to the first encoded value refers to the encoder associated with the first encoded value, or the encoder used to determine the first encoded value. For example, if the first encoded value is the encoded value of the encoder with the highest accuracy among multiple encoders that are in normal condition, then the encoder corresponding to the first encoded value is the encoder with the highest accuracy among multiple encoders that are in normal condition. If the first encoded value is the average encoded value or weighted average encoded value of multiple encoders that are in normal condition, then the encoder corresponding to the first encoded value is all the encoders used to calculate the first encoded value, that is, the multiple encoders that are in normal condition.
[0102] Regardless of whether the first encoded value corresponds to one or more encoders, when at least one of these encoders changes from a normal state to an abnormal state, the encoded value of this at least one encoder becomes inaccurate, causing the first encoded value to also become inaccurate. Therefore, it needs to be switched to another encoded value, called the second encoded value. The second encoded value can be the encoded value of the encoder with the highest accuracy among the multiple encoders that are in a normal state within the current time period, or it can be the average or weighted average encoded value of the multiple encoders that are in a normal state within the current time period.
[0103] In simple terms, scenario one can be understood as switching from outputting the first encoded value to outputting the second encoded value when the encoder currently used to determine the first encoded value changes from a normal state to an abnormal state. That is, when the currently used encoder becomes abnormal, the system avoids the abnormal encoder and switches to use the normal encoder.
[0104] For example, suppose there are three encoders: a photoelectric encoder, a magnetic encoder, and an inductive encoder. The photoelectric encoder has the highest accuracy, followed by the magnetic encoder, and the inductive encoder has the lowest accuracy. If the encoded value of the encoder with the highest accuracy is always output, then, please refer to Figure 6a, which shows a schematic diagram of an output process for switching encoded values provided in this application. The switching result corresponds to the output architecture shown in Figure 6b. Combining Figures 6a and 6b, this process includes the following steps:
[0105] Step 601: In the initial state, when all three encoders are in normal condition, output the encoded value of the photoelectric encoder.
[0106] Here, in the initial state, it is assumed that all three encoders are normal and without interference. Since the encoder with the highest accuracy among the three encoders is the photoelectric encoder, the encoding parsing unit 410 can output the encoded value of the photoelectric encoder to ensure the output of the highest accuracy encoded value.
[0107] Step 602: Determine if the photoelectric encoder is in normal condition. If yes, proceed to step 603; otherwise, proceed to step 604.
[0108] Step 603: Output the encoded value of the photoelectric encoder.
[0109] Here, when outputting the encoded value of the photoelectric encoder, the encoding analysis unit 410 can determine whether the state of the photoelectric encoder has changed based on the electrical signal output by the photoelectric encoder. If the state remains unchanged, it indicates that the photoelectric encoder is always normal, and the encoded value of the photoelectric encoder continues to be output. In this case, regardless of whether the magnetic encoder and the inductive encoder are abnormal, there is no need to switch the output. For example, if only the magnetic encoder is interfered with, and the photoelectric encoder is not interfered with, the encoded value of the photoelectric encoder will still be output.
[0110] Step 604: Determine if the magnetic encoder is in normal condition. If yes, proceed to step 605; otherwise, proceed to step 606.
[0111] Here, when the optical encoder becomes abnormal, it indicates that the internal components of the photoelectric encoder are damaged, or that the code disk of the photoelectric encoder is affected by condensation or dirt, etc., and the encoded value of the photoelectric encoder is no longer accurate. Therefore, it can no longer output the encoded value of the photoelectric encoder and needs to switch to the encoded value of another encoder. Besides the photoelectric encoder, the magnetic encoder has the highest accuracy among the remaining two encoders. Therefore, the encoding parsing unit 410 then determines whether the magnetic encoder is in normal condition.
[0112] Step 605: Output the encoded value of the magnetic encoder.
[0113] Here, when the photoelectric encoder is in an abnormal state, if the magnetic encoder is in a normal state without interference, the encoding parsing unit 410 outputs the encoded value of the magnetic encoder to ensure the output of the second-highest precision encoded value.
[0114] Step 606: Determine if the inductive encoder is in normal condition. If yes, proceed to step 607; otherwise, proceed to step 608.
[0115] Here, if the magnetic encoder also malfunctions when the photoelectric encoder is in an abnormal state, it indicates that not only is there internal component damage or interference from condensation or dirt in the photoelectric encoder, but the magnetic encoder also suffers from internal component damage or interference from a strong external magnetic field or demagnetization. In this case, the encoded values of both the photoelectric and magnetic encoders are inaccurate and cannot be output; instead, the encoded values of other encoders must be output. Besides the photoelectric and magnetic encoders, the only remaining encoder with the lowest accuracy is the inductive encoder. Therefore, the encoding analysis unit 410 then determines whether the inductive encoder is functioning correctly.
[0116] Step 607: Output the encoded value of the inductive encoder.
[0117] Here, if both the photoelectric encoder and the magnetic encoder are in an abnormal state, but the inductive encoder is in a normal state, the encoding parsing unit 410 outputs the encoding value of the inductive encoder to ensure that the equipment with the encoding device installed can operate normally.
[0118] Step 608: Send an alarm message to the vehicle control unit.
[0119] Optionally, if the inductive encoder is also abnormal, it indicates that all encoders are abnormal, and the encoding device is currently unavailable. In this case, the encoding parsing unit 410 can generate an alarm message based on the information that all encoders are abnormal and send it to the vehicle control unit, such as the MDC. The MDC can exit the intelligent driving operation based on the information that all encoders are abnormal. In this way, even if the unavailability of the encoding device causes inaccurate detection by the device, collisions with obstacles due to inaccurate detection can be avoided, ensuring driving safety.
[0120] Optionally, the above alarm messages can have the highest security level, used to warn the user that the encoding device is unavailable. In some scenarios, alarm messages with other security levels can also be used. For example, after each encoder state becomes abnormal, the encoding parsing unit 410 can send an alarm message to the vehicle control unit, which carries the abnormal state of the encoder. For example, when the photoelectric encoder becomes abnormal, the encoding parsing unit 410 can send the abnormal state of the photoelectric encoder to the MDC. The security level of this information can be a notification, such as being displayed in green. The user can choose to perform an operation or not based on this green notification message, which does not affect driving safety. If both the photoelectric encoder and the magnetic encoder become abnormal, the encoding parsing unit 410 can send the abnormal states of both the photoelectric encoder and the magnetic encoder to the MDC. The security level of this information can be a prompt, such as being displayed in yellow. The user can choose to perform an operation or not based on this yellow prompt message, which does not affect driving safety, but compared to a green notification message, a yellow prompt message is more likely to attract the user's attention. If the photoelectric encoder, magnetic encoder, and inductive encoder all malfunction, the encoding parsing unit 410 can send the abnormal status of the three encoders to the MDC. This information can be at the level of a warning, for example, displayed in red. A red warning message can quickly attract the user's attention and prompt action, ensuring driving safety. It should be understood that alarm messages for other encoder malfunctions or combined encoder malfunctions are similar and will not be listed individually.
[0121] In another example, assuming there are still three encoders: a photoelectric encoder, a magnetic encoder, and an inductive encoder, if the output is a weighted average encoded value of multiple encoders in normal condition, please refer to Figure 7, which shows another output flow diagram for switching encoded values provided in this application. This flow includes the following steps:
[0122] Step 701: In the initial state, when all three encoders are in normal condition, output the weighted average encoded value of the three encoders.
[0123] Optionally, the weighted average encoded value of the three encoders refers to the sum of the encoded values of the three encoders after multiplying each by its own weight. The weights of the three encoders can be designed by those skilled in the art based on experience, or configured according to the specific requirements of the scenario. For example, the weights of the three encoders can be configured according to their accuracy; the higher the accuracy, the larger the weight. For instance, the photoelectric encoder has the highest accuracy, followed by the magnetic encoder, and the inductive encoder has the lowest accuracy. Therefore, the weight of the photoelectric encoder can be configured to be greater than that of the magnetic encoder, and the weight of the magnetic encoder can be greater than that of the inductive encoder. Furthermore, the sum of the weights can be 1. This approach balances the needs of multiple encoders operating normally while ensuring good accuracy in the output encoded value.
[0124] Optionally, after step 701, each of the following steps 7021, 7031, and 7041 is performed.
[0125] Step 7021: Determine if the state of the photoelectric encoder is abnormal. If so, proceed to step 7022.
[0126] Here, if the photoelectric encoder is in normal condition, the output does not need to be switched; that is, the weighted average code value of the three encoders will still be output.
[0127] Step 7022: Output the weighted average encoding value of the magnetic encoder and the inductive encoder.
[0128] Here, if the photoelectric encoder changes from a normal state to an abnormal state, it means that the encoding value of the photoelectric encoder is no longer correct and the encoding value of the photoelectric encoder can no longer be used to calculate the weighted average encoding value. In this case, the encoding parsing unit 410 can ignore the photoelectric encoder and only use the encoding values of the magnetic encoder and the encoder to recalculate the weighted average encoding value, and output the recalculated weighted average encoding value.
[0129] Step 7031: Determine if the magnetic encoder is in an abnormal state. If so, proceed to step 7032.
[0130] Here, if the magnetic encoder is in normal condition, the output does not need to be switched; that is, the weighted average code value of the three encoders will still be output.
[0131] Step 7032: Output the weighted average encoding value of the photoelectric encoder and the inductive encoder.
[0132] Here, if the magnetic encoder changes from a normal state to an abnormal state, it means that the encoding value of the magnetic encoder is no longer correct and the encoding value of the magnetic encoder can no longer be used to calculate the weighted average encoding value. In this case, the encoding parsing unit 410 can ignore the magnetic encoder and only use the encoding values of the photoelectric encoder and the inductive encoder to recalculate the weighted average encoding value and output the recalculated weighted average encoding value.
[0133] Step 7041: Determine if the state of the inductive encoder is abnormal. If so, proceed to step 7042.
[0134] Here, if the inductive encoder is in normal condition, the output does not need to be switched; that is, the weighted average code value of the three encoders will still be output.
[0135] Step 7042: Output the weighted average encoding value of the photoelectric encoder and the magnetic encoder.
[0136] Here, if the inductive encoder changes from a normal state to an abnormal state, it means that the encoding value of the inductive encoder is no longer correct and the encoding value of the inductive encoder can no longer be used to calculate the weighted average encoding value. In this case, the encoding parsing unit 410 can ignore the inductive encoder and only use the encoding values of the photoelectric encoder and the magnetic encoder to recalculate the weighted average encoding value and output the recalculated weighted average encoding value.
[0137] Understandably, steps 7021, 7031, and 7041 above can be executed in parallel and used in combination. For example, if it is determined that both the photoelectric encoder and the magnetic encoder are malfunctioning, the encoding value of the inductive encoder can be directly output. If it is determined that both the photoelectric encoder and the inductive encoder are malfunctioning, the encoding value of the magnetic encoder can be directly output. If it is determined that both the magnetic encoder and the inductive encoder are malfunctioning, the encoding value of the photoelectric encoder can be directly output. If it is determined that all three encoders are malfunctioning, an alarm message can also be sent to the vehicle control unit, as described above, and will not be repeated here.
[0138] Furthermore, similar to the above examples, if the output is the average encoding value of multiple encoders in normal condition, the weighted average encoding value in the above examples can be directly replaced with the average encoding value, which will not be repeated here.
[0139] Based on the above scenario one, after the currently used encoder malfunctions, it can be switched to another normal encoder in a timely manner, thereby avoiding the erroneous encoding values of the abnormal encoder and ensuring that the normal encoding values of the normal encoder are always output.
[0140] Scenario 2: The encoder with higher precision than the encoder corresponding to the first encoded value changes from an abnormal state to a normal state.
[0141] Optionally, an encoder with higher precision than the encoder corresponding to the first encoded value can be understood as an encoder with higher precision than the encoder currently used to determine the first encoded value. Assuming we call the encoder corresponding to the first encoded value the first encoder, and the encoder with higher precision the second encoder, then the reason we are currently using the relatively less precise first encoder to determine the first encoded value is because the more precise second encoder is faulty. If the second encoder is no longer faulty, then to ensure the accuracy of the output encoded value, we can switch to the more precise second encoder to redetermine the encoded value to be output. Whether the first encoder itself has become faulty can be disregarded.
[0142] In simple terms, scenario two can be understood as follows: regardless of whether the currently used encoder becomes abnormal, as long as the encoder with higher accuracy than the currently used encoder is no longer abnormal, then the encoder with higher accuracy can be switched to determine the output encoded value.
[0143] For example, if the encoder's encoded value with the highest precision is always output, then, please refer to Figure 8, which shows another flowchart of switching the output encoded value provided by this application. This process includes the following steps:
[0144] Step 801: When the second encoder is in an abnormal state but the first encoder is in a normal state, output the encoded value of the first encoder. The accuracy of the first encoder is lower than that of the second encoder.
[0145] Assuming there are three encoders: a photoelectric encoder, a magnetic encoder, and an inductive encoder, with the photoelectric encoder having the highest accuracy, followed by the magnetic encoder, and the inductive encoder having the lowest accuracy, then the first encoder can be either a magnetic encoder or an inductive encoder. If the first encoder is a magnetic encoder, then the second encoder is a photoelectric encoder. If the first encoder is an inductive encoder, then the second encoder is a combination of a photoelectric encoder and a magnetic encoder.
[0146] Step 802: Determine whether the state of the second encoder has returned to normal. If yes, proceed to step 803; otherwise, proceed to step 804.
[0147] Step 803: Output the encoded value of the second encoder.
[0148] For example, if the first encoder is a magnetic encoder, then during the process of outputting the encoded value of the magnetic encoder, if the state of the photoelectric encoder returns to normal, it can stop outputting the encoded value of the magnetic encoder and switch to outputting the encoded value of the photoelectric encoder.
[0149] For example, if the first encoder is an inductive encoder, then during the process of outputting the encoded value of the inductive encoder, if the magnetic encoder recovers to normal but the photoelectric encoder remains abnormal, the output will switch from the encoded value of the inductive encoder to the encoded value of the magnetic encoder. If the photoelectric encoder recovers to normal but the magnetic encoder remains abnormal, or if both the photoelectric encoder and the magnetic encoder recover to normal, the output will switch from the encoded value of the inductive encoder to the encoded value of the photoelectric encoder.
[0150] Based on this, after the interference of the high-precision encoder is eliminated, the high-precision encoder can be automatically restored to use instead of the low-precision encoder, thus ensuring that the high-precision encoded value is always output.
[0151] Step 804: Output the encoded value of the first encoder.
[0152] For example, if the photoelectric encoder fails to return to normal during the output of the magnetic encoder's encoded value, the output of the magnetic encoder's encoded value can continue. Similarly, if both the photoelectric and magnetic encoders fail to return to normal during the output of the inductive encoder's encoded value, the output of the inductive encoder's encoded value can continue. This ensures that the currently output encoded value is always from a functioning encoder.
[0153] Based on scenario two above, once the higher-precision encoder returns to normal, it can be switched back to the higher-precision encoder in a timely manner to ensure that the highest-precision encoder among all normal encoders is always output.
[0154] Scenario 3: The encoders other than the one corresponding to the first encoded value change from an abnormal state to a normal state.
[0155] Scenario 2 above can be considered a scheme designed for outputting the encoder value with the highest accuracy each time, while Scenario 3 is designed for outputting the average or weighted average encoder value of multiple encoders in normal condition each time. Under this scheme, as long as there is an unused encoder that recovers from an abnormal state to a normal state, the encoder value to be output can be determined together with the encoder value of that encoder, regardless of whether that encoder is a higher accuracy encoder.
[0156] Based on this, please refer to Figure 9, which shows another flowchart of switching output encoding values provided in this application. The figure uses the weighted average encoding value as an example for illustration. The scheme for outputting the average encoding value is also implemented in the same way and will not be repeated here. As shown in Figure 9, the process includes the following steps:
[0157] Step 901: When the second encoder is in an abnormal state, output the weighted average encoding value of all normal encoders except the second encoder.
[0158] Assuming there are three encoders: a photoelectric encoder, a magnetic encoder, and an inductive encoder, if the photoelectric encoder malfunctions, the output will be the weighted average of the encoder values from the magnetic and inductive encoders. Similarly, if the magnetic encoder malfunctions, the output will be the weighted average of the encoder values from the photoelectric and inductive encoders. If the inductive encoder malfunctions, the output will be the weighted average of the encoder values from the photoelectric and magnetic encoders. Optionally, if two encoders are malfunctioning, the output will be the encoder value from the only remaining working encoder.
[0159] Step 902: Determine whether the state of the second encoder has returned to normal. If yes, proceed to step 903; otherwise, proceed to step 904.
[0160] Step 903: Output the weighted average encoding value of all normal encoders, including the second encoder.
[0161] For example, taking a photoelectric encoder as the second encoder, assuming the previous output was a weighted average of the encoding values from the magnetic encoder and the inductive encoder, and at some point the photoelectric encoder's state returns to normal, then the weighted average of the encoding values from the photoelectric encoder, the magnetic encoder, and the inductive encoder can be output. As another example, taking a combination of a magnetic encoder and a photoelectric encoder as the second encoder, assuming the previous output was the encoding value from the inductive encoder, and at some point the photoelectric encoder's state returns to normal, then the weighted average of the encoding values from the photoelectric encoder and the inductive encoder can be output. Later, if the magnetic encoder also returns to normal, then the weighted average of the encoding values from the photoelectric encoder, the magnetic encoder, and the inductive encoder can be output.
[0162] Step 904: Output the weighted average encoding value of all normal encoders except the second encoder.
[0163] Here, in the process of outputting the weighted average encoding value of all normal encoders except the second encoder, if the state of the second encoder does not return to normal, the weighted average encoding value of all normal encoders except the second encoder can continue to be output to avoid encoders in abnormal states.
[0164] Based on scenario three above, once at least one encoder has returned to normal, it can be promptly reinstated to ensure that the most comprehensive range of normal encoders are always used to determine the output encoded value, thereby improving the accuracy of the encoded value output.
[0165] It should be noted that the solutions described above are not isolated and can be used in combination. For example:
[0166] Combining scenarios one and two above, for example: at the initial moment, if the photoelectric encoder is in normal condition, the encoding parsing unit 410 outputs the encoded value of the photoelectric encoder; during the output process, if the photoelectric encoder is found to be abnormal, but the magnetic encoder is in normal condition, the output of the encoded value of the photoelectric encoder is switched to the output of the encoded value of the magnetic encoder; afterwards, if the photoelectric encoder is detected to have returned to normal, the output of the encoded value of the magnetic encoder is switched back to the output of the encoded value of the photoelectric encoder.
[0167] Combining scenarios one and three above, for example: at the initial moment, if the photoelectric encoder, magnetic encoder, and inductive encoder are all in normal condition, the encoding parsing unit 410 outputs the weighted average encoding value of the photoelectric encoder, magnetic encoder, and inductive encoder; during the output process, if the magnetic encoder is found to be abnormal, but the photoelectric encoder and inductive encoder are in normal condition, the output switches to the weighted average encoding value of the photoelectric encoder and inductive encoder; subsequently, if the magnetic encoder is detected to have returned to normal, the output switches to the weighted average encoding value of the photoelectric encoder, magnetic encoder, and inductive encoder.
[0168] Combining scenarios one, two, and three above, for example: Initially, if the photoelectric encoder is in normal condition, considering its high accuracy, the encoding parsing unit 410 can directly output the photoelectric encoder's encoded value. During the output process, if the photoelectric encoder is found to be malfunctioning, but the magnetic encoder and inductive encoder are in normal condition, considering their relatively low accuracy, the output can be switched from the photoelectric encoder's encoded value to the weighted average encoded value of the magnetic encoder and inductive encoder, thus improving accuracy through weighted combination. Afterward, if the photoelectric encoder is detected to have returned to normal, the output can be switched back to the photoelectric encoder's encoded value.
[0169] It is understandable that there are many other possible ways to switch outputs, which will not be listed here.
[0170] The above content introduced which encoding value to switch to. The following section will explain the specific timing of the switch.
[0171] In this application, there are two timings for switching the encoded value: one is to switch when a change in the state of at least one encoder is detected, and the other is to switch at the start of the next encoding after a change in the state of at least one encoder is detected. The specific implementation of these two switching timings is illustrated below through two embodiments.
[0172] Implementation Plan 1
[0173] Please refer to Figure 10, which shows a flowchart of a method for switching output encoded values provided in Implementation Scheme 1. The process includes the following steps:
[0174] Step 1001: Determine the state of the N encoders based on the electrical signals output by the N encoders.
[0175] Here, the encoding parsing unit 410 can determine the state of each encoder based on the electrical signal output by each encoder.
[0176] Each encoder can be in a normal state or an abnormal state. A normal encoder state refers to the state where the output electrical signal correctly characterizes the rotational features of the motor shaft during synchronous rotation with the motor shaft. For example, after the encoder's output electrical signal enters the encoding and parsing unit 410, it is parsed into an angle value. This angle value is equal to the actual angle value of the motor shaft, or the difference between it and the actual angle value does not exceed the allowable deviation value.
[0177] Correspondingly, an abnormal state of the encoder refers to a situation where, during the synchronous rotation of the encoder with the motor shaft, the output electrical signal cannot accurately represent the rotational characteristics of the motor shaft. For example, the electrical signal output by the encoder is interpreted as an angle value by the encoding parsing unit 410, and the difference between this angle value and the actual angle value of the motor shaft exceeds the allowable deviation value.
[0178] Optionally, the abnormal state of the encoder may be caused by a variety of factors, including but not limited to one or more of the following: encoder damage, code disk aging, code disk contamination, code disk condensation, external strong magnetic field, and demagnetization. Encoder damage and code disk aging are abnormal factors applicable to all encoders. Code disk contamination and code disk condensation are abnormal factors applicable to photoelectric encoders; these two factors can easily block the openings on the code disk of the photoelectric encoder, leading to abnormal optical signal reception and affecting the accuracy of the output electrical signal of the photoelectric encoder. External strong magnetic field and demagnetization are abnormal factors applicable to magnetic encoders; these two factors can cause the magnetic induction chip of the magnetic encoder to sense inaccurate magnetic fields, thereby generating incorrect electrical signals and affecting the accuracy of the output electrical signal of the magnetic encoder. It should be understood that other abnormal factors may also exist; any state that affects the accuracy of the encoder's output electrical signal falls under the category of abnormal encoder states in this application, without specific limitations.
[0179] Optionally, the abnormal state of the encoder can be determined based on the second-order differential value corresponding to the electrical signal output by the encoder. Normally, after the motor shaft rotates 360° in one direction, it starts rotating 360° again from 0°, or rotates 360° in the opposite direction. Therefore, one rotation of the motor shaft 360° is called one encoding cycle. In each encoding cycle, as the motor shaft rotates, the rotation angle continuously increases, which is typically a linear increase in the LiDAR. Therefore, the encoded value corresponding to the electrical signal output by the encoder also increases linearly with time, and the relationship between the encoded value and time presents a fixed slope, as shown in Figure 11(A). However, if at a certain moment, the slope of the point in the relationship changes abruptly on both sides, it indicates that the encoded value no longer increases linearly according to the previous slope, but rather changes abruptly, and the electrical signal output by the encoder is abnormal. This is reflected on the corresponding curve by a larger second-order derivative value at the corresponding point, as shown by points R1 and R2 in Figure 11(B). By detecting the positions of points R1 and R2 with larger second-order derivative values, the time period t during which the encoder malfunctions can be determined. 01 ~t 02 .
[0180] Based on this, for each encoder, after acquiring the electrical signal sent by the encoder, the encoding parsing unit 410 can first determine the correspondence between the encoder's encoded value and time based on the electrical signal, and then determine the second derivative value of this correspondence at each moment. If the second derivative value at all moments is less than or equal to a set threshold, it indicates that the encoder's angle value is increasing normally and linearly, and the encoder is always in a normal state. Conversely, if the second derivative value at some moments is greater than the set threshold, it indicates that the angle value corresponding to the electrical signal output by the encoder at these moments is abnormal, and the encoder is in an abnormal state at these moments. By statistically analyzing the moments when the second derivative value is greater than the set threshold, the abnormal periods of the encoder can be obtained.
[0181] For example, assuming there are three encoders: a photoelectric encoder, a magnetic encoder, and an inductive encoder, please refer to Figure 12, which shows the correspondence curves between the encoded values and time of the three encoders under various scenarios provided in Implementation Scheme 1. The first row of the figure shows the correspondence curve between the encoded values and time of the photoelectric encoder; the second row shows the correspondence curve between the encoded values and time of the magnetic encoder; the third row shows the correspondence curve between the encoded values and time of the inductive encoder; and the fourth row shows the correspondence curve between the encoded values and time output by the encoding parsing unit 410. In each correspondence curve, the horizontal axis represents time, and the vertical axis represents the encoded value. Referring to Figure 12:
[0182] In the scenario shown in Figure 12(A), since the encoded values of the three encoders are linearly related to time, the second derivative value of each of the three encoders is 0 at all times, indicating that none of the three encoders are abnormal. Therefore, Figure 12(A) shows the corresponding relationship curves when all three encoders are normal.
[0183] In the scenario shown in Figure 12(B), since the encoded values of the magnetic encoder and the inductive encoder are linearly related to time, the second derivative values of both the magnetic encoder and the inductive encoder are 0 at all times, indicating that neither the magnetic encoder nor the inductive encoder is abnormal. However, for the photoelectric encoder, by calculating the second derivative value of the correspondence between the encoded value and time, it was found that the second derivative value of the photoelectric encoder is 0 in the time period before t1 and in the time period t2-t3, while the second derivative values in the time periods t1-t2 and t3-t4 are greater than the set threshold. Therefore, it is determined that the photoelectric encoder is normal in the time period before t1 and in the time period t2-t3, and abnormal in the time periods t1-t2 and t3-t4. Therefore, Figure 12(B) shows the correspondence curve when only the photoelectric encoder is abnormal.
[0184] In the scenario shown in Figure 12(C), since the encoding value of the inductive encoder has a linear relationship with time, the second derivative value of the inductive encoder is 0 at all times, indicating that the inductive encoder is normal. For the photoelectric encoder, by calculating the second derivative value of the relationship between the encoding value and time, it was found that the second derivative value of the photoelectric encoder is 0 in the time period before t1 and in the time period t2-t3, while the second derivative values in the time periods t1-t2 and t3-t4 are greater than the set threshold. Therefore, it is determined that the photoelectric encoder is normal in the time period before t1 and in the time period t2-t3, and abnormal in the time periods t1-t2 and t3-t4. For the magnetic encoder, by calculating the second derivative value of the relationship between the encoding value and time, it was found that the second derivative value of the magnetic encoder is 0 in the time period before t2, while the second derivative value in the time period t2-t4 is greater than the set threshold. Therefore, it is determined that the magnetic encoder is normal in the time period before t2, and abnormal in the time period t2-t4. Therefore, Figure 12(C) shows the corresponding relationship curves when both the photoelectric encoder and the magnetic encoder are abnormal;
[0185] In the scenario shown in Figure 12(D), since the encoded values of the photoelectric encoder and the inductive encoder are linearly related to time, the second derivative values of both the photoelectric encoder and the inductive encoder are 0 at all times, indicating that neither the photoelectric encoder nor the inductive encoder is abnormal. However, for the magnetic encoder, by calculating the second derivative value of the relationship between the encoded value and time, it was found that the second derivative value of the magnetic encoder is 0 before time t2, while the second derivative value is greater than the set threshold during the time period t2 to t4. Therefore, it is determined that the magnetic encoder is normal before time t2 and abnormal during the time period t2 to t4. Thus, Figure 12(D) shows the relationship curve when only the magnetic encoder is abnormal.
[0186] Optionally, the threshold values mentioned above can be set by those skilled in the art based on experience, or configured according to actual scenario requirements, or obtained through simulation measurements in actual scenarios. For different types of encoders, the threshold values can be the same or different. For example, the same threshold value can be set for photoelectric encoders, magnetic encoders, and inductive encoders; alternatively, a larger threshold value can be set for high-precision encoders, and a smaller threshold value for low-precision encoders, to give high-precision encoders higher fault tolerance; or the threshold value can be set according to user instructions, etc., without limitation.
[0187] Step 1002: Determine the first encoding value based on the encoding value of the first encoder that is in normal condition among the N encoders, and output the first encoding value.
[0188] Optionally, the encoding parsing unit 410 can select all encoders in normal condition from the N encoders based on their states, and then use the encoding value of the encoder with the highest accuracy among all encoders in normal condition as the first encoding value, or use the average encoding value or weighted average encoding value of all encoders in normal condition as the first encoding value, and output the first encoding value.
[0189] For ease of distinction, the encoder that is currently in a normal state is referred to as the first encoder.
[0190] Step 1003: Determine whether the state of at least one encoder has changed. If yes, proceed to step 1004; otherwise, proceed to step 1005.
[0191] Step 1004: Determine the second encoder in a normal state. When the state changes, determine the second encoding value based on the encoding value of the second encoder and output the second encoding value.
[0192] Optionally, if the state of at least one encoder changes and the state change of at least one encoder affects the synchronous rotation control of the encoder disk, the encoding parsing unit 410 can redetermine all encoders that are currently in normal state at the moment when the state of at least one encoder changes. These encoders are called second encoders. The encoding parsing unit 410 can use the encoding value of the second encoder with the highest accuracy among all second encoders as the second encoding value, or use the average encoding value or weighted average encoding value of all second encoders as the second encoding value, and switch from outputting the first encoding value to outputting the second encoding value.
[0193] Step 1005: Determine the first encoded value based on the encoded value of the first encoder, and output the first encoded value.
[0194] Optionally, if the states of all encoders remain unchanged, or if the states of one or more encoders change but these changes have no impact on the synchronous rotation control of the encoder disk, then the first encoded value can continue to be output. For example, when outputting the encoded value of the photoelectric encoder, if the state of the magnetic encoder changes but the state of the photoelectric encoder remains unchanged, since the accuracy of the magnetic encoder is inherently lower than that of the photoelectric encoder, the change in the state of the magnetic encoder has no impact on the output encoded value of the photoelectric encoder. Therefore, the encoded value of the photoelectric encoder is still output.
[0195] Referring to Figure 12 above, let's take a specific example, assuming that the encoded value of the encoder with the highest precision is used as the encoded value to be output:
[0196] If all three encoders are functioning normally, as shown in Figure 12(A), then the output of the encoding parsing unit 410 will always be the encoded value of the photoelectric encoder with the highest accuracy.
[0197] If it is a scenario where only the photoelectric encoder is abnormal, as shown in Figure 12 (B), then in the time period before t1 and in the time period t2 to t3, the photoelectric encoder is not abnormal, and the encoding parsing unit outputs the encoding value of the photoelectric encoder; while in the time period t1 to t2 and in the time period t3 to t4, the photoelectric encoder is abnormal, but the magnetic encoder is not abnormal. Therefore, the encoding parsing unit can switch from outputting the encoding value of the photoelectric encoder to outputting the encoding value of the magnetic encoder.
[0198] In a scenario where both the photoelectric encoder and the magnetic encoder are malfunctioning, as shown in Figure 12(C), the photoelectric encoder is not malfunctioning during the time periods before t1 and t2-t3, and the encoding parsing unit outputs the encoded value of the photoelectric encoder. During the time periods t1-t2, the photoelectric encoder is malfunctioning, but the magnetic encoder is not malfunctioning. Therefore, the encoding parsing unit can switch from outputting the encoded value of the photoelectric encoder to outputting the encoded value of the magnetic encoder. During the time periods t3-t4, both the photoelectric encoder and the magnetic encoder are malfunctioning, but the inductive encoder is not malfunctioning. Therefore, the encoding parsing unit can switch from outputting the encoded value of the photoelectric encoder to outputting the encoded value of the inductive encoder.
[0199] In the case of a scenario where only the magnetic encoder malfunctions, as shown in Figure 12(D), the encoding parsing unit will always output the encoded value of the photoelectric encoder since the photoelectric encoder does not malfunction throughout the entire period.
[0200] Based on the above implementation scheme one, the encoder value can be switched to the encoding value of another normal encoder when the current encoder is in an abnormal state, thereby realizing the switching of output results at the transition point. By switching in real time during each encoding process, it can be ensured that the output encoding value is accurate in each encoding process.
[0201] Implementation Plan 2
[0202] Please refer to Figure 13, which illustrates a flowchart of a method for switching output encoded values provided in Implementation Scheme 2. The process includes the following steps:
[0203] Step 1301: Determine the state of the N encoders based on the electrical signals output by the N encoders.
[0204] For example, the encoding parsing unit 410 can determine the correspondence between the encoding value and time of each encoder based on the electrical signal output by each encoder, and calculate the second derivative of the correspondence at each moment. If the second derivative at a certain moment is greater than or equal to a set threshold, it is determined that the encoder is abnormal at that moment; if it is less than the set threshold, it is determined that the encoder is normal at that moment.
[0205] Step 1302: Determine the first encoding value based on the encoding value of the first encoder that is in normal condition among the N encoders, and output the first encoding value.
[0206] Here, the encoding parsing unit 410 can select all encoders in normal condition from N encoders, and output the encoded value of the encoder with the highest accuracy among all encoders in normal condition as the first encoded value, or output the average encoded value or weighted average encoded value of all encoders in normal condition as the first encoded value. The encoder in normal condition selected at this time is called the first encoder.
[0207] Step 1303: Determine whether the state of at least one encoder has changed. If yes, proceed to step 1304; otherwise, proceed to step 1305.
[0208] Optionally, for each encoder, the encoder's code disk rotates with the rotation of the motor shaft. During the rotation of the code disk, the encoder continuously generates electrical signals and sends them to the encoding parsing unit 410. Upon receiving an electrical signal, the encoding parsing unit 410 parses the current encoded value based on the signal, combines it with previously parsed historical encoded values, and calculates the second derivative value at the current moment. If the second derivative value of an encoder was previously less than a set threshold, but the current second derivative value is greater than or equal to the set threshold, it indicates that the encoder has changed from a normal state to an abnormal state. Conversely, if the previous second derivative value was greater than or equal to the set threshold, but the current second derivative value is less than the set threshold, it indicates that the encoder has changed from an abnormal state to a normal state.
[0209] Optionally, after identifying all encoders whose states have changed, the encoding parsing unit 410 can further determine whether at least one encoder's state change affects the synchronous rotation control of the code disk. For example, it can determine whether at least one of the first encoders used to output the first encoded value changes from a normal state to an abnormal state; whether an encoder with higher precision than the first encoder used to output the first encoded value changes from an abnormal state to a normal state; and whether any encoder other than the first encoder used to output the first encoded value changes from an abnormal state to a normal state. If at least one of these conditions is met, it is determined that at least one encoder's state change affects the synchronous rotation control of the code disk, requiring a change in the encoded value, and step 1304 is executed. If all conditions are not met, it is determined that no at least one encoder's state change affects the synchronous rotation control of the code disk, requiring no change in the encoded value, and step 1305 is executed.
[0210] Step 1304: Determine the second encoder in normal condition. At the start of the next encoding, determine the second encoding value based on the encoding value of the second encoder and output the second encoding value.
[0211] Optionally, encoder malfunctions are usually caused by component damage or external interference. These factors generally do not disappear in a short period of time but will persist for a period of time. Therefore, if a change in the state of at least one encoder is detected in a certain encoding process that affects the synchronous rotation control of the code disk, it can be predicted that the encoder will still be malfunctioning in the next encoding process. In the next encoding process, the encoder's encoding value should not be used to avoid the malfunctioning encoder.
[0212] Based on this, the encoding parsing unit 410 can determine the encoder that has not shown any abnormalities during the current encoding process by analyzing the state changes of all encoders. At the start of the next encoding, it determines the output encoding value based on the encoding values of all encoders that have not shown any abnormalities during the current encoding. For example, assuming the encoder that has not shown any abnormalities during the current encoding is called the second encoder, then in the next encoding, it can always output the encoding value of the encoder with the highest accuracy among all second encoders, or always output the average encoding value or weighted average encoding value of all second encoders. In this way, it can avoid encoders that may have abnormalities in advance in the next encoding, ensuring the accuracy of the output in the next encoding.
[0213] Step 1305: At the start of the next encoding, determine the first encoding value based on the encoding value of the first encoder, and output the first encoding value.
[0214] Here, if in a certain encoding process it is detected that no state change of at least one encoder affects the synchronous rotation control of the code disk, it indicates that the first encoder used in this encoding is accurate and there is no component damage or external interference. Therefore, the first encoder used in this encoding can still be used in the next encoding. For example, starting from the beginning of the next encoding, the encoding parsing unit 410 always outputs the encoding value of the encoder with the highest accuracy among all the first encoders used in this encoding, or always outputs the average encoding value or weighted average encoding value of all the first encoders used in this encoding.
[0215] Understandably, in Implementation Scheme 2, the state changes of N encoders during the current encoding process determine which encoders will be used for the next encoding iteration. In the current encoding, the encoder initially determined—the first encoder—is always used. Simply put, the current encoding always outputs the encoded value from the first encoder or the encoded value determined based on the first encoder's value. After the current encoding ends, the state changes of each encoder during the current encoding process determine the second encoder to be used in the next encoding iteration. In the next encoding iteration, the encoded value from the second encoder or the encoded value determined based on the second encoder's value is always output. After the next encoding iteration ends, the state changes of each encoder during the next encoding process determine the third encoder to be used in the encoding iteration after that. In the encoding iteration after that, the encoded value from the third encoder or the encoded value determined based on the third encoder's value is always output, and so on.
[0216] For example, assuming that each encoding operation outputs the encoder value with the highest accuracy, as shown in Figure 14, for this encoding, regardless of whether all three encoders are functioning correctly or whether one or more encoders are malfunctioning, the encoding parsing unit 410 will always output the encoder value with the highest accuracy from the photoelectric encoder. However, for the next encoding operation:
[0217] If all three encoders are functioning normally, as shown in Figure 14(A), since the highest precision photoelectric encoder is always functioning normally in this encoding, it can continue to be used in the next encoding. The encoding parsing unit 410 will always output the encoded value of the photoelectric encoder in the next encoding.
[0218] If it is a scenario where only the photoelectric encoder is abnormal, as shown in Figure 14(B), since the photoelectric encoder with the highest accuracy is abnormal during the time periods t1~t2 and t3~t4 in this encoding, while the magnetic encoder with the second highest accuracy is always normal in this encoding, the photoelectric encoder will not be used in the next encoding, but the magnetic encoder will be used instead. The encoding parsing unit 410 will always output the encoded value of the magnetic encoder in the next encoding.
[0219] In the case where both the photoelectric encoder and the magnetic encoder are malfunctioning, as shown in Figure 14 (C), since the photoelectric encoder with the highest accuracy is malfunctioning in the time periods t1~t2 and t3~t4 of this encoding, and the magnetic encoder with the second highest accuracy is malfunctioning in the time period t2~t4 of this encoding, while the inductive encoder is always normal in this encoding, the photoelectric encoder and the magnetic encoder will no longer be used in the next encoding, but the inductive encoder will be used instead. The encoding parsing unit 410 will always output the encoding value of the inductive encoder in the next encoding.
[0220] In the case of a scenario where only the magnetic encoder is malfunctioning, as shown in Figure 14(D), since the photoelectric encoder with the highest accuracy is always normal in this encoding, it can continue to be used in the next encoding. The encoding parsing unit 410 will always output the encoded value of the photoelectric encoder in the next encoding.
[0221] Based on the above implementation scheme 2, the encoder to be used for the next encoding can be determined according to the encoder status in the current encoding, so that the encoding value of the normal encoder can be switched at the beginning of the next encoding. By switching the output result at the beginning of each encoding, it can be ensured that the encoding value of the same one or more encoders is always output during each encoding process, avoiding frequent output switching operations and reducing system power consumption.
[0222] It is understandable that, unless otherwise specified or logically conflicting, the terminology and / or descriptions of the various implementation schemes described above are consistent and can be referenced from each other. The technical features of different implementation schemes can be combined to form new implementation schemes based on their inherent logical relationships.
[0223] Furthermore, the above implementation scheme can be modified to form new implementation schemes. For example, in another implementation scheme, the encoded value can be switched in real time during a certain encoding, and the encoder used for the next encoding can be determined based on the state changes of each encoder during the current encoding. Then, the encoded value of that encoder can be continuously output in the next encoding. There are many other possible implementation schemes. Any scheme that can set at least two encoders and switch the output based on the encoded values of at least two encoders is within the scope of protection of this application, and this application does not make specific limitations on it.
[0224] The encoding device described above can be applied to detection devices, such as lidar.
[0225] Please refer to Figure 15, which shows a possible structural schematic diagram of a detection device provided in this application. The detection device 1500 may include the encoding device described above, such as the encoding device 400 shown in Figure 4, as shown in Figure 15. By setting multiple encoders in the encoding device 400 and configuring the aforementioned control logic for switching outputs, even if one or more encoders are damaged or interfered with, the encoding device 400 can still correctly output normal encoded values. Therefore, the detection device 1500, where the encoding device 400 is located, will not experience point cloud skewness or jitter due to incorrect encoded values, thereby enhancing system stability. Simultaneously, it can also resolve the impact of interference with the encoding device on motor control, reduce the NVH of the equipment where the detection device 1500 is located, avoid noise disturbances or motor stalling, and improve the user experience.
[0226] Optionally, as shown in Figure 15, the detection device 1500 may further include a motor 1510 and a motor control unit 1520. Referring to Figure 4 above, the code disks of the N encoders 421-42N in the encoding device 400 are all mounted on the motor 1510, for example, coaxially with the motor 1510. The motor control unit 1520 controls the rotation of the motor 1510, which drives the code disks of the N encoders 421-42N to rotate synchronously. During the synchronous rotation of the code disks, the N encoders 421-42N output N electrical signals to the encoding analysis unit 410. The encoding analysis unit 410 analyzes the N electrical signals to determine N encoding values, such as N angle values, and selects the correct encoding value from the N encoding values for output according to the method described above.
[0227] Optionally, as shown in Figure 15, the motor control unit 1520 is also connected to the output end of the encoding device 400, such as the output end of the encoding parsing unit 410. Based on this connection, the encoded value output by the encoding parsing unit 410 will enter the motor control unit 1520, and the motor control unit 1520 can also adjust the rotation of the motor 1510 according to the encoded value output by the encoding parsing unit 410.
[0228] For example, when the detection device 1500 is first started, the motor control unit 1520 can control the motor 1510 to rotate randomly, such as randomly rotating in a certain direction and at a certain angle. The rotation of the motor 1510 drives the code disks of N encoders 421 to 42N to rotate synchronously. During the synchronous rotation of the code disks, the N encoders 421 to 42N generate N electrical signals and send them to the encoding and parsing unit 410. The encoding and parsing unit 410 parses the encoding values of the N encoders based on the N electrical signals, determines the correct encoding value according to the above method, and then outputs it to the motor control unit 1520. Based on the received encoding value, the motor control unit 1520 can know the current rotation direction and rotation angle of the motor 1510. If the rotation direction and rotation angle are not the desired rotation direction and rotation angle, the motor control unit 1520 adjusts the rotation direction and rotation angle of the motor 1510 so that the motor 1510 rotates in the desired rotation direction and rotation angle. For example, if a 10° turn to the left is required, but the encoded value output by the encoder 400 indicates that the current motor is turning 10° to the right, then the motor control unit 1520 can control the motor 1510 to turn 10° in the opposite direction. Alternatively, if a 10° turn to the left is required, but the encoded value output by the encoder 400 indicates that the current motor is turning 5° to the left, then the motor control unit 1520 can control the motor 1510 to continue turning another 5° in the same direction. There are many other related control logics, which will not be listed here.
[0229] Optionally, as shown in Figure 15, the detection device 1500 may further include a scanning component 1530, which is connected to the motor 1510, for example, fixed to the motor shaft of the motor 1510. In this way, when the motor 1510 rotates, the scanning component 1530 will rotate with the motor 1510, thereby scanning the optical signal to every position in the detection space.
[0230] Optionally, as shown in FIG15, the detection device 1500 may further include a transmitting component 1540, which is used to transmit a light beam to the scanning component 1530, and the scanning component 1530 reflects the light beam emitted by the transmitting component 1540 into the detection space.
[0231] Optionally, as shown in Figure 15, the transmitting component 1540 can also be connected to the output end of the encoding device 400, such as the output end of the encoding parsing unit 410 in the encoding device 400. Based on this connection, the encoded value output by the encoding parsing unit 410 will also enter the transmitting component 1540. The transmitting component 1540 can also adjust the transmitted beam according to the encoded value output by the encoding parsing unit 410, such as adjusting the time, pulse train, and power of the transmitted beam. For example, if it is a linear frequency modulated beam, the power of the transmitted beam is linearly related to time. Since time and scanning angle are also linearly related, the power of the transmitted beam is linearly related to the scanning angle. Based on this linear relationship, after receiving the encoded value (i.e., scanning angle) output by the encoding parsing unit 410, the transmitting component 1540 can determine the power of the transmitted beam corresponding to the encoded value, and then transmit the beam to the scanning component 1530 according to the power, so that the scanning component 1530 can reflect the beam with the corresponding power into the detection space.
[0232] Optionally, as shown in Figure 15, the detection device 1500 may also include a receiving component 1550. After the light beam scanned by the scanning component 1530 into the detection space is reflected back to the detection device by the target in the detection space, it is received by the receiving component 1550. The received light beam is called the echo signal. The receiving component 1550 can parse the echo signal into an electrical signal for use by subsequent components.
[0233] Optionally, as shown in FIG15, the detection device 1500 may further include a processing component 1560, which is connected to the output of the receiving component 1550. The processing component 1560 is used to receive electrical signals from the receiving component 1550 and generate point cloud data based on the electrical signals. The point cloud data can be output to components outside the detection device 1500 to indicate the distance and / or velocity of the target.
[0234] It should be noted that the architecture of the detection device 1500 shown in Figure 15 is only an example. In other examples, the detection device 1500 may include more, fewer, or different structures, and each structure may include more, fewer, or different components. For example, in one example, the detection device 1500 may also include an amplifier and an analog-to-digital converter (ADC), connected between the receiving component 1550 and the processing component 1560. The amplifier amplifies the electrical signal output from the receiving component 1550, and the ADC discretizes the amplified electrical signal, converting it into a digital signal and outputting it to the processing component 1560, so that the processing component 1560 can generate point cloud data based on the digital signal. In another example, the detection device 1500 may also include a window, which protects the internal components of the detection device 1500 and allows the light signal emitted by the detection device 1500 to pass through. And so on, there are many other possible extensions, which this application does not specifically limit.
[0235] Based on the structure and functional principles of the encoding and detection devices described above, this application can also provide a terminal device, as shown in Figure 16. This terminal device 1600 may include the encoding device described above, such as the encoding device 400 shown in Figure 4. Alternatively, it may include the detection device described above, such as the detection device 1500 shown in Figure 15. Figure 16 uses the latter as an example.
[0236] Optionally, as shown in Figure 16, the terminal device 1600 may further include a processor 1610, which is used to call programs or instructions to control the operation of the detection device 1500. Furthermore, the processor 1610 can also receive point cloud data from the detection device 1500. When the terminal device 1600 is a vehicle, the processor 1610 can also perform vehicle path planning, braking, or starting based on the acquired point cloud data. For example, the vehicle's position can be determined using latitude and longitude, or the vehicle's driving direction and destination in the future can be determined using speed and orientation, or the number and density of obstacles around the vehicle can be determined using the distance to surrounding objects.
[0237] Optionally, the processor 1610 can also receive other information from the detection device 1500, such as receiving abnormal encoder status from the encoding device 400 in the detection device 1500, and controlling autonomous driving or assisted driving functions based on the abnormal encoder status. For example, when all encoders are abnormal, intelligent driving can be discontinued to ensure driving safety.
[0238] Furthermore, optionally, the terminal device 1600 may also include a memory 1620 for storing programs or instructions. Of course, the terminal device 1600 may also include other devices, such as wireless communication devices.
[0239] Processor 1610 may include one or more processing units. For example, processor 1610 may include an application processor (AP), an image signal processor (ISP), a controller, a DSP, or other programmable logic devices, transistor logic devices, hardware components, or any combination thereof. Different processing units may be independent devices or integrated into one or more processors. Optionally, when the terminal device 1600 is a vehicle, processor 1610 may specifically be an MDC (Multi-Distributed Control Unit).
[0240] The memory 1620 includes, but is not limited to, random access memory (RAM), flash memory, read-only memory (ROM), programmable read-only memory (PROM), erasable programmable read-only memory (EPROM), electrically erasable programmable read-only memory (EEPROM), registers, hard disks, portable hard disks, CD-ROMs, or any other form of storage medium known in the art. Exemplarily, the storage medium is coupled to a processor, enabling the processor to read information from and write information to the storage medium. Of course, the storage medium can also be a component of the processor. The processor and the storage medium can reside within an ASIC.
[0241] For example, the terminal device 1600 mentioned above may be a vehicle (e.g., unmanned vehicle, intelligent vehicle, electric vehicle, or digital car), robot, surveying equipment, drone, smart home device (e.g., television, robot vacuum cleaner, smart lamp, audio system, smart lighting system, electrical control system, home background music, home theater system, intercom system, or video surveillance), smart manufacturing equipment (e.g., industrial equipment), smart transportation equipment (e.g., AGV, unmanned transport vehicle, or truck), or smart terminal (mobile phone, computer, tablet, PDA, desktop computer, headphones, audio equipment, wearable device, in-vehicle device, virtual reality device, augmented reality device, etc.).
[0242] It should be noted that with the development of detection technology, the coherent calibration device structure provided in this application is also applicable to the same technical problems, and this application does not make specific limitations on it.
[0243] In the above content, "at least one" means one or more, and "more than one" means two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A alone, A and B simultaneously, or B alone, where A and B can be singular or plural. In the textual description of this application, the character " / " generally indicates that the preceding and following related objects have an "or" relationship.
[0244] Additionally, in this application, the terms "optionally" or "exemplary" are used to indicate that they are examples, illustrations, or descriptions. Any embodiment or design described as "optional" or "exemplary" in this application should not be construed as being more preferred or advantageous than other embodiments or design options. Alternatively, it can be understood that the use of the terms "exemplary" or "optional" is intended to present concepts in a specific manner and does not constitute a limitation of this application.
[0245] It is understood that the various numerical designations used in this application are merely for descriptive convenience and are not intended to limit the scope of the embodiments of this application. The order of the process numbers described above does not imply the order of execution; the execution order of each process should be determined by its function and inherent logic. Terms such as "first," "second," and similar expressions are used to distinguish similar objects and are not necessarily used to describe a specific order or sequence. Furthermore, the terms "comprising" and "having," and any variations thereof, are intended to cover non-exclusive inclusion, such as including a series of steps or units. A method, system, product, or device is not necessarily limited to those steps or units explicitly listed, but may include other steps or units not explicitly listed or inherent to these processes, methods, products, or devices.
Claims
1. An encoding device, characterized in that, include: The system consists of an encoding and parsing unit and N encoders, where N is an integer greater than or equal to 2. The N encoders are used to generate N electrical signals during the synchronous rotation of the code disks of the N encoders and send them to the encoding and parsing unit. The encoding and parsing unit is used to switch from outputting a first encoded value to outputting a second encoded value based on the N electrical signals, wherein the first encoded value and the second encoded value are different.
2. The apparatus as claimed in claim 1, characterized in that, The encoding and parsing unit is specifically used for: If it is determined that the state of at least one of the N encoders has changed, the output of the first encoded value is switched to the output of the second encoded value. The state change of the at least one encoder affects the rotation control of the code disk synchronization.
3. The apparatus as described in claim 2, characterized in that, The change in state includes at least one of the following: The encoder state corresponding to the first encoded value changes from a normal state to an abnormal state; The encoder with higher precision than the encoder corresponding to the first encoded value changes from an abnormal state to a normal state. The encoders other than the one corresponding to the first encoded value change from an abnormal state to a normal state.
4. The apparatus as described in claim 3, characterized in that, The abnormal state includes one or more of the following: Encoder damage, code disk aging, code disk dirt, code disk condensation, external strong magnetic field, demagnetization.
5. The apparatus according to any one of claims 1 to 4, characterized in that, The second encoded value is the encoded value of the encoder with the highest accuracy among the encoders in normal operating condition; or, The second encoded value is calculated based on the encoded values of multiple encoders in normal state.
6. The apparatus as claimed in any one of claims 1 to 5, characterized in that, The encoding and parsing unit is also used for: When all N encoders are in normal condition, the first encoded value is output. The first encoded value is the encoded value of the encoder with the highest accuracy among the N encoders, or it is calculated based on the encoded values of the N encoders.
7. The apparatus according to any one of claims 1 to 6, characterized in that, The encoding and parsing unit is specifically used for: When it is determined that the state of at least one of the N encoders has changed, the output of the second encoded value is switched; or... After determining that the state of at least one of the N encoders has changed, at the start of the next encoding, the system switches to outputting the second encoded value.
8. The apparatus as claimed in any one of claims 1 to 7, characterized in that, The encoding and parsing unit is also used for: When it is determined that at least one encoder is in an abnormal state, a message indicating that at least one encoder is in an abnormal state is sent to the mobile data center.
9. The apparatus as claimed in any one of claims 2 to 8, characterized in that, For each encoder, the encoding parsing unit determines the encoder's state in the following manner: Based on the electrical signals sent by the encoder, the correspondence between the encoder's encoded values and time is determined; If the second derivative of the corresponding relationship is less than or equal to a set threshold, the encoder is determined to be in a normal state; if the second derivative is greater than the set threshold, the encoder is determined to be in an abnormal state.
10. The apparatus according to any one of claims 1 to 9, characterized in that, The N encoders include at least one of photoelectric encoders, magnetic encoders, and inductive encoders.
11. A detection device, characterized in that, Includes the encoding device as described in any one of claims 1 to 10.
12. The apparatus as claimed in claim 11, characterized in that, The detection device also includes a motor and a motor control unit, and the code disks of the N encoders are all mounted on the motor; The motor control unit is used to control the rotation of the motor, and the rotation of the motor drives the code disks of the N encoders to rotate synchronously.
13. The apparatus as claimed in claim 12, characterized in that, The motor control unit is also used for: The system receives the encoded value output by the encoding and parsing unit and adjusts the rotation of the motor according to the encoded value.
14. The apparatus as claimed in claim 12 or 13, characterized in that, The detection device also includes a scanning component connected to the motor; The scanning component is used to scan the optical signal into the detection space as the motor rotates.
15. The apparatus as claimed in claim 14, characterized in that, The detection device also includes a transmitting component; The emitting component is used to emit a light beam toward the scanning component.
16. The apparatus as claimed in claim 15, characterized in that, The transmitting component is connected to the encoding and parsing unit; The transmitting component is also used to receive the encoded value output by the encoding and parsing unit, and adjust the transmitted beam according to the encoded value.
17. The apparatus as claimed in any one of claims 11 to 16, characterized in that, The detection device also includes a receiving component; The receiving component is used to receive the echo signal and parse the echo signal into an electrical signal.
18. The apparatus as claimed in claim 17, characterized in that, The detection device also includes a processing component; The processing component is used to generate point cloud data based on the electrical signals from the receiving component.
19. A terminal device, characterized in that, It includes the encoding device as described in any one of claims 1 to 10, or the detection device as described in any one of claims 11 to 18.