CN113970312A - Angle detection method, angle detection device, computer program product and storage medium - Google Patents

Angle detection method, angle detection device, computer program product and storage medium Download PDF

Info

Publication number
CN113970312A
CN113970312A CN202111104512.9A CN202111104512A CN113970312A CN 113970312 A CN113970312 A CN 113970312A CN 202111104512 A CN202111104512 A CN 202111104512A CN 113970312 A CN113970312 A CN 113970312A
Authority
CN
China
Prior art keywords
detected
equipment
direction value
angle
driving motor
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
Application number
CN202111104512.9A
Other languages
Chinese (zh)
Inventor
陈永泽
霍紫健
杨军杰
战航
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Hengtian Weiyan Technology Co ltd
Original Assignee
Shenzhen Hengtian Weiyan Technology Co ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Shenzhen Hengtian Weiyan Technology Co ltd filed Critical Shenzhen Hengtian Weiyan Technology Co ltd
Priority to CN202111104512.9A priority Critical patent/CN113970312A/en
Publication of CN113970312A publication Critical patent/CN113970312A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G01MEASURING; TESTING
    • G01BMEASURING LENGTH, THICKNESS OR SIMILAR LINEAR DIMENSIONS; MEASURING ANGLES; MEASURING AREAS; MEASURING IRREGULARITIES OF SURFACES OR CONTOURS
    • G01B21/00Measuring arrangements or details thereof, where the measuring technique is not covered by the other groups of this subclass, unspecified or not relevant
    • G01B21/22Measuring 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

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Control Of Electric Motors In General (AREA)

Abstract

The invention discloses an angle detection method, an angle detection device, a computer program product and a storage medium, wherein the method comprises the following steps: the method comprises the steps of obtaining an initial direction value of the equipment to be detected, and controlling a driving motor to rotate by a preset angle, wherein the driving motor is used for driving the equipment to be detected to synchronously rotate; after the driving motor rotates the preset angle, acquiring a current direction value of the equipment to be detected; determining a target direction value of the equipment to be detected corresponding to the preset angle; according to the technical scheme, the detection result of the equipment to be detected is determined according to the target direction value, the initial direction value and the current direction value, the problem that errors exist in data reading due to the fact that the equipment to be detected is interfered by a magnetic field in the prior art is solved, and the measurement precision of the equipment to be detected is improved through the technical scheme.

Description

