CN110874066B - Potentiometer precision control method and device, storage medium and electronic equipment - Google Patents

Potentiometer precision control method and device, storage medium and electronic equipment Download PDF

Info

Publication number
CN110874066B
CN110874066B CN201811011422.3A CN201811011422A CN110874066B CN 110874066 B CN110874066 B CN 110874066B CN 201811011422 A CN201811011422 A CN 201811011422A CN 110874066 B CN110874066 B CN 110874066B
Authority
CN
China
Prior art keywords
potentiometer
voltage
valve
interval
current
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.)
Active
Application number
CN201811011422.3A
Other languages
Chinese (zh)
Other versions
CN110874066A (en
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.)
Hytera Communications Corp Ltd
Original Assignee
Hytera Communications Corp 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 Hytera Communications Corp Ltd filed Critical Hytera Communications Corp Ltd
Priority to CN201811011422.3A priority Critical patent/CN110874066B/en
Publication of CN110874066A publication Critical patent/CN110874066A/en
Application granted granted Critical
Publication of CN110874066B publication Critical patent/CN110874066B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/042Programme control other than numerical control, i.e. in sequence controllers or logic controllers using digital processors
    • G05B19/0423Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/20Pc systems
    • G05B2219/24Pc safety
    • G05B2219/24215Scada supervisory control and data acquisition

Abstract

The invention provides a potentiometer precision control method, which comprises the following steps: when the moving end of the potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located at present; determining a plurality of valve voltage intervals according to the total voltage, and associating each valve voltage interval with an execution operation corresponding to the valve voltage interval; and judging a valve voltage interval to which the output voltage belongs to determine the corresponding execution operation when the moving end is at the current preset position. The method provided by the invention can be used for acquiring the total voltage of the current potentiometer in real time, determining a plurality of valve voltage intervals according to the total voltage, and associating the execution operation associated with each valve voltage interval with the corresponding execution operation.

Description

