PWM signal control method and device, vehicle and storage medium
By compensating for the residual value of the previous cycle in the PWM signal control, the problem of insufficient current control accuracy of the motor controller is solved, and higher current control accuracy and stability and efficiency of the electric control system are achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-10-13
- Publication Date
- 2026-03-13
AI Technical Summary
The current control accuracy of existing motor controllers is insufficient, mainly because existing PWM signal control algorithms produce errors during narrow pulse control, resulting in inaccurate current control of the motor controller.
By calculating the residual value of the previous cycle and compensating it for the current cycle, the pulse width and time of the PWM signal are adjusted to ensure improved current control accuracy under the premise of narrow pulse control.
It improves the current control accuracy of the motor controller, reduces current control errors, and enhances the stability and efficiency of the electrical control system.
Smart Images

Figure CN121664070A_ABST
Abstract
Description
Technical Field
[0001] This invention belongs to the field of motor control, and particularly relates to a PWM signal control method, device, vehicle, and storage medium. Background Technology
[0002] As the core execution unit of an electronic control system, the motor controller achieves precise control of the motor by regulating the on and off times of power semiconductor devices. Power semiconductor devices are not only the core carriers for the motor controller to complete power conversion and command execution, but also the fundamental components supporting the efficient operation of the electronic control system. They are widely used in new energy vehicles, industrial frequency converters, rail transportation, and other fields. Their performance directly determines the reliability, efficiency, and safety of the entire electronic control system, and is the foundation for its efficient operation.
[0003] In practical operation, power semiconductor devices experience a response time from receiving control signals at the gate to completing the device's turn-on or turn-off action. If the turn-on or turn-off pulse width is too narrow, resulting in a narrow pulse (insufficient for the power semiconductor device to complete normal carrier filling and operating state transition), it may cause excessively high voltage spikes or high-frequency oscillations, threatening the stability of the device and the electronic control system. Therefore, in the algorithm of the electronic control system, the pulse width and duration of the pulse width modulation (PWM) signal must be strictly controlled to avoid the generation of narrow pulses.
[0004] The control algorithms commonly used in the industry currently follow this logic: based on the minimum pulse width time threshold required for narrow pulse control, when the calculated target pulse width time is less than this minimum pulse width time threshold, the duty cycle of the PWM signal is forced to be 0; when the target pulse width time is greater than the difference between the PWM period and the minimum pulse width time, the duty cycle of the PWM signal is forced to be 100%. Although this algorithm is simple to implement, it can lead to insufficient current control accuracy in motor controllers in practical applications.
[0005] It should be noted that the information disclosed in the background section of this application is intended only to enhance the understanding of the general background of this application, and should not be construed as an admission or in any way implying that the information constitutes prior art known to those skilled in the art. Summary of the Invention
[0006] This application provides a PWM signal control method, device, vehicle, and storage medium to address the problem of insufficient current control accuracy in existing motor controllers.
[0007] In a first aspect, embodiments of this application provide a PWM signal control method, the method comprising: Obtain the initial pulse width time of the current cycle of the PWM signal; The residual value of the previous cycle is added to the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle. Based on the compensated pulse width time of the current cycle, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal, the actual pulse width time and residual value of the current cycle are determined, and the residual value is the difference between the compensated pulse width time and the actual pulse width time.
[0008] In one possible implementation, the minimum pulse width time threshold is the sum of the narrow pulse width time and the dead time of the power semiconductor device controlled by the PWM signal, wherein the narrow pulse width time is the minimum pulse width time that can control the power semiconductor device to operate normally.
[0009] In one possible implementation, before determining the actual pulse width time and residual value of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold of the PWM signal, and the maximum pulse width time threshold, the method further includes: The maximum pulse width time threshold for the current period is determined based on the period of the PWM signal, the actual pulse width time of the previous period, and the minimum pulse width time threshold.
[0010] In one possible implementation, determining the actual pulse width time of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold of the PWM signal, and the maximum pulse width time threshold includes: If the compensated pulse width time of the current cycle is less than the minimum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be 0. If the compensated pulse width time of the current cycle is greater than the maximum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be the maximum pulse width time threshold. If the compensated pulse width time of the current cycle is greater than or equal to the minimum pulse width time threshold of the PWM signal and less than or equal to the maximum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be the compensated pulse width time of the current cycle.
[0011] In one possible implementation, determining the residual value of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold of the PWM signal, and the maximum pulse width time threshold includes: The residual value of the current cycle is determined based on the difference between the compensated pulse width time and the actual pulse width time of the current cycle.
[0012] In one possible implementation, determining the residual value of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold of the PWM signal, and the maximum pulse width time threshold includes: If the compensation pulse width time of the current period is less than the minimum pulse width time threshold of the PWM signal, then the residual value of the current period is determined to be the compensation pulse width time of the current period. If the compensated pulse width time of the current period is greater than the maximum pulse width time threshold of the PWM signal, then the residual value of the current period is determined to be the difference between the compensated pulse width time of the current period and the maximum pulse width time threshold. If the compensated pulse width time of the current cycle is greater than or equal to the minimum pulse width time threshold of the PWM signal and less than or equal to the maximum pulse width time threshold of the PWM signal, then the residual value of the current cycle is determined to be 0.
[0013] In one possible implementation, the step of accumulating the residual value of the previous cycle with the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle includes: If the current period is the first period, then the initial pulse width time of the current period is determined as the compensated pulse width time of the current period; If the current period is not the first period, the residual value of the previous period is added to the initial pulse width time of the current period to obtain the compensated pulse width time of the current period.
[0014] Secondly, embodiments of this application provide a PWM signal control device, comprising: Initial pulse width acquisition module: used to acquire the initial pulse width time of the current cycle of the PWM signal; Compensated pulse width calculation module: used to accumulate the residual value of the previous cycle with the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle; The residual calculation module is used to determine the actual pulse width time and residual value of the current cycle based on the compensated pulse width time of the current cycle, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal, wherein the residual value is the difference between the compensated pulse width time and the actual pulse width time.
[0015] Thirdly, embodiments of this application provide a vehicle, including: A motor controller configured to perform the method described in any one of the first aspects.
[0016] Fourthly, embodiments of this application provide a computer-readable storage medium storing a computer program, which, when executed by a processor, performs the method described in any one of the first aspects.
[0017] In this embodiment, the residual value generated by narrow pulse control in the previous cycle is calculated and compensated for in the current cycle. While ensuring narrow pulse control, the residual value is compensated, thus improving the current control accuracy of the motor controller. Attached Figure Description
[0018] To more clearly illustrate the technical solutions of the embodiments of this application, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.
[0019] Figure 1 This is a schematic diagram of an application scenario provided by an embodiment of this application; Figure 2 A schematic diagram of a PWM signal provided in an embodiment of this application; Figure 3 This is a schematic flowchart of a PWM signal control method provided in an embodiment of this application; Figure 4 This is a schematic diagram of the structure of a PWM signal control device provided in an embodiment of this application. Detailed Implementation
[0020] To better understand the technical solution of this application, the embodiments of this application will be described in detail below with reference to the accompanying drawings.
[0021] It should be understood that the described embodiments are merely some, not all, of the embodiments in this application. All other embodiments obtained by those skilled in the art based on the embodiments in this application without inventive effort are within the scope of protection of this application.
[0022] The terminology used in the embodiments of this application is for the purpose of describing particular embodiments only and is not intended to be limiting of this application. The singular forms “a,” “the,” and “the” used in the embodiments of this application and the appended claims are also intended to include the plural forms unless the context clearly indicates otherwise.
[0023] It should be understood that the term "and / or" used in this article is merely a description of the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent: A existing alone, A and B existing simultaneously, or B existing alone. Additionally, the character " / " in this article generally indicates that the preceding and following related objects have an "or" relationship.
[0024] See Figure 1 This is a schematic diagram illustrating an application scenario provided by an embodiment of this application. For example... Figure 1 As shown, this application scenario includes a vehicle 100, a motor controller 101 in the vehicle 100, and a motor 102 in the vehicle 100. The motor controller 101 includes a power semiconductor device 1011. The motor controller 101 can generate a PWM signal to control the on and off states of the power semiconductor device. The power semiconductor device can quickly respond to changes in the PWM signal, thereby precisely controlling the magnitude of the current flowing to the motor and the on / off time. By controlling the proportion of the power semiconductor device's on time, the average voltage input to the motor can be adjusted, thereby achieving control of the motor speed.
[0025] Power semiconductor devices include, but are not limited to, insulated-gate bipolar transistors (IGBTs) and freewheeling diodes (FWDs). Additionally... Figure 1 The vehicle 100 shown is merely an exemplary description and should not be construed as a limitation on the scope of protection of this application. Vehicles include, but are not limited to, new energy vehicles and fuel vehicles with electric motors. All similar application scenarios should be included within the scope of protection of this application.
[0026] See Figure 2 This is a schematic diagram of a PWM signal provided in an embodiment of this application. Figure 2 As shown, PWM (Pulse Width Modulation) signals are widely used in various electronic control systems. The average voltage or average current of the output is controlled by adjusting the duty cycle of the PWM signal. A complete cycle of a PWM signal includes a high-level time and a low-level time; the pulse width refers to the duration of the high-level signal. The pulse width is usually expressed as a duty cycle, which is the ratio of the high-level time to the entire cycle time, typically expressed as a percentage. For example, if the period of a PWM signal is 10 milliseconds and the high-level time is 7 milliseconds, then the pulse width is 7 milliseconds, and the duty cycle is 7 milliseconds divided by 10 milliseconds, which is 70%.
[0027] In practical operation, power semiconductor devices experience a response time between receiving a PWM signal and completing the device's turn-on or turn-off action. If the turn-on or turn-off pulse width is too narrow, resulting in a narrow pulse (i.e., a pulse signal insufficient for the power semiconductor device to complete a normal operating state transition), it may cause excessively high voltage spikes or high-frequency oscillations, threatening the stability of the device and the electronic control system. Therefore, when designing the control algorithm for the PWM signal, the pulse width and duration of the PWM signal must be strictly controlled to avoid the generation of narrow pulses.
[0028] In related technologies, a minimum pulse width time threshold is preset to avoid the generation of narrow pulses. That is, the target pulse width time (the theoretically required high-level duration of the output PWM signal) cannot be shorter than the minimum pulse width time threshold, thus avoiding the generation of narrow pulses during conduction. Simultaneously, the target pulse width time cannot be longer than the period minus the minimum pulse width time threshold, thus avoiding the generation of narrow pulses during turn-off. Specifically, based on the minimum pulse width time threshold required for narrow pulse control, when the calculated target pulse width time is less than this threshold, the duty cycle of the PWM signal is forced to 0, keeping the power semiconductor device off and preventing the device from failing to fully turn on due to an excessively short conduction time. When the target pulse width time is greater than the difference between the PWM period and the minimum pulse width time, the duty cycle of the PWM signal is forced to 100%, ensuring continuous conduction and preventing the device from failing to fully turn off due to an excessively short turn-off time.
[0029] While the algorithm is simple to implement, the simple numerical constraints can introduce control errors. For example, assume a PWM period of 100 milliseconds and a minimum pulse width threshold of 10 milliseconds. If the target pulse width is 7 milliseconds, which is less than the minimum pulse width threshold, the PWM signal's duty cycle needs to be forced to 0, but a 7-millisecond pulse width is actually required, resulting in a 7-millisecond error. If the target pulse width is calculated to be 95 milliseconds, which is greater than the difference between the period and the minimum pulse width threshold (90 milliseconds), the PWM signal's duty cycle needs to be forced to 100%, but only 95 milliseconds are actually needed, resulting in a 5-millisecond error. In summary, when the target pulse width is less than the minimum pulse width threshold or greater than the difference between the period and the minimum pulse width threshold, the output duty cycle cannot match the theoretically calculated value, thus generating errors. Therefore, in practical applications, this can lead to insufficient current control accuracy in motor controllers.
[0030] To address the aforementioned issues, this application provides a PWM signal control method. Specifically, it calculates the error value generated by narrow pulse control in the previous cycle and compensates for this error value in the current cycle. By compensating for the error value while maintaining narrow pulse control, the current control accuracy of the motor controller is improved.
[0031] Specifically, the following detailed description is provided in conjunction with the accompanying drawings and specific embodiments.
[0032] See Figure 3 This is a schematic flowchart of a PWM signal control method proposed in an embodiment of this application. This method can be applied to... Figure 1 The motor controller in the application scenario shown, such as Figure 3 As shown, it mainly includes the following steps.
[0033] Step S301: Obtain the initial pulse width time of the current cycle of the PWM signal.
[0034] As mentioned above, pulse width duration refers to the duration of the high-level signal in a PWM signal. In practical applications, the ideal pulse width duration for each cycle of the PWM signal is usually calculated based on the control algorithm. This ideal pulse width duration is understood to be the desired pulse width duration. For ease of distinction, this ideal pulse width duration will be referred to as the "initial pulse width duration" in this paper.
[0035] In one possible implementation, the initial pulse width of the current cycle can be determined by the cycle time and the target duty cycle. Specifically, the initial pulse width is determined by multiplying the cycle time by the target duty cycle. The cycle time refers to the length of time required for the signal to repeat from its start (i.e., the sum of the high-level time and the low-level time). The target duty cycle is the desired duty cycle value to be achieved within one cycle of the PWM signal control; it reflects the target percentage of the high-level time (on-time) within a complete cycle. For example, if the period of a PWM signal is 10 milliseconds and the target duty cycle is 60%, then the initial pulse width of the current cycle is 6 milliseconds.
[0036] Of course, those skilled in the art can also directly obtain the initial pulse width of the current period of the PWM signal according to actual needs, and this application embodiment does not impose specific limitations on this.
[0037] Step S302: Add the residual value of the previous cycle to the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle.
[0038] In the embodiments of this application, after obtaining the initial pulse width time of the current cycle, it is usually necessary to compensate the initial pulse width time of the current cycle using the residual value of the previous cycle. For ease of explanation, the compensated pulse width time is referred to as the "compensated pulse width time" in this document. The calculation method of the residual value is described in detail below.
[0039] In this embodiment, if the current period is the first period, since there is no previous period, the residual value of the previous period also does not exist, and no residual compensation is performed in the current period. If the current period is not the first period, then residual compensation is required in the current period.
[0040] Therefore, in one possible implementation, if the current cycle is the first cycle, the initial pulse width time of the current cycle is determined as the compensated pulse width time of the current cycle; if the current cycle is not the first cycle, the residual value of the previous cycle is added to the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle.
[0041] Step S303: Determine the actual pulse width time and residual value of the current cycle based on the compensated pulse width time of the current cycle, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal.
[0042] In this embodiment, the minimum pulse width time threshold is a preset lower limit of the pulse width time in PWM signal control. When the pulse width time is less than the minimum pulse width time threshold, it usually results in the generation of a narrow pulse during conduction. Therefore, it is necessary to limit the compensation pulse width time using the minimum pulse width time threshold. The maximum pulse width time threshold is a preset upper limit of the pulse width time in PWM signal control. When the pulse width time is greater than the maximum pulse width time threshold, it usually results in the generation of a narrow pulse during turn-off. Therefore, it is necessary to limit the compensation pulse width time using the maximum pulse width time threshold.
[0043] For ease of explanation, the compensated pulse width time, after being limited by the minimum and maximum pulse width time thresholds, is referred to as the "actual pulse width time" in this document. In the embodiments of this application, the actual pulse width time is the pulse width time of the PWM signal actually generated by the motor controller.
[0044] It is understandable that, after being constrained by the minimum and maximum pulse width time thresholds, the actual pulse width time may differ from the compensated pulse width time. For example, if the compensated pulse width time of the current cycle is less than the minimum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be 0. In this case, the actual pulse width time is less than the compensated pulse width time. Conversely, if the compensated pulse width time of the current cycle is greater than the maximum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be the maximum pulse width time threshold. In this case, the actual pulse width time is less than the compensated pulse width time.
[0045] Of course, after being limited by the minimum and maximum pulse width time thresholds, the actual pulse width time and the compensated pulse width time may be the same. For example, if the compensated pulse width time of the current cycle is greater than or equal to the minimum pulse width time threshold of the PWM signal and less than or equal to the maximum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be the compensated pulse width time, that is, the two are equal.
[0046] Because the actual pulse width time may differ from the compensated pulse width time after being limited by the minimum and maximum pulse width time thresholds, a residual value will be generated. The residual value is the difference between the compensated pulse width time and the actual pulse width time, and this residual value can be used to compensate for the pulse width time in the next cycle.
[0047] As mentioned above, the residual value is the difference between the compensated pulse width time and the actual pulse width time. Therefore, in one possible implementation, the residual value of the current cycle is determined directly based on the difference between the compensated pulse width time and the actual pulse width time of the current cycle.
[0048] Similarly, in another possible implementation, the residual value can be determined not directly based on the difference between the compensated pulse width time and the actual pulse width time, but based on the constraints of the maximum and minimum pulse width time thresholds. Specifically, if the compensated pulse width time of the current cycle is less than the minimum pulse width time threshold of the PWM signal, then the residual value of the current cycle is determined to be the compensated pulse width time of the current cycle; if the compensated pulse width time of the current cycle is greater than the maximum pulse width time threshold of the PWM signal, then the residual value of the current cycle is determined to be the difference between the compensated pulse width time of the current cycle and the maximum pulse width time threshold; if the compensated pulse width time of the current cycle is greater than or equal to the minimum pulse width time threshold of the PWM signal and less than or equal to the maximum pulse width time threshold of the PWM signal, then the residual value of the current cycle is determined to be 0.
[0049] In practical applications, due to the existence of multiple periods, there are various situations in the calculation and compensation of residual values.
[0050] Specifically, if the current cycle is the second cycle, then only the residual value of the first cycle needs to be calculated and compensated to the current cycle. If the residual value of the first cycle is 0, that is, no narrow pulse control was performed in the first cycle, then the residual compensation for the current cycle is 0; if the residual value of the first cycle is not 0, that is, a residual value was generated by narrow pulse control in the first cycle, then the residual value is compensated to the second cycle.
[0051] If there are historical cycles in the current cycle (i.e., two or more cycles preceding the current cycle), the residual value will be accumulated and needs to be compensated to the current cycle. Here, accumulation refers to accumulating the residual values generated by narrow-pulse control in historical cycles, and then compensating the current cycle with this accumulated residual value.
[0052] For example, assuming the current cycle is the third cycle, if no narrow pulse occurs in the first two cycles, no residual will be generated, meaning the accumulated residual value is 0, and the residual compensation for the current cycle is 0. If the first cycle generates a 5-millisecond residual, and the second cycle has completely offset this 5-millisecond residual through compensation, and the narrow pulse control is not triggered in this cycle, then the accumulated residual value will be cleared to zero, and the residual compensation for the current cycle is 0. If the first cycle generates a 5-millisecond residual due to narrow pulse control, and the initial pulse width time of the second cycle exceeds the maximum pulse width time threshold by 3 milliseconds before residual compensation (i.e., the second cycle itself generates a 3-millisecond residual), then the accumulated residual value is the sum of the residual values of the first two cycles (5 + 3 = 8 milliseconds), and this 8-millisecond residual value needs to be compensated for in the third cycle. In practical applications, the accumulation of residuals is not limited to two cycles; multiple consecutive cycles may generate residual values, leading to a continuous accumulation of residuals.
[0053] In this embodiment, the narrow pulse width time is the minimum pulse width time required for the power semiconductor device to operate normally. This is a basic threshold determined by the device's own physical characteristics. "Normal operation" means that the power semiconductor device can complete normal operating state transitions, and the device will not experience insufficient conduction or incomplete turn-off due to excessively narrow pulse width during the switching process (no narrow pulse will occur).
[0054] Therefore, in one possible implementation, the minimum pulse width time threshold can be set to the narrow pulse width time.
[0055] In practical applications, to prevent the upper and lower bridge arms of the motor controller from conducting simultaneously, a specific time interval is needed for protection; this interval is called dead time. Taking a three-phase inverter as an example, each phase includes an upper bridge arm and a lower bridge arm. The upper bridge arm is usually connected between the positive terminal of the power supply and the motor, responsible for controlling the motor's forward and reverse rotation. The lower bridge arm is connected between the motor and the negative terminal of the power supply, mainly controlling the motor's braking and stopping. In actual circuit operation, if the power semiconductor devices of the upper and lower bridge arms conduct simultaneously, it will cause a power short circuit, potentially damaging the power semiconductor devices instantaneously and affecting the normal operation and safety of the system's electrical control. Therefore, dead time is introduced; after one power semiconductor device is turned off, a short dead time is allowed before the other power semiconductor device is turned on.
[0056] As mentioned above, if the dead time is not considered when calculating the minimum pulse width time threshold, it may lead to a situation where the upper bridge arm is just turned off and the lower bridge arm is triggered to turn on, which may result in a short circuit risk between the upper and lower bridge arms of the motor controller.
[0057] Therefore, in one possible implementation, the minimum pulse width time threshold is the sum of the narrow pulse width time and the dead time. This ensures that the power semiconductor devices of the upper and lower bridge arms will not experience shoot-through risk due to excessively narrow pulse widths during switching, thereby guaranteeing the safe and stable operation of the power control system.
[0058] Similarly, since the duty cycles of the upper and lower bridge arms of the motor controller are complementary, calculating the maximum pulse width time threshold of the upper bridge arm requires considering the minimum pulse width time threshold of the lower bridge arm. Furthermore, because the PWM signal is a center-aligned output, the off-time of the current cycle is continuous with the previous cycle. Calculating the maximum pulse width time threshold of the current cycle based on two adjacent cycles allows for narrow pulse control while maximizing the duty cycle of the current cycle.
[0059] Therefore, in one possible implementation, the maximum pulse width time threshold for the current cycle is determined based on the period of the PWM signal, the actual pulse width time of the previous cycle, and the minimum pulse width time threshold. Specifically, based on the complementary duty cycles of the upper and lower bridge arms, the maximum pulse width time threshold for the upper bridge arm is calculated, i.e., maximum pulse width time threshold = 2 × period - actual pulse width time of the previous cycle - 2 × minimum pulse width time threshold.
[0060] Of course, those skilled in the art can also preset the maximum pulse width time threshold as needed, and this application embodiment does not impose specific restrictions on this.
[0061] To better illustrate the residual compensation process, we will now explain it using specific examples.
[0062] For example, assume the PWM signal period is 100 microseconds, the narrow pulse width is 2 microseconds, the dead time is 2 microseconds, the duty cycle of the PWM signal in the previous cycle is 98%, and the target duty cycle of the current cycle is 100%. First, determine the minimum pulse width threshold as 2 + 2 = 4 microseconds based on the sum of the narrow pulse width and the dead time. Calculate the actual pulse width of the previous cycle as 98% × 100 = 98 microseconds. Then calculate the maximum pulse width of the current cycle as 2 × 100 - 98 - 2 × 4 = 94 microseconds. Next, calculate the residual of the current cycle as 100 - 94 = 6 microseconds, and the maximum duty cycle is 94 / 100 = 94%. Assume the target duty cycle of the next cycle is 80%, i.e., the target pulse width is 80 microseconds. After residual compensation, the compensated pulse width is 86 microseconds, i.e., the target duty cycle of the next cycle is 86 / 100 = 86%.
[0063] In this embodiment, the residual compensation method can compensate for control errors using the PWM duty cycle value of the previous cycle, resulting in more precise current control, smaller current harmonic components, and more stable torque, thereby reducing the problem of reduced motor efficiency caused by current harmonics. Based on the duty cycle value of the current cycle and the PWM center alignment principle, the duty cycle value of the next cycle can be more fully utilized while ensuring narrow pulse control, resulting in higher voltage utilization and thus higher electronic control efficiency. Corresponding to the above method embodiment, this application also provides a PWM signal control device.
[0064] See Figure 4 This is a schematic diagram of the structure of a PWM signal control device provided in an embodiment of this application. Figure 4 As shown, the PWM signal control device 400 includes: an initial pulse width acquisition module 401, a compensation pulse width calculation module 402, and a residual calculation module 403.
[0065] Specifically, the initial pulse width acquisition module 401 is used to acquire the initial pulse width time of the current period of the PWM signal; The compensation pulse width calculation module 402 is used to accumulate the residual value of the previous cycle with the initial pulse width time of the current cycle to obtain the compensation pulse width time of the current cycle. The residual calculation module 403 is used to determine the actual pulse width time and residual value of the current cycle based on the compensated pulse width time, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal. The residual value is the difference between the compensated pulse width time and the actual pulse width time.
[0066] For details regarding the specific content involved in the embodiments of this application, please refer to the description of the above method embodiments. For the sake of brevity, these details will not be repeated here.
[0067] Corresponding to the above method embodiments, this application also provides a vehicle. The vehicle includes a motor controller, which is configured to perform some or all of the steps described in the above method embodiments. Specific details involved in the embodiments of this application can be found in the descriptions of the above method embodiments; for the sake of brevity, they will not be repeated here.
[0068] Corresponding to the above embodiments, this application also provides a computer-readable storage medium, wherein the computer-readable storage medium may store a program, wherein when the program runs, it can control the device where the computer-readable storage medium is located to execute some or all of the steps in the above method embodiments. In specific implementation, the computer-readable storage medium may be a magnetic disk, an optical disk, read-only memory (ROM), or random access memory (RAM), etc.
[0069] In this application embodiment, "at least one" refers to one or more, and "more than one" refers to two or more. "And / or" describes the relationship between related objects, indicating that three relationships can exist. For example, A and / or B can represent the existence of A alone, the simultaneous existence of A and B, or the existence of B alone. A and B can be singular or plural. The character " / " generally indicates that the preceding and following related objects have an "or" relationship. "At least one of the following" and similar expressions refer to any combination of these items, including any combination of single or plural items. For example, at least one of a, b, and c can represent: a, b, c, ab, ac, bc, or abc, where a, b, and c can be single or multiple.
[0070] Those skilled in the art will recognize that the units and algorithm steps described in the embodiments disclosed herein can be implemented using electronic hardware, computer software, or a combination of electronic hardware and software. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementation should not be considered beyond the scope of this application.
[0071] Those skilled in the art will understand that, for the sake of convenience and brevity, the specific working processes of the systems, devices, and units described above can be referred to the corresponding processes in the foregoing method embodiments, and will not be repeated here.
[0072] In the several embodiments provided in this application, any function, if implemented as a software functional unit and sold or used as an independent product, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of this application, in essence, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of this application. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0073] The above description is merely a specific embodiment of this application. Any variations or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the protection scope of this application. The protection scope of this application should be determined by the protection scope of the claims.
Claims
1. A PWM signal control method, characterized in that, The method includes: Obtain the initial pulse width time of the current cycle of the PWM signal; The residual value of the previous cycle is added to the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle. Based on the compensated pulse width time of the current cycle, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal, the actual pulse width time and residual value of the current cycle are determined. The residual value is the difference between the compensated pulse width time and the actual pulse width time, which is used to calculate the compensated pulse width time of the next cycle.
2. The method according to claim 1, characterized in that, The minimum pulse width time threshold is the sum of the narrow pulse width time and the dead time of the power semiconductor device controlled by the PWM signal. The narrow pulse width time is the minimum pulse width time that can control the power semiconductor device to work normally.
3. The method according to claim 2, characterized in that, Before determining the actual pulse width time and residual value of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold, and the maximum pulse width time threshold of the PWM signal, the method further includes: The maximum pulse width time threshold for the current period is determined based on the period of the PWM signal, the actual pulse width time of the previous period, and the minimum pulse width time threshold.
4. The method according to claim 3, characterized in that, The step of determining the maximum pulse width time threshold for the current period based on the period of the PWM signal, the actual pulse width time of the previous period, and the minimum pulse width time threshold includes: According to the formula, the maximum pulse width time threshold is determined as follows: maximum pulse width time threshold = 2 × period of PWM signal - actual pulse width time of the previous period - 2 × minimum pulse width time threshold.
5. The method according to claim 3, characterized in that, Determining the actual pulse width time of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold of the PWM signal, and the maximum pulse width time threshold includes: If the compensated pulse width time of the current cycle is less than the minimum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be 0. If the compensated pulse width time of the current cycle is greater than the maximum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be the maximum pulse width time threshold. If the compensated pulse width time of the current cycle is greater than or equal to the minimum pulse width time threshold of the PWM signal and less than or equal to the maximum pulse width time threshold of the PWM signal, then the actual pulse width time of the current cycle is determined to be the compensated pulse width time of the current cycle.
6. The method according to claim 5, characterized in that, The step of determining the residual value of the current period based on the compensated pulse width time of the current period, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal includes: If the compensation pulse width time of the current period is less than the minimum pulse width time threshold of the PWM signal, then the residual value of the current period is determined to be the compensation pulse width time of the current period. If the compensated pulse width time of the current period is greater than the maximum pulse width time threshold of the PWM signal, then the residual value of the current period is determined to be the difference between the compensated pulse width time of the current period and the maximum pulse width time threshold. If the compensated pulse width time of the current cycle is greater than or equal to the minimum pulse width time threshold of the PWM signal and less than or equal to the maximum pulse width time threshold of the PWM signal, then the residual value of the current cycle is determined to be 0.
7. The method according to claim 1, characterized in that, The step of accumulating the residual value of the previous cycle with the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle includes: If the current period is the first period, then the compensated pulse width time of the current period is determined to be the initial pulse width time of the current period; If the current period is not the first period, the residual value of the previous period is added to the initial pulse width time of the current period to obtain the compensated pulse width time of the current period.
8. A PWM signal control device, characterized in that, include: Initial pulse width acquisition module: used to acquire the initial pulse width time of the current cycle of the PWM signal; Compensated pulse width calculation module: used to accumulate the residual value of the previous cycle with the initial pulse width time of the current cycle to obtain the compensated pulse width time of the current cycle; The residual calculation module is used to determine the actual pulse width time and residual value of the current cycle based on the compensated pulse width time of the current cycle, the minimum pulse width time threshold and the maximum pulse width time threshold of the PWM signal, wherein the residual value is the difference between the compensated pulse width time and the actual pulse width time.
9. A vehicle, characterized in that, include: A motor controller configured to perform the method according to any one of claims 1 to 7.
10. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program, which, when executed by a processor, implements the method described in any one of claims 1-7.