CN114440815A - Angle sensor correction method and device, electronic device and storage medium - Google Patents
Angle sensor correction method and device, electronic device and storage medium Download PDFInfo
- Publication number
- CN114440815A CN114440815A CN202210113732.6A CN202210113732A CN114440815A CN 114440815 A CN114440815 A CN 114440815A CN 202210113732 A CN202210113732 A CN 202210113732A CN 114440815 A CN114440815 A CN 114440815A
- Authority
- CN
- China
- Prior art keywords
- angle
- rotation angle
- rotation
- steering engine
- angle sensor
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Pending
Links
- 238000000034 method Methods 0.000 title claims abstract description 81
- 238000012937 correction Methods 0.000 title claims abstract description 47
- 230000006870 function Effects 0.000 claims description 62
- 238000006243 chemical reaction Methods 0.000 claims description 39
- 230000004044 response Effects 0.000 claims description 18
- 238000004590 computer program Methods 0.000 claims description 16
- 230000008569 process Effects 0.000 claims description 16
- 238000012546 transfer Methods 0.000 claims description 8
- 238000001514 detection method Methods 0.000 claims description 2
- 238000005259 measurement Methods 0.000 abstract description 11
- 238000012545 processing Methods 0.000 description 20
- 238000010586 diagram Methods 0.000 description 18
- 238000004891 communication Methods 0.000 description 11
- 230000008859 change Effects 0.000 description 9
- 238000005516 engineering process Methods 0.000 description 9
- 230000003287 optical effect Effects 0.000 description 5
- 230000005540 biological transmission Effects 0.000 description 4
- 230000003993 interaction Effects 0.000 description 4
- 230000005236 sound signal Effects 0.000 description 4
- 230000001133 acceleration Effects 0.000 description 2
- 239000000835 fiber Substances 0.000 description 2
- 238000010295 mobile communication Methods 0.000 description 2
- 230000001902 propagating effect Effects 0.000 description 2
- 239000004065 semiconductor Substances 0.000 description 2
- 230000003068 static effect Effects 0.000 description 2
- RYGMFSIKBFXOCR-UHFFFAOYSA-N Copper Chemical compound [Cu] RYGMFSIKBFXOCR-UHFFFAOYSA-N 0.000 description 1
- 230000009471 action Effects 0.000 description 1
- 238000003491 array Methods 0.000 description 1
- 230000001413 cellular effect Effects 0.000 description 1
- 230000000295 complement effect Effects 0.000 description 1
- 229910052802 copper Inorganic materials 0.000 description 1
- 239000010949 copper Substances 0.000 description 1
- 238000005538 encapsulation Methods 0.000 description 1
- 238000003384 imaging method Methods 0.000 description 1
- 238000009434 installation Methods 0.000 description 1
- 239000004973 liquid crystal related substance Substances 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 229910044991 metal oxide Inorganic materials 0.000 description 1
- 150000004706 metal oxides Chemical class 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 230000002093 peripheral effect Effects 0.000 description 1
Images
Classifications
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B21/00—Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
- G01B21/22—Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring angles or tapers; for testing the alignment of axes
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B21/00—Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
- G01B21/02—Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring length, width, or thickness
- G01B21/04—Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant for measuring length, width, or thickness by measuring coordinates of points
- G01B21/042—Calibration or calibration artifacts
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01B—MEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
- G01B7/00—Measuring arrangements characterised by the use of electric or magnetic techniques
- G01B7/30—Measuring arrangements characterised by the use of electric or magnetic techniques for measuring angles or tapers; for testing the alignment of axes
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Measurement Of Length, Angles, Or The Like Using Electric Or Magnetic Means (AREA)
Abstract
The present disclosure relates to an angle sensor calibration method and apparatus, an electronic device, and a storage medium, which determine at least one control information including a first rotation angle upon receiving a sensor calibration instruction. And executing each control message in sequence according to a preset sequence, and controlling the target steering engine to rotate by a first rotation angle in the current control message. And reading the value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle. And correcting the angle sensor according to each first rotation angle and each second rotation angle when at least one first rotation angle is different from the corresponding second rotation angle. The angle sensor can be corrected at any time when the angle measurement of the angle sensor of the steering engine deviates, the correction method is simple, and the angle sensor and the corresponding steering engine do not need to be disassembled.
Description
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to an angle sensor calibration method and apparatus, an electronic device, and a storage medium.
Background
In the use process of the steering engine, the angle can be controlled through the pulse width signal, but the angle information of the steering engine cannot be directly read. In some scenes in which the angle of the steering engine needs to be read, an angle sensor needs to be additionally installed on the steering engine. Steering wheel installation angle sensor usually with the steering wheel encapsulation together, angle sensor can take place physical position skew with the steering wheel under the condition such as take place to collide with, lead to the angle of reading to have the error. In the related art, when the angle sensor has errors, the steering engine shell needs to be disassembled to physically adjust the angle sensor, the process is complicated, the universality is not available, and the adjustment accuracy is not high.
Disclosure of Invention
The disclosure provides an angle sensor correction method and device, electronic equipment and a storage medium, and aims to accurately and simply correct an angle sensor of a steering engine.
According to a first aspect of the present disclosure, there is provided an angle sensor correction method, the method including:
in response to receiving the sensor calibration command, determining at least one control information comprising a first angle of rotation;
sequentially executing each piece of control information according to a preset sequence, and controlling a target steering engine to rotate by a first rotation angle in the current control information;
reading a value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle;
in response to at least one of the first rotation angles being different from the corresponding second rotation angle, correcting the angle sensor according to each of the first rotation angles and each of the second rotation angles.
In one possible implementation, the correcting the angle sensor according to each of the first rotation angles and each of the second rotation angles includes:
determining a conversion function according to the second rotation angle corresponding to each first rotation angle;
correcting the angle sensor according to the transfer function.
In one possible implementation, the method further includes:
detecting a third rotation angle of the target steering engine through the angle sensor in response to the detection that the target steering engine enters a manual editing state;
and converting the third rotation angle into a fourth rotation angle through the conversion function to obtain the actual rotation angle of the target steering engine.
In a possible implementation manner, the determining a conversion function according to the second rotation angle corresponding to each first rotation angle includes:
and performing linear fitting on each first rotating angle and the corresponding second rotating angle by a least square method to obtain a conversion function.
In one possible implementation, the method further includes:
storing the transfer function to an EEPROM.
In one possible implementation, the method further includes:
ending the angle sensor correction process in response to each of the first rotation angles being the same as the corresponding second rotation angle.
According to a second aspect of the present disclosure, there is provided an angle sensor correction apparatus, the apparatus including:
a control information determination module for determining at least one control information comprising a first angle of rotation in response to receiving a sensor calibration command;
the steering engine control module is used for sequentially executing each control message according to a preset sequence and controlling a target steering engine to rotate by a first rotation angle in the current control message;
the angle reading module is used for reading the value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle;
and the sensor correction module is used for correcting the angle sensor according to each first rotating angle and each second rotating angle in response to the fact that at least one first rotating angle is different from the corresponding second rotating angle.
In one possible implementation, the sensor correction module includes:
the function determining submodule is used for determining a conversion function according to the second rotating angle corresponding to each first rotating angle;
and the sensor correction submodule is used for correcting the angle sensor according to the conversion function.
In one possible implementation, the apparatus further includes:
the angle editing module is used for responding to the fact that the target steering engine is detected to enter a manual editing state, and detecting a third rotating angle of the target steering engine through the angle sensor;
and the angle conversion module is used for converting the third rotation angle into a fourth rotation angle through the conversion function to obtain the actual rotation angle of the target steering engine.
In one possible implementation, the function determining sub-module includes:
and the function determining subunit is used for performing linear fitting on each first rotation angle and the corresponding second rotation angle by a least square method to obtain a conversion function.
In one possible implementation, the apparatus further includes:
and the function storage module is used for storing the conversion function to the EEPROM.
In one possible implementation, the apparatus further includes:
and the correction completion module is used for responding to the condition that each first rotating angle is the same as the corresponding second rotating angle and finishing the angle sensor correction process.
According to a third aspect of the present disclosure, there is provided an electronic device comprising: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
According to a fourth aspect of the present disclosure, there is provided a computer readable storage medium having stored thereon computer program instructions which, when executed by a processor, implement the above-described method.
According to a fifth aspect of the present disclosure, there is provided a computer program product comprising computer readable code, or a non-transitory computer readable storage medium carrying computer readable code, which when run in an electronic device, implements the above method when executed by a processor in the electronic device.
In the embodiment of the disclosure, the angle sensor can be corrected at any time when the angle measurement of the angle sensor of the steering engine deviates, the correction method is simple, and the angle sensor and the corresponding steering engine do not need to be disassembled.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure. Other features and aspects of the present disclosure will become apparent from the following detailed description of exemplary embodiments, which proceeds with reference to the accompanying drawings.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and, together with the description, serve to explain the principles of the disclosure.
FIG. 1 shows a flow chart of a method of angle sensor calibration according to an embodiment of the present disclosure;
FIG. 2 shows a schematic diagram of a method of angle sensor calibration according to an embodiment of the present disclosure;
FIG. 3 shows a schematic diagram of an angle sensor calibration apparatus according to an embodiment of the present disclosure;
FIG. 4 shows a schematic diagram of an electronic device in accordance with an embodiment of the disclosure;
fig. 5 shows a schematic diagram of another electronic device according to an embodiment of the present disclosure.
Detailed Description
Various exemplary embodiments, features and aspects of the present disclosure will be described in detail below with reference to the accompanying drawings. In the drawings, like reference numbers can indicate functionally identical or similar elements. While the various aspects of the embodiments are presented in drawings, the drawings are not necessarily drawn to scale unless specifically indicated.
The word "exemplary" is used exclusively herein to mean "serving as an example, embodiment, or illustration. Any embodiment described herein as "exemplary" is not necessarily to be construed as preferred or advantageous over other embodiments.
The term "and/or" herein is merely an association describing an associated object, meaning that three relationships may exist, e.g., a and/or B, may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the term "at least one" herein means any one of a plurality or any combination of at least two of a plurality, for example, including at least one of A, B, C, and may mean including any one or more elements selected from the group consisting of A, B and C.
Furthermore, in the following detailed description, numerous specific details are set forth in order to provide a better understanding of the present disclosure. It will be understood by those skilled in the art that the present disclosure may be practiced without some of these specific details. In some instances, methods, means, elements and circuits that are well known to those skilled in the art have not been described in detail so as not to obscure the present disclosure.
In one possible implementation manner, the angle sensor correction method of the embodiment of the present disclosure can be executed by an electronic device such as a terminal device or a server. The terminal device may be any fixed or mobile device such as a User Equipment (UE), a mobile device, a User terminal, a cellular phone, a cordless phone, a Personal Digital Assistant (PDA), a handheld device, a computing device, a vehicle-mounted device, a wearable device, and a control device built in a toy robot. The server may be a single server or a server cluster of multiple servers. Any electronic device may implement the angle sensor correction method of the disclosed embodiments by way of a processor invoking computer readable instructions stored in a memory.
The angle sensor correction method can be used for correcting the angle sensor of any steering engine, for example, correcting the angle sensor which is installed in a toy robot and used for detecting the rotation angle of the steering engine for controlling the rotation of each joint of the robot. When the angle sensor of the steering engine in the toy robot is corrected, the electronic equipment can be control equipment which is connected with the angle sensor and the steering engine in the toy robot, or can also be a server which is in communication connection with the control equipment which is connected with the angle sensor and the steering engine.
Fig. 1 shows a flow chart of a method of angle sensor calibration according to an embodiment of the present disclosure. As shown in fig. 1, the angle sensor correction method of the embodiment of the present disclosure may include the following steps S10-S40.
Step S10, in response to receiving the sensor calibration command, determines at least one control information including the first rotation angle.
In a possible implementation manner, the sensor correction instruction is used for controlling the electronic device to start an angle sensor correction process, and may be sent by another device connected to the electronic device, such as a user terminal, or generated by a manner in which a user triggers a button or other control on the electronic device. The following description will be given by taking an example in which the angle sensor of the steering engine in the toy robot according to the embodiment of the present disclosure is corrected, and the electronic device that executes the angle sensor correction method according to the embodiment of the present disclosure is a control device in the toy robot. The user may send sensor calibration instructions to the electronic device through a toy robot control application installed on the user terminal. Alternatively, the user may also send the sensor correction instruction by directly triggering a correction button on the toy robot or triggering a correction control displayed on a display device mounted on the toy robot to send the sensor correction instruction.
Optionally, the sensor correction instruction may be automatically generated by the electronic device when the electronic device detects that the accuracy of the angle sensor may be affected, for example, by a collision of the angle sensor and/or a connected steering engine. Or the steering engine angle detected by the angle sensor and the steering engine rotation angle indicated by the electronic equipment are different, and the steering engine angle is automatically generated by the electronic equipment.
Further, the electronic device determines at least one piece of control information after receiving the sensor correction instruction, wherein each piece of control information comprises a first rotation angle. The electronic device can preset and store at least one piece of control information with an execution sequence, and directly obtain the control information in a local database or a connected remote database after receiving a sensor correction instruction. Or, after receiving the sensor correction instruction, the electronic device may notify the user of sending the at least one control information in a text message or voice broadcast manner, and then the user inputs the at least one control information according to the user terminal used and sends the at least one control information to the electronic device. Or, the user can also send at least one piece of control information in a mode of directly performing man-machine interaction with the electronic equipment. The content of the control information may be "30 ° counterclockwise" or "15 ° clockwise", for example.
And S20, sequentially executing each control information according to a preset sequence, and controlling a target steering engine to rotate by a first rotation angle in the current control information.
In a possible implementation manner, after determining the plurality of control information, the electronic device may sequentially execute each control information according to a preset sequence, that is, sequentially control the target steering engine to rotate by the first rotation angle according to each control information. The preset sequence may be an execution sequence corresponding to each predetermined control information. For example, when the user sends the control information in a human-computer interaction manner, the execution sequence corresponding to each piece of control information may be sent at the same time, or the electronic device may store the execution sequence corresponding to each piece of control information at the same time. When the control information determined by the electronic device includes "control information 1", "control information 2", and "control information 3", and the execution order corresponding to each control information is sequentially 2, 3, and 1, "control information 3", "control information 1", and "control information 2" may be sequentially executed.
Further, the execution order of each control information may also be a determined order of each control information. For example, when "control information 1", "control information 2", and "control information 3" are determined in order, "control information 1", "control information 2", and "control information 3" may be executed in order.
Optionally, the electronic device may execute the control information by sequentially controlling the target steering engines to rotate by the first rotation angle included in each piece of control information, or by sequentially sending a control instruction including the first rotation angle to a device capable of controlling the target steering engines to rotate, and controlling the target steering engines to rotate by the device receiving the control instruction.
And S30, reading the value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle.
In a possible implementation manner, after the electronic device executes the control information each time to control the target steering engine to rotate, the value of the angle sensor connected to the target steering engine is read to obtain the second rotation angle. Optionally, the second rotation angle is obtained by detecting a rotation angle of the target steering engine by the angle sensor. Therefore, the second rotation angle corresponding to the first rotation angle in each control information is obtained. In order to reduce the possibility of deviation in the reading process of the second rotating angle, the target steering engine is not controlled to rotate by electronic equipment during each time of reading the second rotating angle, and meanwhile, the target steering engine is not manually controlled to rotate in a physical mode.
Alternatively, the angle sensor may be any sensor capable of detecting an angle, such as a rheostat type angle sensor that changes the measurement of the amount of change in the angle of the target steering gear to a measurement of a change in resistance, an area change type capacitance angle sensor that changes the measurement of the amount of change in the angle of the target steering gear to a measurement of a change in capacitance, a magnetoresistive angle sensor that changes the measurement of the amount of change in the angle of the target steering gear to a measurement of an induced electromotive force change, and the like.
Step S40, in response to at least one of the first rotation angles being different from the corresponding second rotation angle, correcting the angle sensor according to each of the first rotation angles and each of the second rotation angles.
In a possible implementation manner, the first rotation angle and the corresponding second rotation angle in each control information are compared, and when at least one first rotation angle is different from the corresponding second rotation angle, it is determined that a deviation occurs in the measurement of the current angle sensor, and the angle sensor needs to be corrected. Alternatively, when each first rotation angle is the same as the second rotation angle, it may be determined that the measurement of the current angle sensor is not deviated, and the correction of the angle sensor is not required. That is, the angle sensor may be corrected according to each first rotation angle and each second rotation angle in response to at least one first rotation angle being different from a corresponding second rotation angle. In response to each first angle of rotation being the same as the corresponding second angle of rotation, the angle sensor correction process ends.
Alternatively, the process of correcting the angle sensor according to each first rotation angle and each second rotation angle may determine a conversion function for the second rotation angle corresponding to each first rotation angle, and correct the angle sensor according to the conversion function. The determination of the conversion function may be to perform linear fitting on each first rotation angle and the corresponding second rotation angle by a least square method to obtain the conversion function. That is, the conversion function is obtained by using x as the plurality of first rotation angles and y as the second rotation angle corresponding to each first rotation angle, and by performing straight line fitting by the least square method to obtain y ═ ax + b. Further, after obtaining the conversion function, the conversion function may be stored in the electronic device, or in an EEPROM (Electrically Erasable Programmable read only memory) connected to the electronic device, for correcting the angle sensor. When the electronic device of the embodiment of the disclosure is used for correcting the angle sensor of at least one steering engine, or the EEPROM is used for storing the conversion function transmitted by at least one electronic device, the EEPROM is also used for storing the identification information of the angle sensor and/or the steering engine corresponding to each conversion function.
FIG. 2 shows a schematic diagram of a method of angle sensor calibration according to an embodiment of the present disclosure. As shown in fig. 2, the angle sensor calibration method of the embodiment of the present disclosure starts when a calibration instruction 20 is received. That is, the electronic device sequentially acquires at least one piece of control information after receiving the correction instruction 20, and the number of pieces of control information acquired by the electronic device may be preset. For example, when N pieces of control information need to be acquired for angle sensor correction, a variable i with an initial value of 1 is determined, control information i21 is acquired, a first rotation angle included in the control information i21 is determined, a target steering engine is adjusted according to the first rotation angle, readings of an angle sensor connected with the target steering engine are read, and a corresponding second rotation angle is obtained. That is, after the control information i21 is determined, the first rotation angle and the second rotation angle 22 corresponding to the control information i21 are determined. Further, the values of i and N are compared to determine if i is less than N23. When i is less than N, i +1 is updated with the value 24 of i, and the current control information i21 is determined again. And when i is not less than N, further judging whether the first rotation angle is different from the corresponding second rotation angle by 25, and when at least one first rotation angle is different from the corresponding second rotation angle, determining that the current angle sensor has deviation and needs to be corrected, namely determining a conversion function 26 according to each first rotation angle and the corresponding second rotation angle. When there is no first angle of rotation and the corresponding second angle of rotation that are different, it is determined that there is no deviation for the current angle sensor, and the correction process 27 ends. Alternatively, the conversion function 26 may also be determined directly without comparing the second rotation angle and the first rotation angle after comparing the values of i and N.
In one possible implementation, after determining the transfer function, the embodiments of the present disclosure correct the angle sensor according to the transfer function. The calibration process of the angle sensor is performed each time when the rotation angle of the target steering engine needs to be acquired. When the target steering engine is controlled to rotate by the control information, the rotating angle of the target steering engine can be directly determined according to the first rotating angle in the control information, and the value of the angle sensor does not need to be read. It is therefore only necessary to correct the values read by the angle sensors by means of a transfer function when manually turning the target steering engine angle. For example, when the target steering gear is a steering gear for controlling the rotation of the toy robot joint, the rotation angle of the target steering gear may be read by an angle sensor of the target steering gear when the user manually breaks the toy robot joint.
Alternatively, the process of correcting the angle sensor according to the conversion function may be to detect a third rotation angle of the target steering engine by the angle sensor in response to detecting that the target steering engine enters the manual editing state. The third rotation angle is a rotation angle with deviation, and the third rotation angle needs to be converted into a fourth rotation angle through a conversion function, so that the actual rotation angle of the target steering engine is obtained. When the process of determining the conversion function is to use the plurality of first rotation angles as x, use the second rotation angle corresponding to each first rotation angle as y, and obtain the conversion function y ═ ax + b through least square linear fitting, the third rotation angle may be used as y to input the conversion function to solve, so that the corresponding x is the fourth rotation angle.
Further, when at least one conversion function and identification information of the angle sensor and/or the steering engine corresponding to each conversion function are stored in the electronic device or the EEPROM, after a steering engine is detected to enter a manual editing state, a third rotation angle of the steering engine is detected through the angle sensor connected with the steering engine. Further, a conversion function corresponding to the identification information is determined in the electronic device or the EEPROM according to the identification information of the steering engine or the angle sensor connected with the steering engine, and then the third rotation angle is converted into a fourth rotation angle according to the conversion function.
The angle sensor can be corrected at any time when the angle measurement of the angle sensor of the steering engine deviates, the correction method is simple, the angle sensor and the corresponding steering engine do not need to be disassembled, and based on the simple correction method, the efficiency of the correction process of the angle sensor can be improved. Under the application scene that the steering wheel is used for controlling the rotation of toy robot joint, the user can carry out the simple angle sensor of step in real time at the in-process that uses toy robot and rectify, need not to disassemble toy robot, has improved user experience.
It is understood that the above-mentioned method embodiments of the present disclosure can be combined with each other to form a combined embodiment without departing from the logic of the principle, which is limited by the space, and the detailed description of the present disclosure is omitted. Those skilled in the art will appreciate that in the above methods of the specific embodiments, the specific order of execution of the steps should be determined by their function and possibly their inherent logic.
In addition, the present disclosure also provides an angle sensor calibration apparatus, an electronic device, a computer-readable storage medium, and a program, which can be used to implement any one of the angle sensor calibration methods provided by the present disclosure, and the corresponding technical solutions and descriptions and corresponding descriptions in the methods section are omitted for brevity.
Fig. 3 shows a schematic diagram of an angle sensor correction device according to an embodiment of the present disclosure, and as shown in fig. 3, the angle sensor correction device according to an embodiment of the present disclosure may include a control information determination module 30, a steering engine control module 31, an angle reading module 32, and a sensor correction module 33.
A control information determination module 30 for determining at least one control information comprising a first rotation angle in response to receiving a sensor calibration command;
the steering engine control module 31 is configured to sequentially execute each control information according to a preset sequence, and control a target steering engine to rotate by a first rotation angle in the current control information;
the angle reading module 32 is used for reading a value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle;
a sensor correction module 33, configured to correct the angle sensor according to each of the first rotation angles and each of the second rotation angles in response to that at least one of the first rotation angles is different from the corresponding second rotation angle.
In one possible implementation, the sensor correction module includes:
the function determining submodule is used for determining a conversion function according to the second rotating angle corresponding to each first rotating angle;
and the sensor correction submodule is used for correcting the angle sensor according to the conversion function.
In one possible implementation, the apparatus further includes:
the angle editing module is used for responding to the fact that the target steering engine is detected to enter a manual editing state, and detecting a third rotating angle of the target steering engine through the angle sensor;
and the angle conversion module is used for converting the third rotation angle into a fourth rotation angle through the conversion function to obtain the actual rotation angle of the target steering engine.
In one possible implementation, the function determining sub-module includes:
and the function determining subunit is used for performing linear fitting on each first rotation angle and the corresponding second rotation angle by a least square method to obtain a conversion function.
In one possible implementation, the apparatus further includes:
and the function storage module is used for storing the conversion function to the EEPROM.
In one possible implementation, the apparatus further includes:
and the correction completion module is used for responding to the condition that each first rotating angle is the same as the corresponding second rotating angle and finishing the angle sensor correction process.
In some embodiments, functions of or modules included in the apparatus provided in the embodiments of the present disclosure may be used to execute the method described in the above method embodiments, and specific implementation thereof may refer to the description of the above method embodiments, and for brevity, will not be described again here.
Embodiments of the present disclosure also provide a computer-readable storage medium having stored thereon computer program instructions, which when executed by a processor, implement the above-mentioned method. The computer readable storage medium may be a volatile or non-volatile computer readable storage medium.
An embodiment of the present disclosure further provides an electronic device, including: a processor; a memory for storing processor-executable instructions; wherein the processor is configured to invoke the memory-stored instructions to perform the above-described method.
The disclosed embodiments also provide a computer program product comprising computer readable code or a non-transitory computer readable storage medium carrying computer readable code, which when run in a processor of an electronic device, the processor in the electronic device performs the above method.
The electronic device may be provided as a terminal, server, or other form of device.
Fig. 4 shows a schematic diagram of an electronic device 800 according to an embodiment of the disclosure. For example, the electronic device 800 may be a mobile phone, a computer, a digital broadcast terminal, a messaging device, a game console, a tablet device, a medical device, a fitness device, a personal digital assistant, or the like terminal.
Referring to fig. 4, electronic device 800 may include one or more of the following components: a processing component 802, a memory 804, a power component 806, a multimedia component 808, an audio component 810, an input/output (I/O) interface 812, a sensor component 814, and a communication component 816.
The processing component 802 generally controls overall operation of the electronic device 800, such as operations associated with display, telephone calls, data communications, camera operations, and recording operations. The processing components 802 may include one or more processors 820 to execute instructions to perform all or a portion of the steps of the methods described above. Further, the processing component 802 can include one or more modules that facilitate interaction between the processing component 802 and other components. For example, the processing component 802 can include a multimedia module to facilitate interaction between the multimedia component 808 and the processing component 802.
The memory 804 is configured to store various types of data to support operations at the electronic device 800. Examples of such data include instructions for any application or method operating on the electronic device 800, contact data, phonebook data, messages, pictures, videos, and so forth. The memory 804 may be implemented by any type or combination of volatile or non-volatile memory devices such as Static Random Access Memory (SRAM), electrically erasable programmable read-only memory (EEPROM), erasable programmable read-only memory (EPROM), programmable read-only memory (PROM), read-only memory (ROM), magnetic memory, flash memory, magnetic or optical disks.
The power supply component 806 provides power to the various components of the electronic device 800. The power components 806 may include a power management system, one or more power supplies, and other components associated with generating, managing, and distributing power for the electronic device 800.
The multimedia component 808 includes a screen that provides an output interface between the electronic device 800 and a user. In some embodiments, the screen may include a Liquid Crystal Display (LCD) and a Touch Panel (TP). If the screen includes a touch panel, the screen may be implemented as a touch screen to receive an input signal from a user. The touch panel includes one or more touch sensors to sense touch, slide, and gestures on the touch panel. The touch sensor may not only sense the boundary of a touch or slide action, but also detect the duration and pressure associated with the touch or slide operation. In some embodiments, the multimedia component 808 includes a front facing camera and/or a rear facing camera. The front camera and/or the rear camera may receive external multimedia data when the electronic device 800 is in an operation mode, such as a shooting mode or a video mode. Each front camera and rear camera may be a fixed optical lens system or have a focal length and optical zoom capability.
The audio component 810 is configured to output and/or input audio signals. For example, the audio component 810 includes a Microphone (MIC) configured to receive external audio signals when the electronic device 800 is in an operational mode, such as a call mode, a recording mode, and a voice recognition mode. The received audio signals may further be stored in the memory 804 or transmitted via the communication component 816. In some embodiments, audio component 810 also includes a speaker for outputting audio signals.
The I/O interface 812 provides an interface between the processing component 802 and peripheral interface modules, which may be keyboards, click wheels, buttons, etc. These buttons may include, but are not limited to: a home button, a volume button, a start button, and a lock button.
The sensor assembly 814 includes one or more sensors for providing various aspects of state assessment for the electronic device 800. For example, the sensor assembly 814 may detect an open/closed state of the electronic device 800, the relative positioning of components, such as a display and keypad of the electronic device 800, the sensor assembly 814 may also detect a change in the position of the electronic device 800 or a component of the electronic device 800, the presence or absence of user contact with the electronic device 800, orientation or acceleration/deceleration of the electronic device 800, and a change in the temperature of the electronic device 800. Sensor assembly 814 may include a proximity sensor configured to detect the presence of a nearby object without any physical contact. The sensor assembly 814 may also include a light sensor, such as a Complementary Metal Oxide Semiconductor (CMOS) or Charge Coupled Device (CCD) image sensor, for use in imaging applications. In some embodiments, the sensor assembly 814 may also include an acceleration sensor, a gyroscope sensor, a magnetic sensor, a pressure sensor, or a temperature sensor.
The communication component 816 is configured to facilitate wired or wireless communication between the electronic device 800 and other devices. The electronic device 800 may access a wireless network based on a communication standard, such as a wireless network (WiFi), a second generation mobile communication technology (2G) or a third generation mobile communication technology (3G), or a combination thereof. In an exemplary embodiment, the communication component 816 receives a broadcast signal or broadcast related information from an external broadcast management system via a broadcast channel. In an exemplary embodiment, the communication component 816 further includes a Near Field Communication (NFC) module to facilitate short-range communications. For example, the NFC module may be implemented based on Radio Frequency Identification (RFID) technology, infrared data association (IrDA) technology, Ultra Wideband (UWB) technology, Bluetooth (BT) technology, and other technologies.
In an exemplary embodiment, the electronic device 800 may be implemented by one or more Application Specific Integrated Circuits (ASICs), Digital Signal Processors (DSPs), Digital Signal Processing Devices (DSPDs), Programmable Logic Devices (PLDs), Field Programmable Gate Arrays (FPGAs), controllers, micro-controllers, microprocessors, or other electronic components for performing the above-described methods.
In an exemplary embodiment, a non-transitory computer-readable storage medium, such as the memory 804, is also provided that includes computer program instructions executable by the processor 820 of the electronic device 800 to perform the above-described methods.
Fig. 5 shows a schematic diagram of an electronic device 1900 according to an embodiment of the disclosure. For example, the electronic device 1900 may be provided as a server. Referring to fig. 5, electronic device 1900 includes a processing component 1922 further including one or more processors and memory resources, represented by memory 1932, for storing instructions, e.g., applications, executable by processing component 1922. The application programs stored in memory 1932 may include one or more modules that each correspond to a set of instructions. Further, the processing component 1922 is configured to execute instructions to perform the above-described method.
The electronic device 1900 may also include a power component 1926 configured to perform power management of the electronic device 1900, a wired or wireless network interface 1950 configured to connect the electronic device 1900 to a network, and an input/output (I/O) interface 1958. The electronic device 1900 may operate based on an operating system, such as the Microsoft Server operating system (Windows Server), stored in the memory 1932TM) Apple Inc. of a graphical user interface based operating system (Mac OS X)TM) Multi-user, multi-process computer operating system (Unix)TM) Free and open native code Unix-like operating System (Linux)TM) Open native code Unix-like operating System (FreeBSD)TM) Or the like.
In an exemplary embodiment, a non-transitory computer readable storage medium, such as the memory 1932, is also provided that includes computer program instructions executable by the processing component 1922 of the electronic device 1900 to perform the above-described methods.
The present disclosure may be systems, methods, and/or computer program products. The computer program product may include a computer-readable storage medium having computer-readable program instructions embodied thereon for causing a processor to implement various aspects of the present disclosure.
The computer readable storage medium may be a tangible device that can hold and store the instructions for use by the instruction execution device. The computer readable storage medium may be, for example, but is not limited to, an electronic memory device, a magnetic memory device, an optical memory device, an electromagnetic memory device, a semiconductor memory device, or any suitable combination of the foregoing. More specific examples (a non-exhaustive list) of the computer readable storage medium would include the following: a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), a Static Random Access Memory (SRAM), a portable compact disc read-only memory (CD-ROM), a Digital Versatile Disc (DVD), a memory stick, a floppy disk, a mechanical coding device, such as punch cards or in-groove projection structures having instructions stored thereon, and any suitable combination of the foregoing. Computer-readable storage media as used herein is not to be construed as transitory signals per se, such as radio waves or other freely propagating electromagnetic waves, electromagnetic waves propagating through a waveguide or other transmission medium (e.g., optical pulses through a fiber optic cable), or electrical signals transmitted through electrical wires.
The computer-readable program instructions described herein may be downloaded from a computer-readable storage medium to a respective computing/processing device, or to an external computer or external storage device via a network, such as the internet, a local area network, a wide area network, and/or a wireless network. The network may include copper transmission cables, fiber optic transmission, wireless transmission, routers, firewalls, switches, gateway computers and/or edge servers. The network adapter card or network interface in each computing/processing device receives computer-readable program instructions from the network and forwards the computer-readable program instructions for storage in a computer-readable storage medium in the respective computing/processing device.
The computer program instructions for carrying out operations of the present disclosure may be assembler instructions, Instruction Set Architecture (ISA) instructions, machine-related instructions, microcode, firmware instructions, state setting data, or source or object code written in any combination of one or more programming languages, including an object oriented programming language such as Smalltalk, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The computer-readable program instructions may execute entirely on the user's computer, partly on the user's computer, as a stand-alone software package, partly on the user's computer and partly on a remote computer or entirely on the remote computer or server. In the case of a remote computer, the remote computer may be connected to the user's computer through any type of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or the connection may be made to an external computer (for example, through the Internet using an Internet service provider). In some embodiments, the electronic circuitry that can execute the computer-readable program instructions implements aspects of the present disclosure by utilizing the state information of the computer-readable program instructions to personalize the electronic circuitry, such as a programmable logic circuit, a Field Programmable Gate Array (FPGA), or a Programmable Logic Array (PLA).
Various aspects of the present disclosure are described herein with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems) and computer program products according to embodiments of the disclosure. It will be understood that each block of the flowchart illustrations and/or block diagrams, and combinations of blocks in the flowchart illustrations and/or block diagrams, can be implemented by computer-readable program instructions.
These computer-readable program instructions may be provided to a processor of a general purpose computer, special purpose computer, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions/acts specified in the flowchart and/or block diagram block or blocks. These computer-readable program instructions may also be stored in a computer-readable storage medium that can direct a computer, programmable data processing apparatus, and/or other devices to function in a particular manner, such that the computer-readable medium storing the instructions comprises an article of manufacture including instructions which implement the function/act specified in the flowchart and/or block diagram block or blocks.
The computer readable program instructions may also be loaded onto a computer, other programmable data processing apparatus, or other devices to cause a series of operational steps to be performed on the computer, other programmable apparatus or other devices to produce a computer implemented process such that the instructions which execute on the computer, other programmable apparatus or other devices implement the functions/acts specified in the flowchart and/or block diagram block or blocks.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present disclosure. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of instructions, which comprises one or more executable instructions for implementing the specified logical function(s). In some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The computer program product may be embodied in hardware, software or a combination thereof. In an alternative embodiment, the computer program product is embodied in a computer storage medium, and in another alternative embodiment, the computer program product is embodied in a Software product, such as a Software Development Kit (SDK), or the like.
Having described embodiments of the present disclosure, the foregoing description is intended to be exemplary, not exhaustive, and not limited to the disclosed embodiments. Many modifications and variations will be apparent to those of ordinary skill in the art without departing from the scope and spirit of the described embodiments. The terminology used herein is chosen in order to best explain the principles of the embodiments, the practical application, or improvements made to the technology in the marketplace, or to enable others of ordinary skill in the art to understand the embodiments disclosed herein.
Claims (10)
1. A method of calibrating an angle sensor, the method comprising:
in response to receiving the sensor calibration command, determining at least one control information comprising a first angle of rotation;
sequentially executing each piece of control information according to a preset sequence, and controlling a target steering engine to rotate by a first rotation angle in the current control information;
reading the value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle;
in response to at least one of the first rotation angles being different from the corresponding second rotation angle, correcting the angle sensor according to each of the first rotation angles and each of the second rotation angles.
2. The method of claim 1, wherein said correcting said angle sensor according to each of said first rotation angles and each of said second rotation angles comprises:
determining a conversion function according to the second rotation angle corresponding to each first rotation angle;
correcting the angle sensor according to the transfer function.
3. The method of claim 2, further comprising:
detecting a third rotation angle of the target steering engine through the angle sensor in response to the detection that the target steering engine enters a manual editing state;
and converting the third rotation angle into a fourth rotation angle through the conversion function to obtain the actual rotation angle of the target steering engine.
4. The method according to claim 2 or 3, wherein said determining a transfer function from said second rotation angle for each said first rotation angle comprises:
and performing linear fitting on each first rotating angle and the corresponding second rotating angle by a least square method to obtain a conversion function.
5. The method according to any one of claims 2-4, further comprising:
storing the transfer function to an EEPROM.
6. The method according to any one of claims 1-5, further comprising:
ending the angle sensor correction process in response to each of the first rotation angles being the same as the corresponding second rotation angle.
7. An angle sensor correction device, characterized in that the device comprises:
a control information determination module for determining at least one control information comprising a first angle of rotation in response to receiving a sensor calibration command;
the steering engine control module is used for sequentially executing each control message according to a preset sequence and controlling a target steering engine to rotate by a first rotation angle in the current control message;
the angle reading module is used for reading the value of an angle sensor connected with the target steering engine to obtain a second rotation angle corresponding to the current first rotation angle;
and the sensor correction module is used for responding to the difference between at least one first rotation angle and the corresponding second rotation angle and correcting the angle sensor according to each first rotation angle and each second rotation angle.
8. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor is configured to invoke the memory-stored instructions to perform the method of any of claims 1 to 6.
9. A computer readable storage medium having computer program instructions stored thereon, which when executed by a processor implement the method of any one of claims 1 to 6.
10. A computer program product comprising computer readable code or a non-transitory computer readable storage medium carrying computer readable code which, when run in an electronic device, causes a processor in the electronic device to perform the method of any of claims 1 to 6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210113732.6A CN114440815A (en) | 2022-01-30 | 2022-01-30 | Angle sensor correction method and device, electronic device and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202210113732.6A CN114440815A (en) | 2022-01-30 | 2022-01-30 | Angle sensor correction method and device, electronic device and storage medium |
Publications (1)
Publication Number | Publication Date |
---|---|
CN114440815A true CN114440815A (en) | 2022-05-06 |
Family
ID=81371366
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202210113732.6A Pending CN114440815A (en) | 2022-01-30 | 2022-01-30 | Angle sensor correction method and device, electronic device and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN114440815A (en) |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110561422A (en) * | 2019-08-14 | 2019-12-13 | 深圳市优必选科技股份有限公司 | Method and device for calibrating joints of robot and robot |
CN111376256A (en) * | 2018-12-29 | 2020-07-07 | 深圳市优必选科技有限公司 | Steering engine angle calibration method and system, robot and storage medium |
-
2022
- 2022-01-30 CN CN202210113732.6A patent/CN114440815A/en active Pending
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN111376256A (en) * | 2018-12-29 | 2020-07-07 | 深圳市优必选科技有限公司 | Steering engine angle calibration method and system, robot and storage medium |
CN110561422A (en) * | 2019-08-14 | 2019-12-13 | 深圳市优必选科技股份有限公司 | Method and device for calibrating joints of robot and robot |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP3076716A1 (en) | Method and apparatus for network access | |
EP3147819A1 (en) | Method and device for fingerprint image alignment | |
CN111323007B (en) | Positioning method and device, electronic equipment and storage medium | |
EP3136699A1 (en) | Method and device for connecting external equipment | |
EP3096565A1 (en) | Method and apparatus for accessing wireless network by terminal device | |
CN112465843A (en) | Image segmentation method and device, electronic equipment and storage medium | |
CN109947981B (en) | Video sharing method and device | |
CN114019473A (en) | Object detection method and device, electronic equipment and storage medium | |
EP3147802B1 (en) | Method and apparatus for processing information | |
CN104469167A (en) | Automatic focusing method and device | |
EP3232301B1 (en) | Mobile terminal and virtual key processing method | |
CN111563138B (en) | Positioning method and device, electronic equipment and storage medium | |
CN107508573B (en) | Crystal oscillator oscillation frequency correction method and device | |
CN108495168B (en) | Bullet screen information display method and device | |
CN111928953A (en) | Temperature measuring method and device, electronic equipment and storage medium | |
EP3173912A1 (en) | Method and apparatus for processing point-reporting of touchscreen | |
CN112541971A (en) | Point cloud map construction method and device, electronic equipment and storage medium | |
EP3142337A1 (en) | Method and apparatus for installing application and smart device using them | |
CN112950712B (en) | Positioning method and device, electronic equipment and storage medium | |
CN113807253A (en) | Face recognition method and device, electronic equipment and storage medium | |
US20220294989A1 (en) | Method and apparatus for processing image | |
CN109992503B (en) | Automatic testing method and device | |
CN112102300A (en) | Counting method and device, electronic equipment and storage medium | |
CN110221813B (en) | Application data connection establishment method and device, storage medium and electronic equipment | |
CN114003542B (en) | Signal conditioner, signal conditioning method, electronic device, and storage medium |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
RJ01 | Rejection of invention patent application after publication | ||
RJ01 | Rejection of invention patent application after publication |
Application publication date: 20220506 |