Potentiometer precision control method and device, storage medium and electronic equipment
Technical Field
The present invention relates to the field of potentiometers, and in particular, to a method and an apparatus for controlling potentiometer accuracy, a storage medium, and an electronic device.
Background
Nowadays, with the continuous development of communication technology, people utilize communication technology means to realize the gradual upgrade of control of electronic products. The potentiometer, as a common controllable electronic component, is widely used in various electronic products, and can control the various electronic products by changing the resistance value of the potentiometer. For example, a volume knob on a sound box belongs to a potentiometer, and people can change the resistance value of the potentiometer in a circuit by rotating the knob, so that the voltage and the current in the circuit are changed, and the volume of the sound box is changed.
The inventor finds that in the process of controlling various electronic products by applying the potentiometer, the theoretical voltage of the potentiometer is generally used as a reference standard to make a control rule for various electronic products, and the theoretical voltage of the potentiometer is a fixed reference value. However, in actual operation, a certain error exists in the accuracy of the resistance value of the potentiometer, which causes the actual voltage to be inconsistent with the theoretical voltage, and in the actual control process, the actual voltage and the control rule formulated according to the theoretical voltage also have deviation, which causes the potentiometer to have low control accuracy and poor modulation effect.
Disclosure of Invention
The invention aims to solve the technical problem of providing a potentiometer precision control method which can acquire the total voltage of a potentiometer in real time and determine corresponding execution operation according to the total voltage in real time so as to improve the control precision of the potentiometer and improve the modulation effect of the potentiometer.
The invention also provides a potentiometer precision control device for ensuring the realization and application of the method in practice.
A potentiometer precision control method comprises the following steps:
when a moving end of a potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located;
determining a plurality of valve voltage intervals according to the total voltage, and associating execution operation corresponding to each valve voltage interval for each valve voltage interval;
and judging the valve voltage interval to which the output voltage belongs to determine the corresponding execution operation when the mobile terminal is at the current preset position.
The above method, optionally, the obtaining the total voltage of the potentiometer includes:
and starting a Micro Control Unit (MCU), and acquiring the voltage corresponding to the total resistance value of the potentiometer through the MCU.
Optionally, the determining a plurality of valve voltage intervals according to the total voltage includes:
acquiring gear information in operating equipment corresponding to the potentiometer;
and dividing a valve voltage interval corresponding to each gear of the operating equipment in a voltage linear interval corresponding to the total voltage according to a preset division rule by combining the gear information.
Optionally, the above method, associating, for each valve voltage interval, an execution operation corresponding to the valve voltage interval, includes:
acquiring the execution operation corresponding to each gear of the operating equipment in the gear information;
and associating the executed operation with the valve voltage interval corresponding to each divided gear.
Optionally, the method for determining the valve voltage interval to which the output voltage belongs to determine that the moving end is in the current predetermined position, includes:
matching the output voltage with each determined valve voltage interval one by one;
and when the matching is successful, inquiring the executing operation corresponding to the valve voltage interval matched with the output voltage in the pre-generated operation mapping table, and taking the inquired executing operation as the corresponding executing operation when the mobile terminal is at the current preset position.
The above method, optionally, further includes:
and controlling the operating equipment corresponding to the potentiometer, and adjusting the related information in the operating equipment according to the execution operation.
A potentiometer accuracy control apparatus comprising:
the acquisition unit is used for acquiring the total voltage of the potentiometer and the output voltage corresponding to the current preset position of the movable end when the movable end of the potentiometer is at the preset position of the potentiometer;
the first determining unit is used for determining a plurality of valve voltage intervals according to the total voltage and associating execution operation corresponding to each valve voltage interval;
and the second determining unit is used for judging the valve voltage interval to which the output voltage belongs so as to determine the corresponding execution operation when the moving end is at the current preset position.
A potentiometer accuracy control circuit, comprising:
a micro control unit MCU, a potentiometer RP1, a first current limiting resistor R1, a second current limiting resistor R2 and a third current limiting resistor R3,
wherein:
the potentiometer RP1 is connected with a first end of the first current-limiting resistor R1, and a second end of the first current-limiting resistor R1 is connected with a power supply;
a first pin of the micro control unit MCU is connected with a first end of the first current limiting resistor R1 through the second current limiting resistor R2;
and a second pin of the micro control unit MCU is connected with the moving end of the potentiometer RP1 through the third current limiting resistor R3.
A storage medium comprising a stored program, wherein a device on which the storage medium is located is controlled to execute the potentiometer accuracy control method described above when the program is run.
An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by one or more processors to perform the potentiometer accuracy control method.
Compared with the prior art, the invention has the following advantages:
the invention provides a potentiometer precision control method, which comprises the following steps: when a moving end of a potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located at present; determining a plurality of valve voltage intervals according to the total voltage, and associating execution operation corresponding to each valve voltage interval for each valve voltage interval; and judging the valve voltage interval to which the output voltage belongs to determine the corresponding execution operation when the mobile terminal is at the current preset position. According to the accuracy control method of the potentiometer, when the moving end of the potentiometer moves to the preset position of the potentiometer, the total voltage of the current potentiometer is obtained in real time, a plurality of valve voltage intervals are determined according to the total voltage, and then execution operation corresponding to the valve voltage intervals is associated with each valve voltage interval.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings required to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the description below are only some embodiments of the present invention, and it is obvious for those skilled in the art that other drawings can be obtained according to the drawings without creative efforts.
FIG. 1 is a flow chart of a method for controlling potentiometer accuracy according to the present invention;
FIG. 2 is a circuit diagram of a potentiometer accuracy control circuit according to the present invention;
FIG. 3 is a circuit diagram of a potentiometer precision control circuit according to the present invention;
FIG. 4 is a schematic structural diagram of a precision control apparatus for a potentiometer according to the present invention;
fig. 5 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
The invention is operational with numerous general purpose or special purpose computing device environments or configurations. For example: personal computers, server computers, hand-held or portable devices, tablet-type devices, multi-processor apparatus, distributed computing environments that include any of the above devices or equipment, and the like.
An embodiment of the present invention provides a method for controlling precision of a potentiometer, where the method may be applied to a Micro Control Unit (MCU) or various operating devices, an execution main body of the method may be a processor in the MCU or a processor in the operating device, and fig. 1 shows a flowchart of the method for controlling precision of the potentiometer provided in the embodiment of the present invention, where the method includes:
s101: when a moving end of a potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located at present;
in the method provided by the embodiment of the invention, the potentiometer can be arranged in an operation device, and the operation device can be a sound box, a lamp with a specific adjusting function or other devices with an adjusting function combined with the potentiometer. In practical application, when a user adjusts device information by operating an adjusting component on a device, a corresponding moving end in the potentiometer moves for corresponding displacement on a resistor of the potentiometer, and when the moving end of the potentiometer moves to a preset position of the potentiometer, total voltage of the potentiometer corresponding to the total resistance value of the potentiometer at present and output voltage corresponding to the preset position where the moving end of the potentiometer is located at present are obtained.
S102: determining a plurality of valve voltage intervals according to the total voltage, and associating execution operation corresponding to each valve voltage interval for each valve voltage interval;
in the method provided by the embodiment of the present invention, a plurality of valve voltage intervals are determined according to the currently obtained total voltage of the potentiometer, each valve voltage interval is a voltage interval determined according to the total voltage, and the maximum voltage value of the interval is not greater than the total voltage.
S103: and judging the valve voltage interval to which the output voltage belongs to determine the corresponding execution operation when the mobile terminal is at the current preset position.
In the method provided by the embodiment of the invention, each valve voltage interval is associated with a corresponding execution operation, and the execution operation required to be executed when the moving end of the potentiometer is at the current preset position of the potentiometer can be determined by judging which specific voltage interval of a plurality of determined valve voltage intervals the obtained output voltage belongs to.
In the method provided by the embodiment of the invention, when a moving end of a potentiometer moves in the moving process or moves to a certain preset position on the potentiometer, the total voltage corresponding to the current potentiometer is obtained, a plurality of valve voltage intervals are determined according to the total voltage, corresponding execution operation is associated for each valve voltage interval, then, the valve voltage interval to which the obtained output voltage belongs is judged, and the corresponding execution operation when the moving end is at the current position can be further determined. In the method provided by the embodiment of the invention, when the moving end of the potentiometer moves to a certain preset position on the potentiometer, the total voltage of the potentiometer is obtained in real time, and the obtained total voltage of the potentiometer is the actual voltage of the potentiometer.
In order to more clearly describe the precision control method of the potentiometer provided by the embodiment of the present invention, the embodiment of the present invention provides a specific example, and the detailed description is provided for the control process of the precision control method of the potentiometer provided by the present invention, specifically as follows:
supposing that the potentiometer precision control method provided by the embodiment of the invention is applied to sound box equipment, the sound box equipment is provided with the potentiometer, the sound box equipment is provided with a rotary button, and a user can adjust the volume of the sound box by rotating the rotary button. The rotary button is connected with the moving end of the potentiometer, correspondingly, the moving end of the potentiometer moves on the resistor of the potentiometer in the rotating process of the rotary button, and the current or the voltage in the circuit is changed by controlling the resistance value of the resistor connected into the circuit, so that the volume of the sound box is adjusted.
In the prior art, as shown in fig. 2 provided by an embodiment of the present invention, in fig. 2, a maximum voltage V1 at two ends of a resistance value of a potentiometer is a theoretical reference voltage value, that is, in fig. 2, a total voltage V1 of the potentiometer is a fixed value, it is assumed that volume adjustment of an audio equipment has 5 steps, a reference valve voltage interval is allocated to five steps of the audio equipment according to the theoretical reference voltage V1 in fig. 2, for example, a 2 step of the audio equipment corresponds to the reference valve voltage interval 2, a 3 step of the audio equipment corresponds to the reference valve voltage interval 3, a corresponding execution operation is allocated to each reference valve voltage interval, for example, the reference valve voltage interval 2 corresponding to the 2 step executes volume adjustment of an audio box to 20 db, in an actual adjustment process, due to an error existing in the resistance value of the potentiometer, the total voltage at two ends of the potentiometer is unstable, when the audio box is adjusted to the 2 step, an output voltage obtained at a current position of a moving end of the potentiometer is under an influence of an actual voltage at two ends of the potentiometer, the corresponding reference valve voltage interval is likely to the reference valve voltage interval 3, and the actual volume adjustment interval corresponds to the reference valve voltage of the audio box, and thus playing of the audio box is likely to a user, when the audio box is adjusted to the user.
Therefore, an embodiment of the present invention provides a method for controlling precision of a potentiometer, which implements a circuit, and as shown in fig. 3 provided in an embodiment of the present invention, in a process of adjusting a volume of a sound box by rotating a rotary button on the sound box, when a moving end of the potentiometer moves correspondingly on the potentiometer, for each predetermined position where the moving end moves, in the method provided in an embodiment of the present invention, a total voltage across the current potentiometer is obtained in real time through an MCU, and the obtained total voltage across the potentiometer is an actual voltage V1 across the potentiometer. The finally determined gear executing operation is unique in real time, so that the control precision of the potentiometer is improved, and the adjusting effect of the potentiometer is optimized.
In the regulating circuit shown in fig. 2:
suppose that: the minimum error voltage is 1/n, and because the resistance of the potentiometer has an error, in the process of actually calculating the output voltage:
the theoretical reference voltage is:
Figure BDA0001785138810000071
the actual voltage is:
Figure BDA0001785138810000072
let delta be R p Error of (2)
Then, when the moving end moves to the predetermined position, the actual error between the actual output voltage and the theoretical output voltage is:
Figure BDA0001785138810000073
with the accuracy control method provided by the present invention, in the circuit described in fig. 3:
the theoretical reference voltage is:
Figure BDA0001785138810000074
the actual reference voltages are:
Figure BDA0001785138810000075
actually obtained output voltageError of (2): delta of 2 =0
Therefore, according to the potentiometer precision control method provided by the embodiment of the invention, the actual total voltage at the two ends of the potentiometer is taken as a basis, the corresponding valve voltage interval is distributed to each different gear according to the actual total voltage in real time, and the corresponding execution operation is associated, so that the output voltage is not influenced by the resistor value error of the potentiometer in the matching process, the matching is more accurate, the corresponding execution operation is more accurate, the control precision of the potentiometer is further improved, and the adjustment effect of the potentiometer is optimized.
The potentiometer precision control method provided by the embodiment of the invention can be applied to a sound box, and can also be applied to a lamp for adjusting the brightness of the lamp light or other various devices with adjusting functions.
In the method provided by the embodiment of the present invention, in the process of obtaining the total voltage of the potentiometer, the method may specifically include:
and starting the Micro Control Unit (MCU), and acquiring the voltage corresponding to the total resistance value of the potentiometer through the MCU.
The method provided by the embodiment of the invention can be applied to a Micro Control Unit (MCU), and the actual total voltage of two ends corresponding to the total resistance value of the potentiometer is obtained in real time through the pin of the MCU.
In the method provided by the embodiment of the present invention, specifically, the pin of the MCU may be understood as an output port of the MCU, preferably, the output port has a function of converting acquired data, the pin may be an ADC pin, and the ADC is an Analog-to-Digital Converter or an Analog-to-Digital Converter. Refers to a device that converts a continuously varying analog signal into a discrete digital signal.
In the method provided by the embodiment of the invention, on the basis of the existing circuit shown in fig. 2 and as shown in fig. 3, an acquisition line is added, so that the actual voltages at two ends of the potentiometer and the output voltage corresponding to the current preset position of the mobile end can be acquired in real time in the moving process of the mobile end of the potentiometer or when the mobile end moves to a certain preset position. The sampling precision of the actual voltage at the two ends of the potentiometer is higher.
In the method for controlling precision of a potentiometer provided in an embodiment of the present invention, determining a plurality of threshold voltage intervals according to the total voltage includes:
acquiring gear information in operating equipment corresponding to the potentiometer;
and dividing a valve voltage interval corresponding to each gear of the operating equipment in a voltage linear interval corresponding to the total voltage according to a preset division rule by combining the gear information.
In the method provided by the embodiment of the present invention, in the process of determining the plurality of valve voltage intervals, it can be understood that the valve voltage interval is a voltage interval divided from a voltage linear interval corresponding to the total voltage.
In the method provided by the embodiment of the present invention, first, gear information in an operating device corresponding to a potentiometer is obtained, where the gear information may include how many gears are set in the operating device, and execution operating information corresponding to each gear, for example: in the loudspeaker box, 5 volume adjustment gears can be set for the loudspeaker box, the volume can be adjusted to 10 decibels through the first gear, the volume can be adjusted to 20 decibels through the second gear, and the like.
In the actual operation process, the actual total voltage of two ends of the potentiometer collected at present is assumed to be 10V, and the voltage linear interval corresponding to the total voltage is 0-10V.
Assuming that the acquired gear information includes 5 gears of the operating device, the preset division rule can divide the voltage linear interval equally into 5 equal intervals, namely 0-2v, 2v-4V 8230, 8V-10V.
In the method provided by the embodiment of the present invention, preferably, a voltage linear interval of the total voltage may be further extracted, specifically, 1V, 3V, 5V, 7V, and 9V in the voltage linear interval may be selected for 5 gears of the operating device, and the voltage values of the 5 points are respectively added or subtracted by 0.5V to the left and the right to determine 5 voltage intervals, which are 0.5V to 1.5V, \ 8230305V to 9.5V, respectively, and further may determine 5 voltage intervals, and associate corresponding execution operations for the 5 voltage intervals. Each of the execution operations is an information adjusting operation that needs to be performed for each gear.
In the method provided by the embodiment of the invention, the determination of the valve voltage interval is determined by taking the voltage value of the actual total voltage at the two ends of the potentiometer and the output voltage value corresponding to each gear in the operating equipment as reference, so that the voltage interval corresponding to each gear can be determined more accurately, and the operation to be executed is further determined, thereby improving the control precision of the potentiometer.
In the accuracy control method for the potentiometer provided in the embodiment of the present invention, the acquired shift information in the operating device corresponding to the potentiometer may be obvious shift information on the operating device, for example, if 16 shifts capable of adjusting the volume are set on the operating device, the acquired shift information may include specific information of the 16 shifts. In the method provided by the embodiment of the present invention, specific information of the 16 gears may be specifically combined, and in a voltage linear interval corresponding to the total voltage, 16 valve voltage intervals are divided, and correspond to the 16 gears, respectively.
Furthermore, the potentiometer accuracy control method provided by the embodiment of the present invention is also applicable to an operating device that is not provided with an obvious gear, for example, a sound box or a light fixture with a continuous rotation button, and taking the sound box with the continuous rotation button as an example, a user may rotate the button in a clockwise direction to adjust the volume of the sound box to increase, or rotate the button in a counterclockwise direction to adjust the volume of the sound box to decrease. The button may be moved in a fixed sliding groove in one direction to adjust the volume of sound to be larger, and may be moved in the opposite direction to adjust the size of the speaker to be smaller. In the embodiment of the present invention, the specific implementation manner of the adjustment modes such as volume and light is not specifically limited, and the technology of adjusting the information of the operation device by continuously adjusting the button on the operation device in combination with the potentiometer is also applicable to the protection scope of the method provided in the embodiment of the present invention.
Specifically, when a user rotates the button in a certain direction, the button can continuously rotate for displacement at a certain angle, so that the movable end of the potentiometer is driven to move for corresponding displacement on the resistor of the potentiometer, and in the process that the movable end of the potentiometer continuously moves, the output voltage of the potentiometer correspondingly changes continuously.
In the embodiment of the present invention, since the length of the resistor in the potentiometer is fixed, the moving displacement of the moving end of the potentiometer in the resistor is also fixed, and the rotation angle or the moving displacement of the rotary button on the corresponding operating device is also fixed, in the process of continuous rotation of the rotary button, a person skilled in the art can accurately understand that, in the operating device without an obvious gear, in fact, in the process of continuous rotation of the rotary button, a plurality of continuous gears are set, and each gear corresponds to the moving position of the moving end of the potentiometer on the potentiometer. In the method provided by the embodiment of the invention, a plurality of corresponding continuous valve voltage intervals are allocated for the continuous rotation process of the button or the continuous movement process of the button in a certain direction according to the current total voltage of the potentiometer and each angle of continuous rotation of the button or each section of displacement of continuous movement, and corresponding execution operation is associated for each valve voltage interval.
In the accuracy control method for a potentiometer provided in an embodiment of the present invention, the associating and corresponding performing operation between each valve voltage interval includes:
acquiring the execution operation corresponding to each gear of the operating equipment in the gear information;
and associating the executed operation with the valve voltage interval corresponding to each divided gear.
In the method provided by the embodiment of the invention, the gear information includes an execution operation corresponding to each gear of the operating device, and after the execution operation corresponding to each gear in the gear information is acquired, the execution operation is associated with the divided valve voltage interval corresponding to each gear, so that the valve voltage interval determined corresponding to each gear is realized and corresponds to a unique execution operation.
In the accuracy control method for a potentiometer provided in an embodiment of the present invention, determining a valve voltage interval to which the output voltage belongs to determine a corresponding execution operation when the moving end is at a current predetermined position includes:
matching the output voltage with each determined valve voltage interval one by one;
and when the matching is successful, inquiring the executing operation corresponding to the valve voltage interval matched with the output voltage in the pre-generated operation mapping table, and taking the inquired executing operation as the corresponding executing operation when the mobile terminal is at the current preset position.
In the method provided by the embodiment of the invention, after the output voltage corresponding to the preset position where the current potentiometer moving end is located is determined, the valve voltage interval corresponding to the output voltage is determined, then the execution operation corresponding to the valve voltage interval is searched in the generated operation mapping table, and the corresponding execution operation when the potentiometer moving end moves to the current preset position is further determined.
The method provided by the embodiment of the invention further comprises the following steps:
and controlling the operation equipment corresponding to the potentiometer, and adjusting the related information in the operation equipment according to the execution operation.
In the embodiment of the invention, after the execution operation corresponding to the current preset position is determined, the operation equipment is controlled, and the relevant information in the operation equipment is adjusted according to the execution operation, for example, the sound box decibel corresponding to the gear 2 is adjusted, or the light of a lamp is adjusted.
Through the description of the above scheme, in the potentiometer accuracy control method provided by the embodiment of the present invention, in the application of volume adjustment: the volume control is divided into 16 levels from the minimum to the maximum, the series of reference voltage valve values distributed to each level by the 16 levels is determined according to the rule of the rotation angle and the resistance value change by checking the specification of the potentiometer, the reference voltage of the series of valve values is V1, because V1 is a variable, the reference voltage valve value of each level is also a variable, and the voltage value V2 actually acquired along with the rotation of the potentiometer is also V1 as a reference, so that the voltage value actually acquired by V2 tends to be synchronous with the preset reference voltage of each level, and the inaccurate control effect caused by the error of the potentiometer body can be avoided.
Corresponding to the method described in fig. 1, an embodiment of the present invention further provides a precision control device for a potentiometer, which is used for specifically implementing the method in fig. 1, and the precision control device for a potentiometer provided in the embodiment of the present invention may be applied to a micro control unit MCU and various operating devices, and a schematic structural diagram of the precision control device for a potentiometer is shown in fig. 4, and specifically includes:
an obtaining unit 201, configured to obtain, when a moving end of a potentiometer is located at a predetermined position of the potentiometer, a total voltage of the potentiometer and an output voltage corresponding to the predetermined position where the moving end is currently located;
a first determining unit 202, configured to determine a plurality of valve voltage intervals according to the total voltage, and associate an execution operation corresponding to each valve voltage interval for each valve voltage interval;
the second determining unit 203 is configured to determine a valve voltage interval to which the output voltage belongs, so as to determine an execution operation corresponding to the moving end when the moving end is at the current predetermined position.
In the device provided in the embodiment of the present invention, when the moving end of the potentiometer moves in the moving process or moves to a predetermined position on the potentiometer, the total voltage corresponding to the current potentiometer is obtained, a plurality of valve voltage intervals are determined according to the total voltage, a corresponding execution operation is associated with each valve voltage interval, and then, the valve voltage interval to which the obtained output voltage belongs is determined, so that the corresponding execution operation when the moving end is at the current position can be determined. In the method provided by the embodiment of the invention, when the moving end of the potentiometer moves to a certain preset position on the potentiometer, the total voltage of the potentiometer is obtained in real time, and the obtained total voltage of the potentiometer is the actual voltage of the potentiometer.
The embodiment of the present invention corresponds to the potentiometer accuracy control method shown in fig. 1, and further provides a potentiometer accuracy control circuit, the circuit diagram of which can be shown in fig. 3 provided in the embodiment of the present invention, specifically including:
a micro control unit MCU, a potentiometer RP1, a first current limiting resistor R1, a second current limiting resistor R2 and a third current limiting resistor R3,
wherein:
the potentiometer RP1 is connected with a first end of the first current-limiting resistor R1, and a second end of the first current-limiting resistor R1 is connected with a power supply;
a first pin of the micro control unit MCU is connected with a first end of the first current limiting resistor R1 through the second current limiting resistor R2;
and a second pin of the micro control unit MCU is connected with the moving end of the potentiometer RP1 through the third current limiting resistor R3.
In the potentiometer accuracy control circuit provided in the embodiment of the present invention, the first pin and the second pin may be output ports of an MCU, and preferably, the pin may be an ADC port, and the ADC is an analog-to-digital converter or an analog-to-digital converter. Refers to a device that converts a continuously varying analog signal into a discrete digital signal.
The potentiometer precision control circuit provided by the embodiment of the invention can simultaneously acquire the actual total voltage at the two ends of the potentiometer and the output voltage when the movable end of the potentiometer moves to a certain preset position, so that the sampling precision of the voltage at the two ends of the potentiometer is improved, and the control precision of the potentiometer is higher.
An embodiment of the present invention further provides a storage medium, where the storage medium includes a stored program, where when the program runs, a device where the storage medium is located is controlled to execute the method for controlling precision of a potentiometer, where the method specifically includes:
when a moving end of a potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located at present;
determining a plurality of valve voltage intervals according to the total voltage, and associating execution operation corresponding to each valve voltage interval for each valve voltage interval;
and judging the valve voltage interval to which the output voltage belongs to determine the corresponding execution operation when the mobile terminal is at the current preset position.
The above method, optionally, the obtaining the total voltage of the potentiometer includes:
and starting the MCU, and acquiring the voltage corresponding to the total resistance value of the potentiometer through the ADC pin of the MCU.
Optionally, the determining a plurality of valve voltage intervals according to the total voltage includes:
acquiring gear information in operating equipment corresponding to the potentiometer;
and dividing a valve voltage interval corresponding to each gear of the operating equipment in a voltage linear interval corresponding to the total voltage according to a preset division rule by combining the gear information.
Optionally, the above method, associating, for each valve voltage interval, an execution operation corresponding to the valve voltage interval, includes:
acquiring the execution operation corresponding to each gear of the operating equipment in the gear information;
and associating the executed operation with the valve voltage interval corresponding to each divided gear.
Optionally, the method for determining the valve voltage interval to which the output voltage belongs to determine that the corresponding execution operation is performed when the moving end is at the current predetermined position includes:
matching the output voltage with each determined valve voltage interval one by one;
and when the matching is successful, inquiring the executing operation corresponding to the valve voltage interval matched with the output voltage in the pre-generated operation mapping table, and taking the inquired executing operation as the corresponding executing operation when the mobile terminal is in the current preset position.
The above method, optionally, further includes:
and controlling the operating equipment corresponding to the potentiometer, and adjusting the related information in the operating equipment according to the execution operation.
An electronic device is provided in an embodiment of the present invention, and its schematic structural diagram is shown in fig. 5, and specifically includes a memory 301 and one or more programs 302, where the one or more programs 302 are stored in the memory 301, and the one or more programs 302 configured to be executed by the one or more processors 303 include instructions for:
when a moving end of a potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located at present;
determining a plurality of valve voltage intervals according to the total voltage, and associating execution operation corresponding to each valve voltage interval for each valve voltage interval;
and judging the valve voltage interval to which the output voltage belongs to determine the corresponding execution operation when the mobile terminal is at the current preset position.
It should be noted that, in the present specification, the embodiments are all described in a progressive manner, each embodiment focuses on differences from other embodiments, and the same and similar parts among the embodiments may be referred to each other. For the device-like embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
Finally, it should also be noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrases "comprising a," "8230," "8230," or "comprising" does not exclude the presence of additional like elements in a process, method, article, or apparatus that comprises the element.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functions of the units may be implemented in the same software and/or hardware or in a plurality of software and/or hardware when implementing the invention.
From the above description of the embodiments, it is clear to those skilled in the art that the present invention can be implemented by software plus necessary general hardware platform. Based on such understanding, the technical solutions of the present invention may be embodied in the form of software products, which may be stored in a storage medium, such as ROM/RAM, magnetic disk, optical disk, etc., and include instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments or some parts of the embodiments.
The potentiometer precision control method and device provided by the invention are described in detail above, a specific example is applied in the text to explain the principle and the implementation mode of the invention, and the description of the above embodiment is only used to help understand the method and the core idea of the invention; meanwhile, for a person skilled in the art, according to the idea of the present invention, there may be variations in the specific embodiments and the application scope, and in summary, the content of the present specification should not be construed as a limitation to the present invention.

