Motor control safety protection method and system

Through the method of current limit counting and hysteresis voltage calculation, combined with event manager and hysteresis module, the problem of unreliable overcurrent protection in traditional motor control is solved, and the reliability and anti-interference ability of motor control are improved.

CN120280864AActive Publication Date: 2025-07-08CHINA STATE SHIPBUILDING CORP NO 707 RES INST
View PDF 4 Cites 0 Cited by

Patent Information

Application Number
CN202510767227.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-06-10
Publication Date
2025-07-08
Estimated Expiration
2045-06-10

AI Technical Summary

Technical Problem

In traditional motor control, peak current mode cannot provide reliable overcurrent protection when the output is shorted, causing the inductor current to enter saturation, which may cause the motor controller to be paralyzed.

Method used

By triggering the current limit count and hysteresis voltage calculation, combined with the event manager and hysteresis module, reliable overcurrent protection is achieved. The comparator, prescaler, clock controller and state controller of the motor controller are used to configure the digital-to-analog converter to generate timer and pulse width modulation outputs, capture external events and calculate hysteresis voltage to judge voltage safety.

Benefits of technology

It provides reliable overcurrent protection, improves the anti-interference ability of motor control, protects the circuit from damage, ensures that the current does not exceed the limited maximum value, and avoids damage to the motor controller.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120280864A_ABST
    Figure CN120280864A_ABST
Patent Text Reader

Abstract

The invention relates to the technical field of motor control and regulation, in particular to a motor control safety protection method and system, and the method comprises the following steps: configuring a digital-to-analog converter, and obtaining the output voltage of a comparator; a timer is generated, pulse width modulation output is configured, and an external event source is generated; external events of an external event source are captured regularly, a lag control mode is configured, and corresponding lag voltage is calculated; judging whether the voltage is safe or not, if the voltage is safe, outputting the current of the current detection protection period through pulse width modulation and then entering the next detection protection period, if the voltage is not safe, blocking the current pulse width modulation output, and if the voltage is not safe, entering the next detection protection period after outputting the current of the previous detection protection period. According to the method and the system provided by the invention, a reliable overcurrent protection method is provided for the motor, the anti-interference capability of motor control is improved, and the circuit is protected from being damaged.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of motor control and regulation, and particularly to a motor control safety protection method and system. Background Art

[0002] At present, in the power supply design of embedded system processors, traditional motor control current adopts peak current mode. When the voltage of the current detection resistor of the power converter reaches the internally set value, the pulse width modulator immediately turns off the drive signal of the main switch tube to form a function of limiting current for each pulse, so as to achieve current protection. In order to filter out the leading edge spikes of the voltage signal of the current detection resistor, the current detection signal uses RC filtering or leading edge blanking time, and the time is about 200 - 300 nanoseconds. The inherent characteristics of peak current control make that when the output is short-circuited, the rising slope of the switching current becomes very large, the output short-circuit voltage is very low, the duty cycle gradually reaches the minimum value, and if the inductor current continues to increase with time, the inductor may enter saturation, resulting in the runaway of the inductor current, and the current detection signal is ineffective. Therefore, the function of limiting current for each pulse cannot provide a reliable overcurrent protection function, and the processor function may be paralyzed, which is a fatal blow to the system. Summary of the Invention

[0003] The technical problem to be solved by the present invention is to provide a motor control safety protection method and system, which provides a reliable overcurrent protection method for the motor by triggering the counting of current limiting times and calculating the hysteresis voltage, improves the anti-interference ability of motor control, and protects the circuit from damage.

