Multi-function output method and circuit of controller port and computer equipment

By setting the brake signal port and output signal port in the microcontroller controller port, detecting the motor information feedback signal and outputting system version information or fault status, the delay problem of multi-function output of the microcontroller port is solved, and the function output efficiency and system stability are improved.

CN119828567APending Publication Date: 2025-04-15NICHIBO MOTOR SHENZHEN CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510026195.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-08
Publication Date
2025-04-15

AI Technical Summary

Technical Problem

The existing microcontroller controller ports have data transmission delays when outputting multiple functions, resulting in low function output efficiency, large resource usage, high cost and poor system stability.

Method used

By setting the brake signal port and the output signal port in the controller port, collecting motor information feedback signals, detecting the brake signal status, calculating system version information or fault status, and outputting results through the output signal port, multi-function output is achieved without waiting time period.

Benefits of technology

It improves the functional output efficiency of microcontroller ports, reduces port resource occupation and controller costs, and enhances the stability of the system.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119828567A_ABST
    Figure CN119828567A_ABST
Patent Text Reader

Abstract

The invention relates to a multi-function output method and circuit of a controller port and computer equipment. The method comprises the following steps: collecting an information feedback signal of a motor corresponding to a controller, and determining a brake signal port and an output signal port of the controller; receiving a brake signal through a brake signal port, and detecting whether the brake signal is in one of a low-level state, a high-level state or a floating state; when the brake signal is in a low-level state, system version information applied to a motor corresponding to the controller is calculated according to the information feedback signal; when the brake signal is in a high-level state or a floating state, the fault state of a motor corresponding to the controller is calculated according to the information feedback signal; and outputting system version information or a fault state through the output signal port. The brake signal port and the output signal port are matched for use, so that the port of the single-chip microcomputer does not need to wait for a time period when outputting multiple functions, the function output efficiency of the port of the single-chip microcomputer is improved, and the system stability is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the technical field of controller function diagnosis, and in particular to a method, circuit and computer device for outputting multiple functions of a controller port. Background Art

[0002] A single-chip microcomputer is a highly integrated microcomputer that integrates a central processing unit, random access memory, read-only memory, input / output ports, etc. on a single chip. Single-chip microcomputer controller ports are widely used in various fields, such as household appliances, industrial control, automotive electronics, and smart devices. In these applications, single-chip microcomputers connect to external devices through ports to realize functions such as data acquisition, processing, and control. For example, in household appliances, single-chip microcomputers control functions such as temperature or time through ports; in automotive electronics, single-chip microcomputers understand or control the operating functions of devices such as engines, windows, and airbags through ports. Therefore, in modern electronic equipment and computer systems, controller ports, as key interfaces connecting external devices to internal processing units, undertake the important tasks of data transmission and control signal transmission.

[0003] The ports of the MCU are configured in input / output mode to realize various functions. In the prior art, the ports of the MCU output multiple functions by means of time-division multiplexing technology to realize the versatility of the ports, thereby meeting the needs of various functional scenarios. However, in a time period of time-division multiplexing technology, the ports of the MCU can only be used for one specific function, and other functions need to wait, which leads to delays in data transmission and reduces the overall functional output efficiency.

[0004] In view of the above problems, there is an urgent need for a controller port with multiple function output methods, circuits and storage media, which can improve the function output efficiency of the microcontroller port, reduce the port resources of the microcontroller, reduce the controller cost of the microcontroller, and improve the stability of the system. Summary of the invention

[0005] In order to improve the functional output efficiency of the microcontroller port, reduce the port resources of the microcontroller, reduce the controller cost of the microcontroller, and improve the stability of the system, the present application provides a multiple function output method, circuit and storage medium of a controller port.

[0006] In a first aspect, the present invention provides a method for outputting multiple functions of a controller port, the method comprising: Collect the information feedback signal of the controller corresponding to the motor, and determine the brake signal port and output signal port of the controller; Receive a brake signal through the brake signal port, and detect whether the brake signal is in a low level state, a high level state or a floating state; When the brake signal is in a low level state, the system version information applied to the motor corresponding to the controller is calculated according to the information feedback signal; When the brake signal is in a high level state or a floating state, the fault state of the motor corresponding to the controller is calculated according to the information feedback signal; The system version information or the fault status is outputted through the output signal port.