Claims (10)

1. A potentiometer precision control method is characterized by comprising the following steps:
when a moving end of a potentiometer is located at a preset position of the potentiometer, acquiring the total voltage of the potentiometer and the output voltage corresponding to the preset position where the moving end is located at present based on double acquisition lines;
determining a plurality of valve voltage intervals according to the total voltage, and associating execution operation corresponding to each valve voltage interval for each valve voltage interval;
and judging a valve voltage interval to which the output voltage belongs to determine corresponding execution operation when the mobile terminal is at the current preset position, wherein the execution operation is information adjustment operation executable by operation equipment.
2. The method of claim 1, wherein obtaining the total voltage of the potentiometer comprises:
and starting a Micro Control Unit (MCU), and acquiring the voltage corresponding to the total resistance value of the potentiometer through the MCU.
3. The method of claim 1, wherein said determining a plurality of valve voltage intervals from said total voltage comprises:
acquiring gear information in operating equipment corresponding to the potentiometer;
and dividing a valve voltage interval corresponding to each gear of the operating equipment in a voltage linear interval corresponding to the total voltage according to a preset division rule by combining the gear information.
4. The method of claim 3, wherein associating for each valve voltage interval an execution operation corresponding thereto comprises:
acquiring the execution operation corresponding to each gear of the operating equipment in the gear information;
and associating the executed operation with the valve voltage interval corresponding to each divided gear.
5. The method according to claim 1, wherein the determining a valve voltage interval to which the output voltage belongs to determine that the moving end is at the current predetermined position, and the corresponding performing operation comprises:
matching the output voltage with each determined valve voltage interval one by one;
and when the matching is successful, inquiring the executing operation corresponding to the valve voltage interval matched with the output voltage in the pre-generated operation mapping table, and taking the inquired executing operation as the corresponding executing operation when the mobile terminal is at the current preset position.
6. The method of claim 1, further comprising:
and controlling the operating equipment corresponding to the potentiometer, and adjusting the related information in the operating equipment according to the execution operation.
7. A potentiometer accuracy control device, comprising:
the acquisition unit is used for acquiring the total voltage of the potentiometer and the output voltage corresponding to the current preset position of the movable end based on the double acquisition lines when the movable end of the potentiometer is in the preset position of the potentiometer;
the first determining unit is used for determining a plurality of valve voltage intervals according to the total voltage and associating execution operation corresponding to each valve voltage interval;
and the second determining unit is used for judging the valve voltage interval to which the output voltage belongs so as to determine the corresponding execution operation when the moving end is at the current preset position, wherein the execution operation is an information adjusting operation executable by an operating device.
8. A potentiometer accuracy control circuit, wherein the control circuit is configured to perform the control method according to any of claims 1 to 6, the control circuit comprising:
a micro control unit MCU, a potentiometer RP1, a first current limiting resistor R1, a second current limiting resistor R2 and a third current limiting resistor R3,
wherein:
the potentiometer RP1 is connected with a first end of the first current-limiting resistor R1, and a second end of the first current-limiting resistor R1 is connected with a power supply;
a first pin of the micro control unit MCU is connected with a first end of the first current limiting resistor R1 through the second current limiting resistor R2;
and a second pin of the micro control unit MCU is connected with the moving end of the potentiometer RP1 through the third current-limiting resistor R3.
9. A storage medium characterized by comprising a stored program, wherein a device on which the storage medium is located is controlled to execute the potentiometer accuracy control method according to any of claims 1 to 6 when the program is run.
10. An electronic device comprising a memory, and one or more programs, wherein the one or more programs are stored in the memory and configured to be executed by the one or more processors to perform the potentiometer accuracy control method according to any of claims 1 to 6.
CN201811011422.3A 2018-08-31 2018-08-31 Potentiometer precision control method and device, storage medium and electronic equipment Active CN110874066B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811011422.3A CN110874066B (en) 2018-08-31 2018-08-31 Potentiometer precision control method and device, storage medium and electronic equipment

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811011422.3A CN110874066B (en) 2018-08-31 2018-08-31 Potentiometer precision control method and device, storage medium and electronic equipment

