CN115940857A - Automatic adjustment method, device, equipment and medium for digital potentiometer - Google Patents
Automatic adjustment method, device, equipment and medium for digital potentiometer Download PDFInfo
- Publication number
- CN115940857A CN115940857A CN202211633507.1A CN202211633507A CN115940857A CN 115940857 A CN115940857 A CN 115940857A CN 202211633507 A CN202211633507 A CN 202211633507A CN 115940857 A CN115940857 A CN 115940857A
- Authority
- CN
- China
- Prior art keywords
- gain
- value
- actual
- digital potentiometer
- values
- 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
Images
Landscapes
- Control Of Amplification And Gain Control (AREA)
Abstract
An automatic adjustment method for a digital potentiometer comprises the following steps: acquiring communication parameters and test parameters, wherein the test parameters comprise a gain adjustment range and a target gain range; obtaining a plurality of gain adjustment values according to a preset stepping gain adjustment range, generating a gain adjustment instruction according to the gain adjustment values and communication parameters, wherein the gain adjustment instruction is used for being sent to a circuit capable of debugging the digital potentiometer, so that the circuit adjusts the gain of the digital potentiometer according to the gain adjustment values and detects the actual gain value of the digital potentiometer; acquiring each actual gain value detected by the circuit and a corresponding gain adjustment value; one of the actual gain values within the target gain range is selected to satisfy a condition, and the corresponding gain adjustment value is used to adjust the digital potentiometer. Because at least one gain adjusting instruction is automatically generated according to the communication parameters and the test parameters, the gain adjusting efficiency of the digital potentiometer is improved. The invention also provides an automatic adjusting device, equipment and a medium for the digital potentiometer.
Description
Technical Field
The invention relates to the technical field of digital potentiometers, in particular to an automatic adjustment method, an automatic adjustment device, automatic adjustment equipment and an automatic adjustment medium for a digital potentiometer.
Background
The digital potentiometer is controlled by an input digital signal and then generates an analog quantity output, namely the digital potentiometer adjusts the resistance value in a numerical control mode. At present, potentiometers used in most instruments in the market are digital potentiometers, however, in the production and use processes, gain adjustment is usually required for the digital potentiometers, for example, the resistance value is adjusted, so that the output of the digital potentiometers meets the use requirements of equipment. The existing digital potentiometer adjusting method mainly comprises the steps of traversing input gain values to a digital potentiometer manually by using a software tool through a communication protocol, reading a current gain output value of the gain values every time one gain value is input, and checking whether the gain output value meets the requirement of equipment or not. Because manual adjustment is carried out manually, the problem of low adjustment efficiency exists on one hand, and the adjustment precision of the digital potentiometer is low on the other hand, so that the requirement of batch adjustment of the digital potentiometer cannot be met easily, and the requirement of high adjustment precision cannot be met.
Disclosure of Invention
The invention mainly solves the technical problem of how to improve the gain adjustment efficiency and the gain adjustment accuracy of the digital potentiometer.
According to a first aspect, there is provided in one embodiment a method of automatic adjustment of a digital potentiometer, comprising:
acquiring at least one group of communication parameters and test parameters determined by a user, wherein the test parameters at least comprise a gain adjustment range and a target gain range;
for each set of communication parameters and test parameters: obtaining a plurality of gain adjustment values according to a preset step from the gain adjustment range, generating at least one corresponding gain adjustment instruction according to the communication parameters by using the plurality of gain adjustment values, wherein the at least one gain adjustment instruction is used for being respectively sent to circuits capable of debugging the digital potentiometers, so that the circuits respectively adjust the gains of the digital potentiometers according to the gain adjustment values and respectively detect actual gain values of the digital potentiometers;
acquiring each actual gain value detected by the circuit and a corresponding gain adjustment value;
and respectively judging whether each actual gain value is in the target gain range, and selecting an actual gain value meeting the condition from the actual gain values in the target gain range so as to use a gain adjusting value corresponding to the actual gain value to adjust the gain of the digital potentiometer.
In some embodiments, the test parameters further include a gain reading duration, and the digital potentiometer automatic adjustment method further includes:
and generating at least one corresponding gain adjusting instruction according to the plurality of gain adjusting values and the gain reading time length and the communication parameters, so that the circuit respectively adjusts the gain of the digital potentiometer according to each gain adjusting value, delays the gain reading time length and then detects the actual gain value of the digital potentiometer.
In some embodiments, the selecting one of the actual gain values within the target gain range that satisfies a condition includes:
determining the number of said actual gain values within said target gain range;
if only one actual gain value exists in the target gain range, selecting the actual gain value;
if at least two actual gain values exist in the target gain range, acquiring a middle value of the target gain range;
and respectively obtaining the difference value between the at least two actual gain values and the intermediate value, and selecting the actual gain value with the minimum difference value from the at least two actual gain values.
In some embodiments, the communication parameter includes a communication protocol type, and the gain adjustment instruction is received and processed by a circuit that satisfies the communication protocol type after the corresponding at least one gain adjustment instruction is generated from at least the plurality of gain adjustment values according to the communication parameter.
In some embodiments, the communication parameter comprises a protocol frame structure, and when at least the plurality of gain adjustment values are used to generate corresponding at least one gain adjustment instruction according to the communication parameter, the method further comprises:
and placing the gain adjustment value in a preset byte section in a gain adjustment instruction according to the protocol frame structure.
In some embodiments, the obtaining each actual gain value and corresponding gain adjustment value detected by the circuit includes:
gain feedback data output by the circuit is obtained;
and analyzing the gain feedback data according to the protocol frame structure to obtain target data in the gain feedback data, and obtaining each actual gain value and a corresponding gain adjustment value according to the target data.
According to a second aspect, an embodiment provides an automatic adjustment device for a digital potentiometer, comprising:
the device comprises a parameter setting module, a parameter setting module and a parameter setting module, wherein the parameter setting module is used for acquiring at least one group of communication parameters and test parameters determined by a user, and the test parameters at least comprise a gain adjusting range and a target gain range;
an instruction generation module for, for each set of communication parameters and test parameters: obtaining a plurality of gain adjustment values according to a preset step from the gain adjustment range, generating at least one corresponding gain adjustment instruction according to the communication parameters by using the plurality of gain adjustment values, wherein the at least one gain adjustment instruction is used for being respectively sent to circuits capable of debugging the digital potentiometers, so that the circuits respectively adjust the gains of the digital potentiometers according to the gain adjustment values and respectively detect actual gain values of the digital potentiometers;
the feedback receiving module is used for acquiring each actual gain value detected by the circuit and the corresponding gain adjusting value;
and the gain adjusting module is used for respectively judging whether each actual gain value is in the target gain range, and selecting one actual gain value meeting the condition from the actual gain values in the target gain range so as to use the gain adjusting value corresponding to the actual gain value for adjusting the gain of the digital potentiometer.
In some embodiments, when selecting one of the actual gain values within the target gain range that satisfies a condition, the gain adjustment module is further configured to:
determining the number of said actual gain values within said target gain range;
if only one actual gain value exists in the target gain range, selecting the actual gain value;
if at least two actual gain values exist in the target gain range, acquiring a middle value of the target gain range;
and respectively obtaining the difference value between the at least two actual gain values and the intermediate value, and selecting the actual gain value with the minimum difference value from the at least two actual gain values.
According to a third aspect, there is provided in an embodiment an apparatus comprising:
a memory for storing a program;
a processor for implementing the method according to the second aspect by executing the program stored in the memory.
According to a fourth aspect, an embodiment provides a computer readable storage medium having a program stored thereon, the program being executable by a processor to implement the method according to the second aspect.
According to the automatic adjustment method of the digital potentiometer, after a group of communication parameters and test parameters determined by a user are obtained, a plurality of gain adjustment values are obtained from a gain adjustment range according to preset steps, then, according to the communication parameters, the plurality of gain adjustment values generate at least one corresponding gain adjustment instruction according to the communication parameters, and a circuit capable of debugging the digital potentiometer is controlled through the at least one gain adjustment instruction, so that the circuit can respectively adjust the gain of the digital potentiometer according to each gain adjustment value, and the actual gain value of the digital potentiometer is respectively detected. And finally, selecting an actual gain value meeting the condition from the actual gain values in the target gain range, and using the corresponding gain adjustment value to adjust the gain of the digital potentiometer. The gain adjustment method comprises the steps of automatically generating at least one corresponding gain adjustment instruction according to communication parameters and test parameters, automatically adjusting the gain of the digital potentiometer, greatly improving the gain adjustment efficiency of the digital potentiometer, obtaining a plurality of gain adjustment values according to a preset step from a gain adjustment range, improving the accuracy of the gain adjustment of the digital potentiometer, and being suitable for the gain adjustment of batch digital potentiometers.
Drawings
FIG. 1 is a flow chart of a digital potentiometer automatic adjustment method according to an embodiment;
FIG. 2 is a flow chart of a digital potentiometer automatic adjustment method according to another embodiment;
FIG. 3 is a block diagram of an embodiment of an automatic adjustment device of a digital potentiometer;
fig. 4 is a schematic diagram of gain adjustment of a digital potentiometer according to an embodiment.
Detailed Description
The present invention will be described in further detail with reference to the following detailed description and accompanying drawings. Wherein like elements in different embodiments are numbered with like associated elements. In the following description, numerous details are set forth in order to provide a better understanding of the present application. However, those skilled in the art will readily recognize that some of the features may be omitted or replaced with other elements, materials, methods in different instances. In some instances, certain operations related to the present application have not been shown or described in detail in order to avoid obscuring the core of the present application from excessive description, and it is not necessary for those skilled in the art to describe these operations in detail, so that they may be fully understood from the description in the specification and the general knowledge in the art.
Furthermore, the features, operations, or characteristics described in the specification may be combined in any suitable manner to form various embodiments. Also, the various steps or actions in the method descriptions may be transposed or transposed in order, as will be apparent to one of ordinary skill in the art. Thus, the various sequences in the specification and drawings are for the purpose of describing certain embodiments only and are not intended to imply a required sequence unless otherwise indicated where such sequence must be followed.
The numbering of the components as such, e.g., "first", "second", etc., is used herein only to distinguish the objects as described, and does not have any sequential or technical meaning. The term "connected" and "coupled" as used herein includes both direct and indirect connections (couplings), unless otherwise specified.
When the gain of the digital potentiometer is manually adjusted, each step of the manual adjustment requires manual operation, such as manually traversing the input gain value, reading the current gain output value of the gain value, checking whether the gain output value meets the requirements of the equipment, and the like, so the efficiency of the manual adjustment is low, and the accuracy of the gain adjustment is also low because the number of the manually traversed input gain values is limited.
In the embodiment of the invention, after the communication parameters and the test parameters determined by the user are obtained, the gain adjustment value can be generated into the corresponding gain adjustment instruction according to the communication parameters and the test parameters, and the gain adjustment of the digital potentiometer can be automatically completed by controlling the circuit capable of debugging the digital potentiometer through the gain adjustment instruction, so that the gain adjustment efficiency and the gain adjustment precision of the digital potentiometer are improved, and the method and the device are suitable for batch gain adjustment of the digital potentiometer.
Some embodiments provide an automatic adjustment method for a digital potentiometer, which can be applied to an upper computer, so that the upper computer automatically adjusts the gain of the digital potentiometer, for example, automatically adjusts the resistance value of the digital potentiometer, and enables the gain output adjusted by the digital potentiometer to reach a target gain range, thereby meeting the requirements of production and use. Referring to fig. 1, the automatic adjustment method of the digital potentiometer is described in detail below.
Step 100: and acquiring at least one group of communication parameters and test parameters determined by a user, wherein the test parameters at least comprise a gain adjustment range and a target gain range.
Referring to fig. 4, in some embodiments, when adjusting the gain of the digital potentiometer, a corresponding circuit is required to input a digital signal for gain adjustment to the digital potentiometer to adjust the gain of the digital potentiometer, and simultaneously, an actual gain value of the adjusted digital potentiometer is measured to feed back whether the gain reaches a preset gain. Usually, the corresponding circuit can be implemented by a corresponding control motherboard or test board, and the control motherboard or test board is generally provided with a processor and a resistance measurement circuit, wherein the processor is used for adjusting the gain of the digital potentiometer, and the resistance measurement circuit is used for measuring the actual gain value of the digital potentiometer. In some embodiments, the upper computer needs to be in communication connection with the control motherboard or the test board, so as to transmit the corresponding control signal to the control motherboard or the test board, to implement the gain adjustment of the digital potentiometer, and to obtain the actual gain value of the digital potentiometer after adjustment.
In some embodiments, the communication parameters include a communication protocol type. The communication protocol type is used for determining a communication protocol and a corresponding communication mode between the upper computer and the control mainboard or the test board, for example, when the communication protocol type determined by the acquisition user is a USB communication protocol, the upper computer and the control mainboard or the test board can establish communication connection through a USB interface, and data is transmitted through the USB interface. On the contrary, when the upper computer is in communication connection with the control mainboard or the test board through the USB interface, the communication protocol type determined by the user can be acquired to be the USB communication protocol. In this embodiment, through the communication protocol type determined by the user, the upper computer can be in communication connection with the control main board or the test board of different communication protocols, so that the gain adjustment of various digital potentiometers can be met.
In some embodiments, the communication parameters further include a protocol frame structure. The protocol frame structure is used for determining data encapsulation and data decapsulation during data transmission between the upper computer and the control mainboard or the test board. For example, the test parameters can be set in preset bytes according to the protocol frame structure, so that data encapsulation and data decapsulation are facilitated, gain feedback data of the upper computer is transmitted to the control mainboard or the test board, and target data in the gain feedback data can be extracted after the gain feedback data are decapsulated according to the protocol frame structure.
In some embodiments, the test parameters are used to achieve automatic adjustment of the gain of the digital potentiometer. The gain adjustment range represents a range of gain adjustment values that need to be input to the digital potentiometer, so that the digital potentiometer can be adjusted according to each gain adjustment value in the gain adjustment range. And the target gain range represents the range of the target gain required by the digital potentiometer, and when the actual gain value of the digital potentiometer is obtained, the actual gain value meeting the requirement can be selected according to the target gain range. Therefore, the adjustment range of the digital potentiometer is determined through the gain adjustment range, and the actual gain value meeting the requirement is determined through the target gain range, so that the automatic adjustment of the gain of the digital potentiometer can be realized.
In some embodiments, the test parameters further include a gain read duration, which represents a duration of time between when the digital potentiometer has been adjusted and when its actual gain value is read. In some embodiments, after the control main board or the test board inputs the digital signal for gain adjustment to the digital potentiometer, if the actual gain value of the digital potentiometer is measured immediately, an error may exist in the measurement of the actual gain value due to unstable output of the digital potentiometer. Therefore, after a certain delay time, for example, the gain reading time length is prolonged, the output of the digital potentiometer tends to be stable, and the actual gain value of the digital potentiometer is measured at the moment, so that the accuracy of the actual gain value of the digital potentiometer can be improved.
In some embodiments, the upper computer may be in communication connection with a plurality of control motherboards or test boards, so as to perform automatic gain adjustment on a plurality of digital potentiometers simultaneously, and at this time, each time a group of communication parameters and test parameters determined by a user are obtained, the upper computer may be used for automatically adjusting the gain of one digital potentiometer.
Step 200: for each set of communication parameters and test parameters: and obtaining a plurality of gain adjustment values according to a preset step by the gain adjustment range, at least generating at least one corresponding gain adjustment instruction according to the communication parameters by the plurality of gain adjustment values, wherein the at least one gain adjustment instruction is used for being respectively sent to circuits capable of debugging the digital potentiometers, so that the circuits respectively adjust the gains of the digital potentiometers according to the gain adjustment values and respectively detect the actual gain values of the digital potentiometers.
In some embodiments, each time a set of communication parameters and test parameters determined by a user is obtained, a plurality of gain adjustment values are obtained from the gain adjustment range according to a preset step. Under the same gain adjustment range, if the preset step is smaller, the number of gain adjustment values is larger, and the adjustment of the digital potentiometer is more accurate, so that the preset step can be correspondingly adjusted according to the requirement of a user. In this embodiment, since the gain adjustment value is obtained from the gain adjustment range according to the preset step, compared with the case where the gain adjustment value is manually input, the efficiency is higher, and the accuracy can be adjusted as required.
In some embodiments, each gain adjustment value is required to generate a corresponding gain adjustment command according to the communication parameter, and the gain adjustment command is used to be sent to a circuit capable of debugging the digital potentiometer, such as a control motherboard or a test board, and after receiving the gain adjustment command, the control motherboard or the test board adjusts the gain of the digital potentiometer according to the gain adjustment value corresponding to the gain adjustment command and detects an actual gain value corresponding to the digital potentiometer. In some embodiments, the plurality of gain adjustment values may generate a corresponding at least one gain adjustment instruction according to the communication parameter, specifically, the number of gain adjustment instructions may be obtained according to the data length of the gain adjustment instruction, and the number and the data length of the gain adjustment values, for example, each gain adjustment value may generate a corresponding gain adjustment instruction according to the communication parameter, and for example, a corresponding gain adjustment instruction may be generated according to the communication parameter by the plurality of gain adjustment values. In some embodiments, after the user determines the communication protocol type in the communication parameters, after the plurality of gain adjustment values generate corresponding at least one gain adjustment instruction according to the communication parameters, the gain adjustment instruction may be received and processed by the control motherboard or the test board that satisfies the communication protocol type. In some embodiments, after the user determines the protocol frame structure in the communication parameters, when at least a plurality of gain adjustment values generate corresponding at least one gain adjustment instruction according to the communication parameters, the gain adjustment values are further placed in a preset byte section in the gain adjustment instruction according to the protocol frame structure, so as to implement data encapsulation and data decapsulation on the gain adjustment values.
In some embodiments, when the test parameter set by the user further includes a gain reading duration, the gain adjustment values and the gain reading duration generate at least one corresponding gain adjustment instruction according to the communication parameter, where each gain adjustment instruction includes the gain reading duration, so that when the control motherboard or the test board adjusts the gain of the digital potentiometer according to the gain adjustment value corresponding to the gain adjustment instruction, the actual gain value corresponding to the digital potentiometer is detected after delaying the gain reading duration.
Step 300: and acquiring each actual gain value detected by the circuit and a corresponding gain adjustment value.
In some embodiments, after the control motherboard or the test board adjusts the gain of the digital potentiometer according to the gain adjustment value corresponding to the gain adjustment instruction and detects the actual gain value corresponding to the digital potentiometer, the actual gain value and the corresponding gain adjustment value need to be fed back to the upper computer. In some embodiments, the control motherboard or the test board packages the actual gain value and the corresponding gain adjustment value into gain feedback data according to a communication protocol with the upper computer and transmits the gain feedback data to the upper computer, and the upper computer analyzes the gain feedback data according to a protocol frame structure in the communication parameters after receiving the gain feedback data to obtain target data in the gain feedback data and obtain the actual gain value and the corresponding gain adjustment value according to the target data. After all the gain feedback data transmitted by the control mainboard or the test board are obtained, each actual gain value and the corresponding gain adjusting value can be obtained.
Step 400: and respectively judging whether each actual gain value is in the target gain range, and selecting an actual gain value meeting the condition from the actual gain values in the target gain range so as to use a gain adjusting value corresponding to the actual gain value to adjust the gain of the digital potentiometer.
In some embodiments, after the digital potentiometer is adjusted by each gain adjustment value in the gain adjustment range, due to the relatively high accuracy, a plurality of actual gain values meeting the target gain range may be obtained, and therefore, one actual gain value meeting the condition needs to be selected from the plurality of actual gain values, and the gain adjustment value corresponding to the actual gain value is used to adjust the digital potentiometer, so as to complete the final adjustment of the digital potentiometer.
Referring to fig. 2, in some embodiments, when selecting an actual gain value satisfying a condition from the actual gain values in the target gain range, the method specifically includes:
step 410: and judging the number of the actual gain values in the target gain range.
Step 420: if there is only one actual gain value within the target gain range, the actual gain value is selected.
Step 430: and if at least two actual gain values exist in the target gain range, acquiring a middle value of the target gain range.
Step 440: and respectively obtaining the difference value between the at least two actual gain values and the intermediate value, and selecting the actual gain value with the minimum difference value from the at least two actual gain values.
In some embodiments, it is determined whether each actual gain value is within the target gain range, and after all the actual gain values are determined, if only one actual gain value is within the target gain range, it may be that the adjustment accuracy is not high, and at this time, the actual gain value is selected as the actual gain value that satisfies the condition. In some embodiments, if there are at least two actual gain values within the target gain range, it may be said that the adjustment accuracy is higher, at this time, a middle value of the target gain range is obtained according to an end value of the target gain range, then differences between the at least two actual gain values and the middle value are respectively determined, and when the differences are smaller, it is said that the corresponding actual gain value is closer to the middle value, so the actual gain value with the smallest difference is selected as the actual gain value meeting the condition, and the accuracy of the gain adjustment of the digital potentiometer can be improved.
According to the embodiment, each group of communication parameters and test parameters determined by one group of users are acquired, the gain of one digital potentiometer can be automatically adjusted, and therefore, the gain of a plurality of digital potentiometers can be automatically adjusted through a plurality of groups of communication parameters and test parameters, and the adjustment efficiency is improved. The method is applicable to gain adjustment of various digital potentiometers through setting of communication parameters, and can determine gain adjustment precision and a target gain range through setting of test parameters. And then selecting the optimal actual gain value and the corresponding gain adjustment value from the actual gain values in the target gain range to adjust the digital potentiometer, thereby completing the automatic gain adjustment of the digital potentiometer. In the embodiment, because the user determines the communication parameters and the test parameters, the user can control the main board or the test board to complete the gain adjustment of the digital potentiometer according to the automatic production gain adjustment instruction, compared with manual gain adjustment, the efficiency is higher, the method is suitable for batch gain adjustment of the digital potentiometer, the accuracy of the gain adjustment is higher, and different user requirements can be met.
Referring to fig. 3, some embodiments provide an automatic adjustment device for a digital potentiometer, which includes a parameter setting module 10, an instruction generating module 20, a feedback receiving module 30, and a gain adjusting module 40, which are described in detail below.
The parameter setting module 10 is configured to obtain at least one set of communication parameters and test parameters determined by a user, where the test parameters at least include a gain adjustment range and a target gain range.
The instruction generation module 20 is configured to, for each set of communication parameters and test parameters: and obtaining a plurality of gain adjustment values according to a preset step by the gain adjustment range, at least generating at least one corresponding gain adjustment instruction according to the communication parameters by the plurality of gain adjustment values, wherein the at least one gain adjustment instruction is used for being respectively sent to circuits capable of debugging the digital potentiometer, so that the circuits respectively adjust the gain of the digital potentiometer according to the gain adjustment values and respectively detect the actual gain value of the digital potentiometer.
The feedback receiving module 30 is used to obtain each actual gain value detected by the circuit and the corresponding gain adjustment value.
The gain adjusting module 40 is configured to respectively determine whether each actual gain value is within the target gain range, and select an actual gain value meeting a condition from the actual gain values within the target gain range, so that a gain adjusting value corresponding to the actual gain value is used to adjust the gain of the digital potentiometer.
In some embodiments, when selecting one of the actual gain values in the target gain range that satisfies the condition, the gain adjustment module 40 is further configured to: determining the number of said actual gain values within said target gain range; if only one actual gain value exists in the target gain range, selecting the actual gain value; if at least two actual gain values exist in the target gain range, acquiring a middle value of the target gain range; and respectively obtaining the difference values between the at least two actual gain values and the intermediate value, and selecting the actual gain value with the minimum difference value from the at least two actual gain values.
In some embodiments, the test parameters further include a gain reading duration, and the instruction generating module 20 is further configured to: and generating at least one corresponding gain adjusting instruction according to the plurality of gain adjusting values and the gain reading time length and the communication parameters, so that the circuit respectively adjusts the gain of the digital potentiometer according to each gain adjusting value, delays the gain reading time length and then detects the actual gain value of the digital potentiometer.
In some embodiments, the communication parameter includes a communication protocol type, and the instruction generating module 20 is further configured to, after at least generating the plurality of gain adjustment values according to the communication parameter to generate the corresponding at least one gain adjustment instruction, enable the gain adjustment instruction to be received and processed by a circuit that satisfies the communication protocol type.
In some embodiments, the communication parameter includes a protocol frame structure, and the instruction generating module 20 is further configured to, when generating the corresponding at least one gain adjustment instruction from the communication parameter at least by using the plurality of gain adjustment values, further: and placing the gain adjustment value in a preset byte section in a gain adjustment instruction according to the protocol frame structure.
In some embodiments, in obtaining each actual gain value and corresponding gain adjustment value detected by the circuit, the feedback receiving module 30 is configured to: gain feedback data output by the circuit is obtained; and analyzing the gain feedback data according to the protocol frame structure to obtain target data in the gain feedback data, and obtaining each actual gain value and a corresponding gain adjustment value according to the target data.
An apparatus is provided in some embodiments and includes a memory and a processor. Wherein the memory is used for storing programs. The processor is used for realizing the digital potentiometer automatic adjustment method by executing the program stored in the memory.
Some embodiments provide a computer-readable storage medium having a program stored thereon, the program being executable by a processor to implement the above-described digital potentiometer automatic adjustment method.
Those skilled in the art will appreciate that all or part of the functions of the various methods in the above embodiments may be implemented by hardware, or may be implemented by computer programs. When all or part of the functions of the above embodiments are implemented by a computer program, the program may be stored in a computer-readable storage medium, and the storage medium may include: a read only memory, a random access memory, a magnetic disk, an optical disk, a hard disk, etc., and the program is executed by a computer to realize the above functions. For example, the program may be stored in a memory of the device, and when the program in the memory is executed by the processor, all or part of the functions described above can be implemented. In addition, when all or part of the functions in the above embodiments are implemented by a computer program, the program may be stored in a storage medium such as a server, another computer, a magnetic disk, an optical disk, a flash disk, or a removable hard disk, and may be downloaded or copied to a memory of a local device, or may be version-updated in a system of the local device, and when the program in the memory is executed by a processor, all or part of the functions in the above embodiments may be implemented.
The present invention has been described in terms of specific examples, which are provided to aid understanding of the invention and are not intended to be limiting. For a person skilled in the art to which the invention pertains, several simple deductions, modifications or substitutions may be made according to the idea of the invention.
Claims (10)
1. An automatic adjustment method of a digital potentiometer is characterized by comprising the following steps:
acquiring at least one group of communication parameters and test parameters determined by a user, wherein the test parameters at least comprise a gain adjustment range and a target gain range;
for each set of communication parameters and test parameters: obtaining a plurality of gain adjustment values according to a preset step from the gain adjustment range, at least generating at least one corresponding gain adjustment instruction according to the communication parameters by the plurality of gain adjustment values, wherein the at least one gain adjustment instruction is used for being respectively sent to circuits capable of debugging the digital potentiometer, so that the circuits respectively adjust the gain of the digital potentiometer according to the gain adjustment values and respectively detect the actual gain value of the digital potentiometer;
acquiring each actual gain value detected by the circuit and a corresponding gain adjustment value;
and respectively judging whether each actual gain value is in the target gain range, and selecting an actual gain value meeting the condition from the actual gain values in the target gain range so as to use a gain adjusting value corresponding to the actual gain value to adjust the gain of the digital potentiometer.
2. The method of automatic adjustment of a digital potentiometer according to claim 1, wherein the test parameters further include a gain read duration, further comprising:
and generating at least one corresponding gain adjusting instruction according to the plurality of gain adjusting values and the gain reading time length and the communication parameters, so that the circuit respectively adjusts the gain of the digital potentiometer according to each gain adjusting value, delays the gain reading time length and then detects the actual gain value of the digital potentiometer.
3. The method of automatic adjustment of a digital potentiometer according to claim 1, wherein the selecting an actual gain value that satisfies a condition among the actual gain values within the target gain range comprises:
judging the number of the actual gain values in the target gain range;
if only one actual gain value exists in the target gain range, selecting the actual gain value;
if at least two actual gain values exist in the target gain range, acquiring a middle value of the target gain range;
and respectively obtaining the difference value between the at least two actual gain values and the intermediate value, and selecting the actual gain value with the minimum difference value from the at least two actual gain values.
4. The method of claim 1, wherein the communication parameter comprises a communication protocol type, and wherein the gain adjustment instruction is received and processed by a circuit that satisfies the communication protocol type after generating at least one corresponding gain adjustment instruction from the plurality of gain adjustment values according to the communication parameter.
5. The digital potentiometer automatic adjustment method according to claim 1, wherein the communication parameters comprise a protocol frame structure, and when generating the corresponding at least one gain adjustment instruction from at least the plurality of gain adjustment values according to the communication parameters, further comprising:
and placing the gain adjustment value in a preset byte section in a gain adjustment instruction according to the protocol frame structure.
6. The digital potentiometer automatic adjustment method according to claim 5, wherein the obtaining each actual gain value and corresponding gain adjustment value detected by the circuit comprises:
acquiring gain feedback data output by the circuit;
and analyzing the gain feedback data according to the protocol frame structure to obtain target data in the gain feedback data, and obtaining each actual gain value and a corresponding gain adjustment value according to the target data.
7. An automatic adjusting device of a digital potentiometer is characterized by comprising:
the device comprises a parameter setting module, a parameter setting module and a parameter setting module, wherein the parameter setting module is used for acquiring at least one group of communication parameters and test parameters determined by a user, and the test parameters at least comprise a gain adjusting range and a target gain range;
an instruction generation module for, for each set of communication parameters and test parameters: obtaining a plurality of gain adjustment values according to a preset step from the gain adjustment range, at least generating at least one corresponding gain adjustment instruction according to the communication parameters by the plurality of gain adjustment values, wherein the at least one gain adjustment instruction is used for being respectively sent to circuits capable of debugging the digital potentiometer, so that the circuits respectively adjust the gain of the digital potentiometer according to the gain adjustment values and respectively detect the actual gain value of the digital potentiometer;
the feedback receiving module is used for acquiring each actual gain value detected by the circuit and the corresponding gain adjusting value;
and the gain adjusting module is used for respectively judging whether each actual gain value is in the target gain range, and selecting one actual gain value meeting the condition from the actual gain values in the target gain range so as to use the gain adjusting value corresponding to the actual gain value for adjusting the gain of the digital potentiometer.
8. The automatic digital potentiometer according to claim 7, wherein when one of the actual gain values within the target gain range is selected, the gain adjusting module is further configured to:
judging the number of the actual gain values in the target gain range;
if only one actual gain value exists in the target gain range, selecting the actual gain value;
if at least two actual gain values exist in the target gain range, acquiring a middle value of the target gain range;
and respectively obtaining the difference values between the at least two actual gain values and the intermediate value, and selecting the actual gain value with the minimum difference value from the at least two actual gain values.
9. An apparatus, comprising:
a memory for storing a program;
a processor for implementing the method of any one of claims 1-6 by executing the program stored by the memory.
10. A computer-readable storage medium, characterized in that the medium has stored thereon a program which is executable by a processor to implement the method according to any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211633507.1A CN115940857A (en) | 2022-12-19 | 2022-12-19 | Automatic adjustment method, device, equipment and medium for digital potentiometer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202211633507.1A CN115940857A (en) | 2022-12-19 | 2022-12-19 | Automatic adjustment method, device, equipment and medium for digital potentiometer |
Publications (1)
Publication Number | Publication Date |
---|---|
CN115940857A true CN115940857A (en) | 2023-04-07 |
Family
ID=86699039
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202211633507.1A Pending CN115940857A (en) | 2022-12-19 | 2022-12-19 | Automatic adjustment method, device, equipment and medium for digital potentiometer |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN115940857A (en) |
-
2022
- 2022-12-19 CN CN202211633507.1A patent/CN115940857A/en active Pending
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US10802472B2 (en) | Method and apparatus for controlling motor vibration | |
CN110460505B (en) | Parallel bus time sequence calibration method and device and receiving end equipment | |
US20050257076A1 (en) | System and method for controlling power sources of motherboards under test through networks | |
US10606236B2 (en) | Control device, control method, and control program | |
CN112995657B (en) | Camera module testing method, device and system | |
CN115940857A (en) | Automatic adjustment method, device, equipment and medium for digital potentiometer | |
US7640477B2 (en) | Calibration system that can be utilized with a plurality of test system topologies | |
CN116312331B (en) | Image quality adjustment control method and related device for display | |
CN114063758B (en) | Current value obtaining method, device and medium | |
CN111399080A (en) | Gravity sensor testing method and device, electronic device and storage medium | |
JP6324183B2 (en) | Impedance adjustment system and impedance adjustment method | |
CN115016437A (en) | Servo system product position calibration device and method | |
CN109639346B (en) | BOSA calibration method, test terminal and readable storage medium | |
JP4645083B2 (en) | Calibration system | |
KR101989340B1 (en) | Data link layer test method and system of CAN communication | |
CN108337054B (en) | Power calibration method, system, computer device and storage medium | |
JP2007189453A (en) | Device and method for adjusting power level | |
CN109542826B (en) | SPI communication control method, device, equipment and system | |
CN114779057B (en) | Automatic verification system and method for input threshold voltage and electronic equipment | |
CN109061434B (en) | Board level circuit degradation testing method | |
US20020100000A1 (en) | Semiconductor testing apparatus and method for optimizing a wait time until stabilization of semiconductor device output signal | |
CN113259600B (en) | Exposure parameter configuration method and device, electronic equipment and medium | |
EP3696763B1 (en) | Method of creating and optimizing customized data sheets, customer portal and non-transitory computer-readable recording medium | |
CN112214486B (en) | Data storage method, system and device | |
KR101983508B1 (en) | Inverter automatic transfer test device, and method for the same |
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 |