[0007] In one embodiment, the calculating of the system version information applied to the motor corresponding to the controller according to the information feedback signal includes: Setting a first detection cycle, and collecting information feedback signals within the first detection cycle; Determine a high / low level change rule of the information feedback signal in the first detection cycle, and convert the high / low level change rule into a version code of the software to be detected; Detecting whether the version code of the software to be tested is the same as the version code of the target software; When the to-be-checked software version code is the same as the target software version code, it is determined that the system version information applied to the motor corresponding to the controller is the system version information corresponding to the target software version code.

[0008] In one embodiment, calculating the fault state of the motor corresponding to the controller according to the information feedback signal includes: Setting a second detection cycle, and calculating a third quantity value of high level and a fourth quantity value of low level in the continuous information feedback signal within the second detection cycle; Substitute the third quantity value and the fourth quantity value into the predicted fault state calculation formula to obtain the fault state to be detected; the predicted fault state calculation formula is: Where W is the fault state value of the motor, is the number of high level signals; is the number of low-level signals; Detecting whether the fault state to be detected is concentrated with a preset fault state; When the to-be-detected fault state exists and is concentrated with the preset fault state, it is determined that the to-be-detected fault state is a fault state of the motor corresponding to the controller.

[0009] In one embodiment, the method further comprises: Outputting the information feedback signal to a measuring instrument that is communicatively connected to the controller through the output signal port, and using the measuring instrument to detect whether the information feedback signal is a low-level signal within a preset time period; When the information feedback signal is a low level signal within the preset time period, it is determined that the motor corresponding to the controller is in a shutdown state; When the information feedback signal has a high level signal and a low level signal within the preset time period, it is determined that the motor corresponding to the controller is in a running state.

[0010] In one embodiment, the method further comprises: Obtaining the number of pole pairs of the motor and the power frequency used to drive the motor; Calculating the motor speed of the motor according to the pole pair number and the power supply frequency; A pulse width modulation port of the controller is determined, and the motor speed is output through the pulse width modulation port.

[0011] In one embodiment, the measuring instrument is an electronic oscilloscope.

[0012] In one embodiment, calculating the motor speed of the motor according to the pole pair number and the power supply frequency includes: Substituting the pole pair number and the power supply frequency into a preset motor speed calculation formula to obtain the motor speed of the motor, the preset motor speed calculation formula is: Among them, N is the motor speed, F is the power frequency, and P is the number of pole pairs.

[0013] In a second aspect, the present invention provides a multi-function output circuit of a controller port, comprising: A controller chip, comprising a first brake signal terminal and a first output signal terminal; A connector chip, comprising a first pull-up resistor, a second pull-up resistor, a second brake signal terminal and a second output signal terminal; the first pull-up resistor is connected to the second brake signal terminal, the second pull-up resistor is connected to the second output signal terminal; the second brake signal terminal is connected to the first brake signal terminal; the second output signal terminal is connected to the first output signal terminal.

[0014] In one embodiment, the first pull-up resistor is a chip resistor with a resistance value of 10kV; the second pull-up resistor is a chip resistor with a resistance value of 10kV.

[0015] In a third aspect, the present invention provides a computer device comprising a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of a method for outputting multiple functions of a controller port in any of the above-mentioned embodiments when executing the computer program.

[0016] In a fourth aspect, the present disclosure provides a computer-readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, a method for outputting multiple functions of a controller port according to any of the above embodiments is executed.

[0017] The above-mentioned controller port's multiple function output method, circuit and computer equipment first collect the information feedback signal of the controller corresponding to the motor, and then determine the controller's brake signal port and output signal port; further receive the brake signal through the brake signal port, and detect whether the brake signal is in one of the low level state, high level state or floating state; when the brake signal is in the low level state, calculate the system version information applied to the controller corresponding to the motor according to the information feedback signal; when the brake signal is in the high level state or floating state, calculate the fault state of the controller corresponding to the motor according to the information feedback signal; finally output the system version information or fault state through the output signal port. By cleverly using the brake signal port and the output signal port in coordination with each other, the port of the single-chip microcomputer does not need to wait for a time period when outputting multiple functions, thereby improving the function output efficiency of the single-chip microcomputer port, reducing the port resources of the single-chip microcomputer, reducing the controller cost of the single-chip microcomputer, and improving the stability of the system. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the conventional technology, the drawings required for use in the embodiments or the conventional technology description are briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work. Among them: Figure 1 The figure is a flowchart of a method for outputting multiple functions of a controller port in an embodiment.