Publications (2)

Publication Number Publication Date
CN110874066A CN110874066A (en) 2020-03-10
CN110874066B true CN110874066B (en) 2023-04-11

Family

ID=69715356

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811011422.3A Active CN110874066B (en) 2018-08-31 2018-08-31 Potentiometer precision control method and device, storage medium and electronic equipment

Country Status (1)

Country Link
CN (1) CN110874066B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6208107B1 (en) * 1999-12-03 2001-03-27 Abbott Laboratories Use of digital current ramping to reduce audible noise in stepper motor
JP2006202411A (en) * 2005-01-20 2006-08-03 Sharp Corp Nonvolatile semiconductor storage device and its controlling method
EP2348277A1 (en) * 2010-01-13 2011-07-27 Abb Ag Potentiometer with main adjusting range and special function range and control/evaluation for same
CN103560717A (en) * 2013-10-23 2014-02-05 国家电网公司 Position detection method and device
CN108369084A (en) * 2017-02-22 2018-08-03 深圳和而泰智能控制股份有限公司 A kind of potentiometer gear determines method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH02257991A (en) * 1989-03-31 1990-10-18 Janome Sewing Mach Co Ltd Multifunction type controller
JPH05213049A (en) * 1992-02-07 1993-08-24 Zexel Corp Operation device for heat pump type air conditioner
CN203501968U (en) * 2013-09-29 2014-03-26 苏州蓝博控制技术有限公司 Potentiometer position acquiring circuit
CN204695058U (en) * 2015-06-17 2015-10-07 海信(山东)冰箱有限公司 For gear selector and the refrigerator of electrical equipment
CN107797594A (en) * 2016-09-07 2018-03-13 佛山市顺德区美的电热电器制造有限公司 A kind of control circuit and its method of work
CN107014429A (en) * 2017-03-28 2017-08-04 厦门芯阳科技股份有限公司 A kind of method that controling parameter is adjusted by potentiometer

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6208107B1 (en) * 1999-12-03 2001-03-27 Abbott Laboratories Use of digital current ramping to reduce audible noise in stepper motor
JP2006202411A (en) * 2005-01-20 2006-08-03 Sharp Corp Nonvolatile semiconductor storage device and its controlling method
EP2348277A1 (en) * 2010-01-13 2011-07-27 Abb Ag Potentiometer with main adjusting range and special function range and control/evaluation for same
CN103560717A (en) * 2013-10-23 2014-02-05 国家电网公司 Position detection method and device
CN108369084A (en) * 2017-02-22 2018-08-03 深圳和而泰智能控制股份有限公司 A kind of potentiometer gear determines method and device

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
基地式CAN总线电动执行器设计;刘文斌等;《电子设计工程》(第05期);全文 *