Angle detection method, angle detection device, computer program product and storage medium
Technical Field
The present invention relates to the field of testing technologies, and in particular, to an angle detection method, an angle detection apparatus, a computer program product, and a storage medium.
Background
With the development of scientific technology, electronic compasses and angle sensors are increasingly used in consumer electronics. The methods mainly adopted for the measurement of the electronic compass and the angle sensor in the related art include: compass comparison, mechanical tool and electric tool, however, when the measured data of the electronic compass and the angle sensor to be measured are read, the electronic compass and the angle sensor are influenced by magnetic field interference, which causes a large error between the read data and the actual data.
Disclosure of Invention
The embodiment of the application aims to improve the measurement precision of equipment to be detected by providing an angle detection method, angle detection equipment, a computer program product and a storage medium.
The embodiment of the application provides an angle detection method, which comprises the following steps:
the method comprises the steps of obtaining an initial direction value of the equipment to be detected, and controlling a driving motor to rotate by a preset angle, wherein the driving motor is used for driving the equipment to be detected to synchronously rotate;
after the driving motor rotates the preset angle, acquiring a current direction value of the equipment to be detected;
determining a target direction value of the equipment to be detected corresponding to the preset angle;
and determining the detection result of the equipment to be detected according to the target direction value, the initial direction value and the current direction value.
In an embodiment, the step of determining the target direction value of the device to be detected corresponding to the preset angle includes:
acquiring the number of pulses required by the driving motor to rotate by the preset angle;
and determining the target direction value of the equipment to be detected according to the initial direction value of the equipment to be detected and the pulse number.
In an embodiment, after the step of determining the detection result of the device to be detected according to the target direction value, the initial direction value, and the current direction value, the method further includes:
determining the current direction variation of the equipment to be detected according to the initial direction value of the equipment to be detected and the current direction value of the equipment to be detected;
determining the offset corresponding to the equipment to be detected according to the target direction value of the equipment to be detected and the current direction variation of the equipment to be detected;
and checking the detection result according to the offset.
In an embodiment, the step of determining the offset corresponding to the device to be detected according to the target direction value of the device to be detected and the current direction variation corresponding to the device to be detected includes:
acquiring a difference value between the current direction variation of the equipment to be detected and the target direction variation of the equipment to be detected;
and determining the offset of the equipment to be detected according to the difference.
In an embodiment, after the step of determining the detection result of the device to be detected according to the target direction value, the initial direction value, and the current direction value, the step includes:
acquiring a mapping relation between the current direction variation of the equipment to be detected and the rotation angle of a driving motor at unit time intervals;
and generating a detection result of the equipment to be detected based on the mapping relation.
In an embodiment, the step of obtaining an initial direction value of the device to be detected and controlling the driving motor to rotate by a preset angle includes:
and establishing a communication connection relation between the driving motor and the equipment to be detected so as to obtain an initial direction value of the equipment to be detected according to the communication connection relation.
In an embodiment, the step of obtaining the current direction value of the device to be detected after the driving motor rotates the preset angle includes:
generating an acquisition instruction after the driving motor rotates by the preset angle;
and acquiring the current direction value of the equipment to be detected according to the acquisition instruction and the communication connection relation.
Further, to achieve the above object, the present invention also provides an angle detection apparatus including: the angle detection method comprises a memory, a processor and an angle detection program which is stored on the memory and can run on the processor, wherein the angle detection program realizes the steps of the angle detection method when being executed by the processor.
In addition, to achieve the above object, the present invention also provides a computer program product including an angle detection program, which when executed by the processor, implements the steps of the above-described angle detection method.
Further, to achieve the above object, the present invention also provides a storage medium having stored thereon an angle detection program which, when executed by a processor, realizes the steps of the above-described angle detection method.
According to the technical scheme, the angle detection method, the angle detection equipment, the angle detection computer program product and the storage medium have the advantages that the driving motor is adopted to drive the electronic compass or the angle sensor to synchronously rotate, the initial direction value of the electronic compass or the angle sensor is obtained, the driving motor is controlled to rotate a preset angle, after the driving motor is detected to rotate the preset angle, the current direction value of the electronic compass or the angle sensor is obtained, because the current direction value possibly has errors, the target direction value of the electronic compass or the angle sensor corresponding to the preset angle is calculated, the target direction value of the electronic compass or the angle sensor is determined according to the target direction value, the initial direction value and the current direction value, and the detection result technical scheme of the electronic compass or the angle sensor is determined through the mode of automatically generating the detection result The problem of error exists in the read data, and the precision of the measurement result is improved.
Drawings
FIG. 1 is a schematic diagram of a hardware operating environment according to an embodiment of the present invention;
FIG. 2 is a schematic flow chart illustrating a first embodiment of an angle detection method according to the present invention;
FIG. 3 is a flowchart illustrating a second embodiment of an angle detection method according to the present invention;
FIG. 4 is a flowchart illustrating a third embodiment of an angle detection method according to the present invention;
FIG. 5 is a flowchart illustrating a fourth embodiment of an angle detection method according to the present invention;
FIG. 6 is a flowchart illustrating a fifth embodiment of an angle detection method according to the present invention;
FIG. 7 is a flowchart illustrating an angle detecting method according to a seventh embodiment of the present invention;
FIG. 8 is a schematic structural diagram of an angle detecting apparatus according to the present invention;
FIG. 9 is a schematic view of the installation of the device to be tested and the driving motor in the gantry;
the objects, features, and advantages of the present invention will be further explained with reference to the accompanying drawings, which are an illustration of one embodiment, and not an entirety of the invention.
Detailed Description
For a better understanding of the above technical solutions, exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited to the embodiments set forth herein. Rather, these embodiments are provided so that this disclosure will be thorough and complete, and will fully convey the scope of the disclosure to those skilled in the art.
As shown in fig. 1, fig. 1 is a schematic structural diagram of a hardware operating environment according to an embodiment of the present invention.
It should be noted that fig. 1 may be a schematic structural diagram of a hardware operating environment of the angle detection apparatus.
As shown in fig. 1, the angle detecting apparatus may include: a processor 1001, such as a CPU, a memory 1005, a user interface 1003, a network interface 1004, a communication bus 1002. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a wireless interface (e.g., WI-FI interface). The memory 1005 may be a high-speed RAM memory or a non-volatile memory (e.g., a magnetic disk memory). The memory 1005 may alternatively be a storage device separate from the processor 1001.
Alternatively, as shown in fig. 9, the angle detecting apparatus may further include an electronic compass or an angle sensor 100, and the angle detecting apparatus may further include a driving motor 200 for driving the electronic compass or the angle sensor to perform a synchronous motion, which may affect an angle measurement value of the electronic compass or the angle sensor due to a magnetic field generated by the driving motor when operating, and thus, the driving motor and the electronic compass or the angle sensor are separately installed at a predetermined distance, for example, as shown in fig. 9, the driving motor and the electronic compass or the angle sensor are installed on a stage, and the electronic compass or the angle sensor is installed above the stage, the driving motor is installed below the stage, and on the premise of ensuring that the magnetic field is small, the electronic compass or the installation positions of the angle sensor and the driving motor on the rack can be set according to actual conditions.
Optionally, as shown in fig. 8, the angle detection apparatus may further include an acquisition control board, where the acquisition control board is configured to acquire measurement data of the electronic compass sensor or the angle sensor; the angle detection device can also comprise a driving motor, the driving motor can be a stepping motor, a motor driver of the driving motor is connected with a main control board, and the process that the main control board controls the driving motor to work is that the main control board generates a control signal to control the motor driver to work, and the driving motor is driven to work when the motor driver works; specifically, the acquisition control board can be connected with the terminal through the bluetooth module, the terminal comprises a driving configuration tool of the driving motor, a user can set the rotating angle step length of the driving motor in the driving configuration tool, and the measurement data of the electronic compass or the angle sensor acquired by the acquisition control board is displayed in the driving configuration tool.
Optionally, the angle detection device may further include a communication device, the communication device may be a wired communication device or a wireless communication device, when the communication device is a wireless communication device, the wireless communication device may be a bluetooth device, a WiFi device, or the like, the communication device is configured to implement communication between the acquisition control board and the main control board, the main control board and the acquisition control board are both provided with the communication device, when the main control board controls the driving motor to operate, the driving motor drives the rotating platform to operate, the rotating platform is provided with an electronic compass or an angle sensor, so as to drive the electronic compass or the angle sensor to operate synchronously when the motor operates, and acquire data of the electronic compass or the angle sensor through the acquisition control board, so as to transmit data acquired by the acquisition control board to the main control board through the communication device for analysis processing in real time, and sending the analysis result to a terminal upper computer to generate a detection result.
Those skilled in the art will appreciate that the angle detection device configuration shown in fig. 1 does not constitute a limitation of the angle detection device and may include more or fewer components than shown, or some components may be combined, or a different arrangement of components.
As shown in fig. 1, a memory 1005, which is a storage medium, may include therein an operating system, a network communication module, a user interface module, and an angle detection program. Among them, the operating system is a program that manages and controls hardware and software resources of the angle detection apparatus, the operation of the angle detection program, and other software or programs.
In the angle detection apparatus shown in fig. 1, the user interface 1003 is mainly used for connecting a terminal, and performing data communication with the terminal; the network interface 1004 is mainly used for the background server and performs data communication with the background server; the processor 1001 may be used to invoke an angle detection program stored in the memory 1005.
In this embodiment, the angle detection apparatus includes: a memory 1005, a processor 1001 and an angle detection program stored on the memory and executable on the processor, wherein:
when the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are performed:
the method comprises the steps of obtaining an initial direction value of the equipment to be detected, and controlling a driving motor to rotate by a preset angle, wherein the driving motor is used for driving the equipment to be detected to synchronously rotate;
after the driving motor rotates the preset angle, acquiring a current direction value of the equipment to be detected;
determining a target direction value of the equipment to be detected corresponding to the preset angle;
and determining the detection result of the equipment to be detected according to the target direction value, the initial direction value and the current direction value.
When the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are also performed:
acquiring the number of pulses required by the driving motor to rotate by the preset angle;
and determining the target direction value of the equipment to be detected according to the initial direction value of the equipment to be detected and the pulse number.
When the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are also performed:
determining the current direction variation of the equipment to be detected according to the initial direction value of the equipment to be detected and the current direction value of the equipment to be detected;
determining the offset corresponding to the equipment to be detected according to the target direction value of the equipment to be detected and the current direction variation of the equipment to be detected;
and checking the detection result according to the offset.
When the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are also performed:
acquiring a difference value between the current direction variation of the equipment to be detected and the target direction variation of the equipment to be detected;
and determining the offset of the equipment to be detected according to the difference.
When the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are also performed:
acquiring a mapping relation between the current direction variation of the equipment to be detected and the rotation angle of a driving motor at unit time intervals;
and generating a detection result of the equipment to be detected based on the mapping relation.
When the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are also performed:
and establishing a communication connection relation between the driving motor and the equipment to be detected so as to obtain an initial direction value of the equipment to be detected according to the communication connection relation.
When the processor 1001 calls the angle detection program stored in the memory 1005, the following operations are also performed:
generating an acquisition instruction after the driving motor rotates by the preset angle;
and acquiring the current direction value of the equipment to be detected according to the acquisition instruction and the communication connection relation.
While a logical order is shown in the flow chart, in some cases, the steps shown or described may be performed in an order different than that shown or described herein.
As shown in fig. 2, in a first embodiment of the present application, an angle detection method of the present application includes the following steps:
step S110, acquiring an initial direction value of the equipment to be detected, and controlling a driving motor to rotate by a preset angle, wherein the driving motor is used for driving the equipment to be detected to synchronously rotate;
step S120, after the driving motor rotates the preset angle, acquiring a current direction value of the equipment to be detected;
step S130, determining a target direction value of the equipment to be detected corresponding to the preset angle;
and S140, determining the detection result of the device to be detected according to the target direction value, the initial direction value and the current direction value.
In this embodiment, in order to solve the problem that when reading the measurement data of the to-be-detected device, the to-be-detected device is influenced by a magnetic field or the data is artificially read to cause a large error between the read data and the actual data, the present application designs an angle detection method, the driving motor is driven to rotate by the main control board, the driving motor is controlled to drive the to-be-detected device to synchronously rotate, the collected measurement data of the to-be-detected device is sent to the terminal upper computer, thereby determining the detection result of the to-be-detected device, the measurement data is not required to be artificially read in the process, the detection result is automatically measured and generated, the error between the artificially read measurement data and the actual measurement data is reduced, and the accuracy of the obtained measurement data of the to-be-detected device is improved.
In this embodiment, the device to be detected includes an electronic compass or an angle sensor, the electronic compass is also called a digital compass, and the electronic compass has been widely used as a navigation instrument or an attitude sensor; the electronic compass can be a plane electronic compass, and the electronic compass can also be a three-dimensional electronic compass, wherein when the plane electronic compass is used, the plane electronic compass needs to be kept horizontally, so that the situation that a measurement result has a large error when the electronic compass is inclined is avoided; the three-dimensional electronic compass comprises an inclination angle sensor inside, and when the electronic compass is inclined, the inclination angle sensor can compensate the inclination of the electronic compass, so that the strict limitation of the plane electronic compass in use is overcome.
In this embodiment, the electronic compass or the angle sensor is configured in a drive configuration tool of the terminal upper computer, and a working mode of the motor may also be configured, for example, the working mode of the motor may be set to a manual control mode or an automatic control mode, and in the automatic control mode, a step length of forward rotation or reverse rotation of the motor may be configured; after the electronic compass or the angle sensor needs to test the angle is configured in the drive configuration tool of the terminal upper computer, when the drive motor is controlled by the main control board to work, the drive motor drives the rotating platform to work, the rotating platform is provided with the electronic compass or the angle sensor, so as to drive the electronic compass or the angle sensor to synchronously work when the motor works, specifically, the main control board is in communication connection with the acquisition control board through the communication equipment to obtain the initial direction value of the equipment to be tested, meanwhile, the terminal upper computer transmits the angle to be tested of the electronic compass or the angle sensor to the main control board through the serial port through the drive configuration tool, the main control board calculates the pulse number corresponding to the angle value to be tested, and the main control board controls the drive motor to move the pulse number, the driving motor is controlled to rotate to a preset angle, the preset angle is determined according to the angle to be tested, which is pre-configured in the driving configuration tool, after the driving motor rotates to the preset angle, the main control board communicates with the acquisition control board through the communication equipment, and the current direction value of the equipment to be tested is obtained.
In this embodiment, after obtaining the current direction value of the device to be detected, the current direction value of the device to be detected needs to be checked to determine whether the measurement value of the device to be detected is accurate, specifically, the number of pulses required by the driving motor to rotate by the preset angle is obtained, the target direction value of the device to be detected is determined according to the initial direction value of the device to be detected and the number of pulses, the accuracy of the measurement data of the device to be detected is determined according to the difference value between the current direction value and the target direction value, and when the difference value is smaller, the accuracy of the measurement data of the device to be detected is higher; in the process, the acquisition control board acquires an electronic compass or the current direction value of the angle sensor, so that the current direction value acquired by the acquisition control board is transmitted to the main control board for analysis processing through the communication equipment, the main control board can analyze the target direction value and the current direction value of the equipment to be detected in real time, generate an analysis result, send the analysis result to a terminal upper computer, and the terminal upper computer can generate a corresponding detection result according to the analysis result.
According to the technical scheme, the technical means that the initial direction value of the equipment to be detected is obtained, the driving motor is controlled to rotate by the preset angle, the current direction value of the equipment to be detected is obtained after the driving motor rotates by the preset angle, the target direction value of the equipment to be detected corresponding to the preset angle is determined, the detection result of the equipment to be detected is determined according to the initial direction value, the target direction value and the current direction value of the equipment to be detected, the problem that errors exist in data reading caused by electromagnetic interference of an electronic compass or an angle sensor is solved by automatically generating the detection result, and the precision of the measurement result is improved.
As shown in fig. 3, fig. 3 is a second embodiment of the present application, and based on the step S130 of the first embodiment, the second embodiment of the present application includes the following steps:
step S131, acquiring the number of pulses required by the driving motor to rotate the preset angle;
and S132, determining a target direction value of the device to be detected according to the initial direction value of the device to be detected and the pulse number.
In this embodiment, the main control board is in communication connection with the acquisition control board through the communication device to obtain an initial direction value of the device to be tested; the method comprises the steps that a terminal upper computer transmits an angle to be tested of an electronic compass or an angle sensor to a main control board through a serial port through a driving configuration tool, the main control board calculates and outputs the pulse quantity required by a driver according to the angle value to be tested, namely, the pulse quantity required by the rotation of a driving motor by a preset angle is obtained, the main control board controls the driving motor to move the pulse quantity, namely, the driving motor is controlled to rotate by the preset angle, the preset angle is determined according to the angle to be tested, which is pre-configured in the driving configuration tool, and after the driving motor rotates by the preset angle, the main control board communicates with an acquisition control board through communication equipment to obtain the current direction value of equipment to be tested; and determining a target direction value of the equipment to be detected according to the initial direction value of the equipment to be detected and the pulse number, wherein the target direction value is a theoretical value of the equipment to be detected.
According to the technical scheme, the technical means that the pulse quantity required by the driving motor for rotating the preset angle is obtained, and the target direction value of the equipment to be detected is determined according to the initial direction value of the equipment to be detected and the pulse quantity is adopted, so that the target direction value of the equipment to be detected is obtained, and the accuracy of the current direction value is verified by adopting the target direction value.
As shown in fig. 4, fig. 4 is a third embodiment of the present application, and after step S140 based on the first embodiment, the third embodiment of the present application includes the following steps:
step S210, determining the current direction variation of the equipment to be detected according to the initial direction value of the equipment to be detected and the current direction value of the equipment to be detected;
step S220, determining the offset corresponding to the equipment to be detected according to the target direction value of the equipment to be detected and the current direction variation of the equipment to be detected;
and step S230, verifying the detection result according to the offset.
In this embodiment, after the target direction value of the device to be detected is obtained, the current direction value of the device to be detected needs to be checked; specifically, after an acquisition control board acquires an initial direction value of an electronic compass or the angle sensor, the initial direction value is stored in a memory; the driving motor rotates after presetting the angle, gather the control panel and acquire the electron compass or angle sensor rotates at driving motor predetermines the current direction value that corresponds behind the angle to pass through the current direction value that the control panel gathered with the communication equipment transmit to the main control panel carries out analysis processes, and at this moment, the main control panel will current direction value compares with the initial direction value in the memory, confirms current direction value with the difference between the initial direction value, according to the difference is confirmed examine the current direction change volume of equipment.
In this embodiment, after the current direction variation of the device to be detected is determined, the offset of the device to be detected is determined according to the current direction variation and the target direction value of the device to be detected, and specifically, the target direction variation of the device to be detected is determined according to the difference between the target direction value of the device to be detected and the initial direction value of the device to be detected and the difference; determining the offset of the equipment to be detected according to the target direction variation of the equipment to be detected and the current direction variation of the equipment to be detected, checking the detection result through the offset, and indicating that the current direction value of the equipment to be detected read is more accurate when the offset is smaller; after the offset of the equipment to be detected is determined, besides the detection result is verified, the offset can be adopted to improve the angle detection equipment so as to correct the current direction value of the equipment to be detected.
According to the technical scheme, the current direction variable quantity of the equipment to be detected is determined according to the initial direction value of the equipment to be detected and the current direction value of the equipment to be detected; determining the offset corresponding to the equipment to be detected according to the target direction value of the equipment to be detected and the current direction variation of the equipment to be detected; the technical means for verifying the detection result according to the offset realizes that the offset corresponding to the equipment to be detected is determined so as to verify the detection result according to the offset.
As shown in fig. 5, fig. 5 is a fourth embodiment of the present application, and based on the third embodiment step S220, the fourth embodiment of the present application includes the following steps:
step S221, acquiring a difference value between the current direction variation of the equipment to be detected and the target direction variation of the equipment to be detected;
and step S222, determining the offset of the device to be detected according to the difference.
In the embodiment, a difference value between a target direction value of the equipment to be detected and an initial direction value of the equipment to be detected is obtained, and a target direction variation of the equipment to be detected is determined according to the difference value; the method comprises the steps of obtaining a difference value between a target direction variable quantity of equipment to be detected and a current direction variable quantity of the equipment to be detected, determining an offset corresponding to the equipment to be detected according to the difference value, wherein the offset is used for representing the precision of the equipment to be detected after rotating by a preset angle, checking a detection result through the offset, and when the offset is smaller, representing that the current direction value of the equipment to be detected read at the moment is more accurate.
According to the technical scheme, the target direction variation of the equipment to be detected is determined according to the initial direction value and the target direction value of the equipment to be detected; acquiring a difference value between the current direction variation of the equipment to be detected and the target direction variation of the equipment to be detected; and determining the offset of the equipment to be detected according to the difference value, so as to determine the precision of the equipment to be detected after rotating the preset angle.
As shown in fig. 6, fig. 6 is a fifth embodiment of the present application, and based on the fourth embodiment, step S140, the sixth embodiment of the present application includes the following steps:
step S141, acquiring a mapping relation between the current direction variation of the equipment to be detected and the rotation angle of the driving motor at unit time intervals;
and S142, generating a detection result of the equipment to be detected based on the mapping relation.
In this embodiment, a mapping relationship between a current direction variation of the device to be detected and a rotation angle of the driving motor at a unit time interval is obtained, where the unit time interval may be set according to an actual situation, for example, the unit time interval may be set to 1S or 500ms, and when the time set at the unit time interval is shorter, the more data is collected, the more accurate the finally determined detection result is; the mapping relation can also be the mapping relation between the rotation angle of the driving motor and a target direction value, an initial direction value and a current direction value, the mapping relation can be configured in a driving configuration tool in advance, after the main control board analyzes the collected data, the mapping relation between the current direction variation of the equipment to be detected and the rotation angle of the driving motor is generated in the driving configuration tool, when developers need to check based on the measurement data, the detection result of the equipment to be detected can be generated based on the mapping relation, and the detection result is led out and checked in a detection report mode.
According to the technical scheme, the mapping relation between the current direction variation of the device to be detected and the rotation angle of the driving motor at unit time intervals is obtained; and generating a detection result of the equipment to be detected based on the mapping relation.
The following embodiment is a sixth embodiment of the present application, and before step S110 based on the first embodiment, the sixth embodiment of the present application includes the following steps:
step S310, establishing a communication connection relation between the driving motor and the equipment to be detected, so as to obtain an initial direction value of the equipment to be detected according to the communication connection relation.
In this embodiment, a communication connection relationship is established between the driving motor and the device to be detected, the communication connection relationship may be a wired communication connection or a wireless communication connection, the wireless communication connection may be implemented by using devices such as a bluetooth device and a WiFi device, the wireless communication connection is used to implement communication between the acquisition control board and the main control board, the main control board and the acquisition control board are both provided with the communication devices, the communication connection relationship between the driving motor and the device to be detected is implemented by using the communication devices, after the communication connection relationship is established, the acquisition control board acquires an initial direction value of the electronic compass or the angle sensor, so as to transmit the initial direction value acquired by the acquisition control board to the main control board for analysis processing through the communication connection relationship, and the acquisition control board may also acquire a current direction value of the electronic compass or the angle sensor, the current direction value acquired by the acquisition control board is sent to the main control board for analysis and processing.
According to the technical scheme, the technical means of establishing the communication connection relationship between the driving motor and the equipment to be detected so as to obtain the initial direction value of the equipment to be detected according to the communication connection relationship is adopted, so that the measurement data of the equipment to be detected can be obtained through the communication connection relationship.
As shown in fig. 7, fig. 7 is a seventh embodiment of the present application, and based on the sixth embodiment, step S120, the seventh embodiment of the present application includes the following steps:
step S121, generating an acquisition instruction after the driving motor rotates the preset angle;
and S122, acquiring the current direction value of the equipment to be detected according to the acquisition instruction and the communication connection relation.
In this embodiment, after the driving motor rotates the preset angle, the main control board generates an acquisition instruction and sends the acquisition instruction to the acquisition control board through a communication connection relationship, and the acquisition control board is controlled to acquire the current direction value of the electronic compass or the angle sensor according to the acquisition instruction.
According to the technical scheme, the acquisition instruction is generated after the driving motor rotates the preset angle; and acquiring the current direction value of the equipment to be detected according to the acquisition instruction and the communication connection relation, thereby realizing the process of acquiring the current direction value of the equipment to be detected.
Based on the same inventive concept, embodiments of the present application further provide a computer program product, where the computer program product includes an angle detection program, and when the angle detection program is executed by a processor, the steps of the angle detection method described above are implemented, and the same technical effect can be achieved, and are not described herein again to avoid repetition.
Since the computer program product provided in the embodiments of the present application is a computer program product used for implementing the method in the embodiments of the present application, based on the method described in the embodiments of the present application, a person skilled in the art can understand the specific structure and modification of the computer program product, and thus details are not described herein. All computer program products that may be used in the methods of the embodiments of the present application are intended to be within the scope of the present application.
Based on the same inventive concept, an embodiment of the present application further provides a storage medium, where an angle detection program is stored, and when the angle detection program is executed by a processor, the steps of the angle detection method described above are implemented, and the same technical effects can be achieved.
Since the storage medium provided in the embodiments of the present application is a storage medium used for implementing the method in the embodiments of the present application, based on the method described in the embodiments of the present application, a person skilled in the art can understand a specific structure and a modification of the storage medium, and thus details are not described here. Any storage medium used in the methods of the embodiments of the present application is intended to be within the scope of the present application.
As will be appreciated by one skilled in the art, embodiments of the present invention may be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the invention. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, 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 specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It should be noted that in the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names.
While preferred embodiments of the present invention have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all such alterations and modifications as fall within the scope of the invention.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.