[0019] Figure 2 A circuit diagram of a multi-functional output circuit of a controller port in one embodiment.

[0020] Figure 3 The diagram is a coding diagram of a software version number in an embodiment.

[0021] Figure 4 The diagram is a coding diagram of a motor fault state in an embodiment.

[0022] Figure 5 FIG. 1 is a schematic diagram of the change of the FG signal of the motor running state in an embodiment. DETAILED DESCRIPTION

[0023] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.

[0024] Embodiment 1 Please refer to Figure 1 In one embodiment of the present application, a method for outputting multiple functions of a controller port includes the following steps: Step 111, collect the information feedback signal of the controller corresponding to the motor, and determine the brake signal port and output signal port of the controller.

[0025] In this embodiment, the brake signal port of the controller includes high-level brake and low-level brake types. High-level brake means that the brake signal line is connected to a high level or floating; low-level brake means that the brake signal line is connected to a low level. Figure 2 As shown in the circuit diagram, the controller 21 is designed with a BK port, which is the brake signal port of the controller 21. The output signal port is an interface on the controller for sending control instructions to the motor or other actuators. Figure 2 As shown in the circuit diagram, the controller 21 is designed with an FG port, which is the output signal port of the controller 21. In practical applications, the controller collects information feedback signals of the motor through a variety of sensors and signal processing technologies, wherein the information feedback signals include speed data, speed data, current data, temperature data, fault data and other data related to the operation of the motor.

[0026] Step 112, receiving a brake signal through the brake signal port, and detecting whether the brake signal is in a low level state, a high level state or a floating state.

[0027] In this embodiment, see Figure 2 In the circuit diagram, the output signal port (FG port) of the controller 21 is connected to the output signal port (FG port) of the connector; the brake signal port (BK port) of the controller 21 is connected to the brake signal port (BK port) of the connector 22. In practical applications, data is transmitted to the controller 21 through the connector 22 so that the port of the controller is not exposed to the outside for a long time, so as to avoid damage to the controller 21 caused by long-term contact with air.

[0028] The brake signal port of the controller 21 is an input port. When a brake signal is input to the brake signal port of the controller 21, in order to further determine the condition for triggering the output of a function of the input brake signal, it is necessary to detect the signal state of the brake signal, such as a high level state, a floating state or a low level state. In practical applications, it is possible to first determine whether the brake signal is in a low level state, a high level state or a floating state. When the brake signal is in a low level state, the brake signal is a condition for triggering the output of the system version information applied to the motor corresponding to the controller; when the brake signal is in a high level state or a floating state, the brake signal is a condition for triggering the output of the fault state of the motor corresponding to the controller.

[0029] Step 113: when the brake signal is in a low level state, the system version information applied to the motor corresponding to the controller is calculated according to the information feedback signal.

[0030] When the brake signal is in a low level state, the controller 21 needs to output the system version information applied on the motor corresponding to the controller. Before outputting the system version information applied on the motor corresponding to the controller, it is necessary to further determine the system version information applied on the motor corresponding to the controller.

[0031] Specifically: first, a first detection cycle is set, and information feedback signals within the first detection cycle are collected; high / low level change rules corresponding to continuous information feedback signals within the first detection cycle are counted; for example, Figure 3 Further, the high / low level change rules are converted into the software version code to be tested, for example, using "1" and "0" to represent the high level state, Figure 3 The high / low level change rule corresponding to the first information feedback signal in can be converted into "000100100001001000010010000" (i.e., the version code of the software to be tested).

[0032] Finally, before outputting the system version information, verify the accuracy of the system version information. Specifically, detect whether the software version code to be tested is the same as the target software version code. The target software version code is to select any target software version code at random from the software version code set. The software version code set stores multiple software version codes and the system version information corresponding to each software version code. When the software version code to be tested is the same as the target software version code, it means that the corresponding system version information can be queried in the software version code set. Therefore, when the software version code to be tested is the same as the target software version code, it is determined that the system version information applied to the motor corresponding to the controller is the system version information corresponding to the target software version code, providing a data basis for step 115.