[0004] A motor control safety protection method includes the following steps: S1: The comparator and state controller of the motor controller configure a digital-to-analog converter to obtain the output voltage of the comparator. S2: Use the prescaler and clock controller of the motor controller to generate a timer, and then configure the pulse width modulation output by using the clock controller, state controller of the motor controller and the external event generator of the event manager to generate an external event source. S3: The external event occurrence counting module of the event manager periodically captures the external events of the external event source, and the hysteresis module of the event manager configures the hysteresis control mode according to the captured external events of the external event source and calculates the corresponding hysteresis voltage. S4: The hysteresis module determines whether the voltage is safe according to the calculated hysteresis voltage. If it is determined that the voltage is safe, the current of the current detection protection period is output through pulse width modulation and then enters the next detection protection period. If it is determined that the voltage is not safe, the current pulse width modulation output of the current is blocked, and the current of the previous detection protection period is output and then enters the next detection protection period.

[0005] Further, an integrated circuit frequency converter is provided to make the motor control safety protection meet the frequency conversion requirements of the power supply.

[0006] Further, the implementation process of the comparator and the state controller of the motor controller configuring the digital-to-analog converter in step S1 is as follows: S11: Reset the digital-to-analog converter peripheral. S12: Disable the digital-to-analog converter trigger. S13: Select the noise wave and enable the noise wave. S14: Enable the digital-to-analog converter buffer. S15: Enable the digital-to-analog converter. S16: Set the digital-to-analog converter output. S17: Set the digital-to-analog converter hysteresis.

[0007] Further, the process of generating the timer in step S2 is as follows: S211: Set the timer reset and turn off the timer. S212: Turn on the corresponding pin clock and enable the pin clock. S213: Turn on the timer clock. S214: Set the pin mode to multiplexed floating output. S215: Set the pin trigger mode. S216: Set the pulse width modulation period. S217: Update the timer configuration.

[0008] Further, the configuration of the pulse width modulation output in step S2 specifically includes the following steps: S221: The output polarity of the pulse width modulation channel is active high. S222: Enable the pulse width modulation output to the port. S223: Set the channel complement and the channel output state. S224: Enable the channel complement output state. S225: Set the channel output duty cycle. S226: Set the output mode of all channels of the timer to pulse width modulation mode. S227: Enable the timer channel output. S228: Enable the timer and enable the external timer interrupt. S229: Enable the pulse width modulation interrupt and add an external event source.

[0009] Further, the following method is used to time-capture the external events of the external event source in step S3: S311: Set the counting timing interrupt period of the external event occurrence counting module and clear the counting timing of the external event occurrence counting module. S312: Set the pulse width modulation interrupt and read the external event capture flag; S313: Determine whether the external event capture flag has captured an external event. If it is determined that an external event has been captured, trigger the external event occurrence counting module to increment the count by one. If it is determined that no external event has been captured, do not trigger the external event occurrence counting module; S314: Determine whether the number of triggers of the external event occurrence counting module within a counting timing interrupt period of an external event occurrence counting module exceeds the set trigger threshold. If the number of triggers exceeds the set trigger threshold, block the pulse width modulation output, clear the count of the external event occurrence counting module, and directly enter the next counting timing interrupt period of the external event occurrence counting module. If the number of triggers of the external event occurrence counting module does not exceed the set trigger threshold, clear the count of the external event occurrence counting module and proceed to the next step.

[0010] Further, in step S3, the hysteresis voltage is calculated according to the following formula: ; Where: represents the hysteresis voltage between the upper and lower level pulses, represents the duration of the upper and lower levels, represents the slope factor, represents the phase angle of the load inductor, represents the vertical component of the optimal pulse speed for eliminating system offset, represents the speed at the initial pulse moment, represents the load inertia, represents the optimal pulse speed for eliminating system offset.

[0011] Optimally, in step S4, the following method is used to determine whether the voltage is safe: Compare the hysteresis voltage with the set hysteresis voltage threshold. If the hysteresis voltage is less than or equal to the set hysteresis voltage threshold, it is determined as a safe voltage. If the hysteresis voltage is greater than the set hysteresis voltage threshold, it is determined as an unsafe voltage.