Claims (10)

1. An angle detection method, characterized in that the angle detection method comprises:
the method comprises the steps of obtaining an initial direction value of the equipment to be detected, and controlling a driving motor to rotate by a preset angle, wherein the driving motor is used for driving the equipment to be detected to synchronously rotate;
after the driving motor rotates the preset angle, acquiring a current direction value of the equipment to be detected;
determining a target direction value of the equipment to be detected corresponding to the preset angle;
and determining the detection result of the equipment to be detected according to the target direction value, the initial direction value and the current direction value.
2. The method according to claim 1, wherein the step of determining the target direction value of the device to be tested corresponding to the preset angle comprises:
acquiring the number of pulses required by the driving motor to rotate by the preset angle;
and determining the target direction value of the equipment to be detected according to the initial direction value of the equipment to be detected and the pulse number.
3. The method of claim 1, wherein the step of determining the detection result of the device under test according to the target direction value, the initial direction value and the current direction value further comprises:
determining the current direction variation of the equipment to be detected according to the initial direction value of the equipment to be detected and the current direction value of the equipment to be detected;
determining the offset corresponding to the equipment to be detected according to the target direction value of the equipment to be detected and the current direction variation of the equipment to be detected;
and checking the detection result according to the offset.
4. The method as claimed in claim 3, wherein the step of determining the offset corresponding to the device to be detected according to the target direction value of the device to be detected and the current direction variation corresponding to the device to be detected comprises:
determining the target direction variation of the equipment to be detected according to the initial direction value and the target direction value of the equipment to be detected;
acquiring a difference value between the current direction variation of the equipment to be detected and the target direction variation of the equipment to be detected;
and determining the offset of the equipment to be detected according to the difference.
5. The method according to claim 3, wherein the step of determining the detection result of the device under test based on the target direction value, the initial direction value and the current direction value is followed by:
acquiring a mapping relation between the current direction variation of the equipment to be detected and the rotation angle of a driving motor at unit time intervals;
and generating a detection result of the equipment to be detected based on the mapping relation.
6. The method of claim 1, wherein the step of obtaining an initial orientation value of the device under test and controlling the driving motor to rotate a preset angle is preceded by the steps of:
and establishing a communication connection relation between the driving motor and the equipment to be detected so as to obtain an initial direction value of the equipment to be detected according to the communication connection relation.
7. The method as claimed in claim 6, wherein the step of obtaining the current direction value of the device to be tested after the driving motor rotates the preset angle comprises:
generating an acquisition instruction after the driving motor rotates by the preset angle;
and acquiring the current direction value of the equipment to be detected according to the acquisition instruction and the communication connection relation.
8. An angle detection apparatus characterized by comprising: memory, a processor and an angle detection program stored on the memory and executable on the processor, the angle detection program when executed by the processor implementing the steps of the angle detection method according to any one of claims 1-7.
9. A computer program product, characterized in that the computer program product comprises an angle detection program which, when being executed by a processor, carries out the steps of the angle detection method according to any one of claims 1-7.
10. A storage medium, characterized in that an angle detection program is stored thereon, which when executed by a processor implements the steps of the angle detection method of any one of claims 1 to 7.
CN202111104512.9A 2021-09-17 2021-09-17 Angle detection method, angle detection device, computer program product and storage medium Pending CN113970312A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111104512.9A CN113970312A (en) 2021-09-17 2021-09-17 Angle detection method, angle detection device, computer program product and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111104512.9A CN113970312A (en) 2021-09-17 2021-09-17 Angle detection method, angle detection device, computer program product and storage medium