[0033] Step 114: when the brake signal is in a high level state or a floating state, the fault state of the motor corresponding to the controller is calculated according to the information feedback signal.

[0034] When the brake signal is in a high level state or a floating state, the controller 21 needs to output the fault state of the motor corresponding to the controller. Before outputting the fault state of the motor corresponding to the controller, it is necessary to further determine the fault state of the motor corresponding to the controller.

[0035] Specifically, first, a second detection cycle is set, and a third quantity value of a high level and a fourth quantity value of a low level in the continuous information feedback signal in the second detection cycle are calculated. The third quantity value and the fourth quantity value are substituted into the prediction fault state calculation formula to obtain the fault state to be detected; the prediction fault state calculation formula is: Where W is the fault state value of the motor, is the number of high level signals; is the number of low-level signals. In this embodiment, if the number of high-level signals in the continuous information feedback signal in the second detection cycle accounts for too high or too low a proportion of the total number of signals, it means that there is some kind of fault in the motor. Therefore, it is necessary to substitute the third and fourth quantity values ​​into the predicted fault state calculation formula to obtain the fault state to be detected; finally, the fault state to be detected is converted into a binary representation to obtain the fault code signal to be detected corresponding to the fault state to be detected, which is expressed as follows Figure 4 Fault coding signal.

[0036] Finally, before outputting the fault state of the motor corresponding to the controller, verify the accuracy of the fault state of the motor corresponding to the controller. Specifically: detect whether the fault state to be detected exists in the preset fault state set; the preset fault state set includes a fault coding signal, the fault cause and fault description corresponding to each fault coding signal, as shown in Table 1 below. When the fault state to be detected exists in the preset fault state set, it means that the fault coding signal to be tested, as well as the fault cause and fault description corresponding to the fault code to be tested can be queried in the preset fault state set. Provide a data basis for step 115.

[0037] Table 1 Step 115: output the system version information or the fault status through the output signal port.

[0038] The above-mentioned controller port's multiple function output method, circuit and computer equipment first collect the information feedback signal of the controller corresponding to the motor, and then determine the controller's brake signal port and output signal port; further receive the brake signal through the brake signal port, and detect whether the brake signal is in one of the low level state, high level state or floating state; when the brake signal is in the low level state, calculate the system version information applied to the controller corresponding to the motor according to the information feedback signal; when the brake signal is in the high level state or floating state, calculate the fault state of the controller corresponding to the motor according to the information feedback signal; finally output the system version information or fault state through the output signal port. By cleverly using the brake signal port and the output signal port in coordination with each other, the port of the single-chip microcomputer does not need to wait for a time period when outputting multiple functions, thereby improving the function output efficiency of the single-chip microcomputer port, reducing the port resources of the single-chip microcomputer, reducing the controller cost of the single-chip microcomputer, and improving the stability of the system.

[0039] It should be understood that although Figure 1 The steps in the flowchart are shown in sequence as indicated by the arrows, but these steps are not necessarily executed in the order indicated by the arrows. Unless otherwise specified in this document, there is no strict order restriction for the execution of these steps, and these steps can be executed in other orders. Moreover, Figure 1 At least part of the steps may include multiple sub-steps or multiple stages. These sub-steps or stages are not necessarily executed at the same time, but can be executed at different times. The execution order of these sub-steps or stages is not necessarily sequential, but can be executed in turn or alternately with other steps or at least part of the sub-steps or stages of other steps.

[0040] In one embodiment, the calculating of the system version information applied to the motor corresponding to the controller according to the information feedback signal includes: 1-1) Setting a first detection cycle and collecting information feedback signals within the first detection cycle.

[0041] 1-2) Determine a high / low level change rule of the information feedback signal in the first detection cycle, and convert the high / low level change rule into a version code of the software to be detected.

[0042] 1-3) Detect whether the version code of the software to be checked is the same as the version code of the target software.

[0043] 1-4) When the to-be-checked software version code is the same as the target software version code, it is determined that the system version information applied to the motor corresponding to the controller is the system version information corresponding to the target software version code.

[0044] In one embodiment, calculating the fault state of the motor corresponding to the controller according to the information feedback signal includes: 2-1) Setting a second detection cycle, and calculating a third quantity value of high level and a fourth quantity value of low level in the continuous information feedback signal within the second detection cycle.