[0012] A motor control safety protection system for implementing the motor control safety protection method described in any one of the above, which includes a motor controller and an event manager. The motor controller includes a comparator, a prescaler, a clock controller, and a state controller. The event manager includes an external event occurrence counting module, an external event generator, and a hysteresis module; The comparator is used to wake up the motor controller from the low-power mode through an analog signal. Under given conditions, use the analog signal as the trigger source, and combine with the digital-to-analog converter and the state controller to perform pulse width modulation output to achieve current control; The prescaler is used to divide the crystal oscillator clock for output, with a fixed timing per cycle to obtain the accurate timer clock frequency; The clock controller provides the clock frequency for configuring the motor controller and the timing for input and output operations; The state controller includes a status register and a control register. The status register is used to obtain the working status of the motor controller by reading the relevant register bits, and the control register is used to set and control the working mode of the motor controller; The external event occurrence counting module triggers the pulse width modulation action through an external event, captures the pulse width modulation, and then determines whether the external event has occurred and counts by reading the capture flag bit; The external event generator is used to input the current sampling signal into the comparator. The output result of the comparator is used as the trigger source of the external event, which is monitored in the centralized event portal to generate external events and interrupts; The hysteresis module is used to configure the hysteresis control method according to the captured external event of the external event source, calculate the corresponding hysteresis voltage, and then determine whether the voltage is safe. If the voltage is judged to be unsafe, the current pulse width modulation output is blocked.

[0013] Furthermore, the system also includes an integrated circuit frequency converter, which is used to make the motor control safety protection meet the frequency conversion requirements of the power supply.

[0014] Advantages of the invention: A motor control safety protection method and system provided by the present invention have the following advantages: The external event occurrence counting module of the event manager periodically captures the external events of the external event source, calculates the corresponding hysteresis voltage through the hysteresis module, and then determines whether the voltage is safe according to the calculated hysteresis voltage. If the voltage is judged to be safe, the current is directly output and the monitoring of the next cycle is entered. If the voltage is judged to be unsafe, the pulse width modulation output is blocked and the monitoring of the next cycle is entered. If the voltage is judged to be safe in the monitoring of the next cycle, the pulse width modulation output is restarted, thereby outputting the corresponding current. Then, the hysteresis level can be controlled in the comparison circuit to eliminate the oscillation phenomenon of the comparison circuit, providing reliable overcurrent protection for the motor, improving the anti-interference ability of the motor, and protecting the protection circuit from damage. Description of the drawings

[0015] Figure 1 is the flow schematic diagram of the present invention.

[0016] Figure 2 is the oscilloscope waveform schematic diagram of the present invention.

[0017] Figure 3 is the system structure schematic diagram of the present invention. Detailed implementation manners

[0018] A motor control safety protection method, the schematic flow diagram of which is as Figure 1 shown, and specifically includes the following steps: S1: The comparator and status controller of the motor controller configure a digital-to-analog converter (DAC) to obtain the output voltage of the comparator. Specifically, the implementation process of the comparator and status controller of the motor controller configuring the digital-to-analog converter is as follows: S11: Reset the digital-to-analog converter peripheral. S12: Disable the digital-to-analog converter trigger. S13: Select the noise wave and enable the noise wave. S14: Enable the digital-to-analog converter buffer. S15: Enable the digital-to-analog converter. S16: Set the digital-to-analog converter output. Here, it is preferably to output a digital-to-analog converter voltage value of 3.3 volts. S17: Set the digital-to-analog converter hysteresis. Preferably, the digital-to-analog converter hysteresis is 700 millivolts, which can reduce the comparator output jitter.

[0019] Here, the motor controller preferably uses a Loongson 3A3000 processor and is configured by being connected to a Loongson 7A1000 bridge chip through an HT high-speed bus.

[0020] Based on the autonomous CS464E architecture of the Loongson 3A3000 with a quad-core 64-bit processor, a reliable overcurrent protection function is constructed by a high-precision timer, an event manager, and an integrated circuit frequency converter, which can improve the anti-interference ability, optimize the implementation control process, and improve the wide-range circuit and communication guarantee efficiency.

