A method for accurately calculating the deviation of waveform when the oscilloscope knob is moved

By calculating the pixel value corresponding to each contact point rotated by the oscilloscope knob, it solves the problem of precise control of the digital oscilloscope when adjusting the waveform offset, achieves precise waveform movement under different conditions, and improves the user operating experience.

CN117929824BActive Publication Date: 2024-09-13QINGDAO HANTEK ELECTRONICS
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202410088797.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2024-01-23
Publication Date
2024-09-13
Estimated Expiration
2044-01-23

AI Technical Summary

Technical Problem

It is difficult for existing digital oscilloscopes to achieve precise control when using a touch screen to adjust the waveform offset position, and due to different screen sizes, the knob may move too fast or too slowly when adjusting the waveform, affecting the user's observation effect.

Method used

By determining the current number of contacts of the knob, the drawing range displayed by the oscilloscope, the number of pixels for one rotation of the knob and the ADC drawing range, the pixel value corresponding to each contact point of the knob is calculated to accurately adjust the waveform movement.

Benefits of technology

It achieves precise control of waveform movement under different oscilloscope and knob conditions, ensuring that the waveform movement is exactly one grid when the knob is rotated for one revolution, improving the accuracy and comfort of user operations.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN117929824B
    Figure CN117929824B
Patent Text Reader

Abstract

The present invention discloses a method for accurately calculating the waveform offset size of an oscilloscope knob movement, the steps comprising: step S1, determining the number of contacts cNum of the current knob; step S2, determining the drawing range Pix displayed by the current oscilloscope 总 And the number of pixels that are offset when the knob is rotated one circle Pix 旋 ; Step S3, determine the current oscilloscope ADC drawing range ADC 总 ; Step S4, calculate the number of pixels required to move a single ADC quantization value; Step S5, calculate the ADC quantization value required for one rotation of the knob; Step S6, calculate the ADC quantization value corresponding to a single contact of the knob; Step S7, calculate the number of pixels moved by the waveform. The present invention can accurately calculate the pixel value that needs to be moved for each rotation of a contact of the knob, so that the pixel value that needs to be moved corresponding to the rotation of part of the contact, half a rotation or a rotation of the knob can be adjusted, and the movement of the waveform can be accurately controlled by the knob.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The invention relates to the technical field of calculating the movement size of a waveform, and in particular to a method for accurately calculating the deviation size of an oscilloscope knob movement waveform. Background Art

[0002] At present, digital oscilloscopes have become a commonly used electronic measuring instrument. By converting the collected values ​​into digital signals for processing, the changes in waveforms can be observed more intuitively.

[0003] Existing digital oscilloscopes usually use a control method that uses a touch screen and a knob to adjust the waveform for observation; however, it is difficult to achieve precise control when using the touch screen to change the offset position of the waveform displayed by the digital oscilloscope, so the knob needs to be used again for readjustment; and because the display screen size of the oscilloscope is different, the number of displayed grids is also different. If the pixels corresponding to the movement of the waveform when the knob is turned are not controlled, when the knob is turned to adjust the waveform, the waveform will move too fast or too slow, which is not conducive to the user's observation of the waveform;

[0004] Therefore, the existing technology can no longer meet the needs of people at this stage. Based on the current situation, it is urgent to improve the existing technology. Summary of the invention

[0005] The object of the present invention is to provide a method for accurately calculating the offset of an oscilloscope knob movement waveform, so as to solve the problems raised in the above background technology.

[0006] The present invention provides the following technical solution: a method for accurately calculating the offset of an oscilloscope knob movement waveform, the steps comprising:

[0007] Step S1, determining the number of contacts cNum of the current knob;

[0008] Step S2, determine the current drawing range Pix displayed by the oscilloscope 总 And the number of pixels that are offset when the knob is rotated one circle Pix 旋 ;

[0009] Step S3, determining the ADC drawing range ADC of the current oscilloscope 总 ;

[0010] Step S4, according to the drawing range of the oscilloscope display in step S2 and the drawing range of the ADC in step S3, calculate the number of pixels required to move a single ADC quantization value: Pix ADC =Pix 总 / ADC 总 ;

[0011] Step S5, based on the number of pixels determined in step S2 for one rotation of the knob and the number of pixels required to move a single ADC quantization value calculated in step S4, calculate the ADC quantization value required for one rotation of the knob: ADC 周 =Pix 旋 / PIX ADC ;

[0012] Step S6, based on the ADC quantization value of the knob rotating one circle calculated in step S5 and the number of contacts of the current knob determined in step S1, calculate the ADC quantization value corresponding to a single contact of the knob: K = ADC 周 / cNum;

