Brake control method, device, timer and microcontroller
By generating immediate and delayed braking signals and controlling them according to the signal sequence and priority, the problem that timers cannot handle multiple braking signals is solved, ensuring the smooth execution and safety of timers under various signals.
Patent Information
- Application Number
- CN202410169125.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-02-06
- Publication Date
- 2026-11-24
- Estimated Expiration
- 2044-02-06
AI Technical Summary
Existing timers can only control one type of braking signal and cannot effectively handle the execution sequence of multiple braking signals, leading to equipment damage and safety issues.
A braking control method is provided, which generates immediate braking signals and delayed braking signals, and distinguishes and controls them according to the generation order and priority of the signals, so as to ensure that the timer can smoothly perform braking operation under multiple braking signals.
This technology enables the timer to execute smoothly under various braking signals, improving equipment safety and meeting usage requirements while reducing the risk of equipment damage.
Smart Images

Figure CN118011917B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of timer technology, and more specifically, to a braking control method, device, timer, and microcontroller unit. Background Technology
[0002] Timers are an important component in microcontroller units. When a fault occurs, existing timers can generally only brake for one type of braking signal, that is, they are only configured with one braking mode: immediate braking or delayed braking. However, in actual use, different braking sources correspond to different faults. Handling different faults based on a single braking mode may cause varying degrees of damage to the equipment, making it difficult to meet usage and safety requirements. If the timer is directly increased to include more configurable braking signal types, it will be unable to handle the execution order of different braking signals. When multiple braking signals occur simultaneously, the timer will be unable to perform the braking operation smoothly.
[0003] There is currently no effective technical solution to the above problems. Summary of the Invention
[0004] The purpose of this application is to provide a braking control method, device, timer, and microcontroller unit, so that the timer can successfully perform braking operation when multiple braking signals are present.
[0005] In a first aspect, this application provides a braking control method applied to a timer, the timer having multiple braking sources, the braking control method comprising the following steps: S1. Generate a braking signal based on the abnormal signal input from the braking source, wherein the braking signal is an immediate braking signal or a delayed braking signal; S21. When there are multiple braking signals and the immediate braking signal and the delayed braking signal are triggered in the same off state, the timer braking is controlled according to the generation order of the braking signals. S22. When there are multiple braking signals and the immediate braking signal and the delayed braking signal trigger different shutdown states, the timer braking is controlled according to the priority and generation order of the braking signals.
[0006] The braking control method of this application is applied to a timer with multiple braking sources and capable of generating delayed braking signals and immediate braking signals. When multiple braking sources of the timer generate multiple braking signals, the timer can differentiate and control based on the off state triggered by the corresponding braking signal. This ensures that the timer can smoothly execute the braking operation and meets the usage requirements of braking source triggering braking. It enables the timer to smoothly execute the braking operation according to steps S21 and S22 when multiple braking signals occur.
[0007] In the aforementioned braking control method, the braking source that triggers the generation of the delayed braking signal is a system fault or an application fault, and the braking source that triggers the generation of the immediate braking signal is an application fault.
[0008] In this example, the delayed braking signal can be applied to both system faults and application faults, while the immediate braking signal, which has lower safety, is only applied to application faults.
[0009] The braking control method further includes the following steps: S3. When the automatic output enable of the timer is turned on, all brake signals are disabled, or an update event is triggered, control the timer to reset its output.
[0010] The braking control method of this application can reset the timer output after an update event is triggered.
[0011] The braking control method, wherein the step of controlling the timer reset output includes: Set the MOE bit of the timer to 1 to enable the timer to output normally.
[0012] In the aforementioned braking control method, the off state is when the PWM output signal of the timer is forcibly adjusted to a low level or the PWM output signal is forcibly adjusted to a preset level.
[0013] In the aforementioned braking control method, the PWM output signal includes a first PWM signal and a second PWM signal; When there are multiple braking signals and the corresponding shutdown states triggered by the immediate braking signal and the delayed braking signal are different, the shutdown state triggered by the immediate braking signal is to adjust the first PWM signal and the second PWM signal to a low level, and the shutdown state triggered by the delayed braking signal is to adjust the first PWM signal to a low level and the second PWM signal to a preset level. The priority of the delayed braking signal is higher than that of the immediate braking signal.
[0014] In the aforementioned braking control method, the immediate braking signal can only be triggered when both the timer OSSR bit and OSSI bit are enabled.
[0015] Secondly, this application also provides a braking control device applied to a timer, the timer having multiple braking sources, the braking control device comprising: A signal triggering component is used to generate a braking signal based on an abnormal signal input from a braking source, wherein the braking signal is an immediate braking signal or a delayed braking signal; A brake control component is configured to control the timer brake according to the generation order of the brake signals when there are multiple brake signals and the corresponding off states triggered by the immediate brake signal and the delayed brake signal are consistent; and to control the timer brake according to the priority and generation order of the brake signals when there are multiple brake signals and the corresponding off states triggered by the immediate brake signal and the delayed brake signal are different.
[0016] The brake control device of this application is applied to a timer with multiple brake sources and capable of generating delayed brake signals and immediate brake signals. When multiple brake sources of the timer generate multiple brake signals, it can differentiate and control based on the corresponding off state triggered by the brake signals, ensuring that the timer can smoothly execute the braking operation and meet the usage requirements of brake source triggering braking. This allows the timer to smoothly execute the braking operation using the brake control component 202 when multiple brake signals are present.
[0017] Thirdly, this application also provides a timer including a brake controller and a PWM signal output circuit, wherein the brake controller is used to perform the steps of the method provided in the first aspect to control the PWM signal output circuit to brake.
[0018] Fourthly, this application also provides a microcontroller unit, which includes a timer as provided in the third aspect.
[0019] As can be seen from the above, this application provides a braking control method, device, timer, and microcontroller unit. The braking control method is applied to a timer with multiple braking sources that can generate delayed braking signals and immediate braking signals. When multiple braking sources of the timer generate multiple braking signals, it can differentiate and control based on the off state triggered by the corresponding braking signal. This ensures that the timer can smoothly execute the braking operation and meets the usage requirements of braking source triggering braking. It also enables the timer to smoothly execute the braking operation according to steps S21 and S22 when multiple braking signals occur. Attached Figure Description
[0020] Figure 1 A flowchart of a braking control method provided in an embodiment of this application.
[0021] Figure 2 Another flowchart of the braking control method provided in the embodiments of this application.
[0022] Figure 3 This is a schematic diagram of the brake control device provided in an embodiment of this application.
[0023] Figure 4 This is another structural schematic diagram of the brake control device provided in an embodiment of this application.
[0024] Reference numerals: 201, signal triggering component; 202, brake control component; 203, output reset module. Detailed Implementation
[0025] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only a part of the embodiments of this application, and not all of the embodiments. The components of the embodiments of this application described and shown in the accompanying drawings can generally be arranged and designed in various different configurations. Therefore, the following detailed description of the embodiments of this application provided in the accompanying drawings is not intended to limit the scope of the claimed application, but merely represents selected embodiments of this application. All other embodiments obtained by those skilled in the art based on the embodiments of this application without inventive effort are within the scope of protection of this application.
[0026] It should be noted that similar reference numerals and letters in the following figures indicate similar items; therefore, once an item is defined in one figure, it does not need to be further defined and explained in subsequent figures. Furthermore, in the description of this application, terms such as "first," "second," etc., are used only to distinguish descriptions and should not be construed as indicating or implying relative importance.
[0027] Firstly, please refer to Figure 1 and Figure 2 This application provides a braking control method for a timer, which has multiple braking sources. The braking control method includes the following steps: S1. Generate a braking signal based on the abnormal signal input from the braking source. The braking signal can be an immediate braking signal or a delayed braking signal. S21. When there are multiple braking signals and the immediate braking signal and the delayed braking signal are triggered in the same off state, the timer braking is controlled according to the generation order of the braking signals. S22. When there are multiple braking signals and the immediate braking signal and the delayed braking signal trigger different closing states, the timer braking is controlled according to the priority and generation order of the braking signals.
[0028] Specifically, the braking source is a signal receiving and judging device in the timer used to receive external signals to determine whether a braking signal needs to be generated to control the timer's braking. Common circuit devices such as comparators that can receive external signals and perform signal magnitude analysis can be used. In this embodiment, the timer has multiple external signal input terminals, which are connected to the braking source, so that the braking source can receive external input signals and analyze whether these external input signals are abnormal signals. Abnormal signals refer to external input signals whose magnitude does not match expectations, indicating that a fault has occurred.
[0029] More specifically, in the embodiments of this application, the timer is applied in a microcontroller unit (MCU), and the braking source is connected to the detection circuit in the microcontroller unit or the detection circuit in the system device to which the microcontroller unit is applied, so as to receive external input signals (such as detection current) representing the detection results of these detection circuits to determine whether it is necessary to control the timer braking.
[0030] More specifically, the timer's break function, also known as the circuit breaker function, is mainly used to turn off the PWM signal output by the timer or to adjust the PWM signal to a preset safe level (corresponding to two off states respectively) to achieve the purpose of circuit protection.
[0031] It should be noted that the braking control method in this application aims to comprehensively control multiple braking signals generated by a timer that has multiple braking sources and can generate delayed braking signals and immediate braking signals, so as to control the timer to brake. If only one braking signal is generated, the timer is directly controlled to brake based on that braking signal.
[0032] More specifically, the immediate braking signal is used to control the timer to perform the braking operation immediately, while the delayed braking signal is used to control the timer to perform the braking operation after a delay. Generally, after the delayed braking signal is generated, the timer enters the braking operation after a dead time.
[0033] It should be noted that the timer used in the braking control method of this application embodiment has an immediate braking signal generation circuit and a delayed braking signal generation circuit. These circuits are all connected to at least one braking source. The braking signal generation circuit and the delayed braking signal generation circuit can be implemented using existing circuit structures, which will not be described in detail here.
[0034] More specifically, the processing method (triggered shutdown state) of the PWM signal corresponding to the brake signal will affect the safety of the corresponding braking operation. When multiple brake signals are valid, the brake control method of this application embodiment configures an appropriate processing method to control the timer brake based on the corresponding trigger shutdown state triggered by these brake signals.
[0035] More specifically, in step S1, "generating a brake signal" means that the corresponding brake signal changes from an invalid state to an effective state. For example, when the brake signal changes from a high level (invalid state) to a low level (effective state), the brake signal is generated. When the brake signal ends, it means that the brake signal has switched to an invalid state.
[0036] More specifically, the shutdown state triggered by the immediate braking signal and the delayed braking signal can be designed according to usage requirements.
[0037] More specifically, in step S21, if the immediate braking signal and the delayed braking signal trigger the same off state, then these braking signals can control the timer to brake and adjust its output PWM signal to the same state. Therefore, step S21 controls the timer to brake based on the generation order of the braking signals. The braking signal generated first can adjust the PWM signal output by the timer to the off state. When the braking signal generated later is generated, the PWM signal has already been adjusted to the off state. At this time, the braking operation corresponding to the later-generated braking signal can be skipped, or an invalid braking operation can be performed based on the later-generated braking signal. These processing methods will not affect the off state of the PWM signal. On the other hand, if the PWM signal has returned to normal output when the later-generated braking signal is generated, then the timer is controlled to brake again based on the later-generated braking signal.
[0038] More specifically, in step S22, the immediate braking signal and the delayed braking signal trigger different off states, meaning that these braking signals can control the timer to brake and adjust its output PWM signal to different states, resulting in a large safety difference between the two types of braking signals. Therefore, step S22 needs to comprehensively control the timer to brake based on the priority and triggering order of the two types of braking signals in order to improve the reliability and safety of the braking operation.
[0039] More specifically, the priority of the brake signal is determined based on the off state triggered by the corresponding brake signal.
[0040] The braking control method of this application embodiment is applied to a timer with multiple braking sources and capable of generating delayed braking signals and immediate braking signals. When multiple braking sources of the timer generate multiple braking signals, it can differentiate and control based on the off state triggered by the corresponding braking signal, ensuring that the timer can smoothly execute the braking operation and meet the usage requirements of braking source triggering braking. This allows the timer to smoothly execute the braking operation according to steps S21 and S22 when multiple braking signals occur.
[0041] In some preferred embodiments, the braking source that triggers the generation of the delayed braking signal is a system fault or application fault, while the braking source that triggers the generation of the immediate braking signal is an application fault.
[0042] Specifically, application failures refer to software failures, such as software failures in the microcontroller unit used in timer applications, while system failures refer to equipment failures, such as overvoltage and overcurrent failures in equipment used by microcontroller units.
[0043] More specifically, since the delayed braking signal is used to control the timer to brake after a delay based on the dead zone length, its corresponding control method is safer than the control method corresponding to the immediate braking signal, and can effectively reduce damage to the microcontroller or device. Therefore, in this embodiment, the delayed braking signal can be applied to system faults and application faults, while the immediate braking signal, which has lower safety, is only applied to application faults.
[0044] In some preferred embodiments, the braking control method further includes the following steps: S3. When the timer's automatic output is enabled, all brake signals are disabled, or an update event is triggered, control the timer to reset its output.
[0045] Specifically, a brake signal failure indicates that the abnormal signal input from the corresponding brake source has returned to a normal signal. If the timer's automatic output enable signal is turned on, it can be automatically reset and restored to the normal output state when the update event is triggered.
[0046] More specifically, an update event refers to an event that causes the timer's register to be updated so that the timer operates under a new configuration, such as when a timing cycle ends (counter overflow) or other events occur. Therefore, the braking control method of this application embodiment can reset the timer's output after the update event is triggered.
[0047] More specifically, the timer's control register has multiple flag bits. Among them, the automatic output enable is an enable signal generated when the AOE bit in the timer's control register is turned on (set to 1), which can be used to determine when the timer resets the output.
[0048] In some preferred embodiments, the step of controlling the timer to reset the output includes: Set the MOE bit of the timer to 1 to enable the timer to output normally.
[0049] Specifically, the MOE bit is a register bit in the timer's control register. The timer can only generate and output a PWM signal when the MOE bit is turned on. Therefore, step S3 resets the timer's output based on turning on the MOE bit (setting it to 1).
[0050] In some preferred embodiments, the PWM output signal of the timer in the off state is forced to a low level or forced to a preset level.
[0051] Specifically, the preset level is a non-zero level and corresponds to a safe output state.
[0052] In some preferred embodiments, the PWM output signal includes a first PWM signal and a second PWM signal; When there are multiple braking signals and the corresponding shutdown states triggered by the immediate braking signal and the delayed braking signal are different, the shutdown state triggered by the immediate braking signal is to adjust the first PWM signal and the second PWM signal to a low level, and the shutdown state triggered by the delayed braking signal is to adjust the first PWM signal to a low level and the second PWM signal to a preset level. The priority of the delayed braking signal is higher than that of the immediate braking signal.
[0053] Specifically, the higher priority of the delayed braking signal compared to the immediate braking signal means that the delayed braking signal can continue to trigger the control timer to execute delayed braking after the immediate braking signal is triggered, while the immediate braking signal cannot continue to trigger the control timer to execute immediate braking after the delayed braking signal is triggered.
[0054] More specifically, the off state triggered by the delayed braking signal is more preferably achieved by simultaneously adjusting the first PWM signal to a low level and the second PWM signal to a preset level after the delayed braking signal is generated and after a corresponding dead time delay.
[0055] More specifically, the first PWM signal and the second PWM signal are two complementary PWM signals generated by the normal output of the timer. The first PWM signal is generally labeled as OCx and the second PWM signal is generally labeled as OCxN. In other embodiments, the first PWM signal can also be labeled as OCxN and the second PWM signal can also be labeled as OCx.
[0056] More specifically, the timer essentially controls the output by changing the output of two PWM signals according to the braking signal to change the upper and lower bridge arm switches. In this embodiment, the process of controlling the timer to brake according to the immediate braking signal is as follows: immediately adjust the first PWM signal to a low level to adjust the upper bridge arm to the closed state and immediately adjust the second PWM signal to a low level to adjust the lower bridge arm to the closed state. The process of controlling the timer to brake according to the delayed braking signal is as follows: after a dead time delay, adjust the first PWM signal to a low level to adjust the upper bridge arm to the closed state, and adjust and fix the second PWM signal, which should be complementary to the first PWM signal, at a preset level to adjust the lower bridge arm to the open state.
[0057] More specifically, step S22, which controls the timer braking process based on the priority and generation order of the braking signals, is as follows: The timer brakes are controlled based on the initially generated brake signal. If the priority of the next generated brake signal is higher than the priority of all previously generated brake signals, then the timer is controlled to brake based on that brake signal; otherwise, the braking operation of that brake signal is skipped.
[0058] For example, in this embodiment, the priority of the delayed braking signal is higher than that of the immediate braking signal. The immediate braking signal only triggers the control timer braking when the delayed braking signal is invalid (i.e., the control timer braking is not triggered based on the delayed braking signal). It cannot trigger the control timer braking when the delayed braking signal is already valid (i.e., the control timer braking has already been triggered based on the delayed braking signal). However, the delayed braking signal can trigger the control timer braking when the immediate braking signal is already valid (i.e., the control timer braking has already been triggered based on the immediate braking signal). Based on the foregoing, it is clear that delayed braking is safer than immediate braking. Therefore, the braking control method in this embodiment sets the priority of the delayed braking signal higher than that of the immediate braking signal and then controls the timer braking based on the control logic, which can further improve the safety of braking operation.
[0059] In some preferred embodiments, the immediate braking signal is triggered only when both the timer OSSR bit and the OSSI bit are enabled.
[0060] Specifically, the OSSR bit and OSSI bit are flag bits in the control register of the timer. The function of turning on the OSSR bit and OSSI bit is to generate preset constraints on the pin output when the MOE bit is turned on and when the MOE bit is turned off, respectively. In this embodiment, the immediate braking signal is equivalent to controlling the timer to set the MOE bit from 1 to 0, so that the pin output that meets the constraint when the OSSR bit is turned on is changed to the pin output that meets the constraint when the OSSI bit is turned on.
[0061] Secondly, please refer to Figure 3 and Figure 4 Some embodiments of this application also provide a braking control device applied to a timer, the timer having multiple braking sources, the braking control device including: The signal triggering component 201 is used to generate a braking signal based on the abnormal signal input from the braking source. The braking signal is either an immediate braking signal or a delayed braking signal. Brake control component 202 is used to control timer braking according to the generation order of brake signals when there are multiple brake signals and the corresponding off states triggered by the immediate brake signal and the delayed brake signal are the same. It is also used to control timer braking according to the priority and generation order of brake signals when there are multiple brake signals and the corresponding off states triggered by the immediate brake signal and the delayed brake signal are different.
[0062] The brake control device of this application embodiment is applied to a timer that has multiple brake sources and can generate delayed brake signals and immediate brake signals. When multiple brake sources of the timer generate multiple brake signals, it can differentiate and control based on the off state triggered by the corresponding brake signal, which can ensure that the timer can smoothly execute the braking operation and meet the usage requirements of the brake source triggering the brake. This allows the timer to smoothly execute the braking operation using the brake control component 202 when multiple brake signals occur.
[0063] In some preferred embodiments, the brake control device further includes: The output reset module 203 is used to control the timer to reset the output when the timer's automatic output enable is turned on, all brake signals are disabled, or an update event is triggered.
[0064] In some preferred embodiments, the brake control device of this application is used to perform the brake control method provided in the first aspect above.
[0065] Thirdly, some embodiments of this application also provide a timer, including a brake controller and a PWM signal output circuit, wherein the brake controller is used to perform the steps of the method provided in the first aspect to control the PWM signal output circuit to brake.
[0066] Fourthly, embodiments of this application provide a microcontroller unit, which includes a timer as provided in the third aspect.
[0067] In summary, the embodiments of this application provide a braking control method, device, timer, and microcontroller unit. The braking control method is applied to a timer with multiple braking sources that can generate delayed braking signals and immediate braking signals. When multiple braking sources of the timer generate multiple braking signals, the timer can differentiate and control based on the corresponding off state triggered by the braking signals. This ensures that the timer can smoothly execute the braking operation and meets the usage requirements of braking source-triggered braking. It also enables the timer to smoothly execute the braking operation according to steps S21 and S22 when multiple braking signals are present.
[0068] In the embodiments provided in this application, it should be understood that the disclosed apparatus and methods can be implemented in other ways. The apparatus embodiments described above are merely illustrative. For example, the division of units is only a logical functional division, and in actual implementation, there may be other division methods. Furthermore, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed. Additionally, the displayed or discussed mutual couplings, direct couplings, or communication connections may be through some communication interfaces; indirect couplings or communication connections between devices or units may be electrical, mechanical, or other forms.
[0069] Furthermore, the units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment according to actual needs.
[0070] Furthermore, the functional modules in the various embodiments of this application can be integrated together to form an independent part, or each module can exist independently, or two or more modules can be integrated to form an independent part.
[0071] In this document, relational terms such as first and second are used only to distinguish one entity or operation from another entity or operation, without necessarily requiring or implying any such actual relationship or order between these entities or operations.
[0072] The above description is merely an embodiment of this application and is not intended to limit the scope of protection of this application. Various modifications and variations can be made to this application by those skilled in the art. Any modifications, equivalent substitutions, improvements, etc., made within the spirit and principles of this application should be included within the scope of protection of this application.
Claims
1. A braking control method applied to a timer, characterized in that, The timer has multiple braking sources, and the braking control method includes the following steps: S1. Generate a braking signal based on the abnormal signal input from the braking source, wherein the braking signal is an immediate braking signal or a delayed braking signal; S21. When there are multiple braking signals and the immediate braking signal and the delayed braking signal are triggered in the same off state, the timer braking is controlled according to the generation order of the braking signals. S22. When there are multiple braking signals and the immediate braking signal and the delayed braking signal trigger different shutdown states, the timer braking is controlled according to the priority and generation order of the braking signals.
2. The braking control method according to claim 1, characterized in that, The braking source that triggers the generation of the delayed braking signal is a system fault or an application fault, while the braking source that triggers the generation of the immediate braking signal is an application fault.
3. The braking control method according to claim 1, characterized in that, The braking control method further includes the following steps: S3. When the automatic output enable of the timer is turned on, all brake signals are disabled, or an update event is triggered, control the timer to reset its output.
4. The braking control method according to claim 3, characterized in that, The step of controlling the timer to reset the output includes: Set the MOE bit of the timer to 1 to enable the timer to output normally.
5. The braking control method according to claim 1, characterized in that, The off state is when the PWM output signal of the timer is forcibly adjusted to a low level or the PWM output signal is forcibly adjusted to a preset level.
6. The braking control method according to claim 5, characterized in that, The PWM output signal includes a first PWM signal and a second PWM signal; When there are multiple braking signals and the corresponding shutdown states triggered by the immediate braking signal and the delayed braking signal are different, the shutdown state triggered by the immediate braking signal is to adjust the first PWM signal and the second PWM signal to a low level, and the shutdown state triggered by the delayed braking signal is to adjust the first PWM signal to a low level and the second PWM signal to a preset level. The priority of the delayed braking signal is higher than that of the immediate braking signal.
7. The braking control method according to claim 1, characterized in that, The immediate braking signal can only be triggered when both the timer's OSSR bit and OSSI bit are enabled.
8. A brake control device applied to a timer, characterized in that, The timer has multiple braking sources, and the braking control device includes: A signal triggering component is used to generate a braking signal based on an abnormal signal input from a braking source, wherein the braking signal is an immediate braking signal or a delayed braking signal; A brake control component is configured to control the timer brake according to the generation order of the brake signals when there are multiple brake signals and the corresponding off states triggered by the immediate brake signal and the delayed brake signal are consistent; and to control the timer brake according to the priority and generation order of the brake signals when there are multiple brake signals and the corresponding off states triggered by the immediate brake signal and the delayed brake signal are different.
9. A timer, characterized in that, The method includes a brake controller and a PWM signal output circuit, wherein the brake controller is used to perform the steps of the method as described in any one of claims 1-7 to control the PWM signal output circuit to brake.
10. A microcontroller unit, characterized in that, The microcontroller unit includes the timer as described in claim 9.
Citation Information
Patent Citations
Brake control method and device and brake control system
CN112448369A
Equipment fault monitoring method and device, equipment and readable storage medium
CN114356708A