[0021] The comparator selects the output of the digital-to-analog converter as an external event source, wakes up the motor controller from the low-power mode through an analog signal, and under given conditions, uses the analog signal as a trigger source, combines the pulse-width modulation output of the digital-to-analog converter and the timer to achieve current control.

[0022] The status controller includes a status register SR and a control register CR. Among them, the status register SR obtains the working status of the motor controller by reading relevant register bits; the control register CR sets and controls the working mode of the motor controller, including the trigger mode, output polarity, duty cycle, and output mode, etc.

[0023] S2: Use the prescaler and clock controller of the motor controller to generate a timer, and then use the clock controller, status controller, and external event generator of the event manager of the motor controller to configure the pulse-width modulation (PWM) output to generate an external event source. The prescaler is used to divide the crystal oscillator clock for output. It can obtain the expected precise timer clock frequency by fixed timing per cycle.

[0024] The clock controller provides the clock frequency for configuring the motor controller and provides the timing for input and output operations.

[0025] The external event generator inputs the current sampling signal into the comparator. The output result of the comparator serves as the trigger source for external events, which are monitored in the centralized event portal to generate events and interrupts.

[0026] Specifically, the process of generating a timer using the prescaler of the motor controller and the clock controller is as follows: S211: Set the timer to reset and turn off the timer; S212: Turn on the clock for the corresponding pin and enable the pin clock; S213: Turn on the timer clock; S214: Set the pin mode to multiplexed floating output; S215: Set the pin trigger mode. The specific pin trigger mode can be determined according to the edge, and the rising edge trigger is adopted; S216: Set the pulse width modulation period, and here the pulse width modulation period can preferably be set to 20 milliseconds; S217: Update the timer configuration.

[0027] Here, the timer can preferably use the general-purpose input / output pins PB6, PB7, PB8, and PB9 as the pulse width modulation outputs.

[0028] Specifically, setting the pin mode to multiplexed floating output includes the following steps: S2141: Specify the operation mode and type of the general-purpose input / output pin PB6, and configure the general-purpose input / output pin PB6 into the multiplexed floating output function mode with a maximum output rate of 50 MHz; S2142: Specify the operation mode and type of the general-purpose input / output pin PB7, and configure the general-purpose input / output pin PB7 into the multiplexed floating output function mode with a maximum output rate of 50 MHz; S2143: Specify the operation mode and type of the general-purpose input / output pin PB8, and configure the general-purpose input / output pin PB8 into the multiplexed floating output function mode with a maximum output rate of 50 MHz; S2144: Specify the operation mode and type of the general-purpose input / output pin PB9, and configure the general-purpose input / output pin PB9 into the multiplexed floating output function mode with a maximum output rate of 50 MHz; Configuring the pulse width modulation output specifically includes the following steps: S221: The output polarity of the pulse width modulation channel is active high; S222: Enable the pulse width modulation output to the port; S223: Set channel complementarity and channel output status; S224: Enable the channel complementary output status; S225: Set the channel output duty cycle, and the duty cycle here can be set to 50%; S226: Set the output mode of all channels of the timer to the pulse width modulation mode; S227: Enable the timer channel output; S228: Enable the timer and enable the external timer interrupt; S229: Enable the pulse width modulation interrupt and add an external event source.

[0029] S3: The external event occurrence counting module of the event manager captures the external events of the external event source at regular intervals. The hysteresis module of the event manager configures the hysteresis control method according to the captured external events of the external event source and calculates the corresponding hysteresis voltage; The external events captured here include clearing the count of the timing interrupt, counting the external events of the pulse width modulation interrupt, etc.

