A motion control function block testing system and method
By designing a motion control function block test system, and using the main control unit and the excitation generation unit to automatically generate and execute test instructions, the problem of low test coverage in the existing technology is solved, and comprehensive testing and automated execution of the PLCopen standard is realized.
Patent Information
- Application Number
- CN202510104474.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2025-01-23
- Publication Date
- 2025-05-23
- Estimated Expiration
- 2045-01-23
AI Technical Summary
The prior art cannot fully verify the PLCopen standard requirements in motion control function block testing, especially when multiple function blocks are called in combination, the test coverage is low, and the integrity of the motion control function block and the axis/axis group state machine cannot be guaranteed.
A motion control functional block testing system is designed, including a main control unit, an excitation generation unit, a motion control detection unit and a variable detection unit. By automatically generating excitation sequences and detection cycle instructions, a comprehensive test of the PLCopen motion control functional block and the axis/axis group state machine is realized.
Standardized testing of PLCopen motion control function block behavior and shaft/axis group state machine compliance is realized, which improves test coverage and can automatically execute tests, and is suitable for a variety of controllers.
Smart Images

Figure CN119556684B_ABST
Abstract
Description
Technical Field
[0001] The invention relates to the technical field of industrial controller detection systems, and in particular to a motion control function block testing system and method. Background Art
[0002] In the industrial control industry, motion control is widely used in various devices as a basic function. In order to make the use of motion control more universal, the PLCopen organization proposed the PLCopen function block standard for motion control based on the IEC61131-3 programming language standard. The PLCopen function block standard stipulates the motion control state machine specification of the axis / axis group.
[0003] Although the PLCopen standard stipulates the axis / axis group state machine specifications and the change logic of the function block input and output parameters, it does not specify the specific implementation method and implementation platform. Therefore, for controller design and development manufacturers, although there are design requirements for motion control function blocks, it cannot ensure that the developed motion control function blocks fully meet the PLCopen standard, especially when multiple function blocks are called in combination, testing is often required for verification. Currently, the commonly used tests in the industry are composed of two parts:
[0004] One is to test a single motion control function block directly, that is, in the configuration software, write the output of each function block when calling a single function block separately. In this way, only the execution of a single function block under certain parameters can be tested, and the axis state machine required by PLCopen cannot be tested.
[0005] The other method is to verify the operation of the axis / axis group state machine by writing complex motion control cases, such as writing multiple test cases containing complex functions such as enabling, constant speed, positioning, and returning to zero. This method can test the operation of the state machine during the switching process between some functional blocks, but it is difficult to achieve a high test coverage by manually writing cases. Summary of the invention
[0006] In view of the above-mentioned shortcomings of the prior art, the purpose of the present invention is to provide a motion control function block testing system and method, which are used to solve the problem that in the motion control function block testing process in the prior art, only a part of the functions of the function block can be tested and verified, and more complex combinations of multiple function blocks cannot be verified. In the actual use of the controller, various ever-changing functional requirements and function block calls will be faced, and it is impossible to ensure that the developed PLCopen motion control function block and the corresponding axis / axis group state machine meet the requirements.
[0007] To achieve the above-mentioned purpose and other related purposes, the present invention provides a motion control function block test system, comprising: a main control unit, an excitation generation unit, a motion control detection unit and a variable detection unit; the main control unit is used to receive configuration information of a human-computer interaction unit, and send the configuration information to the excitation generation unit to obtain an excitation sequence generated by the excitation generation unit, and generate an excitation detection cycle instruction according to the excitation sequence and the configuration information; the excitation generation unit is used to send the generated excitation sequence to a controller under test to execute a corresponding function block according to the excitation detection cycle instruction; the variable detection unit is used to monitor the output variable value of the function block executed by the controller under test; the motion control detection unit is used to detect the motion control output signal of the controller under test; the main control unit is also used to control the issuance of the next excitation detection cycle instruction to the excitation generation unit according to the output variable value and the motion control output signal corresponding to the previous excitation detection cycle instruction.
[0008] In one embodiment of the present invention, the human-computer interaction unit includes: a configuration module, which is used to obtain input parameters of relevant tests and generate configuration information; wherein the input parameters include parameters related to the functional blocks to be tested, test plan information and test start control parameters; and a display module, which is used to display status information; wherein the status information includes test progress, real-time test results and test result log.
[0009] In one embodiment of the present invention, the main control unit includes: a first receiving module, used to receive configuration information of a human-computer interaction unit; wherein the configuration information includes function block information to be tested, test plan information and excitation detection cycle information; a conversion module, used to convert the configuration information into a corresponding format of an excitation generation unit; an excitation control module, used to read an excitation sequence generated by the excitation generation unit, obtain the corresponding excitation detection cycle in the configuration information, and control the excitation generation unit to perform signal excitation according to the excitation detection cycle; a sending control module, used to send the excitation detection cycle instruction of the next function block to the excitation generation unit according to the output variable value; and a test analysis module, used to analyze the test results of the function block to determine whether the motion control test of the function block meets the relevant requirements of the PLCopen standard.
[0010] In one embodiment of the present invention, the sending control module includes: a detection module, which is used to detect the sending of the operation instructions of the functional block of the stimulus generation unit according to the output variable value; and a sending module, which is used to send the operation instructions of the next functional block to the stimulus generation unit when the output variable value meets the set requirements.
[0011] In one embodiment of the present invention, the test analysis module includes: a comparison analysis module, which is used to compare the excitation output parameters, output variable values and motion control data corresponding to the motion control output signal of the excitation sequence in the current excitation detection cycle to obtain a comparison result; and an output module, which is used to output that when the comparison result is correct, the motion control test of the function block meets the relevant requirements of the PLCopen standard.
[0012] In one embodiment of the present invention, the comparison and analysis module includes: a comparison module, which is used to compare the excitation output parameters, output variable values and motion control data corresponding to the motion control output signal of the excitation sequence in the current excitation detection cycle; a first result output module, which is used to obtain a correct comparison result when the function block is jumped under the excitation sequence and the function block is executed according to the state machine specified by the PLCopen standard; a second result output module, which is used to obtain a correct comparison result in each excitation detection cycle when the input variable value and the output variable value of the executed function block meet the timing of the function block specified by the PLCopen standard; wherein the function block includes an edge-triggered function block and a level-controlled function block; and a third result output module, which is used to obtain a correct comparison result after each excitation detection cycle or after each function block is executed when the position and speed information of the detected motion control are consistent with the input configuration set in the excitation sequence.
[0013] In one embodiment of the present invention, the stimulus generation unit includes: a second receiving module, which is used to receive configuration information and test plan parameter information corresponding to the function block executed by the controller under test issued by the main control unit; a list generation module, which is used to generate a state machine-function block list through the PLCopen state machine according to the configuration information; and an execution module, which is used to generate multiple stimulus sequences according to the state machine-function block list and the test plan parameter information, and send the stimulus sequence to the main control unit, so as to generate an stimulus detection cycle instruction through the main control unit, and send the stimulus sequence to the controller under test to execute the corresponding function block.
[0014] In one embodiment of the present invention, the execution module includes: a point detection module, which is used to receive the excitation detection cycle instruction of the main control unit and detect the digital input points of the controller under test; a first excitation module, which is used to send the excitation sequence to the controller under test in the form of a communication instruction when the digital input points of the controller under test are insufficient, so as to stimulate the controller under test to execute the corresponding function block; and a second excitation module, which is used to send the excitation sequence to the controller under test in the form of point control when the digital input points of the controller under test are sufficient, so as to stimulate the controller under test to execute the corresponding function block.
[0015] In one embodiment of the present invention, the activation sequence includes: simultaneous activation of the operation type and management type function blocks of a single axis and simultaneous activation of the function blocks of multiple axes of a multi-axis.
[0016] To achieve the above-mentioned object and other related objects, the present invention also provides a motion control function block testing method, comprising:
[0017] The main control unit receives configuration information of the human-computer interaction unit, sends the configuration information to the stimulus generation unit to obtain the stimulus sequence generated by the stimulus generation unit, and generates a stimulus detection cycle instruction according to the stimulus sequence and the configuration information;
[0018] The stimulus generation unit sends the generated stimulus sequence to the controller under test to execute the corresponding function block according to the stimulus detection cycle instruction;
[0019] Monitoring the output variable value of the function block executed in the controller under test by means of a variable detection unit;
[0020] Detecting the motion control output signal of the controller under test by a motion control detection unit;
[0021] The main control unit controls the issuance of the next excitation detection cycle instruction to the excitation generation unit according to the output variable value and the motion control output signal corresponding to the previous excitation detection cycle instruction.
[0022] As described above, a motion control function block testing system and method of the present invention have the following beneficial effects: through the motion control function block testing system and method of the present invention, the behavior standardization of the PLCopen motion control function block can be tested, and the compliance of the state machine of the axis / axis group can also be tested. Not only the correctness of the function block operation result is tested, but also the behavior and state during the operation process can be tested. Through the stimulus generation unit, various combinations of test cases can be automatically generated, and the results can be compared and analyzed, which can greatly improve the test coverage. In principle, all possible tests can be achieved. Automated testing can be achieved through the setting of the test plan. It can be adapted to most controllers. If a new custom function block is added, the test can be achieved by simply adding the new function block data according to the current configuration method. BRIEF DESCRIPTION OF THE DRAWINGS
[0023] Figure 1 Shown is a structural block diagram of the motion control function block testing system of the present invention.
[0024] Figure 2 Shown is a system framework diagram of a test platform provided in one embodiment of the present invention.
[0025] Figure 3Shown is a single-axis motion state machine diagram specified in the PLCopen motion control standard provided in one embodiment of the present invention.
[0026] Figure 4 Shown is a schematic diagram of input and output logic requirements of an edge-triggered function block specified in the PLCopen motion control standard provided in an embodiment of the present invention.
[0027] Figure 5 Shown is a schematic diagram of input and output logic requirements of a level control function block specified in the PLCopen motion control standard provided in an embodiment of the present invention.
[0028] Figure 6 Shown is a basic program style diagram that needs to be written for the controller under test provided in one embodiment of the present invention.
[0029] Figure 7 Shown is an interactive information diagram of the stimulus generation unit, the main control unit and the controller under test provided in one embodiment of the present invention.
[0030] Figure 8 Shown is a schematic diagram of a single function block data structure received by a stimulus generation unit provided in one embodiment of the present invention.
[0031] Fig. 9 Shown is a state machine-function block list diagram generated by a stimulus generation unit provided in one embodiment of the present invention.
[0032] Fig.10 Shown is a schematic diagram of an excitation sequence provided in an embodiment of the present invention.
[0033] Fig.11 Shown is a functional framework diagram of a motion control detection unit provided in one embodiment of the present invention.
[0034] Fig.12 Shown is a state information table diagram of a function block test configuration provided in one embodiment of the present invention.
[0035] Fig.13 Shown is a flow chart of a motion control function block testing method provided in one embodiment of the present invention.
[0036] Component number description
[0037] Main control unit 10; excitation generation unit 20; motion control detection unit 30; variable detection unit 40; human-computer interaction unit 50; controller under test 60. DETAILED DESCRIPTION
[0038] The following is an explanation of the embodiments of the present invention by specific examples, and those skilled in the art can easily understand other advantages and effects of the present invention from the contents disclosed in this specification. The present invention can also be implemented or applied through other different specific embodiments, and the details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention. It should be noted that the features in the following embodiments and the embodiments can be combined with each other without conflict. It should also be understood that the terms used in the embodiments of the present invention are intended to describe specific embodiments, rather than to limit the scope of protection of the present invention. The test methods for which specific conditions are not specified in the following examples are usually carried out under conventional conditions or according to the conditions recommended by the manufacturers.
[0039] PLC: Programmable Logic Controller, a controller commonly used in industrial environments, including input, output, storage, master control and other parts, which can realize logic control, motion control and other functions through configuration programming.
[0040] Motion controller: An industrial controller mainly used for controlling mechanical axes. It can realize precise position, speed, acceleration and other control of mechanical motion through function interface or configuration programming, and also supports point input and output.
[0041] PLCopen motion control: In the programming environment of IEC61131-3 standard, the function blocks required for various types of motion control are standardized for different controller hardware, including single-axis motion control function blocks, multi-axis coordinated motion control function blocks, state changes and regulations during motion control. Motion control function blocks that meet this standard can be reused in different software from different suppliers.
[0042] See also Figure 1 The present invention provides a motion control function block test system, which can accurately test the compliance of the PLCopen motion control function block executed by the tested controller 60, and can realize automated testing by setting a test plan, greatly improving the test coverage and test effect. The test system may include a main control unit 10, an excitation generation unit 20, a motion control detection unit 30, a variable detection unit 40, a human-computer interaction unit 50 and the tested controller 60.
[0043] See also Figure 1The present invention provides a motion control function block test system, comprising: a main control unit 10, an excitation generation unit 20, a motion control detection unit 30 and a variable detection unit 40; the main control unit 10 is used to receive the configuration information of the human-computer interaction unit 50, and send the configuration information to the excitation generation unit 20 to obtain the excitation sequence generated by the excitation generation unit 20, and generate an excitation detection cycle instruction according to the excitation sequence and the configuration information; the excitation generation unit 20 is used to send the generated excitation sequence to the controller under test 60 to execute the corresponding function block according to the excitation detection cycle instruction; the variable detection unit 40 is used to monitor the output variable value of the function block executed by the controller under test 60; the motion control detection unit 30 is used to detect the motion control output signal of the controller under test 60; the main control unit 10 is also used to control the issuance of the next excitation detection cycle instruction to the excitation generation unit 20 according to the output variable value and the motion control output signal corresponding to the previous excitation detection cycle instruction.
[0044] In one embodiment of the present invention, through the motion control function block test system of the present invention, it is possible to implement input excitation to the motion control function block, detect the motion control output signal, and detect the output parameters of various function blocks, and realize automatic testing through the main control unit, which can greatly improve the test coverage of the function block. Specifically, through the main control unit 10 and the excitation generation unit 20 of the present invention, it is possible to realize the generation of the function block operation process according to a certain method and parameters according to the specified excitation detection cycle, and control the controller under test to execute various motion control function blocks. Through the variable detection unit 40 and the motion control detection unit 30, the output parameter values of each function block executed in the controller under test can be detected according to the specified excitation detection cycle, on the one hand, the state machine operation of the axis / axis group can be detected, and on the other hand, the output parameters and timing of the function block can be detected to meet the PLCopen standard; the motion control output signal of the controller under test, such as a pulse signal or a bus signal, can also be detected to obtain the running position, speed and other data of the axis / axis group, and detect whether the function block is executed normally according to the parameters.
[0045] The motion control function block test system provided by the present invention can be applied to various controller tests with PLCopen motion control function blocks, and has the universality of detection. It also greatly improves the standardized test coverage of PLCopen motion control function blocks, and at the same time eliminates the need to write various complex test cases for the controller under test, realizes the automatic execution of the test, and improves the detection efficiency.
[0046] See also Figure 2 , Figure 2In one embodiment, a motion control function block test system of the present invention includes a main control unit 10, an excitation generation unit 20, a motion control detection unit 30, a variable detection unit 40, a human-computer interaction unit 50 and a controller under test 60. Among them, the controller under test 60 is connected to the excitation generation unit 20 by communication or point mode, the controller under test 60 is connected to the variable detection unit 40 by communication, and the controller under test 60 is connected to the motion control detection unit 30 by pulse signal or EtherCAT bus signal. The main control unit 10 is connected to the excitation generation unit 20 and the variable detection unit 40 respectively through internal interaction, the main control unit 10 is also connected to the motion control detection unit 30 by communication, and the main control unit 10 is also connected to the human-computer interaction unit 50 by communication to obtain the configuration information of the motion control function block of the human-computer interaction unit 50; the main control unit 10 will also send the state information of the controller under test 60 when executing the corresponding motion control function block to the human-computer interaction unit 50 for content display.
[0047] See also Figure 3 , Figure 3 An embodiment given is a state machine specification for a single axis (the axis group also has a corresponding state machine specification, which is not described in detail) and the change logic of the input and output parameters of various function blocks. According to the type of function blocks, there are two types: edge triggered function blocks and level control function blocks, which correspond to different input and output variable response logics.
[0048] See also Figure 4 and Figure 5 , Figure 4 and Figure 5 In one embodiment, the MC_MoveAbsolute function block is specified for executing the single-axis absolute motion function, and the timing requirements of the function block input and output parameters are described. At the same time, in the state machine switching logic, it is required that when the function block is executed, the state of the axis must enter the discrete motion state. Controller developers can develop custom function blocks according to these requirements to achieve various motions.
[0049] See also Figure 6 , Figure 6 In one embodiment, the controller under test 60 is used to verify whether the motion control function block meets the PLCopen motion control standard. Generally, it should support a programming language environment that meets the IEC61131-3 standard, such as ladder diagrams, ST languages, etc. The controller under test 60 should also have an external communication interface (such as Modbus TCP / RTU, CANopen, etc.), a digital input and output interface, and a motion control output interface (such as a pulse signal or an EtherCAT bus signal). In order to test each function block in the controller under test 60, it is necessary to press Figure 6 The basic program of each motion control function block is written in a manner, and read and write addresses are assigned to each variable of the function block, and access and configure them through the external interface. Among them, the external communication interface realizes communication with the excitation generation unit 20 and the variable detection unit 40. The controller under test 60 receives the function block excitation signal from the excitation generation unit 20, executes the corresponding motion control function block, and also communicates with the variable detection unit 40 to read and write the variable data of each function block in the controller through the address.
[0050] The excitation generation unit 20 is mainly used to receive the configuration information of the main control unit 10, and randomly selects the function blocks that need to be executed from the motion control function blocks supported by the controller under test 60 according to the state machine process specified by the PLCopen standard to form an excitation sequence. According to the control signal of the main control unit 10 (excitation detection cycle instruction), the excitation signal is sent to the controller under test 60 in a certain sequence.
[0051] In one embodiment of the present invention, the human-computer interaction unit 50 includes: a configuration module, which is used to obtain input parameters of relevant tests and generate configuration information; wherein the input parameters include parameters related to the functional blocks to be tested, test plan information and test start control parameters; and a display module, which is used to display status information; wherein the status information includes test progress, real-time test results and test result logs.
[0052] The human-computer interaction unit 50 is also a display unit, which can enable the test platform user to input relevant test information through the configuration module to configure the configuration information. The status display can be performed through the display module. Its input parameters include relevant parameters of the function block to be tested, test plan information, and test start control. Its display content includes information such as test progress, real-time test results, and test result logs. Moreover, all this information is communicated with the main control unit 10.
[0053] In one embodiment of the present invention, the main control unit 10 includes: a first receiving module, which is used to receive configuration information of the human-computer interaction unit 50; wherein the configuration information includes function block information to be tested, test plan information and excitation detection cycle information; a conversion module, which is used to convert the configuration information into a corresponding format of the excitation generation unit 20; an excitation control module, which is used to read the excitation sequence generated by the excitation generation unit 20, obtain the corresponding excitation detection cycle in the configuration information, and control the excitation generation unit 20 to perform signal excitation according to the excitation detection cycle; a sending control module, which is used to send the excitation detection cycle instruction of the next function block to the excitation generation unit 20 according to the output variable value; and a test analysis module, which is used to analyze the test results of the function block to determine whether the motion control test of the function block meets the relevant requirements of the PLCopen standard.
[0054] The main control unit 10 receives the configuration information of the human-machine interaction unit 50, sends the configuration information to the excitation generation unit 20, obtains the excitation sequence generated by the excitation generation unit 20, and generates the excitation detection cycle instruction according to the excitation sequence. The configuration information of the human-machine interaction unit 50 can be collected through the first receiving module. The configuration information is then converted into the corresponding format of the excitation generation unit 20 through the conversion module. Subsequently, the excitation control module obtains the corresponding excitation detection cycle in the configuration information according to the excitation sequence, and controls the excitation generation unit 20 to perform signal excitation according to the excitation detection cycle. Finally, the test results of the function block are analyzed through the test analysis module to determine whether the motion control test of the function block meets the relevant requirements of the PLCopen standard.
[0055] The main control unit 10 is a CPU unit that can run an operating system and execute related programs, and can communicate with the human-computer interaction unit, and also communicate with the stimulus generation unit, the motion control detection unit, and the variable detection unit. The main control unit 10 can coordinate the entire test process, control the start and stop of related tests of the motion control function block according to the configuration information of the human-computer interaction unit 50, and save the test logs and results and feed them back to the human-computer interaction unit 50.
[0056] The main control unit 10 can receive configuration information from the human-computer interaction unit 50 through the first receiving module, including information such as function block information to be tested, test plan, and excitation detection cycle. The configuration information is converted into a format supported by the excitation generation unit through the conversion module and sent to the excitation generation unit 20, and the excitation sequence fed back by the excitation detection unit 20 can be read. According to the excitation sequence, an excitation detection cycle is generated, and the excitation generation unit 20 is controlled to perform signal excitation based on the excitation sequence according to this cycle, and the data of the variable detection unit 40 and the motion control detection unit 30 are read at the same time, wherein the excitation generation unit 30 and the variable detection unit 40 can be implemented in the form of software, so they can be read with the main control unit 10 through internal interaction, and communicate with the motion control detection unit 30 through a high-speed board-level bus. For the controller 60 under test with a bottleneck in communication rate, the excitation detection cycle generated by the main control unit 10 can be adjusted, so that a relatively fine short-cycle real-time process state reading can be realized, and a staged state result reading with a larger cycle can also be realized.
[0057] Furthermore, the sending control module includes: a detection module, which is used to perform sending detection of the operation instructions of the functional block of the stimulus generation unit 20 according to the output variable value; and a sending module, which is used to send the operation instructions of the next functional block to the stimulus generation unit 20 when the output variable value meets the set requirements.
[0058] According to the output variable values of each functional block read by the variable detection unit 40, the detection module detects whether to control the stimulus generation unit 20 to issue the running instructions of the next functional block. For example, if the Busy signal becomes True, it means that the current functional block is running. Under the normal test process, no new stimulus functional block signal is sent. If the Done variable (and other variables) is True, it means that the current functional block is completed. Under the normal test process, the next new stimulus functional block execution instruction is issued through the issuing module.
[0059] In one embodiment of the present invention, the test analysis module includes: a comparison analysis module, which is used to compare the excitation output parameters, output variable values and motion control data corresponding to the motion control output signal of the excitation sequence in the current excitation detection cycle to obtain a comparison result; and an output module, which is used to output that when the comparison result is correct, the motion control test of the function block meets the relevant requirements of the PLCopen standard.
[0060] In one embodiment of the present invention, the excitation output parameter is an output parameter for the excitation function block. The excitation output of the current cycle can be compared with the variable values and motion control data detected in the current cycle through the comparison analysis module to confirm whether the PLCopen standard is met. Finally, when the comparison result is correct, the motion control test of the output function block meets the relevant requirements of the PLCopen standard through the output module. For example, during the execution of the MC_MoveAbsolute excitation, it is necessary to detect whether the Busy variable of the MC_MoveAbsolute function block is True, whether the Done variable is False, whether the real-time position value corresponding to the motion control changes toward the set target position, etc., and when it is detected that the Done of MC_MoveAbsolute is True, whether the corresponding position is consistent with the set position. This detection process is always carried out in each cycle.
[0061] In one embodiment of the present invention, the comparison and analysis module includes: a comparison module, which is used to compare the excitation output parameters, output variable values and motion control data corresponding to the motion control output signal of the excitation sequence in the current excitation detection cycle; a first result output module, which is used to obtain a correct comparison result when the function block is jumped under the excitation sequence and the function block is executed according to the state machine specified by the PLCopen standard; a second result output module, which is used to obtain a correct comparison result in each excitation detection cycle when the input variable value and the output variable value of the executed function block meet the timing of the function block specified by the PLCopen standard; wherein the function block includes an edge-triggered function block and a level-controlled function block; and a third result output module, which is used to obtain a correct comparison result after each excitation detection cycle or after each function block is executed when the position and speed information of the detected motion control are consistent with the input configuration set in the excitation sequence.
[0062] In the process of comparative analysis by the comparison and analysis module, the comparison module can be used to compare the excitation output parameters, output variable values and motion control data corresponding to the motion control output signal of the excitation sequence in the current excitation detection cycle. Then, the first result output module is used to determine whether the function block can be executed according to the state machine specified in the PLCopen standard when jumping the function block under the excitation sequence; if the function block is executed according to the state machine specified in the PLCopen standard, the comparison result is correct. The second result output module is used to determine whether the input and output variables of the executed function block meet the timing of the two function blocks (edge-triggered and level-controlled) specified in the PLCopen standard in each excitation detection cycle; when the input variable values and output variable values of the executed function block meet the timing of the function block specified in the PLCopen standard, the comparison result is correct. The third result output module can be used to determine whether the position and speed information of the motion control detection are consistent with the input configuration set in the excitation sequence when each excitation detection cycle or each function block is executed; when the position and speed information of the motion control detection are consistent with the input configuration set in the excitation sequence, the comparison result is correct.
[0063] In one embodiment of the present invention, the stimulus generation unit 20 includes: a second receiving module, which is used to receive configuration information and test plan parameter information corresponding to the function block executed by the controller under test 60 and issued by the main control unit 10; a list generation module, which is used to generate a state machine-function block list through the PLCopen state machine according to the configuration information; and an execution module, which is used to generate multiple stimulus sequences according to the state machine-function block list and the test plan parameter information, and send the stimulus sequence to the main control unit 10, so as to generate an stimulus detection cycle instruction through the main control unit 10, and send the stimulus sequence to the controller under test 60 to execute the corresponding function block.
[0064] Specifically, the configuration information includes the function block name, number, type of each function block input parameter, upper and lower limit range, parameter address, execution status of each function block and its previous and subsequent status; the test plan parameter information includes the number of function block execution cycles, test weight, function block combination level, normal test proportion and number of cases.
[0065] See also Figure 7 , Figure 7 In one embodiment, the stimulus generation unit 20 sends the generated stimulus sequence to the controller under test 60 to execute the corresponding function block according to the stimulus detection cycle instruction, and receives the configuration information from the main control unit 10 through the second receiving module, which mainly includes the function block name, number, type of each function block input parameter, upper and lower limit range, parameter address (the address corresponds to the address in the program of the controller under test), the state of each function block during execution and its sequence state, etc. Specifically, the main control unit 10 first sends the function block information such as the function block name, number, parameter, range, address, etc. to the stimulus generation unit 20 according to the process sequence, and then sends the test plan parameters to the stimulus generation unit 20, and then sends the stimulus sequence, stimulus detection cycle signal and stop signal to the stimulus generation unit 20. The stimulus generation unit 20 then sends the function block parameters, function block operation and parameter update data to the controller under test 60 for execution in sequence according to the process sequence.
[0066] See also Figure 8 , Figure 8 In one embodiment given, the data structure formed by each function block that needs to be tested mainly includes the function block name, function block number, parameter range, address range, input parameter N, execution status, previous status, normal jump status and abnormal jump status.
[0067] See also Fig. 9 After receiving the function block information, the stimulus generation unit 20 can generate a state machine-function block list according to the PLCopen state machine. Specifically, it includes Disabled (unavailable) state, Homing (home) state, Stopping (stopping) state, Errorstop (axis error stop) state, Synchronized Motion (synchronous motion) state, Continuous Motion (continuous motion) state, Discrete Motion (discrete motion) state and Standstill (stagnation) state.
[0068] In one embodiment of the present invention, the stimulus generation unit 20 receives the function block information and the test plan parameter information, including parameters such as the number of function block execution cycles, test weight, function block combination level, normal test proportion, number of cases, etc. Further, the stimulus generation unit 20 generates multiple stimulus sequences according to the state machine-function block list and the test plan parameter information through the execution module.
[0069] See also Fig.10 , Fig.10 In one embodiment, in the process of generating multiple stimulus sequences according to the state machine-function block list and the test plan parameter information, the order of execution of the stimulus function blocks, the input parameters of each function block, the normal / abnormal jump flag, etc. are included. The number of stimulus sequences is consistent with the number of cases in the test plan parameter information. In addition to normal execution cases, abnormal execution cases are also generated, such as function block calls in non-jump states, and cases where input parameters are outside the upper and lower limits. The selection and generation of function blocks in the stimulus sequence are internally generated according to the PLCopen state machine, and are generated in two ways: a normal jump state machine and an abnormal jump state machine.
[0070] After the excitation sequence is obtained, the generated multiple excitation sequences are further fed back to the main control unit 10 through the execution module, and the main control unit 10 initiates a formal excitation detection cycle instruction.
[0071] In one embodiment of the present invention, the execution module includes: a point detection module, which is used to receive the excitation detection cycle instruction of the main control unit 10 and detect the digital input point of the controller under test 60; a first excitation module, which is used to send the excitation sequence to the controller under test 60 in the form of a communication instruction when the digital input point of the controller under test 60 is insufficient, so as to stimulate the controller under test 60 to execute the corresponding function block; and a second excitation module, which is used to send the excitation sequence to the controller under test 60 in the form of point control when the digital input point of the controller under test 60 is sufficient, so as to stimulate the controller under test 60 to execute the corresponding function block.
[0072] After the execution module receives the excitation detection cycle instruction signal of the main control unit 10, the point detection module can be used to detect the digital input point of the controller under test 60. When the digital input point of the controller under test 60 is insufficient, the excitation sequence will be sent to the controller under test 60 in the form of a communication instruction through the first excitation module. When the digital input point of the controller under test 60 is sufficient, the excitation sequence can be sent to the controller under test 60 in the form of point control to excite the execution of the specified function block.
[0073] Furthermore, the excitation sequence includes: simultaneous excitation of the operation and management function blocks of a single axis and simultaneous excitation of the function blocks of multiple axes of a multi-axis. In this embodiment, the excitation sequence supports simultaneous excitation of multiple function blocks. For example, for a single axis, it can support simultaneous excitation of the motion and management function blocks; for multiple axes, it can support simultaneous excitation of the function blocks of multiple axes.
[0074] See also Fig.11 , Fig.11 In one embodiment given, the motion control detection unit 30 can be used to detect the motion control output signal of the controller under test 60, that is, it can detect pulse signals and EtherCAT bus signals. This part of the function is usually implemented by a dedicated circuit, which includes a high-speed pulse detection module, an EtherCAT slave module and an MCU module. In the present invention, the motion control output form mainly includes pulse output and bus output, so the motion control detection unit can support two forms of signal detection at the same time. Among them, the high-speed pulse detection module can support orthogonal pulse detection, pulse + direction signal detection, support 1 / 2 / 4 frequency division counting detection, support single channel / multi-channel detection, and the detected data includes pulse number, real-time frequency, and the axis position and axis speed parameters of the corresponding motion control. The EtherCAT slave module has built-in 4 channels to simulate the external axis of the controller under test, and can obtain the position and speed parameters of each axis according to the control cycle of the controller under test. The high-speed pulse detection module and the EtherCAT slave module can send the acquired data to the MCU module in real time, and the MCU module will give the acquired data to the main control unit 10 according to the excitation detection cycle of the main control unit 10.
[0075] In one embodiment of the present invention, the variable detection unit 40 can be used to detect the output variable value of the executed function block in the controller under test 60. The detection cycle is based on the detection excitation cycle of the main control unit 10, and the detected variable value is sent to the main control unit 10 in real time. In order to reduce the communication pressure, the detected variables are mainly the output variables of the function block being executed in the excitation sequence, such as the indication signal of the function block being executed, the DONE signal, the ERROR signal, the ERROR ID value, etc.
[0076] The motion control function block test system of the present invention can be applied not only to the test of normal function block jump, but also to the test of abnormal jump, that is, when the normal jump is not satisfied, a new execution function block instruction can be stimulated to check whether Error feedback will occur, etc. The corresponding stimulus sequence is also generated by the stimulus generation unit 20 before the test starts and sent to the main control unit 10, which can be checked through the normal / abnormal jump flag in the stimulus sequence. It can also be used for the test of input parameters exceeding the upper and lower limits of the function block variables, that is, the function block input variables in the stimulus sequence are out of limit, and it can be checked whether Error feedback will occur.
[0077] See also Fig.12 , Fig.12In the given embodiment, taking the test of two function blocks (MC_Power and MC_MoveAbsolute) as an example, the names of the two function blocks, the numerical range and address of each parameter are input in the human-computer interaction interface, such as the Enable variable address of the MC_Power function block, the type is bool, the range is True-False, and so on, as well as the address, type, range and other data of variables such as Axis, Status, Error, etc. The MC_MoveAbsolute function block is also configured and issued in the same way, and the execution state, preceding state, normal jump state and abnormal jump state of the two function blocks need to be configured, such as the execution state of MC_MoveAbsolute is Discrete Motion state, the preceding state is Standstill state, Continuous Motion state, Synchronized Motion state and Discrete Motion state, the normal jump state is Standstill state, Stopping state, Continuous Motion state, SynchronizedMotion state, Discrete Motion state Motion state and Disable state, the abnormal jump state is Errorstop state, and it is also necessary to configure the maximum combination length of the function block (4 in this example) and the number of cases (2 in this example). After these configuration information is sent to the main control unit 10, it will be converted into a format that can be recognized by the stimulus generation unit. The stimulus generation unit 20 generates two stimulus sequences based on the two function blocks according to the specifications of the PLCopen standard state machine, the combination length data, and the number of cases, such as: MC_Power-->MC_MoveAbsolute; MC_Power-->MC_MoveAbsolute-->MC_MoveAbsolute; and the corresponding function block parameters are also recorded in the stimulus sequence and fed back to the main control unit 10. The main control unit 10 starts the test according to the instruction of the human-computer interaction unit 50, and continuously controls the stimulus generation unit 20 to execute the corresponding stimulus and send it to the controller under test through the stimulus detection cycle (60 if the parameter does not change, it will not be sent), and reads the data of the variable detection unit 40 and the motion control detection unit 30 according to the stimulus detection cycle. The data reading of the variable detection unit 40, such as the Done signal, is used as the starting signal for running the next function block stimulus, and controls the stimulus generation unit 20 to send the next function block execution instruction. At the same time, the PLCopen standard is judged by comparing the stimulus and the data of the two detection units.
[0078] Among them, in the process of judging the PLCopen standard, the detection is divided into three parts: First, whether the process of motion control of the controller under test 60 is executed according to the configuration of the excitation, that is, whether the Status or Busy variable of MC_Power and MC_MoveAbsolute is True, so as to verify that the state machine of the motion control jumps according to the standard; Second, all output variables of the function block being executed are detected, and their Bool values are confirmed, expressed as True or False, to determine whether the timing definition of the edge trigger function block and the level control function block is met; Third, the state of motion control is detected, and the corresponding axis position changes when the MC_MoveAbsolute function block is executed, and the data such as Position and Velocity of the function block are read, and the position and speed are compared in real time during the motion process to see whether they meet the requirements, and after the end, it is confirmed whether the final position is the expected position issued in the excitation sequence, so as to determine whether the motion control function block is running normally. Through the comparison of the main control unit 10, the test results of the two excitation sequences will be finally obtained, and the test log under each excitation detection cycle will also be recorded synchronously, and finally displayed by the human-computer interaction unit 50.
[0079] In the framework of the present invention, in addition to EtherCAT and pulse-based motion control, other interfaces such as profinet, CANopen, etc. can also be implemented.
[0080] In the present invention, although the excitation generation unit 20, the variable detection unit 40 and the main control unit 10 all adopt an internal interaction method, this is only one example. If independent board units are used, the three can also adopt a communication method.
[0081] See also Fig.13 The present invention also provides a motion control function block testing method, comprising:
[0082] Step S10: receiving configuration information of the human-computer interaction unit 50 through the main control unit 10, sending the configuration information to the stimulus generation unit 20 to obtain the stimulus sequence generated by the stimulus generation unit 20, and generating an stimulus detection cycle instruction according to the stimulus sequence and the configuration information;
[0083] Step S20: The stimulus generation unit 20 sends the generated stimulus sequence to the controller under test 60 to execute the corresponding function block according to the stimulus detection cycle instruction;
[0084] Step S30: monitoring the output variable value of the function block executed in the controller under test 60 through the variable detection unit 40;
[0085] Step S40: Detecting the motion control output signal of the controller under test 60 through the motion control detection unit 30;
[0086] Step S50: The main control unit 10 controls the issuance of the next excitation detection cycle instruction to the excitation generation unit 20 according to the output variable value and the motion control output signal corresponding to the previous excitation detection cycle instruction.
[0087] In summary, the present invention discloses a motion control function block test system and method, which can realize the standardized closed-loop test of the PLCopen motion control function block of the controller under test, including the motion control state machine compliance test of the PLCopen standard, the variable behavior test of the PLCopen motion control function block, and the functional test of the PLCopen motion control function block. According to the configuration content (such as the function block name, parameter, address, range, function block state) and the test plan requirements, a variety of test cases can be automatically generated to realize automated testing and obtain test results. In addition to being able to test the function blocks mentioned in the PLCopen standard and provide relevant function block configuration information, it can also be used for the PLCopen standard test of custom function blocks. According to the function block list, function block parameter type, range, address, execution state, pre-order state, normal jump state, abnormal jump state, the overall state machine-function block corresponding list and the state machine list of each function block can be generated. According to the PLCopen standard state machine and the test plan requirements, a variety of permutations and combinations of excitation sequences can be generated for the excitation control of the controller under test. It can support the simultaneous excitation of multiple function blocks, that is, for a single axis, it supports the simultaneous excitation of motion and management function blocks; for multiple axes, it supports the simultaneous excitation of the function blocks of multiple axes. The excitation sequence generated by the excitation generation unit 20 includes a test sequence for normal jumps of the state machine and a test sequence for abnormal jumps of the state machine, which can cover normal test cases and abnormal test cases, and is distinguished by the normal / abnormal jump flags of each function block in the excitation sequence. It also supports the input parameter abnormal test sequence, that is, the excitation test when the input parameter exceeds the upper and lower limits of the function block variable. Through the main control unit 10, different excitation detection cycles can be set according to the communication rate of the controller under test. The state of each operating cycle of the function block can be viewed in a short cycle, and the state of the key stage of the function block can be viewed in a long cycle. And based on the excitation detection cycle, the detection results can be compared in real time in combination with the data of the excitation sequence, the variable detection unit and the motion control detection unit, and the numerical state of some function blocks in the variable detection unit is used as the excitation signal of the new function block of the excitation sequence. Through the motion control detection unit, bus mode and pulse mode motion control detection can be supported at the same time, and information such as position, speed, acceleration, etc. can be obtained. Moreover, the motion control function block test system and method of the present invention are not only applicable to the standardized detection of single-axis motion control, but also can realize the standardized detection of multi-axis or axis group motion control through the synchronous reading of multi-axis data. Therefore, the present invention effectively overcomes various shortcomings in the prior art and has high industrial utilization value.
[0088] The above embodiments are merely illustrative of the principles and effects of the present invention, and are not intended to limit the present invention. Anyone familiar with the art may modify or alter the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or alterations made by a person of ordinary skill in the art without departing from the spirit and technical concept disclosed by the present invention shall still be covered by the claims of the present invention.
Claims
1. A motion control function block test system, characterized in that: include: Main control unit, excitation generation unit, motion control detection unit and variable detection unit; The main control unit is used to receive configuration information of the human-computer interaction unit, send the configuration information to the stimulus generation unit, and obtain the stimulus sequence generated by the stimulus generation unit according to the state machine-function block list and the test plan parameter information, and generate a stimulus detection cycle instruction according to the stimulus sequence and the configuration information; wherein the configuration information includes the function block information to be tested, the test plan information and the stimulus detection cycle information; The stimulus generation unit is used to send the generated stimulus sequence to the controller under test to execute the corresponding function block according to the stimulus detection cycle instruction; The variable detection unit is used to monitor the output variable value of the function block executed by the controller under test; The motion control detection unit is used to detect the motion control output signal of the controller under test; The main control unit is further used to control the issuance of the next excitation detection cycle instruction to the excitation generation unit according to the output variable value and the motion control output signal corresponding to the previous excitation detection cycle instruction.
2. The motion control function block test system according to claim 1, characterized in that: The human-computer interaction unit comprises: A configuration module, used to obtain input parameters of relevant tests and generate the configuration information; wherein the input parameters include relevant parameters of the function blocks to be tested, test plan information and test start control parameters; and The display module is used to display status information; wherein the status information includes test progress, real-time test results and test result logs.
3. The motion control function block test system according to claim 1, characterized in that: The main control unit comprises: A first receiving module, configured to receive the configuration information of the human-computer interaction unit; wherein the configuration information includes function block information to be tested, test plan information, and stimulus detection cycle information; A conversion module, used to convert the configuration information into a corresponding format of the stimulus generation unit; An excitation control module, configured to read the excitation sequence generated by the excitation generation unit, obtain the excitation detection cycle corresponding to the configuration information, and control the excitation generation unit to perform signal excitation according to the excitation detection cycle; a sending control module, used for sending the excitation detection cycle instruction of the next function block to the excitation generation unit according to the output variable value; and The test analysis module is used to analyze the test result of the function block to determine whether the motion control test of the function block meets the relevant requirements of the PLCopen standard.
4. The motion control function block test system according to claim 3, characterized in that: The sending control module includes: a detection module, used to detect the issuance of the operation instruction of the functional block of the stimulus generation unit according to the output variable value; and The sending module is used to send the operation instruction of the next function block to the stimulus generation unit when the output variable value meets the set requirements.
5. The motion control function block test system according to claim 3, characterized in that: The test analysis module includes: A comparison and analysis module, used for comparing the excitation output parameters corresponding to the excitation sequence in the current excitation detection cycle, the output variable value and the motion control data corresponding to the motion control output signal to obtain a comparison result; and The output module is used for outputting that the motion control test of the function block meets the relevant requirements of the PLCopen standard when the comparison result is correct.
6. The motion control function block test system according to claim 5, characterized in that: The comparison and analysis module comprises: A comparison module, used for comparing the excitation output parameter corresponding to the excitation sequence in the current excitation detection cycle, the output variable value and the motion control data corresponding to the motion control output signal; A first result output module is used for obtaining the comparison result as correct when the function block is jumped under the excitation sequence and the function block is executed according to the state machine specified in the PLCopen standard; A second result output module, configured to obtain the comparison result as correct in each excitation detection cycle when the input variable value and the output variable value of the executed function block meet the timing of the function block specified by the PLCopen standard; wherein the function block includes an edge-triggered function block and a level-controlled function block; and The third result output module is used to obtain the comparison result as correct when the position and speed information of the motion control are consistent with the input configuration set in the excitation sequence after each excitation detection cycle or each function block is executed.
7. The motion control function block test system according to claim 1, characterized in that: The incentive generating unit comprises: A second receiving module is used to receive configuration information and test plan parameter information corresponding to the function block executed by the controller under test issued by the main control unit; A list generation module, used to generate a state machine-function block list through a PLCopen state machine according to the configuration information; and An execution module is used to generate multiple excitation sequences according to the state machine-function block list and the test plan parameter information, and send the excitation sequence to the main control unit, so as to generate the excitation detection cycle instruction through the main control unit, and send the excitation sequence to the controller under test to execute the corresponding function block.
8. The motion control function block test system according to claim 7, characterized in that: The execution module includes: A point detection module, used for receiving the excitation detection cycle instruction of the main control unit, and detecting the digital input point of the controller under test; A first excitation module, configured to send the excitation sequence to the controller under test in the form of a communication instruction when the digital input points of the controller under test are insufficient, so as to excite the controller under test to execute a corresponding function block; and The second excitation module is used to send the excitation sequence to the controller under test in a point-controlled manner when the digital quantity input points of the controller under test are sufficient, so as to excite the controller under test to execute the corresponding function block.
9. The motion control function block test system according to any one of claims 1 to 8, characterized in that: The excitation sequence includes: simultaneous excitation of the operation type and management type function blocks of a single axis and simultaneous excitation of the function blocks of multiple axes of a multi-axis.
10. A test method for the motion control function block test system according to claim 9, characterized in that: include: receiving configuration information of the human-computer interaction unit through the main control unit, sending the configuration information to the stimulus generation unit to obtain the stimulus sequence generated by the stimulus generation unit, and generating an stimulus detection cycle instruction according to the stimulus sequence and the configuration information; The stimulus generation unit sends the generated stimulus sequence to the controller under test to execute the corresponding function block according to the stimulus detection cycle instruction; Monitoring the output variable value of the function block executed in the controller under test by a variable detection unit; Detecting the motion control output signal of the controller under test by a motion control detection unit; The main control unit controls the sending of the next excitation detection cycle instruction to the excitation generation unit according to the output variable value and the motion control output signal corresponding to the previous excitation detection cycle instruction.
Citation Information
Patent Citations
Verification method, platform, device and equipment of interface controller and storage medium
CN117112320A