[0045] 2-2) Substituting the third quantity value and the fourth quantity value into the predicted fault state calculation formula to obtain the fault state to be detected; the predicted fault state calculation formula is: Where W is the fault state value of the motor, is the number of high level signals; The number of low level signals.

[0046] 2-3) Detect whether the fault state to be detected is concentrated with the preset fault state.

[0047] 2-4) When the fault state to be detected is concentrated with the preset fault state, it is determined that the fault state to be detected is a fault state of the motor corresponding to the controller.

[0048] In one embodiment, the method further comprises: 3-1) Outputting the information feedback signal to a measuring instrument that is communicatively connected to the controller through the output signal port, and using the measuring instrument to detect whether the information feedback signal is a low-level signal within a preset time period.

[0049] 3-2) When the information feedback signal is a low level signal within the preset time period, it is determined that the motor corresponding to the controller is in a shutdown state.

[0050] When the motor is stopped, its internal circuit and control system usually enter a low power consumption or standby mode. In the stopped state, since the motor is not working, the corresponding control system or sensor may output a low level signal to indicate that the motor is currently not working. Therefore, when the information feedback signal is a low level signal within a preset time period, the working state of the controller corresponding to the motor is the stopped state.

[0051] 3-3) When the information feedback signal has a high level signal and a low level signal within the preset time period, it is determined that the motor corresponding to the controller is in a running state.

[0052] The running state of the motor is usually accompanied by a series of dynamic changes, which will cause the level in the information feedback signal to change accordingly. The existence of high-level signals and low-level signals indicates that these changes are occurring, thereby proving the running state of the motor. Therefore, when the information feedback signal has high-level signals and low-level signals within a preset time period, it is determined that the working state of the motor corresponding to the controller is the running state.

[0053] In one embodiment, the measuring instrument is an electronic oscilloscope.

[0054] In one embodiment, the method further comprises: 4-1) Obtaining the number of pole pairs of the motor and the power frequency for driving the motor.

[0055] 4-2) Calculating the motor speed of the motor according to the pole pair number and the power supply frequency.

[0056] 4-3) Determine a pulse width modulation port of the controller, and output the motor speed through the pulse width modulation port.

[0057] In this embodiment, after calculating the motor speed, the controller 21 generates a corresponding PWM signal according to the motor speed and the motor characteristics. The controller 21 outputs the PWM signal through the pulse width modulation port. Figure 2 A PWM port is designed on the connector 22, and the connector 22 is connected to the controller 21. The controller 21 outputs a PWM signal to the PWM port on the connector 22, and the motor speed is output through the PWM port of the connector 22.

[0058] In one embodiment, the PWM signal is a digital signal that controls the voltage and current of the motor by adjusting the duty cycle of the signal (ie, the proportion of the high level time to the total time).

[0059] In one embodiment, calculating the motor speed of the motor according to the pole pair number and the power supply frequency includes: 5-1) Substituting the pole pair number and the power supply frequency into a preset motor speed calculation formula to obtain the motor speed of the motor. The preset motor speed calculation formula is: Among them, N is the motor speed, F is the power frequency, and P is the number of pole pairs.

[0060] Embodiment 2 Please refer to Figure 2In one embodiment of the present application, a multi-function output circuit of a controller port includes: a controller 21 and a connector 22; wherein the controller 21 is designed with a first brake signal terminal (BK terminal) and a first output signal terminal (FG terminal); the connector 22 is designed with a first pull-up resistor (R17), a second pull-up resistor (R18), a second brake signal terminal (BK terminal) and a second output signal terminal (FG terminal).

[0061] As an example, see Figure 2 The first pull-up resistor is connected to the second brake signal terminal, and the second pull-up resistor is connected to the second output signal terminal; the second brake signal terminal of the connector 22 is connected to the first brake signal terminal of the controller 21; the second output signal terminal of the connector 22 is connected to the first output signal terminal of the controller 21.

[0062] In this embodiment, the first output signal terminal (FG terminal) of the single-chip microcomputer controller 21 is used for multiple function outputs, and the first brake signal terminal is used to receive a brake signal, and the level state of the brake signal is used as a condition for the first output signal terminal (FG terminal) to trigger the function output.

