Motor control safety protection method and system
Through the method of current limit counting and hysteresis voltage calculation, combined with high-precision timer and integrated circuit inverter, reliable overcurrent protection of the motor control system is achieved, solving the current saturation problem of traditional motor control systems during short circuits, and improving the anti-interference ability and safety of the system.
Patent Information
- Application Number
- CN202510767227.7
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-06-10
- Publication Date
- 2025-08-29
- Estimated Expiration
- 2045-06-10
AI Technical Summary
When the output is shorted, peak current control causes the inductor current to enter saturation when the existing motor control system is short-circuited. The traditional pulse-by-pulse current limiting function cannot provide reliable overcurrent protection, which may cause the processor to be paralyzed.
By triggering the current limit count and hysteresis voltage calculation, combined with the event manager and hysteresis module, the motor is realized with reliable overcurrent protection, and a high-precision timer and integrated circuit inverter are used to configure digital-to-analog converter and pulse width modulation output to judge voltage safety and block the pulse width modulation output.
It provides reliable overcurrent protection, improves the anti-interference ability of motor control, prevents circuit damage, ensures current within a safe range, and avoids system failure.
Smart Images

Figure CN120280864B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the technical field of motor control and regulation, and in particular to a motor control safety protection method and system. Background Art
[0002] Currently, in embedded system processor power supply designs, conventional motor current control utilizes peak current control. When the voltage across the power converter's current sense resistor reaches an internally set rating, the pulse-width modulator (PWM) immediately shuts off the drive signal to the main switch, implementing pulse-by-pulse current limiting for current protection. To filter out the leading-edge spikes in the current sense resistor voltage signal, the current sense signal uses RC filtering or a leading-edge blanking time of approximately 200-300 nanoseconds. The inherent characteristics of peak current control result in a very steep ramp-up of the switch current when the output is short-circuited, resulting in a very low output short-circuit voltage and a gradual decrease in the duty cycle. As the inductor current continues to increase over time, it may reach saturation, causing the inductor current to run away and rendering the current sense signal ineffective. Therefore, pulse-by-pulse current limiting cannot provide reliable overcurrent protection, potentially paralyzing the processor, a devastating 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 current limiting times counting and the hysteresis voltage calculation, improves the anti-interference ability of the motor control, and protects the circuit from damage.
[0004] A motor control safety protection method comprises the following steps:
[0005] S1: The motor controller's comparator and state controller are configured with a digital-to-analog converter to obtain the comparator's output voltage.
[0006] S2: Use the prescaler and clock controller of the motor controller to generate a timer, and then use the clock controller, state controller and external event generator of the event manager of the motor controller to configure the pulse width modulation output to generate an external event source;
[0007] S3: The external event occurrence counting module of the event manager periodically captures external events of the external event source, and the hysteresis module of the event manager configures a hysteresis control mode according to the captured external events of the external event source and calculates the corresponding hysteresis voltage;
[0008] S4: The hysteresis module determines whether the voltage is safe based on the calculated hysteresis voltage. If the voltage is safe, it outputs the current of the current detection protection cycle through pulse width modulation and enters the next detection protection cycle. If the voltage is unsafe, it blocks the current pulse width modulation output and outputs the current of the previous detection protection cycle and enters the next detection protection cycle.
[0009] Furthermore, an integrated circuit frequency converter is provided to ensure that the motor control safety protection meets the power supply frequency conversion requirements.
[0010] Furthermore, the implementation process of configuring the digital-to-analog converter of the motor controller's comparator and the state controller in step S1 is as follows:
[0011] S11: DAC peripheral reset;
[0012] S12: DAC trigger disable;
[0013] S13: Select a noise wave and enable the noise wave;
[0014] S14: DAC buffer enable;
[0015] S15: DAC enable;
[0016] S16: DAC output setting;
[0017] S17: DAC hysteresis setting.
[0018] Furthermore, the process of generating the timer in step S2 is as follows:
[0019] S211: Set the timer reset and turn off the timer;
[0020] S212: Turn on the corresponding pin clock and enable the pin clock;
[0021] S213: Start the timer clock;
[0022] S214: Set the pin mode to multiplexed floating output;
[0023] S215: Set pin trigger mode;
[0024] S216: Setting the pulse width modulation period;
[0025] S217: Timer update configuration.
[0026] Furthermore, configuring the pulse width modulation output in step S2 specifically includes the following steps:
[0027] S221: Pulse width modulation channel output polarity is high level valid;
[0028] S222: Enable pulse width modulation output to the port;
[0029] S223: Set channel complement and channel output status;
[0030] S224: Channel complementary output state enable;
[0031] S225: Set channel output duty cycle;
[0032] S226: Set the output mode of all channels of the timer to pulse width modulation mode;
[0033] S227: Enable timer channel output;
[0034] S228: Enable timer, enable peripheral timer interrupt;
[0035] S229: Enable pulse width modulation interrupt and add external event source.
[0036] Furthermore, in step S3, the following method is used to periodically capture external events from the external event source:
[0037] S311: Setting the counting timing interruption period of the external event occurrence counting module, and clearing the counting timing of the external event occurrence counting module;
[0038] S312: Set pulse width modulation interrupt and read external event capture flag;
[0039] S313: Determine whether the external event capture identifier captures an external event. If it is determined that the external event is captured, the external event occurrence counting module is triggered to increase the count by one. If it is determined that the external event is not captured, the external event occurrence counting module is not triggered.
[0040] S314: Determine whether the number of triggers of the external event occurrence counting module within a counting timing interrupt cycle of the external event occurrence counting module exceeds the trigger number setting threshold. If the trigger number exceeds the trigger number setting threshold, block the pulse width modulation output, and clear the count of the external event occurrence counting module to zero and directly enter the next counting timing interrupt cycle of the external event occurrence counting module. If the number of triggers of the external event occurrence counting module does not exceed the trigger number setting threshold, clear the count of the external event occurrence counting module to zero and enter the next step.
[0041] Furthermore, in step S3, the hysteresis voltage is calculated according to the following formula:
[0042] ;
[0043] in: Indicates the hysteresis voltage between the upper and lower level pulses, Indicates the duration of the upper and lower levels. represents the slope factor, represents the phase angle of the load inductance, represents the vertical component of the pulse optimal velocity to eliminate system offset, represents the velocity at the time of the initial pulse, Indicates the load inertia, Indicates the optimal pulse speed to eliminate system offset.
[0044] Optimally, in step S4, the following method is used to determine whether the voltage is safe:
[0045] The hysteresis voltage is compared with the hysteresis voltage setting threshold. If the hysteresis voltage is less than or equal to the hysteresis voltage setting threshold, it is judged as a safe voltage. If the hysteresis voltage is greater than the hysteresis voltage setting threshold, it is judged as an unsafe voltage.
[0046] A motor control safety protection system, for executing any one of the motor control safety protection methods described above, comprising a motor controller and an event manager, wherein the motor controller comprises a comparator, a prescaler, a clock controller, and a state controller, and the event manager comprises an external event occurrence counting module, an external event generator, and a hysteresis module;
[0047] The comparator is used to wake up the motor controller from low-power mode through an analog signal. Under given conditions, the analog signal is used as a trigger source, combined with the digital-to-analog converter and state controller to perform pulse width modulation output to achieve current control;
[0048] The prescaler is used to divide the crystal oscillator clock into different frequencies and output them, with a fixed timing per cycle to obtain the precise timer clock frequency;
[0049] The clock controller provides the clock frequency used to configure the motor controller and provides the timing of input and output operations;
[0050] 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.
[0051] 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;
[0052] 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.
[0053] 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.
[0054] Furthermore, the system also includes an integrated circuit frequency converter, which is used to ensure that the motor control safety protection meets the power supply frequency conversion requirements.
[0055] Beneficial effects of the invention:
[0056] The motor control safety protection method and system provided by the present invention have the following advantages:
[0057] The external event occurrence counting module of the event manager is used to capture external events of the external event source at regular intervals, and the corresponding hysteresis voltage is calculated through the hysteresis module. Then, whether the voltage is safe is judged based on the calculated hysteresis voltage. If the voltage is judged to be safe, the current is directly output and the next cycle of monitoring is entered. If the voltage is judged to be unsafe, the pulse width modulation output is blocked and the next cycle of monitoring is entered. If the monitoring of the next cycle judges that the voltage is safe, the pulse width modulation output is enabled again, thereby outputting the corresponding current. Then, the hysteresis level can be controlled in the comparison circuit, the oscillation phenomenon of the comparison circuit is eliminated, and reliable overcurrent protection is provided for the motor, the anti-interference ability of the motor is improved, and the protection circuit is protected from damage. BRIEF DESCRIPTION OF THE DRAWINGS
[0058] Figure 1 It is a schematic flow chart of the present invention.
[0059] Figure 2 It is a schematic diagram of the oscilloscope waveform of the present invention.
[0060] Figure 3 It is a schematic diagram of the system structure of the present invention. DETAILED DESCRIPTION
[0061] A motor control safety protection method, the flow diagram of which is as follows Figure 1 As shown, the specific steps include:
[0062] S1: The motor controller's comparator and state controller configure a digital-to-analog converter (DAC) to obtain the comparator's output voltage.
[0063] Specifically, the implementation process of configuring the digital-to-analog converter of the motor controller's comparator and state controller is as follows:
[0064] S11: DAC peripheral reset;
[0065] S12: DAC trigger disable;
[0066] S13: Select a noise wave and enable the noise wave;
[0067] S14: DAC buffer enable;
[0068] S15: DAC enable;
[0069] S16: DAC output setting, where the preferred output DAC voltage value is 3.3V;
[0070] S17: DAC hysteresis setting. The preferred DAC hysteresis is 700 mV, which can reduce comparator output jitter.
[0071] The motor controller here is preferably based on the Loongson 3A3000 processor and is configured by connecting to the Loongson 7A1000 bridge chip via the HT high-speed bus.
[0072] Based on the independent CS464E architecture of Loongson 3A3000 and equipped with a quad-core 64-bit processor, it builds a reliable overcurrent protection function designed by high-precision timer, event manager, and integrated circuit inverter, which can improve anti-interference ability, optimize the implementation of control process, and improve the efficiency of wide-band circuit and communication guarantee.
[0073] The comparator selects the output of the digital-to-analog converter as the external event source and wakes up the motor controller from low-power mode through an analog signal. Under given conditions, the analog signal is used as a trigger source, combined with the pulse-width modulation output of the digital-to-analog converter and the timer to achieve current control.
[0074] The state controller includes a state register SR and a control register CR. The state register SR obtains the working state of the motor controller by reading the relevant register bits; the control register CR sets and controls the working mode of the motor controller, including trigger mode, output polarity, duty cycle and output mode.
[0075] S2: Use the prescaler and clock controller of the motor controller to generate a timer, and then use the clock controller, state 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;
[0076] The prescaler is used to divide the crystal oscillator clock and output it with a fixed timing per cycle, so as to obtain the expected precise timer clock frequency.
[0077] The clock controller provides the clock frequency used to configure the motor controller and provides the timing of input and output operations.
[0078] The external event generator inputs the current sampling signal into the comparator. The output result of the comparator serves as the trigger source of the external event, which is monitored in the centralized event portal and generates events and interrupts.
[0079] Specifically, the process of using the prescaler and clock controller of the motor controller to generate a timer is as follows:
[0080] S211: Set the timer reset and turn off the timer;
[0081] S212: Turn on the corresponding pin clock and enable the pin clock;
[0082] S213: Start the timer clock;
[0083] S214: Set the pin mode to multiplexed floating output;
[0084] S215: Set the pin trigger mode. The specific pin trigger mode can be determined by the edge, and rising edge trigger is used;
[0085] S216: Setting a pulse width modulation period, where the pulse width modulation period can be preferably set to 20 milliseconds;
[0086] S217: Timer update configuration.
[0087] The timer here can preferably use the general input and output pins PB6, PB7, PB8, and PB9 as pulse width modulation outputs.
[0088] Specifically, setting the pin mode to multiplexed floating output includes the following steps:
[0089] S2141: Specify the operation mode and type of general-purpose input / output pin PB6, and configure the general-purpose input / output pin PB6 to multiplexed floating output function mode with a maximum output rate of 50 MHz.
[0090] S2142: Specify the operation mode and type of general-purpose input / output pin PB7, and configure general-purpose input / output pin PB7 to multiplexed floating output function mode with a maximum output rate of 50 MHz.
[0091] S2143: Specify the operation mode and type of general-purpose input / output pin PB8, and configure general-purpose input / output pin PB8 to multiplexed floating output function mode with a maximum output rate of 50 MHz.
[0092] S2144: Specify the operation mode and type of the general-purpose input / output pin PB9, and configure the general-purpose input / output pin PB9 to the multiplexed floating output function mode with a maximum output rate of 50 MHz.
[0093] Configuring PWM output includes the following steps:
[0094] S221: Pulse width modulation channel output polarity is high level valid;
[0095] S222: Enable pulse width modulation output to the port;
[0096] S223: Set channel complement and channel output status;
[0097] S224: Channel complementary output state enable;
[0098] S225: Set the channel output duty cycle, the duty cycle here can be set to 50%;
[0099] S226: Set the output mode of all channels of the timer to pulse width modulation mode;
[0100] S227: Enable timer channel output;
[0101] S228: Enable timer, enable peripheral timer interrupt;
[0102] S229: Enable pulse width modulation interrupt and add external event source.
[0103] S3: The external event occurrence counting module of the event manager periodically captures external events of the external event source, and the hysteresis module of the event manager configures a hysteresis control mode according to the captured external events of the external event source and calculates the corresponding hysteresis voltage;
[0104] The external events captured here include timer interrupt clear count, pulse width modulation interrupt external event count, etc.
[0105] Specifically, the following methods can be used to periodically capture external events from external event sources:
[0106] S311: Setting the counting timer interruption period of the external event occurrence counting module, and clearing the counting timer of the external event occurrence counting module. The counting timer interruption period is preferably 1 second;
[0107] S312: Set pulse width modulation interrupt and read external event capture flag;
[0108] S313: Determine whether the external event capture identifier captures an external event. If it is determined that the external event is captured, the external event occurrence counting module is triggered to increase the count by one. If it is determined that the external event is not captured, the external event occurrence counting module is not triggered.
[0109] S314: Determine whether the number of triggers of the external event occurrence counting module within a counting timing interrupt cycle of the external event occurrence counting module exceeds the trigger number setting threshold. If the trigger number exceeds the trigger number setting threshold, block the pulse width modulation output, and clear the count of the external event occurrence counting module and directly enter the next counting timing interrupt cycle of the external event occurrence counting module. If the number of triggers of the external event occurrence counting module does not exceed the trigger number setting threshold, clear the count of the external event occurrence counting module and enter the next step.
[0110] The trigger count setting threshold may preferably be 3 times.
[0111] The hysteresis control mode configured here includes adjusting the control hysteresis voltage and feedback to eliminate oscillation, thereby improving the anti-interference ability.
[0112] The specific algorithm steps of hysteresis control are as follows:
[0113] 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:
[0114] ;
[0115] in: Indicates the hysteresis voltage between the upper and lower level pulses, represents the front-end load power factor, Indicates the typical speed at the initial moment when comparing the upper and lower levels. Indicates the back-end load power factor, Indicates the duration of the upper and lower levels. Indicates that when comparing the upper and lower levels Typical speed of the moment, Indicates that when comparing the upper and lower levels Typical speed of the moment, Indicates that when comparing the upper and lower levels Typical speed of time, Indicates that when comparing the upper and lower levels Typical speed of the moment, Indicates that when comparing the upper and lower levels Typical speed at the moment.
[0116] Front-end load power factor and back-end load power factor There is the following formula:
[0117] , , , ;
[0118] in: represents the slope factor, , Indicates the load impedance value, represents the horizontal component of the pulse optimal velocity to eliminate system offset, represents the phase angle of the load inductance, Represents the vertical component of the pulse's optimal velocity to eliminate system offset.
[0119] The typical speed at each moment when comparing the upper and lower levels is shown in the following formula:
[0120] ;
[0121] in: Indicates the load inertia, represents the quality factor, where A preferred value is 10.
[0122] According to the front-end load power factor and back-end load power factor , and substitute the typical speed at each moment into the hysteresis voltage calculation formula between the upper and lower level pulses, then the following formula is obtained:
[0123] ;
[0124] After Fourier transforming the sine wave, the corresponding The hysteresis voltage can be expressed as follows:
[0125] ;
[0126] in: represents the optimal pulse speed to eliminate system offset, where , Indicates the optimal speed and the offset of the optimal speed , this offset is two-dimensional, and decomposing it can be obtained and .
[0127] Therefore, the hysteresis voltage calculated according to the above hysteresis voltage expression is more accurate.
[0128] S4: The hysteresis module determines whether the voltage is safe based on the calculated hysteresis voltage. If the voltage is safe, it outputs the current of the current detection protection cycle through pulse width modulation and enters the next detection protection cycle. If the voltage is unsafe, it blocks the current pulse width modulation output and outputs the current of the previous detection protection cycle and enters the next detection protection cycle.
[0129] Specifically, the following methods can be used to determine whether the voltage is safe:
[0130] The hysteresis voltage is compared with the hysteresis voltage setting threshold. If the hysteresis voltage is less than or equal to the hysteresis voltage setting threshold, it is judged as a safe voltage. If the hysteresis voltage is greater than the hysteresis voltage setting threshold, it is judged as an unsafe voltage.
[0131] Here the hysteresis voltage setting threshold can be set to 3 mV.
[0132] The motor control safety protection method provided by the present invention implements current protection by counting the number of current limit triggers. Using a high-precision timer and external event manager, it improves anti-interference capabilities and ensures that the current does not exceed a specified maximum value. If the current limit protection is triggered multiple times in a short period of time, the pulse width modulation output is forcibly blocked, forcing the system into a fault protection state. During this process, the number of current limit triggers is counted to determine whether the system is short-circuited or overloaded, and then decide whether the system enters the protection state. This replaces the peak current mode power converter of previous processors, which uses hardware logic gate circuits. 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, which can easily lead to pulse-by-pulse current limiting and cannot provide reliable overcurrent protection. To reliably protect the system, for chips without internal overcurrent protection, the current limit triggering and current limit counting methods fully compensate for the system's shortcomings of fast and stable operation, thereby protecting the circuit from damage.
[0133] Furthermore, an integrated circuit frequency converter is provided to ensure that the motor control safety protection meets the power supply frequency conversion requirements.
[0134] The chip models used in the integrated circuit inverter are BM3675 and BM5126, and a cascade power supply method is used to output 3V to 12V to meet the power supply frequency conversion requirements of the motor controller.
[0135] Based on the high-precision timer based on the Loongson 3A3000 processor, the current protection method is implemented by counting the number of current limit triggers. The following test method is used for verification. The specific steps are:
[0136] 1. Hardware power-on test: Hardware is the premise and foundation of system applications, so there must be no problems with the hardware design. The power supply, clock and configuration signals are normal, and there are no short circuits or cold solder joints on the pins of each device.
[0137] 2. Establishment of test environment: The test environment must be correctly configured to lay a good foundation for subsequent tests.
[0138] A platform test was built on the alignment information processing and distribution device. The external current sampling signal was directly input to the on-chip comparator (COMPx_IP). The selected DAC output (COMPx_IM) was used as the reference for the comparator. The comparator output was used as the external event trigger source. The waveforms were viewed on an oscilloscope and the operating conditions of each waveform were compared on the oscilloscope. For details, see Figure 2 ;
[0139] 3. Observe the waveform for analysis, Figure 2 Each horizontal grid in the middle represents 50 milliseconds, and one cycle is 100 milliseconds, or 10Hz;
[0140] 4. Test verification process: After correctly implementing the above 1, 2, and 3, compare the waveforms on the oscilloscope. 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.
[0141] 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 limit triggers to determine whether the system has a short circuit or overload, and then decide whether the system should enter a permanent protection state and wait for the system to enable output again, meeting the circuit usage requirements.
[0142] A motor control safety protection system, the structural diagram of which is as follows Figure 3 As shown, a motor control safety protection method for executing any one of the above-mentioned methods 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;
[0143] 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 method.
[0144] The comparator is used to wake up the motor controller from low-power mode through an analog signal. Under given conditions, the analog signal is used as a trigger source, combined with the digital-to-analog converter and state controller to perform pulse width modulation output to achieve current control;
[0145] The prescaler is used to divide the crystal oscillator clock into different frequencies and output them, with a fixed timing per cycle to obtain the precise timer clock frequency;
[0146] The clock controller provides the clock frequency used to configure the motor controller and provides the timing of input and output operations;
[0147] 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.
[0148] 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;
[0149] 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.
[0150] 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.
[0151] Furthermore, the system also includes an integrated circuit frequency converter, which is used to ensure that the motor control safety protection meets the power supply frequency conversion requirements.
[0152] In summary, the motor control safety protection method and system provided by the present invention can provide reliable overcurrent protection for the motor by counting the number of triggered current limiting times and calculating the hysteresis voltage, and improve the anti-interference ability of the motor control to protect the circuit from damage.
[0153] The foregoing description is merely a preferred embodiment of the present invention and is not intended to limit the present invention. Those skilled in the art will readily appreciate that various modifications and variations of the present invention are possible. Any modifications, equivalent substitutions, or improvements made within the spirit and principles of the present invention are intended to be within the scope of protection of the present invention.
Claims
1. A motor control safety protection method, characterized in that: The steps include: S1: The motor controller's comparator and state controller are configured with a digital-to-analog converter to obtain the comparator's output voltage. S2: Use the prescaler and clock controller of the motor controller to generate a timer, and then use the clock controller, state controller and external event generator of the event manager of the motor controller 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 external events from the external event source. The hysteresis module of the event manager configures the hysteresis control mode according to the captured external events from the external event source and calculates the corresponding hysteresis voltage according to the following formula: ; in: Indicates the hysteresis voltage between the upper and lower level pulses, Indicates the duration of the upper and lower levels. represents the slope factor, represents the phase angle of the load inductance, represents the vertical component of the pulse optimal velocity to eliminate system offset, represents the velocity at the time of the initial pulse, Indicates the load inertia, Indicates the optimal pulse speed to eliminate system offset; S4: The hysteresis module determines whether the voltage is safe based on the calculated hysteresis voltage. If the voltage is safe, it outputs the current of the current detection protection cycle through pulse width modulation and enters the next detection protection cycle. If the voltage is unsafe, it blocks the current pulse width modulation output and outputs the current of the previous detection protection cycle and enters the next detection protection cycle.
2. A motor control safety protection method according to claim 1, characterized in that: An integrated circuit frequency converter is provided to ensure that the motor control safety protection meets the power supply frequency conversion requirements.
3. The motor control safety protection method according to claim 1, characterized in that: The implementation process of configuring the digital-to-analog converter of the motor controller's comparator and state controller in step S1 is as follows: S11: DAC peripheral reset; S12: DAC trigger disable; S13: Select a noise wave and enable the noise wave; S14: DAC buffer enable; S15: digital-to-analog converter enable; S16: DAC output setting; S17: DAC hysteresis setting.
4. The 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: Start the timer clock; S214: Set the pin mode to multiplexed floating output; S215: Set pin trigger mode; S216: Setting the pulse width modulation period; S217: Timer update configuration.
5. The motor control safety protection method according to claim 1, characterized in that: Configuring the pulse width modulation output in step S2 specifically includes the following steps: S221: Pulse width modulation channel output polarity is high level valid; S222: Enable pulse width modulation output to the port; S223: Set channel complement and channel output status; S224: Channel complementary output state enable; S225: Set channel output duty cycle; S226: Set the output mode of all channels of the timer to pulse width modulation mode; S227: Enable timer channel output; S228: Enable timer, enable peripheral timer interrupt; S229: Enable pulse width modulation interrupt and add external event source.
6. The motor control safety protection method according to claim 1, characterized in that: In step S3, the following method is used to periodically capture external events from external event sources: S311: Setting the counting timing interruption period of the external event occurrence counting module, and clearing the counting timing of the external event occurrence counting module; S312: Set pulse width modulation interrupt and read external event capture flag; S313: Determine whether the external event capture identifier captures an external event. If it is determined that the external event is captured, the external event occurrence counting module is triggered to increase the count by one. If it is determined that the external event is not captured, the external event occurrence counting module is not triggered. S314: Determine whether the number of triggers of the external event occurrence counting module within a counting timing interrupt cycle of the external event occurrence counting module exceeds the trigger number setting threshold. If the trigger number exceeds the trigger number setting threshold, block the pulse width modulation output, and clear the count of the external event occurrence counting module to zero and directly enter the next counting timing interrupt cycle of the external event occurrence counting module. If the number of triggers of the external event occurrence counting module does not exceed the trigger number setting threshold, clear the count of the external event occurrence counting module to zero and enter the next step.
7. The motor control safety protection method according to claim 1, characterized in that: In step S4, the following method is used to determine whether the voltage is safe: The hysteresis voltage is compared with the hysteresis voltage setting threshold. If the hysteresis voltage is less than or equal to the hysteresis voltage setting threshold, it is judged as a safe voltage. If the hysteresis voltage is greater than the hysteresis voltage setting threshold, it is judged as an unsafe voltage.
8. A motor control safety protection system, configured to execute a motor control safety protection method according to any one of claims 1 to 7, characterized in that: 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 comparator is used to wake up the motor controller from the low power mode through an 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 into different frequencies and output them, with a fixed timing per cycle to obtain an accurate timer clock frequency; The clock controller provides a clock frequency for configuring the motor controller and provides a timing for input and output operations; The state controller includes a state register and a control register, wherein the state register is used to obtain the working state of the motor controller by reading 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 by 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, and 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 event 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.
9. The motor control safety protection system according to claim 8, characterized in that: It also includes an integrated circuit frequency converter, which is used to ensure that the motor control safety protection meets the power supply frequency conversion requirements.
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