Publications (1)

Publication Number Publication Date
CN113970312A true CN113970312A (en) 2022-01-25

Family

ID=79586705

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111104512.9A Pending CN113970312A (en) 2021-09-17 2021-09-17 Angle detection method, angle detection device, computer program product and storage medium

Country Status (1)

Country Link
CN (1) CN113970312A (en)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03196314A (en) * 1989-12-26 1991-08-27 Nissan Motor Co Ltd Controller for motor
CN106546163A (en) * 2015-09-23 2017-03-29 上海世德子汽车零部件有限公司 The detection correction system of magneto resistive angular sensor
CN107830850A (en) * 2017-10-27 2018-03-23 东莞华贝电子科技有限公司 The test system and method for electronic compass
CN208795210U (en) * 2018-11-12 2019-04-26 北京经纬恒润科技有限公司 A kind of calibration tooling
CN111307134A (en) * 2020-04-27 2020-06-19 武汉海达数云技术有限公司 Electronic compass calibration method, device, system and computer readable storage medium
CN213657922U (en) * 2020-09-18 2021-07-09 美新半导体(天津)有限公司 Magnetic angle sensor testing device

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH03196314A (en) * 1989-12-26 1991-08-27 Nissan Motor Co Ltd Controller for motor
CN106546163A (en) * 2015-09-23 2017-03-29 上海世德子汽车零部件有限公司 The detection correction system of magneto resistive angular sensor
CN107830850A (en) * 2017-10-27 2018-03-23 东莞华贝电子科技有限公司 The test system and method for electronic compass
CN208795210U (en) * 2018-11-12 2019-04-26 北京经纬恒润科技有限公司 A kind of calibration tooling
CN111307134A (en) * 2020-04-27 2020-06-19 武汉海达数云技术有限公司 Electronic compass calibration method, device, system and computer readable storage medium
CN213657922U (en) * 2020-09-18 2021-07-09 美新半导体(天津)有限公司 Magnetic angle sensor testing device