[0063] In actual applications, when the motor corresponding to the controller 21 stops due to a fault, a brake signal is input through the second brake signal terminal (BK terminal) of the connector 22, and the second brake signal terminal (BK terminal) of the connector 22 transmits the brake signal to the first brake signal terminal (BK terminal) of the controller 21; then the controller 21 detects the signal level state corresponding to the brake signal received from the first brake signal terminal (BK terminal); when the brake signal is a low-level signal, the controller 21 triggers the function of outputting the system version information applied to the motor corresponding to the controller, and then the controller 21 controls the first output signal terminal (FG terminal) to output the system version information applied to the motor corresponding to the controller to the second output signal terminal of the connector 22.

[0064] For example, when the brake signal received by the first brake signal terminal (BK terminal) is at a low level, the FG feedback port will output the system software version level change. The FG signal reflects the software version number of the motor: when the motor stops due to a fault, the BK brake port line is grounded, and the FG signal outputs several continuous high and low level signals at a certain period. The software version number can be determined based on the number of high and low level signals. The encoding signal of the software version number is as follows: Figure 3 As shown, Figure 3 The first signal is "000100100001001000010010000", which is the version code of software version 2; Figure 3 The second signal is "0001001001000010010010000", which is the version code of software version 3.

[0065] When the brake signal is in a high level state or a floating state, the controller 21 triggers the function of outputting the fault state of the motor corresponding to the controller, and then the controller 21 controls the first output signal terminal (FG terminal) to output the fault state to the second output signal terminal of the connector 22.

[0066] For example, when the brake signal received by the first brake signal terminal (BK terminal) is a high-level signal: the FG feedback port will output a system fault code level change. When the motor stops due to a fault, the first brake signal terminal (BK terminal) is connected to a high level or floated, and the FG signal outputs several continuous high-low level signals in a certain period. The type of fault can be determined based on the number of high-low level signals. The output condition of this fault mode is that when the entire system fails, the system will stop running, and the first output signal terminal (FG terminal) outputs a specific coding signal. The coding signal is such as Figure 4 As shown, Figure 4 The first signal is "001010010100101000", which is the code of fault No. 2; Figure 4 The second signal is "001010100101010010101000", which is the code of fault No. 3. The coding method of different fault codes at different levels is shown in Table 2 below. Other information can also be reflected according to other.

[0067] Table 2 In one embodiment, the step of obtaining system version information applied on the motor corresponding to the controller includes: first, collecting the information feedback signal of the motor corresponding to the controller, setting a first detection cycle, and collecting the information feedback signal within the first detection cycle; then determining the high / low level change rule of the information feedback signal within the first detection cycle, and converting the high / low level change rule into a software version code to be tested; further, detecting whether the software version code to be tested is the same as the target software version code; when the software version code to be tested is the same as the target software version code, determining that the system version information applied on the motor corresponding to the controller is the system version information corresponding to the target software version code.

[0068] In one embodiment, the step of obtaining the fault state of the motor corresponding to the controller includes: first, collecting the information feedback signal of the motor corresponding to the controller; then setting a second detection cycle, calculating the third quantity value of the high level and the fourth quantity value of the low level in the continuous information feedback signal in the second detection cycle; further, substituting the third quantity value and the fourth quantity value into the predicted fault state calculation formula to obtain the fault state to be detected; the predicted fault state calculation formula is: Where W is the fault state value of the motor, is the number of high level signals; is the number of low-level signals; finally, it is detected whether the fault state to be detected exists and is concentrated with the preset fault state; when the fault state to be detected exists and is concentrated with the preset fault state, it is determined that the fault state to be detected is the fault state of the motor corresponding to the controller.

[0069] In this embodiment, the first pull-up resistor is connected to the second brake signal terminal, and the second brake signal terminal of the connector 22 is connected to the first brake signal terminal of the controller 21; the first pull-up resistor is used to make the brake signal transmitted on the first brake signal terminal and the second brake signal terminal more stable. The second pull-up resistor is connected to the second output signal terminal, and the second output signal terminal of the connector 22 is connected to the first output signal terminal of the controller 21; the second pull-up resistor is used to make the data transmitted on the first output signal terminal and the second output signal terminal (system version information applied to the motor corresponding to the controller or the fault status of the motor corresponding to the controller) more stable.

[0070] In this embodiment, the multi-function output circuit of the controller port solves the problem that the port of the single-chip microcomputer does not need to wait for a time period when outputting multiple functions. The principle is: when the single-chip microcomputer has insufficient single-port resources, the controller port combination method is used to complete the output of related content, so that a small amount of hardware resources can be used to realize product functions, greatly reducing hardware maintenance costs and improving system stability.