[0030] Specifically, the following method can be used to capture the external events of the external event source at regular intervals: S311: Set the counting timing interrupt period of the external event occurrence counting module, clear the count of the external event occurrence counting module at regular intervals, and the counting timing interrupt period is preferably 1 second; S312: Set the pulse width modulation interrupt and read the external event capture flag; S313: Determine whether the external event capture flag captures an external event. If it is determined that an external event is captured, trigger the external event occurrence counting module to increment the count by one. If it is determined that no external event is captured, do not trigger the external event occurrence counting module; S314: Determine whether the number of triggers of the external event occurrence counting module within a counting timing interrupt period of an external event occurrence counting module exceeds the trigger count setting threshold. If the number of triggers exceeds the trigger count setting threshold, block the pulse width modulation output, clear the count of the external event occurrence counting module, and directly enter the next counting timing interrupt period of the external event occurrence counting module. If the number of triggers of the external event occurrence counting module does not exceed the trigger count setting threshold, clear the count of the external event occurrence counting module and enter the next step.

[0031] The trigger count setting threshold can be preferably 3 times.

[0032] The configuration of the hysteresis control method here includes adjusting the control hysteresis voltage and feedback to eliminate oscillations, thereby improving the anti-interference ability.

[0033] The specific algorithm steps of the hysteresis control are as follows: First, a small amount of positive feedback is added to the non-inverting terminal of the comparator to compare the upper and lower levels near the original level, and the hysteresis voltage between the upper and lower level pulses is calculated according to the following formula: ; Where: represents the hysteresis voltage between the upper and lower level pulses, represents the front-end load power factor, represents the typical speed at the initial moment when comparing the upper and lower levels, represents the back-end load power factor, represents the duration of the upper and lower levels, represents at the time when comparing the upper and lower levels the typical speed, represents at the time when comparing the upper and lower levels the typical speed, represents at the time when comparing the upper and lower levels the typical speed, represents at the time when comparing the upper and lower levels the typical speed, represents at the time when comparing the upper and lower levels the typical speed.

[0034] The front-end load power factor and the back-end load power factor have the following formula: , , , ; Where: represents the slope factor, , represents the load impedance value, represents the horizontal component of the optimal speed of the pulse for eliminating system offset, represents the phase angle of the load inductance, represents the vertical component of the optimal speed of the pulse for eliminating system offset.

[0035] The typical speed at each moment when comparing the upper and lower levels is shown in the following formula: ; Where: represents the load inertia, represents the quality factor, where can preferably take the value of 10.

[0036] According to the front-end load power factor and the back-end load power factor The calculation formula, and substitute the typical speed at each moment into the calculation formula of the hysteresis voltage between the upper and lower level pulses, then there is the following formula: ; After performing the Fourier transform of the sine wave on the above formula and taking the corresponding component, the expression of the hysteresis voltage can be obtained as the following formula: ; Where: represents the optimal speed of the pulse for eliminating the system offset. Here, there is , represents the optimal speed, and the offset of the optimal speed , this offset is two-dimensional, and by decomposing it, we can obtain and .

[0037] Therefore, the hysteresis voltage calculated according to the above expression of the hysteresis voltage is relatively accurate.

[0038] S4: The hysteresis module determines whether the voltage is safe according to the calculated hysteresis voltage. If it is determined that the voltage is safe, it outputs the current of the current detection and protection period through pulse width modulation and then enters the next detection and protection period. If it is determined that the voltage is unsafe, it blocks the current pulse width modulation output and outputs the current of the previous detection and protection period and then enters the next detection and protection period.

[0039] Specifically, the following method can be used to determine whether the voltage is safe: Compare the hysteresis voltage with the set threshold of the hysteresis voltage. If the hysteresis voltage is less than or equal to the set threshold of the hysteresis voltage, it is determined as a safe voltage. If the hysteresis voltage is greater than the set threshold of the hysteresis voltage, it is determined as an unsafe voltage.

[0040] Here, the set threshold of the hysteresis voltage can be set to 3 millivolts.

