A CAN bus mobile debugging method based on new energy motor test bench
By using CAN bus mobile debugging method in the new energy motor stand, and using a microcontroller and USB-CAN bus analyzer, the automatic communication debugging of the frequency converter cabinet is realized, solving the problems of complex and long cycles in the existing technology, and realizing the It has a simple and efficient debugging process and is suitable for various types of CAN bus communication test benches.
Patent Information
- Application Number
- CN202111457085.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-12-02
- Publication Date
- 2024-11-12
- Estimated Expiration
- 2041-12-02
AI Technical Summary
In the prior art, the communication debugging system of the frequency converter cabinet has a complex structure, a long debugging cycle, high cost, and depends on computers for debugging, and has poor flexibility.
Using the CAN bus mobile debugging method based on the new energy motor stand, by writing a communication code library, using a microcontroller and USB-CAN bus analyzer, real-time monitoring and automatic comparison between the stand controller and the frequency converter cabinet are realized, and communication is completed. Debugging simplifies the debugging process and reduces the need to rely on computers.
Without starting the bench controller, offline debugging is realized, which shortens debugging time and reduces manual debugging costs. The system is easier to operate, and has mobile debugging functions. It is suitable for various types of CAN bus communication test benches. .
Smart Images

Figure CN114355799B_ABST
Abstract
Description
Technical Field
[0001] The invention belongs to the technical field of automatic control of research and development test equipment, and relates to a CAN bus mobile debugging method based on a new energy motor test bench. Background Art
[0002] Figure 1 This is the hardware structure diagram of the bench test system. The system includes industrial computers, frequency conversion cabinets, test benches, bench controllers, assembly under test, bus power supplies, battery simulators, power analyzers, motor controllers, inverters and other hardware. The battery simulator provides DC power to the inverter, which is then supplied to the motor under test after being inverted; the industrial computer is connected to the bench controller via a network cable, the bench controller is connected to the frequency conversion cabinet via a CAN line, the busbar plug-in box supplies power to the frequency conversion cabinet, and the frequency conversion cabinet supplies power to the bench dynamometer and fan to drive the dynamometer to operate.
[0003] Figure 2 This is the schematic diagram of the test bench control system. The industrial computer sends instructions to the test bench controller through the network port communication. The test bench controller and the frequency converter cabinet use the CAN bus communication method to send instructions to the frequency converter cabinet control module, including start, stop, reset, enable, set parameters, etc., and receive the corresponding status instructions returned by the frequency converter cabinet control module. The frequency converter cabinet supplies power to the test bench and receives the speed signal returned by the test bench. At the same time, the dynamometer uploads the speed, torque, power and other signals to the test bench controller. When diagnosing the test bench communication fault, it is necessary to debug the communication between the host computer system and the frequency converter multiple times in order to find and eliminate the response fault.
[0004] The frequency converter cabinet is mainly used to convert 380V AC into variable frequency AC in bench test, to supply power to the bench dynamometer and dynamometer fan, to communicate with the host computer controller, to send and receive controller instructions, to make the dynamometer operate at the required frequency, and to collect the dynamometer speed signal, which is the center of the system. One of the prerequisites for the normal operation of the system is that the frequency converter cabinet needs to ensure that the state is normal and meets the operating conditions.
[0005] Self-test method of existing frequency conversion cabinet: During the operation of the motor test bench, the test bench controller and the frequency conversion cabinet use CAN bus communication to communicate in real time. When the frequency conversion cabinet has a communication failure and needs to be repaired, it is necessary to start the test bench operation software multiple times, repeatedly call the test bench database, and load system parameters. The operation is complicated and the loading time is long. In addition, it is affected by the control strategy of the test bench control system itself. Other software and hardware failures in the system, such as safety relays, will interfere with communication debugging. If debugging is performed using a laptop computer with CAN bus debugging software, the system will be overly dependent on the computer Windows system, and the overall structure will be complex and have poor flexibility.
[0006] At present, there is a fault detection device for a high-voltage inverter, including a single-chip microcomputer, a first interface module, a first expandable interface module, and a touch screen; the single-chip microcomputer is connected to the touch screen through the first interface module; the single-chip microcomputer is connected to the high-voltage inverter through the first expandable interface module: the single-chip microcomputer obtains a detection instruction issued by a user from the touch screen through the first interface module, generates a corresponding preset instruction code, and sends the instruction code to the high-voltage inverter through the sending port of the first expandable interface module, and feeds back a fault code after detecting a fault; the single-chip microcomputer receives the fault code fed back by the high-voltage inverter through the receiving port of the first expandable interface module, and after converting the fault code into corresponding fault information, sends the fault information to the touch screen through the first expandable interface module, so that the touch screen can display the fault information.
[0007] Patent document 1 with announcement number CN201956700U discloses a doubly-fed inverter communication system for a wind turbine generator set, which includes: a grid-side main control chip, a machine-side main control chip, a wind turbine main controller and a communication bus, wherein the grid-side main control chip and the machine-side main control chip are respectively connected to the communication bus, the grid-side main control chip is electrically connected to the grid-side inverter, and the machine-side main control chip is electrically connected to the machine-side inverter; the wind turbine main controller is connected to the communication bus, and communicates with the grid-side inverter and the machine-side inverter respectively.
[0008] Patent document 2 with announcement number CN208291223U discloses a frequency converter control system for a rail vehicle air conditioning system, including a host computer, an MCU, multiple frequency converters and multiple contactors, wherein the host computer is respectively connected to the MCU and multiple frequency converters in communication, and the input ends of the multiple contactors are all connected to the output ends of the MCU, and the output ends of the contactors are connected to the input ends of the frequency converters in a one-to-one correspondence. The utility model includes a host computer, an MCU, multiple frequency converters and multiple contactors, and a host computer and multiple contactors are added. The host computer can cooperate with the MCU and multiple contactors to operate multiple frequency converters at the same time, which is more efficient and more accurate than the existing manual method of operating the frequency converters one by one; the host computer connected to the frequency converter can remotely monitor the status of the frequency converter in real time, which is more convenient. The utility model can be widely used in the field of variable frequency air conditioners for rail vehicles.
[0009] Patent document 3 with announcement number CN105487998B provides a multiple interface communication debugging tool, including: a tool body and an optical modem, a U-port splitter and a network cable splitter arranged inside the tool body; the optical modem is used for signal conversion and transmission, and the optical modem is provided with an optical fiber closing port and an optical fiber emitting port for connecting an optical fiber, a network port for connecting a network cable and an optical modem charging port for charging the optical modem; the network cable splitter is provided with three ports, namely a transmission port, an input port and an output port, for providing a network port communication function; the U-port splitter is electrically connected to the network port of the optical modem, and the U-port splitter also has a U-port and an output end for connecting a computer, and a serial port for connecting to a debugging device is also connected at the output end, and the serial port is used to connect a serial port type network cable of the debugging device. When in use, the interfaces of the computer and the debugging device are connected to the corresponding interfaces of the multiple interface communication debugging tool of the present invention, and multiple interface communication debugging can be completed.
[0010] Patent Document 1 and Patent Document 2 require the communication debugging of the inverter to be completed through a host computer, and also include other hardware such as a PLC controller. The structural form and control method are significantly different from the present application.
[0011] Patent document 3 is a mobile debugging tool that still needs to rely on a computer to complete the debugging work during the debugging process. The system structure and implementation process are quite different from those of the present application. Summary of the invention
[0012] The technical problem to be solved by the present invention is to overcome the problems of complex structure, long debugging cycle and high cost of the communication debugging system in the prior art, and provide a CAN bus mobile debugging method based on a new energy motor test bench.
[0013] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device.
[0014] In order to solve the above technical problems, the present invention is implemented by adopting the following technical solutions:
[0015] The CAN bus mobile debugging method based on the new energy motor test bench is characterized in that the data in the communication code library is compiled step by step to form a control instruction, and the control instruction includes a start instruction, a send instruction, and a target instruction;
[0016] Press the start button on the communication controller. The button is closed and sent to the single-chip microcomputer in the communication controller as a start instruction. After receiving the start instruction, the single-chip microcomputer in the communication controller automatically sends instructions in sequence.
[0017] Each step of the instruction sent corresponds to a set of target instructions. Each time the communication controller sends a step of instruction, it will receive a set of instructions fed back by the frequency converter cabinet and compare the fed-back instructions with the target instructions.
[0018] If the instruction fed back is consistent with the target instruction, the next instruction will be sent automatically; if not, the communication fault light will turn on and the detection will end.
[0019] Furthermore, the sending instructions include a standby instruction, a fault reset instruction, an enable instruction, a mode selection instruction, a set value instruction and a start instruction.
[0020] Furthermore, the single chip microcomputer sends standby instructions, fault reset instructions, enable instructions, mode selection instructions, set value instructions, and start instructions to the frequency converter cabinet in sequence, receives instructions fed back from the frequency converter cabinet at each stage, and confirms whether the communication status of the frequency converter cabinet is normal.
[0021] Furthermore, the USB-CAN bus analyzer is connected to the original test bench control system through the two data communication lines CAN_H and CAN_L, and the computer is used to monitor and record in real time the instructions sent by the test bench controller to the frequency converter cabinet and the instructions fed back by the frequency converter cabinet to the test bench controller in each link, master the instructions sent and received by the host computer system, analyze the meaning of each byte in the bus data frame, understand the communication logic and control strategy of the motor test bench system, implant the sending instructions and target instructions into the microcontroller in the form of a program, establish a communication code library, and write control instructions.
[0022] Furthermore, when the on-site debugging personnel operate the communication controller, the operator sets the command cycle sending and receiving time on the communication controller to ensure that the breathing light of the frequency converter cabinet flashes normally; at the same time, the instructions fed back by the frequency converter cabinet are received, and the fed back instructions are automatically compared with the target instructions.
[0023] Furthermore, the sending instructions are written into the microcontroller program in sequence. At the same time, in addition to the programs for sending and receiving related instructions, the microcontroller also includes bus initialization, port, baud rate, data bit, and stop bit parameter setting configuration programs to ensure that instructions can be sent and received normally.
[0024] Furthermore, after the microcontroller receives the switch signal, the program starts to execute in steps:
[0025] First, the MCU sends a standby command, which is sent once every 5ms. At the same time, the data feedback content is detected within the 5ms time interval. If there is no feedback data within the 5ms time interval, or the feedback data content is inconsistent with the target instruction content, the MCU will report an error, the fault light will be constant, indicating a communication failure, and the fault information will be stored in the MCU fault database, and the detection process will end; if there is feedback within the 5ms time interval and the feedback data is consistent with the target instruction content, the fault light will not light up, indicating that the communication is normal, and the MCU will automatically enter the second step to send a fault reset command;
[0026] It is sent once every 5ms, and the data feedback content is detected within the 5ms time interval. The judgment process is the same as the first step. If the communication is normal, the fault light is off, and the microcontroller automatically sends the next instruction. If the communication fails, the fault light is always on, and the fault information is stored in the microcontroller fault database, and the detection process ends.
[0027] After each operation is executed, a similar feedback instruction judgment as above is required to determine whether the received instruction is consistent with the target instruction. If they are consistent, the next step is executed and the next step is valid. If the received instruction is inconsistent with the target instruction, the fault light is always on, indicating a communication failure. The fault information is stored in the microcontroller fault database. After all steps are completed, if the communication is normal and the fault light is not always on, it proves that the communication failure of the frequency converter cabinet has been eliminated and the test bench communication debugging is completed.
[0028] Furthermore, the USB-CAN bus analyzer is connected in parallel to the test bench control system through the two communication lines CAN_H and CAN_L, the USB-CAN bus analyzer is turned on, the baud rate and port number parameters are configured, the USB-CAN bus analyzer is started, and the communication between the test bench controller and the frequency conversion cabinet is monitored in real time, the instructions sent by the test bench controller to the frequency conversion cabinet and the instructions uploaded by the frequency conversion cabinet to the test bench controller are recorded, the cyclic sending time of the standby instruction, fault reset instruction, enable instruction, mode selection instruction, set value instruction, and start instruction are recorded, and a communication code library is formed to provide source code for the communication controller program writing.
[0029] Furthermore, the communication controller is powered by a 9V switching power supply, the 220V AC power of the switching power supply is provided by the inside of the frequency converter cabinet, and is connected to the frequency converter cabinet through two power lines L and N. The communication controller is connected to the frequency converter cabinet control module through two CAN lines.
[0030] Furthermore, the single chip microcomputer includes a communication module, a data processing module, and a data storage module.
[0031] The communication module is used to send instructions to the frequency converter cabinet and receive instructions fed back by the frequency converter cabinet;
[0032] The data processing module is used to process the instructions fed back by the frequency converter cabinet, extract the data frame part in the instruction, compare each byte in the data frame with the corresponding byte in the data frame in the target instruction, and determine whether they are consistent;
[0033] The data storage module is used to store communication fault information.
[0034] The present invention monitors the communication data between the bench controller and the inverter through a USB-CAN bus analyzer, establishes a communication code library, uses a single-chip microcomputer to make a communication controller, writes a communication program, implants the communication controller, sends communication data to the frequency conversion cabinet according to a predetermined logic, and simultaneously receives the communication data fed back by the frequency conversion cabinet, automatically compares it with the target value, and completes communication debugging.
[0035] Compared with the prior art, the present invention has the following beneficial effects:
[0036] The present invention provides a mobile debugging method for CAN bus communication of a test bench, which has the advantage that during the operation and maintenance of the test bench, the debugging tool can be directly connected to the frequency conversion cabinet on site, and offline debugging can be achieved without starting the test bench controller and operating the control system. The debugging process does not rely on a computer and does not require repeated program writing. The system is simple and easy to operate, which greatly saves CAN bus debugging time and manual debugging costs. BRIEF DESCRIPTION OF THE DRAWINGS
[0037] The present invention will be further described below in conjunction with the accompanying drawings:
[0038] Figure 1 This is the structure diagram of the bench test system;
[0039] Figure 2 This is the working principle diagram of the control system in the bench test system;
[0040] Figure 3 This is the working principle diagram of the communication controller;
[0041] Figure 4 Debug flow chart for communication. DETAILED DESCRIPTION
[0042] In order to make the purpose, technical scheme and advantages of the implementation of the present invention clearer, the technical scheme in the embodiment of the present invention will be described in more detail below in conjunction with the drawings in the embodiment of the present invention. In the drawings, the same or similar reference numerals throughout represent the same or similar elements or elements with the same or similar functions. The described embodiments are part of the embodiments of the present invention, not all of the embodiments. The embodiments described below with reference to the drawings are exemplary and are intended to be used to explain the present invention, and should not be construed as limitations on the present invention. Based on the embodiments in the present invention, all other embodiments obtained by ordinary technicians in this field without making creative work are within the scope of protection of the present invention. The embodiments of the present invention are described in detail below in conjunction with the drawings.
[0043] In the description of the present invention, it should be understood that the terms "center", "longitudinal", "lateral", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing the present invention and simplifying the description, rather than indicating or implying that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore should not be understood as limiting the scope of protection of the present invention.
[0044] The present invention is described in detail below in conjunction with the accompanying drawings:
[0045] like Figure 3 As shown, the present invention includes hardware such as a communication controller, a switching power supply, and a frequency conversion cabinet. The communication controller is powered by a 9V switching power supply, and the 220V AC power of the switching power supply is provided by the inside of the frequency conversion cabinet, and is connected to the frequency conversion cabinet through two power lines L and N. The communication controller is connected to the frequency conversion cabinet control module through two CAN lines. The communication controller is composed of a single-chip microcomputer and a switching power supply. The single-chip microcomputer includes a communication module, a data processing module, a data storage module, etc. The switching power supply and the single-chip microcomputer with a program are packaged together, and the power line and two data communication lines CAN_H and CAN_L are reserved. During on-site debugging, 220V AC power is taken from the inside of the frequency conversion cabinet, and the two communication lines are connected to the communication plug on the frequency conversion cabinet.
[0046] Press the start button on the communication controller. When the button is closed, it is sent as a start command to the microcontroller in the communication controller. After receiving the start command, the microcontroller in the communication controller automatically sends the standby command, fault reset command, enable command, mode selection command, set value command, and start command in sequence. Each time a command is sent, it automatically detects whether the command fed back by the frequency converter is consistent with the target command in the communication code library within the effective time. If the command fed back is consistent with the target command, the next command is automatically sent; if not, the communication fault light is on and the detection ends.
[0047] For example, the controller first sends a standby command to the frequency converter cabinet, then receives the command fed back by the frequency converter cabinet, and compares the fed back command with the target command. If they are consistent, it continues to send a fault reset command; if they are inconsistent, the communication fault light is on and the detection ends.
[0048] When the system is working, the communication controller sends standby commands, fault reset commands, enable commands, mode selection commands, set value commands, and start commands to the frequency converter cabinet in sequence, receives commands fed back from the frequency converter cabinet at each stage, and confirms whether the communication status of the frequency converter cabinet is normal. Figure 4 As shown, the principle is as follows:
[0049] 1. Communication code library and program settings
[0050] Connect the USB-CAN bus analyzer to the original test bench control system through the two data communication lines CAN_H and CAN_L. Use a computer to monitor and record in real time the instructions sent by the test bench controller to the frequency converter cabinet and the instructions fed back by the frequency converter cabinet to the test bench controller in each link. Master the instructions sent and received by the host system, analyze the meaning of each byte in the bus data frame, understand the communication logic and control strategy of the motor test bench system, and implant the sending instructions into the single-chip microcomputer in the form of a program. Establish a communication code library, write control instructions, including standby instructions, fault reset instructions, enable instructions, mode selection instructions, given set value instructions, start instructions, etc. Set the data cycle sending and receiving time to ensure that the breathing light of the frequency converter cabinet flashes normally. At the same time, receive the instructions fed back by the frequency converter cabinet, and automatically compare the received instructions with the target instructions. The contents of the sending instructions and target instructions are as follows:
[0051] Standby command:
[0052] ID 501: 06 18 / 98 00 00 00 00 00 00, the second byte changes alternately;
[0053] ID 202: 00 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0054] Target instruction:
[0055] ID 381: 00 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0056] ID 182: 02 00 / 80 01 00 00 00 00 00, the second byte changes alternately;
[0057] Fault reset command:
[0058] ID 501: 86 18 / 98 00 00 00 00 00 00, the second byte changes alternately;
[0059] ID 202: 80 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0060] Target instruction:
[0061] ID 381: 00 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0062] ID 182: 02 00 / 80 01 00 00 00 00 00, the second byte changes alternately;
[0063] Enable instruction:
[0064] ID 501: 0F 18 / 98 00 00 00 00 00 00, the second byte changes alternately;
[0065] ID 202: 01 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0066] Target instruction:
[0067] ID 381: 03 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0068] ID 182: 06 00 / 80FE / FB 02 / 03 00 00 00 00, the 2nd, 3rd, and 4th bytes change alternately;
[0069] Mode selection command:
[0070] ID 501: 1F 18 / 98 00 00 00 00 00 00, the second byte changes alternately;
[0071] ID 202: 01 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0072] Target instruction:
[0073] ID 381: 07 00 / 80 00 / F6 00 / FF 00 00 00 00, the 2nd, 3rd and 4th bytes change alternately;
[0074] ID 182: 06 00 / 80C6 / B3 02 00 00 00 00, the second and third bytes change alternately;
[0075] Give a set value of 0r / min and start the command:
[0076] ID 501: 1F 18 / 98 00 00 00 00 00 00, the second byte changes alternately;
[0077] ID 202: 01 00 / 80 00 00 00 00 00 00, the second byte changes alternately;
[0078] Target instruction:
[0079] ID 381: 07 00 / 80 00 / F6 00 / FF 00 00 00 00, the 2nd, 3rd and 4th bytes change alternately;
[0080] ID 182: 06 00 / 80C6 / B3 02 00 00 00 00, the second and third bytes change alternately;
[0081] The above instructions are written into the microcontroller in sequence. During the communication process, in addition to the specific instruction sending program and instruction comparison program, the microcontroller also includes bus initialization, port, baud rate, data bit, stop bit and other parameter configuration programs. These configuration programs are used to ensure that data can be sent and received normally.
[0082] 2. Testing process
[0083] like Figure 4As shown in the figure, during communication debugging, press the start button to transmit the switch closing signal to the MCU inside the communication controller. After the MCU receives the switch signal, the program starts to execute step by step. First, the standby command is sent. ID501 sends data 06 18 / 98 00 00 00 00 00 00, and ID202 sends data 00 00 / 80 00 00 00 00 00 00, which is sent once every 5ms. At the same time, the command content fed back by ID381 and ID182 is detected within the 5ms time interval. The target command of ID381 is 00 00 / 80 00 00 00 00 00 00, and the target command of ID202 is 00 00 / 80 00 00 00 00 00 00, if these two IDs have no feedback instructions within the 5ms time interval, or the feedback instruction content is inconsistent with the target instruction content, the system will report an error, the fault light will be constant, prompting a communication fault, and the fault information will be stored in the MCU fault database, and the detection process will end. If ID381 and ID202 have feedback within the 5ms time interval and the feedback instruction is consistent with the target instruction content, the fault light will not be on, indicating that the communication is normal, and the system will automatically enter the second step, that is, send a fault reset instruction, which is sent every 5ms. At the same time, the instructions fed back by ID381 and ID182 are detected within the 5ms time interval. The judgment process is the same as the first step. If the communication is normal, the fault light will not be on, and the system will automatically send an enable instruction. If the communication fails, the fault light will be always on, and the fault information will be stored in the MCU fault database, and the detection process will end. After each operation is executed, a similar feedback value judgment as above is required to determine whether the received instruction is consistent with the target instruction. If they are consistent, the next step is executed and the next step is valid. If the received instruction is inconsistent with the target instruction, the fault light is always on, indicating a communication failure. The fault information is stored in the microcontroller fault database. After all steps are completed, if the communication is normal and the fault light is not always on, it proves that the communication failure of the frequency converter cabinet has been eliminated and the test bench communication debugging is completed.
[0084] The present invention realizes the completion of CAN communication debugging of the frequency converter cabinet without starting the test bench control system, greatly shortens the debugging cycle, reduces the debugging cost, gets rid of the dependence on the computer during the on-site debugging process, realizes the mobile debugging function, and makes the system more flexible, simple and easy to operate. It can be horizontally extended to all other test benches that use CAN bus communication to realize CAN communication debugging of different types of test benches, and has certain scalability.
[0085] The present invention connects a USB-CAN bus analyzer in parallel to a bench control system through two communication lines CAN_H and CAN_L, uses dedicated monitoring software for the USB-CAN bus analyzer to monitor the communication between the bench controller and the frequency conversion cabinet in real time, operates the bench step by step, records the instructions sent by the bench controller to the frequency conversion cabinet and the instructions uploaded by the frequency conversion cabinet to the bench controller in each step, and respectively records the cyclic sending time of the bench controller sending instructions and the frequency conversion cabinet feedback instructions, forms a communication code library, and provides source code for writing communication controller instructions.
[0086] The present invention uses the original data of the communication between the bench controller and the frequency conversion cabinet in the communication code library as the basic data, and writes the program step by step to form a control instruction. When the start button is pressed, the controller automatically sends the standby instruction, fault reset instruction, enable instruction, mode selection instruction, given set value instruction, and start instruction in sequence after receiving the start instruction. At the same time, after sending each step of the instruction, the instruction fed back by the frequency conversion cabinet is automatically detected within the effective time and automatically compared with the target instruction. If the instruction fed back by the frequency conversion cabinet is consistent with the target instruction, the next step instruction is automatically sent. If the instruction fed back by the frequency conversion cabinet is inconsistent with the target instruction, the communication fault light is on and the detection is completed. The whole process truly realizes automatic detection, greatly shortens the debugging cycle, and reduces the debugging cost.
[0087] The above is only a specific implementation of the present invention, but the protection scope of the present invention is not limited thereto. Any modification, equivalent replacement and improvement made by any person skilled in the art within the technical scope disclosed by the present invention and within the spirit and principle of the present invention shall be covered within the protection scope of the present invention. At the same time, the contents not described in detail in this specification belong to the prior art known to those skilled in the art.
Claims
1. A CAN bus mobile debugging method based on a new energy motor test bench, characterized in that: The data in the communication code library is compiled step by step to form a control instruction, which includes a start instruction, a send instruction, and a target instruction; Press the start button on the communication controller. The button is closed and sent to the single-chip microcomputer in the communication controller as a start instruction. After receiving the start instruction, the single-chip microcomputer in the communication controller automatically sends instructions in sequence. Each step of the instruction sent corresponds to a set of target instructions. Each time the communication controller sends a step of instruction, it will receive a set of instructions fed back by the frequency converter cabinet and compare the fed-back instructions with the target instructions. If the feedback instruction is consistent with the target instruction, the next instruction will be automatically sent; if not, the communication fault light will be on and the detection will end; The sending instructions include a standby instruction, a fault reset instruction, an enable instruction, a mode selection instruction, a set value instruction and a start instruction; The single-chip microcomputer sends a standby command, a fault reset command, an enable command, a mode selection command, a set value command, and a start command to the frequency converter cabinet in sequence, receives the commands fed back by the frequency converter cabinet at each stage, and confirms whether the communication status of the frequency converter cabinet is normal; Connect the USB-CAN bus analyzer to the original test bench control system through the two data communication lines CAN_H and CAN_L. Use a computer to monitor and record in real time the instructions sent by the test bench controller to the frequency converter cabinet and the instructions fed back by the frequency converter cabinet to the test bench controller in each link. Master the instructions sent and received by the host computer system, analyze the meaning of each byte in the bus data frame, understand the communication logic and control strategy of the motor test bench system, implant the sending instructions and target instructions into the single-chip microcomputer in the form of a program, establish a communication code library, and write control instructions; When the on-site commissioning personnel operate the communication controller, the operator sets the command cycle sending and receiving time on the communication controller to ensure that the breathing light of the frequency converter cabinet flashes normally; at the same time, the operator receives the command feedback from the frequency converter cabinet and automatically compares the feedback command with the target command; Write the sending instructions into the MCU program in sequence. At the same time, in addition to the programs for sending and receiving related instructions, the MCU also includes bus initialization, port, baud rate, data bit, stop bit parameter setting configuration programs to ensure that the instructions can be sent and received normally; After the microcontroller receives the switch signal, the program starts to execute step by step: First, the MCU sends a standby command, which is sent once every 5ms. At the same time, the data feedback content is detected within the 5ms time interval. If there is no feedback data within the 5ms time interval, or the feedback data content is inconsistent with the target command content, the MCU reports an error, the fault light is always on, indicating a communication failure, and the fault information is stored in the MCU fault database, and the detection process ends; If there is feedback within the 5ms time interval and the feedback data is consistent with the target command content, the fault light will not light up, indicating that the communication is normal, and the microcontroller will automatically enter the second step to send a fault reset command; It is sent once every 5ms, and the data feedback content is detected within the 5ms time interval. The judgment process is the same as the first step. If the communication is normal, the fault light is off, and the microcontroller automatically sends the next instruction. If the communication fails, the fault light is always on, and the fault information is stored in the microcontroller fault database, and the detection process ends. After each operation is executed, a similar feedback instruction judgment as above is required to determine whether the received instruction is consistent with the target instruction. If they are consistent, the next step is executed and the next step is valid. If the received instruction is inconsistent with the target instruction, the fault light is always on, indicating a communication failure. The fault information is stored in the microcontroller fault database. After all steps are completed, if the communication is normal and the fault light is not always on, it proves that the communication failure of the frequency converter cabinet has been eliminated and the test bench communication debugging is completed.
2. According to claim 1, a CAN bus mobile debugging method based on a new energy motor test bench is characterized in that: Connect the USB-CAN bus analyzer in parallel to the test bench control system through the two communication lines CAN_H and CAN_L, turn on the USB-CAN bus analyzer, configure the baud rate and port number parameters, start the USB-CAN bus analyzer, monitor the communication between the test bench controller and the frequency conversion cabinet in real time, record the instructions sent by the test bench controller to the frequency conversion cabinet and the instructions uploaded by the frequency conversion cabinet to the test bench controller, record the cyclic sending time of the standby instruction, fault reset instruction, enable instruction, mode selection instruction, set value instruction, and start instruction, form a communication code library, and provide source code for the communication controller program writing.
3. According to claim 2, a CAN bus mobile debugging method based on a new energy motor test bench is characterized in that: The communication controller is powered by a 9V switching power supply, and the 220V AC power of the switching power supply is provided by the frequency conversion cabinet, and is connected to the frequency conversion cabinet through two power lines L and N. The communication controller is connected to the frequency conversion cabinet control module through two CAN lines.
4. According to claim 3, a CAN bus mobile debugging method based on a new energy motor test bench is characterized in that: The single chip microcomputer includes a communication module, a data processing module, and a data storage module; The communication module is used to send instructions to the frequency converter cabinet and receive instructions fed back by the frequency converter cabinet; The data processing module is used to process the instructions fed back by the frequency converter cabinet, extract the data frame part in the instruction, compare each byte in the data frame with the corresponding byte in the data frame in the target instruction, and determine whether they are consistent; The data storage module is used to store communication fault information.
Citation Information
Patent Citations
A substation multi-interface communication debugging tool
CN105487998B
Double-fed frequency converter communication system for wind power generator set
CN201956700U
Rail vehicle air conditioning system's converter control system
CN208291223U
Method for data communication of bus users in an open automation system
CN101208674A
Full-automatic testing device of open type portable motor driver
CN101598766A