[0071] The multi-function output circuit of the controller port in the above-mentioned embodiment cleverly cooperates the brake signal port and the output signal port with each other, so that the controller in the single-chip microcomputer first receives the brake signal through the brake signal terminal (BK terminal); when the brake signal received by the controller is a low-level signal, the single-chip microcomputer controls the output signal terminal to output the system version information applied to the motor corresponding to the controller through the controller; when the brake signal received by the controller is a high-level signal or a floating signal, the single-chip microcomputer controls the output signal terminal to output the system version information or fault status through the controller; the problem that the port of the single-chip microcomputer does not need to wait for a time period when outputting multiple functions is solved, thereby improving the functional output efficiency of the single-chip microcomputer port, reducing the port resources of the single-chip microcomputer, reducing the controller cost of the single-chip microcomputer, and improving the stability of the system.

[0072] In one embodiment, the controller 21 in the multi-function output circuit of the controller port can also output the information feedback signal of the motor corresponding to the controller to the measuring instrument connected to the controller through the first brake signal terminal (BK terminal), and use the measuring instrument to detect whether the information feedback signal is a low-level signal in a preset time period; when the information feedback signal is a low-level signal in the preset time period, it is determined that the motor corresponding to the controller is in a shutdown state; when the information feedback signal has a high-level signal and a low-level signal in the preset time period, it is determined that the motor corresponding to the controller is in a running state; so as to realize the feedback of the motor state running or stopped through the first output signal terminal (FG terminal). It is worth mentioning that the measuring instrument can be an electronic oscilloscope.

[0073] For example, if the controller's information feedback signal (i.e., FG signal) corresponding to the motor has high and low level outputs and a frequency higher than (20hz), it can basically indicate that the motor is in normal operation; if the FG signal is always at a low level output, it means that the motor is in a stopped state.

[0074] 1: Motor running status: Feedback motor status (running, stopping) After the motor is running, the FG port will output high and low level signals. The high and low level signals can be measured through another port, which means that the motor is running. 2: After the motor stops, the FG port will output a low-level signal. The low-level signal can be measured through another port, indicating that the motor has stopped running.

[0075] See also Figure 5 , we can see the basic situation of the motor's operating status, that is, when the FG signal is always at a low level output, it means that the motor is in a stopped state; when the FG signal is high or low level output and the frequency is higher than (20hz), it can basically indicate that the motor is in a normal operating state.

[0076] In this embodiment, the controller 21 can also control the pulse width modulation port of the controller (see Figure 2 The motor speed is output through the pulse width modulation port. Specifically, the FG signal speed calculation principle: the external port interrupt is generated by the change of the Hall induction magnetic field, and the FG signal output defined by the GPIO is flipped into the interrupt function. The higher the speed, the faster the FG output frequency, and vice versa. The motor speed is calculated based on the relationship between the frequency and the number of motor poles. The preset motor speed calculation formula is as follows: Among them, N is the motor speed, F is the power frequency, and P is the number of pole pairs.

[0077] Embodiment 3 In this embodiment, a computer device is provided. The computer device includes a processor, a memory, a network interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program, and the non-volatile storage medium is deployed with a database, which is used to store all data involved in a multiple function output method of a controller port. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The network interface of the computer device is used to communicate with other computer devices deployed with application software. When the computer program is executed by the processor, a multiple function output method of a controller port is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covered on the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse.

[0078] In one embodiment, a computer device is provided, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of a method for outputting multiple functions of a controller port described in any of the above embodiments when executing the computer program.

[0079] Embodiment 4 In this embodiment, a computer-readable storage medium is provided, on which a computer program is stored. When the computer program is executed by a processor, a method for outputting multiple functions of a controller port described in any of the above embodiments is executed.

[0080] Those of ordinary skill in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include non-volatile and / or volatile memory. Non-volatile memory may include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM) or flash memory. Volatile memory may include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in many forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDRSDRAM), enhanced SDRAM (ESDRAM), synchronous link (Synchlink) DRAM (SLDRAM), memory bus (Rambus) direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and memory bus dynamic RAM (RDRAM), etc.