[0041] The motor control safety protection method provided by the present invention realizes current protection by counting the current limiting trigger times. Through a high-precision timer and an external event manager, the anti-interference ability is improved to ensure that the current does not exceed the limited maximum value. If the current limiting protection is triggered multiple times within a short period, the pulse width modulation output is forcibly blocked to make the system enter the fault protection state. During this process, the number of times of current limiting trigger is counted to determine whether the system has a short circuit or overload, and then decide whether the system enters the protection state, replacing the peak current mode power converter of the previous processor, which uses a hardware logic gate circuit. In order to filter the leading edge spikes of the voltage signal of the current detection resistor, the current detection signal uses RC filtering or leading edge blanking time, which is likely to cause the function of current limiting for each pulse and cannot provide reliable overcurrent protection. In order to reliably protect the system, for chips without an overcurrent protection function inside, the method of triggering current limiting and current limiting counting fully makes up for the shortcomings of the system's speed and stability, thus protecting the circuit from damage.

[0042] Furthermore, an integrated circuit frequency converter is set to make the motor control safety protection meet the frequency conversion requirements of the power supply.

[0043] The chip models adopted by the integrated circuit frequency converter are BM3675 and BM5126, and the cascade power supply mode is used to output the power supply from 3V to 12V to meet the frequency conversion requirements of the power supply for the motor controller.

[0044] According to the above-mentioned current protection method that realizes current protection by counting the current limiting trigger times based on the high-precision timer under the Loongson 3A3000 processor, the following test method is adopted for verification, and the specific steps are as follows: 1. Hardware power-on test: Hardware is the premise and foundation of the system application program. Therefore, there should be no problems in the hardware design, the power supply, clock, and configuration signals are normal, and there is no short circuit or virtual soldering at the pins of each device; 2. Establishment of the test environment: The test environment must be correctly configured to lay a good foundation for subsequent tests.

[0045] Build a platform for testing on the alignment information processing and distribution device. The external current sampling signal is directly input into the on-chip comparator (COMPx_IP), and the output of the selected digital-to-analog converter (COMPx_IM) is used as the reference of the comparator. The output result of the comparator is used as the external event trigger source. View the waveforms through an oscilloscope and compare the operating conditions of each waveform on the oscilloscope. For details, see Figure 2 ; 3. Observe the waveforms for analysis. Figure 2 Each horizontal grid in [the figure] represents 50 milliseconds, and one cycle is 100 milliseconds, that is, 10Hz; 4. Test verification process: After correctly implementing 1, 2, and 3 above, the oscilloscope compares the waveforms. The lower two lines represent the output pulse width modulation drive, and the upper two lines represent the internal comparator output signal. When the output is high, it indicates current limiting protection, triggering the wave blocking. When the output is low, the pulse width modulation can be output normally.

[0046] Analysis of test results: Using a high-precision timer based on the Loongson 3A3000 processor, the current protection method is implemented by counting the number of current limiting triggers to determine whether the system has a short circuit or overload, and then decide whether the system enters a permanent protection state and waits for the system to enable output again, meeting the circuit usage requirements.

[0047] A motor control safety protection system, the structural diagram of which is shown in Figure 3 As shown, a motor control safety protection method for executing any one of the above-mentioned items includes a motor controller and an event manager, wherein the motor controller includes a comparator, a prescaler, a clock controller and a state controller, and the event manager includes an external event occurrence counting module, an external event generator and a hysteresis module; The motor controller is used to configure the DAC, generate timers, and configure PWM outputs. The event manager is used to capture external events according to the PWM output timing and configure the hysteresis control mode. The comparator is used to wake up the motor controller from the low power mode through the analog signal. Under given conditions, the analog signal is used as a trigger source, combined with the digital-to-analog converter and the state controller to perform pulse width modulation output to achieve current control; The pre-divider is used to divide the crystal oscillator clock and output it, with a fixed timing per cycle to obtain the precise timer clock frequency; The clock controller provides the clock frequency used to configure the motor controller and provides the timing of input and output operations; The state controller includes a state register and a control register. The state register is used to obtain the working state of the motor controller by reading the relevant register bits. The control register is used to set and control the working mode of the motor controller. The external event occurrence counting module triggers the pulse width modulation action through the external event, captures the pulse width modulation, and then determines whether the external event occurs and counts by reading the capture flag bit; The external event generator is used to input the current sampling signal into the comparator. The output result of the comparator is used as the trigger source of the external event, which is monitored in the centralized event portal to generate external events and interrupts. The hysteresis module is used to configure the hysteresis control mode according to the external events of the captured external event source, calculate the corresponding hysteresis voltage, and then determine whether the voltage is safe. If the voltage is determined to be unsafe, the current pulse width modulation output is blocked.