[0013] Step S7, calculate the number of pixels Pix that the waveform moves based on the number of pixels required to move the single ADC quantization value calculated in step S4, the ADC quantization value corresponding to the single knob contact calculated in step S6, and the number of contacts currently rotated by the knob. 显 =K×Number of contacts of the current knob rotation×Pix ADC .

[0014] Preferably, the number of pixels offset by rotating the knob one circle is Pix 旋 The plot range of the oscilloscope display when the height of a grid is 总 The value is exactly the height of 8 grids.

[0015] Preferably, the ADC drawing range is proportional to the number of quantization bits of the ADC. The higher the number of quantization bits, the larger the drawing range.

[0016] The present invention has the following beneficial effects:

[0017] Through the calculation method of the present invention, even if the number of contacts of the knobs of different oscilloscopes is different, the drawing ranges displayed by the oscilloscopes are different, the number of pixels offset when the knob is rotated one circle is different, and the ADC drawing ranges of the oscilloscopes are different, the pixel value to be moved corresponding to each rotation of one contact of the knob can be accurately calculated, so that the pixel value to be moved corresponding to the rotation of part of the contacts, half a circle or one circle of the knob can be adjusted, and the movement of the waveform can be accurately controlled by the knob; the pixels moved by the waveform when the knob of the present invention is rotated one circle is exactly one grid, which makes it easier for users to use. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] Figure 1 Determine the drawing range Pix displayed by the current oscilloscope for the present invention 总 Schematic diagram of the mapping relationship on the oscilloscope screen;

[0019] Figure 2 Determine the drawing range Pix displayed by the current oscilloscope for the present invention 总And the number of pixels that are offset when the knob is rotated one circle Pix 旋 Schematic diagram of the comparative mapping relationship;

[0020] Figure 3 The present invention is an overall flow chart. DETAILED DESCRIPTION

[0021] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. All other embodiments obtained by ordinary technicians in the field of the present invention without creative work are within the scope of protection of the present invention.

[0022] refer to Figure 1-Figure 3 The present invention provides the following technical solution: a method for accurately calculating the offset size of an oscilloscope knob movement waveform, comprising:

[0023] Step S1, determining the number of contacts cNum of the current knob;

[0024] In this embodiment, the number of contacts of the knob is determined by the mechanical structure of the knob itself. The more contacts there are, the more precise the control of the instrument will be. It will be more comfortable if the knob rotates more than 5° each time. This embodiment takes 7.5° as an example, that is, cNum=48.

[0025] Step S2, determine the current drawing range Pix displayed by the oscilloscope 总 And the number of pixels that are offset when the knob is rotated one circle Pix 旋 ;

[0026] In this embodiment, the oscilloscope has a grid display, and the specific number of pixels when the knob rotates one circle can be determined according to the number of grids. In this embodiment, the number of pixels Pix selected when the knob rotates one circle is offset. 旋 The value is 60px, which is the height of a grid; and the drawing range selected in this embodiment is Pix 总 The value is 480px, which is the height of 8 grids.

[0027] Step S3, determining the ADC drawing range ADC of the current oscilloscope 总 ;

[0028] In this embodiment, the ADC drawing range depends on the number of bits of the analog-to-digital converter, that is, the number of quantization bits. The higher the number of quantization bits, the larger the drawing range. The quantization value range of the ADC used in this embodiment is 192.

[0029] Step S4, according to the drawing range of the oscilloscope display in step S2 and the drawing range of the ADC in step S3, calculate the number of pixels required to move a single ADC quantization value: Pix ADC =Pix 总 / ADC 总 ;

[0030] In this embodiment, Pix ADC =Pix 总 / ADC 总 =480 / 192=2.5.

[0031] Step S5, based on the number of pixels determined in step S2 for one rotation of the knob and the number of pixels required to move a single ADC quantization value calculated in step S4, calculate the ADC quantization value required for one rotation of the knob: ADC 周 =Pix 旋 / PIX ADC ;

[0032] In this embodiment, ADC 周 The number and cNum number are usually not equal, that is, one knob value may require multiple ADC quantization values ​​to correspond. In this embodiment, the ADC quantization value required for one rotation of the knob is: ADC 周 =Pix 旋

[0033] / PIX ADC =60 / 2.5=24.

[0034] Step S6, based on the ADC quantization value of the knob rotating one circle calculated in step S5 and the number of contacts of the current knob determined in step S1, calculate the ADC quantization value corresponding to a single contact of the knob: K = ADC 周 / cNum;