Also Published As

Publication number Publication date
CN110874066A (en) 2020-03-10

Similar Documents

Publication Publication Date Title
US11656694B2 (en) Multi-mode scroll wheel for input device
CN112150962B (en) Chip clock frequency adjusting method and device, chip and electronic equipment
EP3382707A1 (en) Audio file re-recording method, device and storage medium
CN109542376A (en) The vision-control method, apparatus and medium of screen
CN110874066B (en) Potentiometer precision control method and device, storage medium and electronic equipment
US9552810B2 (en) Customizable and individualized speech recognition settings interface for users with language accents
US20140266569A1 (en) Controlling music variables
US10395630B1 (en) Touchless knob and method of use
CN107526569A (en) A kind of volume adjusting method, device, storage medium and mobile terminal
CN110648634B (en) Backlight brightness determining and adjusting method and device, storage medium and electronic equipment
US10199022B1 (en) Touchless signal modifier and method of use
US20140270256A1 (en) Modifying Control Resolution
CN110633756B (en) Recipe generation method, system, device and medium for cooking device
KR102151417B1 (en) Smooth vi mode crossover method at compliance limit threshold
CN106528103B (en) A kind of data migration method, device and calculate equipment
CN111146986B (en) Position locating method and device of magnetic encoder, electronic equipment and computer readable storage medium
CN114461466A (en) Method, device, equipment and storage medium for fine tuning of reference circuit of flash memory chip
CN114776570B (en) Infusion pump speed change adjustment method and device, electronic equipment and readable storage medium
CN111948610B (en) Radar control method and equipment
CN111491176B (en) Video processing method, device, equipment and storage medium
CN109140392B (en) Control method for eliminating irrational gear ratio of rotating pattern disc
CN107621920B (en) Method, device and storage medium for adjusting position of lyric locator
CN115102365A (en) Adjustable power supply system, control method, adjustable power supply and storage medium
Blandino et al. Using a Pursuit Tracking Task to Compare Continuous Control of Various NIME Sensors
CN107708001B (en) Terminal control method and device

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
GR01 Patent grant
GR01 Patent grant