[0048] Further, the system further includes an integrated circuit frequency converter, which is used to make the motor control safety protection meet the frequency conversion requirements of the power supply.

[0049] In summary, a motor control safety protection method and system provided by the present invention can provide reliable overcurrent protection for the motor by triggering the overcurrent limit count and calculating the lag voltage, and improve the anti-interference ability of motor control to protect the circuit from damage.

[0050] The foregoing is only a preferred embodiment of the present invention and is not intended to limit the present invention. For those skilled in the art, the present invention may have various modifications and changes. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.

Claims

1. A motor control safety protection method, characterized in that: It includes the following steps: S1: The comparator and status controller of the motor controller configure the digital-to-analog converter to obtain the output voltage of the comparator; S2: Use the prescaler and clock controller of the motor controller to generate a timer, and then use the clock controller, status controller of the motor controller, and the external event generator of the event manager to configure the pulse width modulation output to generate an external event source; S3: The external event occurrence counting module of the event manager periodically captures the external events of the external event source, and the hysteresis module of the event manager configures the hysteresis control mode according to the captured external events of the external event source and calculates the corresponding hysteresis voltage; S4: The hysteresis module determines whether the voltage is safe according to the calculated hysteresis voltage. If it is determined that the voltage is safe, the current of the current detection and protection period is output through the pulse width modulation and then enters the next detection and protection period. If it is determined that the voltage is not safe, the current pulse width modulation output is blocked, and the current of the previous detection and protection period is output and then enters the next detection and protection period.

2. The motor control safety protection method according to claim 1, characterized in that: Set the integrated circuit frequency converter to make the motor control safety protection meet the frequency conversion requirements of the power supply.

3. A motor control safety protection method according to claim 1, characterized in that: The implementation process of the comparator and status controller of the motor controller configuring the digital-to-analog converter in step S1 is as follows: S11: Reset the digital-to-analog converter peripheral; S12: Disable the digital-to-analog converter trigger; S13: Select the noise wave and enable the noise wave; S14: Enable the digital-to-analog converter buffer; S15: Enable the digital-to-analog converter; S16: Set the digital-to-analog converter output; S17: Set the digital-to-analog converter hysteresis.

4. A motor control safety protection method according to claim 1, characterized in that: The process of generating a timer in step S2 is as follows: S211: Set the timer reset and turn off the timer; S212: Turn on the corresponding pin clock and enable the pin clock; S213: Turn on the timer clock; S214: Set the pin mode to multiplexed floating output; S215: Set the pin trigger mode; S216: Set the pulse width modulation period; S217: Update the timer configuration.

5. A motor control safety protection method according to claim 1, characterized in that: The configuration of the pulse width modulation output in step S2 specifically includes the following steps: S221: The output polarity of the pulse width modulation channel is active high; S222: Enable the pulse width modulation output to the port; S223: Set the channel complementary and channel output status; S224: Enable the channel complementary output status; S225: Set the channel output duty cycle; S226: Set the output mode of all channels of the timer to pulse width modulation mode; S227: Enable the timer channel output; S228: Enable the timer and enable the external timer interrupt; S229: Enable the pulse width modulation interrupt and add an external event source.

