PWM (Pulse Width Modulation) signal acquisition circuit and method, motor driving device and adjustable-speed motor equipment
By using a comparator with variable reference voltage in the PWM signal acquisition circuit, the problem of PWM signal acquisition under industrial field interference is solved, and the accurate signal detection and processing is achieved, which improves the stability of the equipment and reduces the on-site transformation cost.
Patent Information
- Application Number
- CN202411267614.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
In industrial sites, the transmission of PWM signals is easily disturbed, resulting in insufficient high-level amplitude or excessive low-level amplitude, affecting the acquisition and processing of signals.
A PWM signal acquisition circuit is designed, which uses a variable reference voltage to receive the original PWM signal through the comparator, and adjusts the reference voltage to ensure that the frequency and duty cycle of the signal are not zero, so as to achieve effective acquisition of signals under interference.
It effectively eliminates the impact of field interference on PWM signal acquisition, ensures that the frequency and duty cycle of the signal can be accurately detected and processed, improves the operating stability of the equipment, and reduces the cost and cycle of on-site transformation.
Smart Images

Figure CN119125659A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of automatic control technology, and in particular to a PWM signal acquisition circuit and method, a motor drive device, and a speed regulating motor device. Background Art
[0002] With the development of industrial automation, frequency converters, servo drives, speed-adjustable fans and other automation equipment are widely used in industrial sites, and PWM (Pulse Width Modulation) signals, as a way of signal transmission between automation equipment, are increasingly used in industrial sites. The duty cycle of the high and low levels in the PWM signal determines the size of the signal, but in industrial sites, the transmission of PWM signals is often subject to various interferences, resulting in insufficient high-level amplitude of the PWM signal or too high low-level amplitude, thus affecting the acquisition and subsequent processing of the PWM signal. Summary of the invention
[0003] In view of the above problems, the present application provides a PWM signal acquisition circuit and method, a motor drive device and a speed regulating motor device to realize PWM signal acquisition under field interference. The specific scheme is as follows:
[0004] The first aspect of the present application provides a PWM signal acquisition circuit, comprising: a comparator; wherein,
[0005] An input end of the comparator is used as an input end of the PWM signal acquisition circuit to receive the original PWM signal;
[0006] Another input terminal of the comparator is used to receive a reference voltage; the value of the reference voltage is variable;
[0007] The output end of the comparator, as the output end of the PWM signal acquisition circuit, is used to output the PWM signal to be tested and indicate the acquisition result of the original PWM signal by the PWM signal acquisition circuit;
[0008] Wherein, when the frequency and the duty cycle of the PWM signal to be measured are both zero, the value of the reference voltage is adjusted so that at least one of the frequency and the duty cycle is not zero, or an adjustment stop condition is satisfied.
[0009] In a possible implementation, the output end of the PWM signal acquisition circuit is used to connect to a detection interface of a controller;
[0010] The value of the reference voltage is obtained after the controller adjusts the detection result of the PWM signal to be tested.
[0011] In a possible implementation, the PWM signal acquisition circuit further includes: an amplification circuit;
[0012] The input end of the amplifier circuit receives an adjustable voltage; the adjustable voltage is a voltage obtained after the controller adjusts the detection result of the PWM signal to be detected;
[0013] The output end of the amplifier circuit is used to output the reference voltage.
[0014] In a possible implementation, the amplifying circuit includes: an operational amplifier, a first resistor, a second resistor, and a third resistor;
[0015] The non-inverting input terminal of the operational amplifier is connected to the input terminal of the amplifier circuit through the first resistor;
[0016] The inverting input terminal of the operational amplifier is grounded through the second resistor and is also connected to the output terminal of the operational amplifier through the third resistor;
[0017] The output end of the operational amplifier is connected to the output end of the amplifier circuit.
[0018] In a possible implementation, the source of the adjustable voltage is the controller.
[0019] In a possible implementation, the non-inverting input terminal of the comparator serves as the input terminal of the PWM signal acquisition circuit to receive the original PWM signal;
[0020] The inverting input terminal of the comparator receives the reference voltage.
[0021] In a possible implementation, the PWM signal acquisition circuit further includes:
[0022] a pull-up resistor connected between a power supply and a non-inverting input terminal of the comparator;
[0023] Alternatively, a pull-up resistor and a diode are connected in series between the power supply and the non-inverting input terminal of the comparator; when the diode is turned on, current flows from the power supply to the non-inverting input terminal of the comparator.
[0024] A second aspect of the present application provides a PWM signal acquisition method, comprising:
[0025] Acquire a PWM signal to be tested; the PWM signal to be tested is output by the PWM signal acquisition circuit as described in the first aspect or any implementation form of the first aspect above;
[0026] Detecting the frequency and duty cycle of the PWM signal to be tested;
[0027] When both the frequency and the duty cycle are zero, the reference voltage of the PWM signal acquisition circuit is adjusted until at least one of the frequency and the duty cycle is not zero, or until an adjustment stop condition is met.
[0028] In a possible implementation, adjusting the reference voltage of the PWM signal acquisition circuit includes:
[0029] The value of the reference voltage is changed according to a preset method.
[0030] In a possible implementation, the preset method is a dichotomy method.
[0031] In a possible implementation, when the PWM signal acquisition circuit includes an amplification circuit, in the PWM signal acquisition method, changing the value of the reference voltage includes:
[0032] The adjustable voltage received by the input terminal of the amplifier circuit is adjusted.
[0033] In a possible implementation, after at least one of the frequency and the duty cycle is not zero, the method further includes:
[0034] The current value of the reference voltage is saved as the initial value of the reference voltage when the frequency and duty cycle of the PWM signal to be tested are detected next time.
[0035] In a possible implementation, the adjustment stop condition includes: a minimum interval between values of the reference voltage is smaller than a preset difference, and / or a number of adjustments to the reference voltage is greater than a preset number.
[0036] The third aspect of the present application provides a motor drive device, comprising: a controller, a power module, and a PWM signal acquisition circuit as described in the first aspect or any implementation form of the first aspect; wherein:
[0037] The input end of the power module is connected to a power source;
[0038] The output end of the power module is connected to the motor;
[0039] The power module is controlled by the controller;
[0040] The detection interface of the controller is connected to the output end of the PWM signal acquisition circuit;
[0041] The input end of the PWM signal acquisition circuit is connected to the output end of the speed sensor of the motor;
[0042] The controller is used to execute the PWM signal acquisition method as described in the second aspect or any implementation form of the second aspect.
[0043] In a possible implementation, when the PWM signal acquisition circuit includes an amplifier circuit, the voltage output end of the digital-to-analog conversion module in the controller is connected to the input end of the amplifier circuit to provide an adjustable voltage.
[0044] A fourth aspect of the present application provides a speed regulating motor device, comprising: a motor, a speed measuring sensor, and a motor driving device as described in the third aspect or any implementation form of the third aspect;
[0045] The motor is controlled by the motor driving device;
[0046] The speed sensor is used to detect the rotation speed of the motor, generate and output the original PWM signal to the input end of the PWM signal acquisition circuit in the speed regulating motor device.
[0047] By means of the above technical scheme, the PWM signal acquisition circuit provided by the present application receives the original PWM signal through a comparator, and compares it with a reference voltage, thereby realizing the recognition of high and low levels in the original PWM signal, and outputting a PWM signal to be tested as the acquisition result of the original PWM signal by the PWM signal acquisition circuit; moreover, the reference voltage is variable, and is not a fixed value; when the frequency and duty cycle of the PWM signal to be tested are both zero, the value of the reference voltage is adjusted so that at least one of the frequency and the duty cycle is not zero, or the adjustment stop condition is satisfied; for example, when the transmission of the original PWM signal is interfered with on-site, resulting in insufficient high level amplitude or excessive low level amplitude, the reference voltage can be adjusted so that the reference voltage is again between the high and low levels of the original PWM signal, so as to realize the recognition of high and low levels in the original PWM signal, and the PWM signal to be tested obtained after the identification is used as the acquisition result of the original PWM signal under on-site interference, so as to detect the frequency and duty cycle of the PWM signal to be tested. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] The above and other features, advantages and aspects of the embodiments of the present disclosure will become more apparent with reference to the following detailed description in conjunction with the accompanying drawings. Throughout the accompanying drawings, the same or similar reference numerals represent the same or similar elements. It should be understood that the drawings are schematic and the originals and elements are not necessarily drawn to scale.
[0049] Figure 1 A schematic diagram of the structure of a PWM signal acquisition circuit provided in an embodiment of the present application;
[0050] Figure 2 Another structural schematic diagram of the PWM signal acquisition circuit provided in an embodiment of the present application;
[0051] Figure 3Another structural schematic diagram of the PWM signal acquisition circuit provided in an embodiment of the present application;
[0052] Figure 4 Another structural schematic diagram of the PWM signal acquisition circuit provided in an embodiment of the present application;
[0053] Figure 5 A flow chart of a PWM signal acquisition circuit method provided in an embodiment of the present application;
[0054] Figure 6 A schematic diagram of the structure of a speed regulating motor device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0055] The following describes the embodiments of the present application in conjunction with the drawings in the embodiments of the present application. The terms used in the implementation method section of the present application are only used to explain the specific embodiments of the present application, and are not intended to limit the present application.
[0056] The embodiments of the present application are described below in conjunction with the accompanying drawings. Obviously, the described embodiments are only part of the embodiments of the present application, rather than all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of this application. It is known to ordinary technicians in this field that with the development of technology and the emergence of new scenarios, the technical solutions provided in the embodiments of the present application are also applicable to similar technical problems.
[0057] The terms "first", "second", etc. in the specification and claims of the present application and the above-mentioned drawings are used to distinguish similar objects, and need not be used to describe a specific order or sequential order. It should be understood that the terms used in this way can be interchangeable under appropriate circumstances, which is only to describe the distinction mode adopted by the objects of the same attributes when describing in the embodiments of the present application. In addition, the terms "including" and "having" and any of their variations are intended to cover non-exclusive inclusions, so that the process, method, system, product or equipment comprising a series of units need not be limited to those units, but may include other units that are not clearly listed or inherent to these processes, methods, products or equipment.
[0058] The present application provides a PWM signal acquisition circuit to realize PWM signal acquisition under field interference. The specific scheme is as follows:
[0059] See also Figure 1 , the PWM signal acquisition circuit includes: a comparator U1; wherein:
[0060] An input end of the comparator U1, such as the in-phase input end, serves as the input end of the PWM signal acquisition circuit to receive the original PWM signal S1; the original PWM signal S1 refers to the acquisition object of the PWM signal acquisition circuit, that is, the external original signal that has not been processed by the PWM signal acquisition circuit, which can specifically be a speed signal representing the motor speed, or other PWM signals whose frequency and / or duty cycle need to be detected, which is not limited here.
[0061] Another input terminal of the comparator U1, such as the inverting input terminal, receives a reference voltage S3; the value of the reference voltage S3 is variable, that is, the value of the reference voltage S3 is not fixed and can be changed.
[0062] The output end of the comparator U1 serves as the output end of the PWM signal acquisition circuit, and outputs the PWM signal to be measured S4 as the acquisition result of the original PWM signal S1 by the PWM signal acquisition circuit.
[0063] When the frequency and duty cycle of the PWM signal S4 to be measured are both zero, the value of the reference voltage S3 is adjusted so that at least one of the frequency and the duty cycle is not zero, or the adjustment stop condition is met.
[0064] The specific working principle is:
[0065] Assuming that the comparator U1 receives the original PWM signal S1 at the in-phase input terminal and receives the reference voltage S3 at the inverting input terminal, then: under normal circumstances, when the original PWM signal S1 is at a high level, its value will be greater than the reference voltage S3, thereby making the PWM signal S4 to be tested at a high level; when the original PWM signal S1 is at a low level, its value will be less than the reference voltage S3, thereby making the PWM signal S4 to be tested at a low level. Since the PWM signal S4 to be tested will change with the original PWM signal S1, the frequencies of the two are the same, and the duty cycles of the two are also the same, except that the amplitude of the PWM signal S4 to be tested is matched with its receiving device, such as a controller, which is beneficial for the receiving device to further process it and then identify the frequency and duty cycle.
[0066] If the transmission of the original PWM signal S1 is interfered by the field, resulting in insufficient high level amplitude or too high low level amplitude, errors may occur when comparing its high and low levels with the values of the reference voltage S3 under the above normal circumstances. For example, when the high-level amplitude of the original PWM signal S1 is insufficient, it may be smaller than the value of the reference voltage S3 under the above normal circumstances, resulting in that when the original PWM signal S1 is at a high level or a low level, the PWM signal S4 to be tested is at a low level, and can no longer maintain the same frequency and duty cycle as the original PWM signal S1. At this time, the frequency and duty cycle obtained by detecting the PWM signal S4 to be tested will both be zero; and when the low-level amplitude of the original PWM signal S1 is too high, it may be greater than the value of the reference voltage S3 under the above normal circumstances, resulting in that when the original PWM signal S1 is at a high level or a low level, the PWM signal S4 to be tested is at a high level, and can no longer maintain the same frequency and duty cycle as the original PWM signal S1. At this time, the frequency and duty cycle obtained by detecting the PWM signal S4 to be tested will also be zero. Therefore, in this embodiment, the reference voltage S3 is set to be variable. For example, when the original PWM signal S1 is interfered with on-site and the high-level amplitude is insufficient, the value of the reference voltage S3 is lowered; and when the original PWM signal S1 is interfered with on-site and the low-level amplitude is too high, the value of the reference voltage S3 is increased; and the value of the reference voltage S3 can be adjusted based on a preset initial value, which can be an intermediate value within its value range, but is not limited to this. The purpose of adjusting the reference voltage S3 is to make the reference voltage S3 be between the high and low levels of the original PWM signal S1 again, so that the PWM signal S4 to be tested can still change with the original PWM signal S1, and the two maintain the same frequency and duty cycle; in practical applications, if this purpose can be achieved, the frequency and duty cycle obtained by detecting the PWM signal S4 to be tested will no longer be zero, and the above adjustment can be stopped at this time; if this purpose cannot be achieved, but the preset adjustment stop condition is met during the adjustment process, the adjustment can also be stopped to avoid continuing meaningless adjustment when the original PWM signal S1 does not have any high or low level changes.
[0067] The adjustment stop condition may specifically be: the minimum interval between the values of the reference voltage S3 is less than a preset difference, and / or the number of adjustments to the reference voltage S3 is greater than a preset number; for details, please refer to the following content and no detailed introduction is given here.
[0068] In practical applications, the receiving signals corresponding to the two input terminals of the comparator U1 are not limited to the above-mentioned cases, and the inverting input terminal can also be used as the input terminal of the PWM signal acquisition circuit to receive the original PWM signal S1, while the non-inverting input terminal receives the reference voltage S3; at this time, the PWM signal S4 to be tested will be opposite to the high and low levels of the original PWM signal S1, but at this time, the sum of the duty cycle of the PWM signal S4 to be tested and the duty cycle of the original PWM signal S1 is 1, so the duty cycle of the PWM signal S4 to be tested can be subtracted from 1, and the difference obtained can be used as the duty cycle of the original PWM signal S1; the frequency of the PWM signal S4 to be tested is still the same as that of the original PWM signal S1, and no conversion is required. Therefore, this solution is also within the protection scope of this application, depending on its specific application environment.
[0069] The PWM signal acquisition circuit provided in the present embodiment receives the original PWM signal S1 through the comparator U1, and compares it with the reference voltage S3, thereby realizing the recognition of the high and low levels in the original PWM signal S1, and outputting a PWM signal to be tested S4 as the acquisition result of the original PWM signal S1 by the PWM signal acquisition circuit; moreover, the reference voltage S3 is variable, not a fixed value, and will be adjusted according to the above principle; for example, if the transmission of the original PWM signal S1 is interfered with on-site, resulting in insufficient high level amplitude or excessive low level amplitude, the reference voltage S3 can be adjusted so that the reference voltage S3 is again between the high and low levels of the original PWM signal S1, so as to realize the recognition of the high and low levels in the original PWM signal S1, and the PWM signal to be tested S4 obtained after the recognition is used as the acquisition result of the original PWM signal S1 under on-site interference, so as to detect the frequency and duty cycle of the PWM signal to be tested, and realize the PWM signal acquisition under on-site interference.
[0070] On the basis of the previous embodiment, this embodiment further describes the PWM signal acquisition circuit. For example, the output end of the PWM signal acquisition circuit can be used to connect to the detection interface of the controller. The controller can refer to a controller in a motor drive device such as a frequency converter and a motor driver, but is not limited thereto. The controller receives the above-mentioned PWM signal S4 to be tested through the detection interface, and then detects the frequency and duty cycle of the original PWM signal S1.
[0071] In practical applications, if the original PWM signal S1 is interfered with on-site, resulting in insufficient high-level amplitude or too high low-level amplitude, the value of the reference voltage S3 under normal circumstances may cause the PWM signal S4 to be unable to generate corresponding high and low levels, thereby making it impossible for the controller to detect the frequency and duty cycle of the original PWM signal S1. Therefore, the value of the reference voltage S3 can be obtained after adjusting the detection result of the PWM signal S4 to be detected by the controller. If the controller detects the PWM signal S4 to be detected, and the frequency and duty cycle are both 0 in the detection result obtained, it may be caused by the above-mentioned on-site interference; at this time, the reference voltage S3 can be adjusted under this detection result, such as adjusting it in different directions respectively. The specific adjustment method can be referred to below, until at least one of the frequency and duty cycle in the detection result is not 0, or it is determined that the detection result of the frequency and duty cycle being 0 is not caused by the above-mentioned on-site interference, then the adjustment of the reference voltage S3 can be stopped.
[0072] The PWM signal acquisition circuit provided in this embodiment can adjust the reference voltage S3 of the comparator U1 so that the comparator U1 can effectively convert the original PWM signal S1 into a signal recognizable by the chip in the controller (i.e., the PWM signal S4 to be measured), eliminate the amplitude interference of the original PWM signal S1 caused by the field environment, and meet the requirements of adaptive field environment when the external original PWM signal S1 causes fixed amplitude interference to its level due to the field environment.
[0073] It is worth noting that, since the existing PWM signal acquisition circuit can only collect high and low level signals within a certain range, when there is interference on site, resulting in a large change in the amplitude of the high and low levels, which exceeds the detection level range of the circuit, it is necessary to manually go to the site to modify the hardware to adapt to the interference on site. This method is not only time-consuming and labor-intensive, but also in some special occasions, such as offshore wind power and online detection of transmission lines, it is unrealistic to manually go to the site to modify the hardware.
[0074] The PWM signal acquisition circuit provided in this embodiment can adaptively eliminate the influence of on-site interference through the above-mentioned principle. For situations where the product cannot be modified on-site after installation, the operating stability of the product can be improved. For terminal products with large quantities or wide layout areas, the cost and cycle of on-site modification of the product can be greatly reduced.
[0075] In practical applications, the PWM signal acquisition circuit can also be used as Figure 2As shown in , on the basis of the above embodiment, it further includes: an amplifier circuit 101; the input end of the amplifier circuit 101 receives an adjustable voltage S2; the adjustable voltage S2 is a voltage obtained after the controller adjusts the detection result of the above-mentioned PWM signal S4 to be measured, and when adjusting it, it can be adjusted based on a preset initial value, and the initial value can be an intermediate value within its value range, but is not limited to this; the output end of the amplifier circuit 101 outputs the above-mentioned reference voltage S3.
[0076] That is, the controller or other control device can adjust the adjustable voltage S2 according to the detection result in the controller; then, the adjustable voltage S2 is amplified by the amplifier circuit 101 to obtain the reference voltage S3, so that the value of the reference voltage S3 is adjusted.
[0077] Specifically, the source of the adjustable voltage S2 can be directly the controller, for example, the adjustable voltage S2 can be provided by the DAC (Digital-to-Analog Converter) in the controller; at this time, the controller detects the received PWM signal S4 to be tested, obtains the corresponding detection result, and adjusts the output voltage of the adjustable voltage S2 output by its own DAC according to the detection result. In practical applications, the source of the adjustable voltage S2 can also be other power converters, such as an auxiliary power supply for powering the controller, as long as there is an adjustable output voltage and the adjustment range is compatible with the adjustable voltage S2, it is within the protection scope of this application.
[0078] In one example, the amplifier circuit 101 may include Figure 3 As shown in: an operational amplifier U2, a first resistor R1, a second resistor R2 and a third resistor R3; wherein the non-inverting input terminal of the operational amplifier U2 is connected to the input terminal of the amplifier circuit 101 through the first resistor R1 to receive the adjustable voltage S2; the inverting input terminal of the operational amplifier U2 is grounded through the second resistor R2, and is also connected to the output terminal of the operational amplifier U2 through the third resistor R3; the output terminal of the operational amplifier U2 is connected to the output terminal of the amplifier circuit 101 to output the reference voltage S3.
[0079] The amplification factor of the amplifier circuit 101 is (R3+R2) / R2. In practical applications, resistors with appropriate resistance values can be selected according to application requirements to build the above circuit structure.
[0080] In addition, if Figure 4 As shown in , when the non-inverting input terminal of the comparator U1 receives the original PWM signal S1 as the input terminal of the PWM signal acquisition circuit, and the inverting input terminal of the comparator U1 receives the reference voltage S3, the PWM signal acquisition circuit may also include Figure 4 As shown in: pull-up resistor R4, which is connected between power supply VCC and the in-phase input terminal of comparator U1. The existence of the pull-up resistor R4 can ensure the accuracy of the high-level signal, prevent interference, and increase the stability, driving ability and reliability of the circuit; for example, when the original PWM signal S1 comes from a passive contact, a pull-up voltage needs to be provided, and the pull-up resistor R4 is added to limit the current. In practical applications, a diode D can also be connected in series with the pull-up resistor R4, such as Figure 4 As shown in , when the diode D is turned on, current flows from the power supply to the non-inverting input terminal of the comparator U1. The presence of the diode D can prevent current from flowing back to the power supply VCC, and its connection position can be between the pull-up resistor R4 and the comparator U1 (such as Figure 4 ), or between the power supply VCC and the pull-up resistor R4 (not shown in the figure), depending on the specific application environment, all of which are within the protection scope of the present application.
[0081] In one example, assuming that the high level of the original PWM signal S1 is 12V under normal circumstances, at this time, the voltage of the power supply VCC can be 12V, and the amplification factor (R3+R2) / R2 of the amplifier circuit 101 can be 4 times. For example, the resistance values of the first resistor R1 and the second resistor R2 can both be 11kΩ, and the resistance value of the third resistor R3 can be 33kΩ; the value range of the adjustable voltage S2 can be 0 to 3V, then after the amplification effect of the amplifier circuit 101, the value range of the reference voltage S3 obtained is 0 to 12V, which matches the original PWM signal S1 whose high level is 12V under normal circumstances.
[0082] In practical applications, the voltage of the power supply VCC, the amplification factor of the amplifier circuit 101 and the value range of the adjustable voltage S2 can be changed according to actual conditions and are not limited to the above examples.
[0083] In addition, the reference voltage S3 can also be directly provided by other power converters such as the auxiliary power supply mentioned above, that is, the amplifier circuit 101 can also be omitted in the PWM signal acquisition circuit; it depends on the specific application environment and is within the protection scope of this application.
[0084] Based on the above embodiments, this embodiment provides a PWM signal acquisition method. Figure 5 ,include:
[0085] S101, obtaining a PWM signal to be tested.
[0086] The PWM signal to be tested is output by the PWM signal acquisition circuit described in any of the above embodiments, that is, the above PWM signal to be tested S4. The structure and working principle of the PWM signal acquisition circuit can be found in the above embodiments, and will not be described in detail here.
[0087] S102: Detect the frequency and duty cycle of the PWM signal to be tested.
[0088] By counting the high and low level changes of the PWM signal S4 to be tested, the corresponding frequency and duty cycle can be obtained; the detection process of the PWM signal S4 to be tested can refer to the prior art and will not be described in detail here.
[0089] S103 . When both the frequency and the duty cycle are zero, adjust the reference voltage of the PWM signal acquisition circuit until at least one of the frequency and the duty cycle is not zero, or until an adjustment stop condition is satisfied.
[0090] In practical applications, the reference voltage of the PWM signal acquisition circuit (ie, the reference voltage S3 described in the above embodiment) is adjusted, and the corresponding process may specifically include: changing the value of the reference voltage S3 according to a preset method.
[0091] In one example, the preset method can be a binary method. Specifically, assuming that the high level of the original PWM signal S1 is 12V under normal circumstances, the first value of the reference voltage S3, that is, the initial value, can be 6V. If the frequency and duty cycle detected under this value are both zero, the reference voltage S3 needs to be valued for the second time; when the reference voltage S3 is valued for the second time, there are two different values, one of which is 3V, an intermediate value between 0 and 6V, and the other is 9V, an intermediate value between 6 and 12V. In practical applications, the order of adjusting the reference voltage S3 to these two values is not limited; if the frequency and duty cycle detected under the second two values are both zero, the reference voltage S3 needs to be valued for the third time; when the reference voltage S3 is valued for the second time, there are two different values, one of which is 3V, an intermediate value between 0 and 6V, and the other is 9V, an intermediate value between 6 and 12V. In practical applications, the order of adjusting the reference voltage S3 to these two values is not limited; if the frequency and duty cycle detected under the second two values are both zero, the reference voltage S3 needs to be valued for the third time; When the reference voltage S3 is taken for the third time, there are four different values: one value is 1.5V, an intermediate value between 0 and 3V, one value is 4.5V, an intermediate value between 3 and 6V, one value is 7.5V, an intermediate value between 6 and 9V, and the last value is 10.5V, an intermediate value between 9 and 12V. In practical applications, there is no limit to the order in which the reference voltage S3 is adjusted to these four values; if the frequency and duty cycle detected under the third four values are all zero, the reference voltage S3 needs to be taken for the fourth time; ..., and so on, until the frequency and duty cycle detected under a certain value are no longer zero, or the adjustment stop condition is met, then the value of the reference voltage S3 is no longer adjusted.
[0092] In practical applications, the preset method is not limited to the binary method. For example, the first value of the reference voltage S3 can be taken as the center, and the values can be taken on both sides with a certain step size; assuming that the first value of the reference voltage S3 can be 6V, and the step size is 0.1V, then the second value of the reference voltage S3 has two different values: 5.9V and 6.1V, and the third value of the reference voltage S3 also has two different values: 5.8V and 6.2V, ..., and so on, until the frequency and duty cycle detected at a certain value are no longer zero, or the adjustment stop condition is met, then the value of the reference voltage S3 is no longer adjusted.
[0093] In another example, when the PWM signal acquisition circuit includes an amplifier circuit, in the PWM signal acquisition method, the value of the reference voltage is changed, and the process specifically includes: adjusting the adjustable voltage received by the input end of the amplifier circuit (that is, the adjustable voltage S2 described in the above embodiment). For example, taking the case where the amplification factor is 4 in the above embodiment as an example, under the binary method, in order to achieve the first value of the reference voltage S3 of 6V, the initial value of the adjustable voltage S2 should be 1.5V; if further adjustment is required, the adjustable voltage S2 is adjusted to 0.75V and 2.25V respectively, so that the reference voltage S3 can achieve its second value; ..., and so on, until the frequency and / or duty cycle is detected, or the adjustment stop condition is met, the adjustable voltage S2 is no longer adjusted.
[0094] In addition, the adjustment stop condition may specifically be: the minimum interval between each value of the reference voltage S3 is less than the preset difference. That is, when the interval between any two adjacent values in all the values under each value is less than or equal to the preset difference, it means that the value adjustment resolution of the reference voltage S3 is small enough, and the reason why the frequency and duty cycle have not been detected is that there is indeed no original PWM signal S1 outside. At this time, it is meaningless to continue to adjust the value of the reference voltage S3 infinitely, so the value adjustment of the reference voltage S3 can be stopped. In practical applications, the adjustment stop condition may also be that the number of adjustments to the reference voltage S3 is greater than the preset number; that is, according to the voltage value of the high level of the original PWM signal S1 under normal circumstances and the above-mentioned preset method, a preset number that can reflect that the adjustment resolution is small enough can be set in advance, and when the number of adjustments to the reference voltage S3 is greater than the preset number, the value adjustment of the reference voltage S3 is stopped. In addition, according to actual application requirements, the adjustment stop condition can be set to include the above two conditions at the same time to ensure that the adjustment resolution is small enough; the specific settings can depend on the application environment and are all within the protection scope of this application.
[0095] Since the device or equipment where the controller is located may be reset or powered on again under the same on-site interference conditions, in order to avoid the need to re-perform the above-mentioned adjustment process after each reset operation or power-on, the PWM signal acquisition method may also include: saving the current value of the reference voltage S3 as the initial value of the reference voltage S3 when the frequency and duty cycle of the PWM signal to be tested are detected next time, after at least one of the frequency and duty cycle is not zero.
[0096] That is, if a reset operation occurs or the power is recycled, the value obtained after the last adjustment of the reference voltage S3 can be used as its default initial value. If the on-site interference situation is the same, the frequency and / or duty cycle may be detected directly without further adjustment. If the on-site interference changes, the reference voltage S3 needs to be further adjusted, and it will also be adjusted based on the default initial value. When the on-site interference does not change much, the appropriate value can be found quickly, shortening the adjustment process.
[0097] In the case where the PWM signal acquisition circuit includes an amplifier circuit, after at least one of the frequency and the duty cycle is not zero, the current value of the reference voltage S3 is saved as the initial value of the reference voltage when the frequency and the duty cycle of the PWM signal to be measured are detected next time. The specific process is: saving the current value of the adjustable voltage S2 as the initial value of the adjustable voltage S2 when the frequency and the duty cycle of the PWM signal to be measured are detected next time.
[0098] The following is an example of the case where the magnification is 4 and the binary method is used to illustrate the complete process of the controller executing the PWM signal acquisition method:
[0099] When the system is powered on, the controller takes the value of the adjustable voltage S2 for the first time and sets a value k1=1.5V. At this time, the reference voltage S3 is 6V. The original PWM signal S1 is compared by the comparator U1 to generate the PWM signal S4 to be tested. The controller detects the frequency and duty cycle of the PWM signal S4 to be tested.
[0100] If the frequency and the duty cycle are both 0, the adjustable voltage S2 is adjusted. According to the dichotomy principle, the second value of the adjustable voltage S2 has two values k21 and k22, where k21=0.75V and k22=2.25V. The adjustable voltage S2 can be first set equal to the value k21 and then equal to the value k22, or the order of the two can be swapped. If the frequency and / or duty cycle is detected when the adjustable voltage S2 is equal to the value k21 or k22, it means that the self-adaptation is successful and the adjustment is stopped. If the frequency and duty cycle are not detected under the two values, the third value of the adjustable voltage S2 is continued; and so on, until the frequency and / or duty cycle are detected; or, until the interval between any two adjacent values of the adjustable voltage S2 is less than or equal to 10mV, for example, the interval between a value kmn closest to the first value k1 and the first value k1 |kmn-k1|≤10mv, then the adjustment is stopped. At this time, the controller can also generate information that there is no external original PWM signal.
[0101] In addition, during the above adjustment process, when it is detected that the frequency and / or the duty cycle is not 0, that is, when the adaptation is successful, the current value kk of the adjustable voltage S2 can be saved.
[0102] The system is reset or powered on again, and the adjustable voltage S2 is directly set to the value kk saved last time. If the frequency and duty cycle are detected to be 0, the above steps are repeated to perform a new adaptive adjustment process.
[0103] The PWM signal acquisition method provided in this embodiment can adjust the reference voltage S3 of the comparator U1 through software when the external original PWM signal S1 causes fixed amplitude interference to its level due to the field environment, eliminating the amplitude interference of the field environment on the original PWM signal S1, and meeting the requirements of adaptive field environment. For occasions where the product cannot be modified on site after installation, the operating stability of the product can be improved; for terminal products with large quantities or wide layout areas, the cost and cycle of product on-site modification can be greatly reduced.
[0104] Another embodiment of the present application further provides a motor drive device, see Figure 6 , comprising: a controller 20, a power module 30 and a PWM signal acquisition circuit 10 as described in any of the above embodiments; wherein:
[0105] The input end of the power module 30 is connected to a power source; the power source may be a mains supply or a three-phase supply (such as Figure 6), or direct current, which is not limited here. The output end of the power module 30 is connected to the motor 200; the motor 200 can be various motors 200 in the prior art, such as a three-phase permanent magnet synchronous AC servo motor 200, but is not limited thereto, depending on its specific application environment. The power module 30 is controlled by the controller 20.
[0106] In practical applications, the power module 30 can adopt an AC-DC-AC conversion structure, that is, it can include a rectifier circuit, a filter circuit, an inverter circuit, etc. For example, the input mains power or three-phase power can be rectified by a three-phase full-bridge rectifier circuit to obtain the corresponding direct current; then the direct current is frequency-converted by a three-phase sinusoidal PWM voltage-type inverter circuit to drive the motor 200. The controller 20 can control the operation of the power module 30, specifically, control the operation of each power switch tube in the power module 30, so that the power module 30 provides the motor 200 with corresponding electric energy, so that the speed of the motor 200 reaches the controller 20.
[0107] The motor driving device 100 may be a device such as a frequency converter, a servo driver, etc. that can drive the motor 200, which is not limited here.
[0108] In addition, the detection interface of the controller 20 is connected to the output end of the PWM signal acquisition circuit 10 to receive the above-mentioned PWM signal S4 to be tested; the input end of the PWM signal acquisition circuit 10 is connected to the output end of the speed sensor of the motor 200 to receive the above-mentioned original PWM signal S1.
[0109] In practical applications, the speed sensor is arranged in the motor 200, which can specifically be a rotary transformer, a photoelectric encoder, a Hall encoder, etc., which is not limited here and can be determined according to its specific application environment, all of which are within the protection scope of this application.
[0110] The structure and working principle of the PWM signal acquisition circuit 10 can be found in the above embodiment and will not be described in detail here.
[0111] The controller 20 is used to execute the PWM signal acquisition method as described in any of the above embodiments. The specific process and principle of the PWM signal acquisition method can be referred to the above embodiments, and will not be repeated here. In practical applications, S103 in the PWM signal acquisition method can also be executed by other devices, such as a control device or a host computer connected to the controller 20, which can directly or indirectly adjust the reference voltage S3 so that the controller 20 can detect the frequency and duty cycle of the original PWM signal S1, all of which are within the protection scope of the present application.
[0112] In addition, when the PWM signal acquisition circuit 10 includes an amplifier circuit, a voltage output terminal of the DAC in the controller 20 can be connected to the input terminal of the amplifier circuit to provide the above-mentioned adjustable voltage S2; at this time, the controller 20 adjusts the adjustable voltage S2 by adjusting the corresponding output voltage of its DAC, thereby indirectly adjusting the reference voltage S3. Of course, as described in the above embodiment, the controller 20 can also control other auxiliary power supplies to output the adjustable voltage S2, depending on the specific application environment, which is within the protection scope of this application.
[0113] The motor drive device 100 provided in this embodiment realizes the acquisition of PWM signals through the PWM signal acquisition circuit 10, which can eliminate the interference of the field environment on the amplitude of the original PWM signal S1, and meet the requirements of adaptive field environment. For occasions where the product cannot be modified on site after installation, the operating stability of the product can be improved; for terminal products with large quantities or wide layout areas, the cost and cycle of product on-site modification can be greatly reduced.
[0114] Another embodiment of the present application also provides a speed regulating motor device, such as Figure 6 As shown in the figure, it includes: a motor 200, a speed sensor (not shown) and a motor drive device 100 as described in any of the above embodiments; wherein the motor 200 is controlled by the motor drive device 100; the structure and working principle of the motor drive device 100 can be referred to the above embodiments, and will not be repeated here. The speed sensor is used to detect the speed of the motor 200, generate and output the original PWM signal to the input end of the PWM signal acquisition circuit 10 in the motor drive device 100.
[0115] The speed-regulating motor device may be a device with controllable motor speed, such as a speed-regulating fan, which is not limited here; as long as the speed signal is collected during the motor speed control process, the PWM signal collection circuit 10 and / or the PWM signal collection method described in the above embodiment is used, it is within the protection scope of the present application.
[0116] The speed regulating motor device provided in this embodiment can eliminate the interference of the field environment on the amplitude of the original PWM signal by using the above motor driving device 100, and meet the requirements of adaptive field environment. For occasions where the product cannot be modified on site after installation, the operating stability of the product can be improved; for terminal products with large quantities or wide layout areas, the cost and cycle of product on-site modification can be greatly reduced.
[0117] The same and similar parts between the various embodiments in this specification can refer to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the system or system embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can refer to the partial description of the method embodiment. The system and system embodiments described above are only schematic, wherein the units described as separate components may or may not be physically separated, and the components displayed as units may or may not be physical units, that is, they may be located in one place, or they may be distributed on multiple network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of this embodiment. Ordinary technicians in this field can understand and implement it without paying creative work.
[0118] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of this application.
[0119] For the above description of the disclosed embodiments, the features described in the embodiments in this specification may be replaced or combined with each other, so that professionals in the field can implement or use the present application. Various modifications to these embodiments will be obvious to professionals in the field, and the general principles defined herein can be implemented in other embodiments without departing from the spirit or scope of the present application. Therefore, the present application will not be limited to the embodiments shown herein, but will conform to the widest scope consistent with the principles and novel features disclosed herein.
Claims
1. A PWM signal acquisition circuit, It is characterized in that include: Comparator; where An input end of the comparator is used as an input end of the PWM signal acquisition circuit to receive the original PWM signal; Another input terminal of the comparator is used to receive a reference voltage; the value of the reference voltage is variable; The output end of the comparator, as the output end of the PWM signal acquisition circuit, is used to output the PWM signal to be tested and indicate the acquisition result of the original PWM signal by the PWM signal acquisition circuit; Wherein, when the frequency and the duty cycle of the PWM signal to be measured are both zero, the value of the reference voltage is adjusted so that at least one of the frequency and the duty cycle is not zero, or an adjustment stop condition is satisfied.
2. The PWM signal acquisition circuit according to claim 1, It is characterized in that The output end of the PWM signal acquisition circuit is used to connect to the detection interface of the controller; The value of the reference voltage is obtained after the controller adjusts the detection result of the PWM signal to be tested.
3. The PWM signal acquisition circuit according to claim 1, It is characterized in that Also includes: Amplifier circuit; The input end of the amplifier circuit receives an adjustable voltage; the adjustable voltage is a voltage obtained after the controller adjusts the detection result of the PWM signal to be detected; The output end of the amplifier circuit is used to output the reference voltage.
4. The PWM signal acquisition circuit according to claim 3, It is characterized in that The amplifying circuit comprises: an operational amplifier, a first resistor, a second resistor and a third resistor; The non-inverting input terminal of the operational amplifier is connected to the input terminal of the amplifier circuit through the first resistor; The inverting input terminal of the operational amplifier is grounded through the second resistor and is also connected to the output terminal of the operational amplifier through the third resistor; The output end of the operational amplifier is connected to the output end of the amplifier circuit.
5. The PWM signal acquisition circuit according to claim 3, It is characterized in that The source of the adjustable voltage is the controller.
6. The PWM signal acquisition circuit according to any one of claims 1 to 5, It is characterized in that The non-inverting input terminal of the comparator serves as the input terminal of the PWM signal acquisition circuit to receive the original PWM signal; The inverting input terminal of the comparator receives the reference voltage.
7. The PWM signal acquisition circuit according to claim 6, It is characterized in that Also includes: a pull-up resistor connected between a power supply and a non-inverting input terminal of the comparator; Alternatively, a pull-up resistor and a diode are connected in series between the power supply and the non-inverting input terminal of the comparator; when the diode is turned on, current flows from the power supply to the non-inverting input terminal of the comparator.
8. A PWM signal acquisition method, It is characterized in that include: Acquire a PWM signal to be tested; the PWM signal to be tested is output by the PWM signal acquisition circuit according to any one of claims 1 to 7; Detecting the frequency and duty cycle of the PWM signal to be tested; When both the frequency and the duty cycle are zero, the reference voltage of the PWM signal acquisition circuit is adjusted until at least one of the frequency and the duty cycle is not zero, or until an adjustment stop condition is met.
9. The PWM signal acquisition method according to claim 8, It is characterized in that Adjusting the reference voltage of the PWM signal acquisition circuit includes: The value of the reference voltage is changed according to a preset method.
10. The PWM signal acquisition method according to claim 9, It is characterized in that The preset method is a dichotomy method.
11. The PWM signal acquisition method according to claim 9, It is characterized in that When the PWM signal acquisition circuit includes an amplifier circuit, in the PWM signal acquisition method, changing the value of the reference voltage includes: The adjustable voltage received by the input terminal of the amplifier circuit is adjusted.
12. The PWM signal acquisition method according to any one of claims 8 to 11, It is characterized in that After at least one of the frequency and the duty cycle is not zero, the method further comprises: The current value of the reference voltage is saved as the initial value of the reference voltage when the frequency and duty cycle of the PWM signal to be tested are detected next time.
13. The PWM signal acquisition method according to any one of claims 8 to 11, It is characterized in that The adjustment stop condition includes: the minimum interval between the values of the reference voltage is smaller than a preset difference, and / or the number of adjustments to the reference voltage is greater than a preset number.
14. A motor drive device, It is characterized in that include: A controller, a power module and a PWM signal acquisition circuit as claimed in any one of claims 1 to 7; wherein: The input end of the power module is connected to a power source; The output end of the power module is connected to the motor; The power module is controlled by the controller; The detection interface of the controller is connected to the output end of the PWM signal acquisition circuit; The input end of the PWM signal acquisition circuit is connected to the output end of the speed sensor of the motor; The controller is used to execute the PWM signal acquisition method as described in any one of claims 8 to 13.
15. The motor drive device according to claim 14, It is characterized in that When the PWM signal acquisition circuit includes an amplifier circuit, the voltage output end of the digital-to-analog conversion module in the controller is connected to the input end of the amplifier circuit to provide an adjustable voltage.
16. A speed regulating motor device, It is characterized in that include: A motor, a speed sensor and a motor drive device as claimed in claim 14 or 15; The motor is controlled by the motor driving device; The speed sensor is used to detect the rotation speed of the motor, generate and output the original PWM signal to the input end of the PWM signal acquisition circuit in the speed regulating motor device.
Citation Information
Cited By
Pwm signal acquisition circuit, test device and test system
CN121741279B