Similar Documents

Publication Publication Date Title
CN112710871B (en) Test method and device for positioning speed measurement system host
CN105911563A (en) Method for detecting static GPS observation data mass in real time
CN112462353B (en) Ultrasonic radar testing method, device, system and equipment
CN109633529B (en) Detection equipment, method and device for positioning accuracy of positioning system
CN107830850B (en) Test system and method of electronic compass
CN112109549A (en) Instrument display method and system
CN110688732A (en) Simulation test platform and method for speed and distance measuring system
CN106683417A (en) Parking space state detection method based on magneto-sensitive detector and magneto-sensitive detector
CN112985867B (en) Steering engine testing method, device, equipment and storage medium
CN113970312A (en) Angle detection method, angle detection device, computer program product and storage medium
CN111044290B (en) Detection method and detection system of linear motor
CN102024322B (en) Data processing equipment and method for testing serial signals
CN116893341A (en) Stepping motor driver, stepping motor testing method, system, equipment and medium
CN113310673B (en) Method and device for detecting repetition precision, computer equipment and storage medium thereof
CN110940352B (en) Automatic calibration system of micro-electro-mechanical system inertia measurement unit and calibration verification method thereof
JP2010008074A (en) Pointer-indicating-angle calculation device, pointer-indicating-angle evaluation system, and pointer-indicating-angle calculation program
CN115657494A (en) Virtual object simulation method, device, equipment and storage medium
CN110186399B (en) Driver positioning accuracy detection device and method
CN110967446B (en) Parameter targeting method and device, storage medium and electronic equipment
CN117470292B (en) Instrument detection method, system, intelligent terminal and storage medium
CN111562798A (en) Device capable of generating fixed-angle pulse at specified position and working method thereof
CN116879579B (en) Vehicle acceleration calculation method, device, computer equipment and storage medium
CN117389869B (en) ASIC algorithm test method, device and medium of millimeter wave radar SOC chip
Taut et al. Software instrument for testing cluster devices using high-speed CAN protocol
CN113513985B (en) Optimization method and device for precision detection, electronic equipment and 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