6. A motor control safety protection method according to claim 1, characterized in that: The following method is adopted in step S3 to periodically capture the external events of the external event source: S311: Set the counting timing interrupt period of the external event occurrence counting module and clear the counting timing of the external event occurrence counting module; S312: Set the pulse width modulation interrupt and read the external event capture flag; S313: Determine whether the external event capture flag captures an external event. If it is determined that an external event is captured, trigger the external event occurrence counting module to increment the count by one. If it is determined that no external event is captured, do not trigger the external event occurrence counting module; S314: Determine whether the number of triggers of the external event occurrence counting module within the counting timing interruption period of an external event occurrence counting module exceeds the set trigger threshold. If the number of triggers exceeds the set trigger threshold, block the pulse width modulation output, clear the count of the external event occurrence counting module, and directly enter the next counting timing interruption period of the external event occurrence counting module. If the number of triggers of the external event occurrence counting module does not exceed the set trigger threshold, clear the count of the external event occurrence counting module and then proceed to the next step.

7. A motor control safety protection method according to claim 1, characterized in that: In step S3, calculate the hysteresis voltage according to the following formula: ; Wherein: represents the hysteresis voltage between the upper and lower level pulses, represents the upper and lower level duration, represents the slope factor, represents the phase angle of the load inductance, represents the vertical component of the optimal speed of the pulse for eliminating the system offset, represents the speed at the initial pulse moment, represents the load inertia, represents the optimal speed of the pulse for eliminating the system offset.

8. A motor control safety protection method according to claim 1, characterized in that: In step S4, use the following method to determine whether the voltage is safe: Compare the hysteresis voltage with the set hysteresis voltage threshold. If the hysteresis voltage is less than or equal to the set hysteresis voltage threshold, it is determined as a safe voltage. If the hysteresis voltage is greater than the set hysteresis voltage threshold, it is determined as an unsafe voltage.

9. A motor control safety protection system for implementing a motor control safety protection method according to any one of claims 1 to 8, characterized in that: It includes a motor controller and an event manager. The motor controller includes a comparator, a prescaler, a clock controller, and a state controller. The event manager includes an external event occurrence counting module, an external event generator, and a hysteresis module; The comparator is used to wake up the motor controller from the low-power mode through an analog signal. Under given conditions, use the analog signal as the trigger source, and combine with the digital-to-analog converter and the state controller to perform pulse width modulation output to achieve current control; The prescaler is used to divide the crystal oscillator clock for output, and perform fixed timing per cycle to obtain the accurate timer clock frequency; The clock controller provides the clock frequency used to configure the motor controller and provides the timing for input and output operations; The state controller includes a status register and a control register. The status register is used to obtain the working status of the motor controller by reading relevant register bits. The control register is used to set and control the working mode of the motor controller; The external event occurrence counting module triggers the pulse width modulation action through an external event, captures the pulse width modulation, and then determines whether the external event occurs and performs counting by reading the capture flag bit; The external event generator is used to input the current sampling signal into the comparator. The output result of the comparator is used as the trigger source of the external event, and it is monitored in the centralized event portal to generate external events and interrupts; The hysteresis module is used to configure the hysteresis control method according to the captured external event source of the external event, calculate the corresponding hysteresis voltage, and then determine whether the voltage is safe. If it is determined that the voltage is unsafe, block the current pulse width modulation output.

10. A motor control safety protection system according to claim 9, characterized in that: It also includes an integrated circuit frequency converter, which is used to make the motor control safety protection meet the frequency conversion requirements of the power supply.

Citation Information

Patent Citations

  • Switching regulator and operations control method thereof

    CN101542883A

  • Single-cycle detection and protection method for peak current of brushless direct current motor

    CN104767176A

  • Software and hardware combined five-phase permanent magnet synchronous motor overcurrent control method

    CN115411700A

  • Phase-locked loop circuit and information reproducing device

    JP2006060381A