[0035] In this embodiment, since the ADC 周 The number and cNum number are usually not equal, so it is necessary to calculate the ADC quantization value K corresponding to a single contact of the knob = ADC 周 / cNum=24 / 48=0.5.

[0036] Step S7, calculate the number of pixels Pix that the waveform moves based on the number of pixels required to move the single ADC quantization value calculated in step S4, the ADC quantization value corresponding to the single knob contact calculated in step S6, and the number of contacts currently rotated by the knob. 显 =K×Number of contacts of the current knob rotation×Pix ADC ;

[0037] In this embodiment, when the number of contacts of the current knob is 1, the moving pixel Pix is ​​displayed.显 =0.5*1*2.5=1.25px; that is, each time the knob rotates one contact point, the pixel value moves 1.25px; when the number of contacts rotated by the current knob is 48, that is, when the knob rotates one circle, the number of pixels that the waveform moves is Pix 显 =0.5*48*2.5=60px; That is, in this embodiment, when the knob rotates one circle, the pixels of the waveform move just one grid, or the pixels moved just equal the number of pixels Pix that are offset when the knob rotates one circle 旋 , namely Pix 显 =Pix 旋 , which makes it more accurate to control the waveform movement through the knob during the adjustment of the oscilloscope waveform offset.

[0038] Although the present invention has been described in detail with reference to the aforementioned embodiments, it is still possible for those skilled in the art to modify the technical solutions described in the aforementioned embodiments, or to make equivalent substitutions for some of the technical features therein. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present invention should be included in the protection scope of the present invention.

Claims

1. A method for accurately calculating the waveform offset of an oscilloscope knob movement, characterized in that: According to the number of touch points of the knobs in different oscilloscopes, the drawing range of the oscilloscope display, the number of pixels shifted when the knob is rotated one circle, and the ADC drawing range of the oscilloscope, the pixel value required to move each time the knob is turned one touch point can be calculated, and the waveform movement can be accurately controlled by the knob; The steps include: Step S1, determining the number of contacts cNum of the current knob; Step S2, determine the current drawing range Pix displayed by the oscilloscope 总 And the number of pixels that are offset when the knob is rotated one circle Pix 旋 ; Step S3, determining the ADC drawing range ADC of the current oscilloscope 总 ; Step S4, according to the drawing range of the oscilloscope display in step S2 and the drawing range of the ADC in step S3, calculate the number of pixels required to move a single ADC quantization value: Pix ADC =Pix 总 / ADC 总 ; Step S5, based on the number of pixels determined in step S2 for one rotation of the knob and the number of pixels required to move a single ADC quantization value calculated in step S4, calculate the ADC quantization value required for one rotation of the knob: ADC 周 =Pix 旋 / Pix ADC ; Step S6, based on the ADC quantization value of the knob rotating one circle calculated in step S5 and the number of contacts of the current knob determined in step S1, calculate the ADC quantization value corresponding to a single contact of the knob: K = ADC 周 / cNum; Step S7, calculate the number of pixels Pix that the waveform moves based on the number of pixels required to move the single ADC quantization value calculated in step S4, the ADC quantization value corresponding to the single knob contact calculated in step S6, and the number of contacts currently rotated by the knob. 显 =K×Number of contacts of the current knob rotation×Pix ADC ; When the knob is rotated one circle, the number of pixels that the waveform moves is equal to the number of pixels that are offset when the knob is rotated one circle. 旋 , namely Pix 显 =Pix 旋 ; The pixel value required to move one touch point when the knob is turned = Pix 显 =K×Pix ADC The pixel value can be used to accurately calculate the number of pixels that the waveform moves when the knob is rotated one circle. 显 to determine the most suitable number of contacts cNum for the knob.

2. The method for accurately calculating the offset of an oscilloscope knob movement waveform according to claim 1, characterized in that: For step S2, the number of pixels Pix that is offset by rotating the knob one circle 旋 When the height of a grid is set, the drawing range of the oscilloscope display is Pix 总 The value is the height of 8 grids.

3. The method for accurately calculating the offset of an oscilloscope knob movement waveform according to claim 1, characterized in that: For step S7, when the knob rotates one circle, the number of pixels that the waveform moves is Pix. 显 A grid size.

4. The method for accurately calculating the deviation of an oscilloscope knob movement waveform according to claim 1, characterized in that: For step S3, the ADC drawing range is proportional to the number of quantization bits of the ADC. The higher the number of quantization bits, the larger the drawing range.