[0081] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0082] The above-mentioned embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the invention patent. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the patent of the present application shall be subject to the attached claims.

Claims

1. A method for outputting multiple functions of a controller port, characterized in that: Applied to a single chip microcomputer, the method comprises: Collect the information feedback signal [YY1] of the controller corresponding to the motor, and determine the brake signal port [YY2] and output signal port [YY3] of the controller; Receive a brake signal through the brake signal port, and detect whether the brake signal is in a low level state, a high level state or a floating state; When the brake signal is in a low level state, the system version information applied to the motor corresponding to the controller is calculated according to the information feedback signal; When the brake signal is in a high level state or a floating state, the fault state of the motor corresponding to the controller is calculated according to the information feedback signal; The system version information or the fault status is outputted through the output signal port.

2. The method for outputting multiple functions according to claim 1, characterized in that: The calculating, based on the information feedback signal, the system version information applied to the motor corresponding to the controller comprises: Setting a first detection cycle, and collecting information feedback signals within the first detection cycle; Determine a high / low level change rule of the information feedback signal in the first detection cycle, and convert the high / low level change rule into a version code of the software to be detected; Detecting whether the version code of the software to be tested is the same as the version code of the target software; When the to-be-checked software version code is the same as the target software version code, it is determined that the system version information applied to the motor corresponding to the controller is the system version information corresponding to the target software version code.

3. The method for outputting multiple functions according to claim 1, characterized in that: The step of calculating the fault state of the motor corresponding to the controller according to the information feedback signal includes: Setting a second detection cycle, and calculating a third quantity value of high level and a fourth quantity value of low level in the continuous information feedback signal within the second detection cycle; Substitute the third quantity value and the fourth quantity value into the predicted fault state calculation formula to obtain the fault state to be detected; the predicted fault state calculation formula is:

4. Among them, W is the fault state value of the motor, is the number of high level signals; is the number of low-level signals; Detecting whether the fault state to be detected is concentrated with a preset fault state; When the to-be-detected fault state exists and is concentrated with the preset fault state, it is determined that the to-be-detected fault state is a fault state of the motor corresponding to the controller.

5. The multiple function output method according to claim 1 or 2, characterized in that: The method further comprises: Outputting the information feedback signal to a measuring instrument that is communicatively connected to the controller through the output signal port, and using the measuring instrument to detect whether the information feedback signal is a low-level signal within a preset time period; When the information feedback signal is a low level signal within the preset time period, it is determined that the motor corresponding to the controller is in a shutdown state; When the information feedback signal has a high level signal and a low level signal within the preset time period, it is determined that the motor corresponding to the controller is in a running state.

6. The multiple function output method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining the number of pole pairs of the motor and the power frequency used to drive the motor; Calculating the motor speed of the motor according to the pole pair number and the power supply frequency; A pulse width modulation port of the controller is determined, and the motor speed is output through the pulse width modulation port.

7. The method for outputting multiple functions according to claim 4, characterized in that: The measuring instrument is an electronic oscilloscope.

8. The method for outputting multiple functions according to claim 5, characterized in that: The calculating the motor speed of the motor according to the pole pair number and the power supply frequency comprises: Substitute the pole pair number and the power supply frequency into a preset motor speed calculation formula to obtain the motor speed of the motor. The preset motor speed calculation formula is:

9. Where N is the motor speed, F is the power frequency, and P is the number of pole pairs.

10. A multi-function output circuit of a controller port, characterized in that: A method for outputting multiple functions of a controller port as claimed in any one of claims 1 to 7, comprising: A controller chip, comprising a first brake signal terminal and a first output signal terminal; A connector chip, comprising a first pull-up resistor, a second pull-up resistor, a second brake signal terminal and a second output signal terminal; the first pull-up resistor is connected to the second brake signal terminal, the second pull-up resistor is connected to the second output signal terminal; the second brake signal terminal is connected to the first brake signal terminal; the second output signal terminal is connected to the first output signal terminal.

11. The multi-function output circuit according to claim 8, characterized in that: The first pull-up resistor is a chip resistor with a resistance value of 10kV; the second pull-up resistor is a chip resistor with a resistance value of 10kV.

12. A computer device comprising a memory and a processor, wherein the memory stores a computer program, characterized in that: When the processor executes the computer program, the steps of the method according to any one of claims 1 to 7 are implemented.