[go: up one dir, main page]

CN113885426A - Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program - Google Patents

Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program Download PDF

Info

Publication number
CN113885426A
CN113885426A CN202111196354.4A CN202111196354A CN113885426A CN 113885426 A CN113885426 A CN 113885426A CN 202111196354 A CN202111196354 A CN 202111196354A CN 113885426 A CN113885426 A CN 113885426A
Authority
CN
China
Prior art keywords
simulation
model
excavator
visual
control program
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111196354.4A
Other languages
Chinese (zh)
Inventor
秦浩良
刘建
张腾飞
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Jiangsu Xugong Construction Machinery Research Institute Co ltd
Original Assignee
Jiangsu Xugong Construction Machinery Research Institute Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Jiangsu Xugong Construction Machinery Research Institute Co ltd filed Critical Jiangsu Xugong Construction Machinery Research Institute Co ltd
Priority to CN202111196354.4A priority Critical patent/CN113885426A/en
Publication of CN113885426A publication Critical patent/CN113885426A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/04Programme control other than numerical control, i.e. in sequence controllers or logic controllers
    • G05B19/05Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
    • G05B19/054Input/output
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/10Plc systems
    • G05B2219/11Plc I-O input output
    • G05B2219/1103Special, intelligent I-O processor, also plc can only access via processor

Landscapes

  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Engineering & Computer Science (AREA)
  • Automation & Control Theory (AREA)
  • Testing And Monitoring For Control Systems (AREA)

Abstract

本发明公开了一种挖掘机控制程序PLC代码自动生成方法、测试方法及可视化测试系统,该方法包括根据用户需求搭建控制策略模型;对控制策略模型进行错误排查以及进行参数配置;根据目标控制器选择编译环境;将控制策略模型进行封装自动生成PLC代码;将所生成的PLC代码置于所选择的编译环境中进行集成,生成可执行程序文件;以及,将生成的可执行程序文件下载到搭建的可视化测试系统的待测控制器中,并依据测试用例通过驾驶模拟操作台进行测试,检验控制程序是否能够正常运行,结果输出是否满足需求。本发明可以直观快速的生成工程机械挖掘机控制程序PLC代码,并且进行可视化仿真验证,可以尽早发现逻辑偏差并修改错误,提高工作效率。

Figure 202111196354

The invention discloses an excavator control program PLC code automatic generation method, testing method and visual testing system. The method includes building a control strategy model according to user requirements; performing error checking and parameter configuration on the control strategy model; Select the compilation environment; encapsulate the control strategy model to automatically generate PLC code; place the generated PLC code in the selected compilation environment for integration, and generate an executable program file; and, download the generated executable program file to the building In the controller to be tested of the visual test system, and according to the test case, the test is carried out through the driving simulation console to check whether the control program can run normally and whether the result output meets the requirements. The invention can intuitively and quickly generate the PLC code of the engineering machinery excavator control program, and carry out visual simulation verification, so as to detect the logic deviation as early as possible and correct the error, thereby improving the work efficiency.

Figure 202111196354

Description

Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program
Technical Field
The invention relates to an automatic generation method, a test method and a visual test system of a PLC code of an excavator control program, and belongs to the technical field of engineering machinery.
Background
In recent years, with the appearance and development of high and new technologies, the technical level of engineering machinery is continuously improved, and the engineering machinery industry provides powerful guarantee for national infrastructure, and belongs to one of the fields of national emphasis on encouraging development. With the continuous development of national economy and the arrival of the era of internet, electronic information technology and artificial intelligence, more requirements are put forward on the development of the engineering machinery industry, traditional engineering machinery products are more and more developed towards automation and intellectualization by manual operation, and software development not only occupies larger proportion in the development process of the whole product, but also has more and more complex programs.
Because the working environment conditions of the engineering machinery are generally severe and the duration of single operation is very long, the controller and the program operation are required to be reliable and stable enough, the excavator control program in the traditional engineering machinery industry is mainly realized by manually writing PLC codes, the method is stable and feasible after practice verification, but the action types of the existing engineering machinery excavator are relatively fixed, the control program has a simple logic structure, most of the control programs belong to the condition of single input and single output, namely, one instruction is operated to carry out a corresponding action, the development environment based on IEC61131-3 is generally adopted, a sequence structure is generally adopted, a programming language of a ladder diagram or a function block diagram is used, although the development of the engineering machinery control system is convenient, the software functions are more and more abundant along with the improvement of the intelligent requirement of the control system, programs will also become more complex and existing approaches have become increasingly difficult to meet with current technology developments in terms of flexibility and development efficiency.
In addition, in the engineering machinery industry, the excavator has more action instructions, and the requirements on the control system in the aspects of real-time performance and accuracy are higher and higher, so that the control effect needs to be verified at the early stage of program development, and the investment of manpower and material resources in the test process of a prototype is reduced. At present, the mainstream method is to directly adopt real vehicle verification or use an analog simulation test platform with simple functions, the control effect cannot be visually displayed, the visualization capability is poor, the detail display aiming at the action process is rough, meanwhile, the requirements of different environment working conditions on a machine are different, and the practical problems are also key factors for restricting the debugging of control program parameters.
With the improvement of the intellectualization requirement of the control system, the control program becomes more and more complex, and the flexibility and the development efficiency of the software are more and more emphasized by developers. The existing manual program compiling mode developers need to master the use of a software development platform skillfully, and also need to spend a great deal of energy to solve the non-technical problem in the coding process, so that the development efficiency is low, the errors are more, and the system is difficult to adapt to the system with complex subsequent functions. Due to poor readability of the handwritten codes and the fact that writing styles of everyone are different, much inconvenience is brought to later maintenance and experience reference. After the program is compiled, the simulation test precision is low, the simulation modeling process is complex, the visualization capability is poor, the human-computer interaction cannot obtain an intuitive control effect, the controlled dynamic change process cannot be seen as soon as possible before the program real vehicle test, meanwhile, the complex environmental working condition cannot be simulated, the full verification of the road environment is lacked, and the time and the labor are wasted completely depending on the real vehicle test in the later period.
Disclosure of Invention
The invention aims to provide an automatic generation method, a test method and a visual test system of a PLC code of an excavator control program.
In order to achieve the purpose, the technical scheme adopted by the invention is as follows:
the invention provides a method for automatically generating PLC codes of an excavator control program on one hand,
building a control strategy model according to the user requirement;
setting a solver according to the built control strategy model, and carrying out error troubleshooting and parameter configuration on the control strategy model;
selecting a compiling environment according to the target controller;
packaging the built control strategy model to automatically generate a PLC code;
and placing the generated PLC codes in the selected compiling environment for integration to generate an executable program file.
Preferably, a basic module in the simulink model library is called to build a control strategy model according to user requirements.
Preferably, the built control strategy model is subjected to error troubleshooting through simulation operation of a solver.
Preferably, the parameter configuration includes setting a solver step length, setting a system target file generated by a PLC code, setting an annotation option, and setting a report format.
Preferably, a solver of the control strategy model is set to a fixed step length;
and setting the basic sampling period of the control strategy model to be consistent with the interrupt period of the target controller hardware chip.
Preferably, the first and second liquid crystal materials are,
the comment setting option is to configure whether the generated PLC code contains a comment or not; and configuring whether the generated PLC codes contain the used basic module description;
the report format setting means that the configured and generated report has a hyperlink which jumps from a code to a position corresponding to the model; configuring whether to generate a traceability report; and configuring whether to automatically open a report after the compiling of the control strategy model is finished.
Another aspect of the present invention provides a visual test system for an excavator control program, including: the system comprises a vision host, a semi-physical simulation cabinet, a development host, a controller to be tested and a driving simulation operation console;
the visual host is used for building a real-time simulation model of the engineering machinery;
the semi-physical simulation cabinet is used for processing and converting signals in the test process;
the development host is used for configuring the board card in the semi-physical simulation cabinet and creating a test case based on the engineering machinery simulation model;
the controller to be tested is used for storing and running the compiled executable program file, establishing communication with the semi-physical simulation cabinet, controlling the driving simulation operation console to execute corresponding operation actions and testing and verifying the executable program file of the control strategy;
the driving simulation operation platform is used for simulating an engineering machinery cab and executing corresponding operation actions according to a test instruction issued by the controller to be tested.
Preferably, the view host comprises an environment model, a dynamics model, a UDP communication module, a hydraulic system model and a VR interface module;
the environment model is used for simulating a terrain three-dimensional model of an excavator real working scene;
the dynamic model is used for simulating a three-dimensional model of the excavator;
the UDP communication module is used for transmitting control output signals of each model built in the view host to the semi-physical simulation cabinet, driving a corresponding board card to act, and transmitting signals generated by the board card to a corresponding controlled object model in the view host;
the hydraulic system model is used for simulating the actions of all hydraulic circuits of the excavator;
and the VR interface module is used for transmitting the visual signals of the models to the driving simulation operation console.
Preferably, the semi-physical simulation cabinet comprises: the PXI bus backboard comprises an Ethernet communication board card, a PXI real-time controller, a bus simulation board card I, an analog quantity simulation board card I, a digital quantity simulation board card II, an analog quantity simulation board card II and a bus simulation board card II which are connected with the PXI bus backboard through the PXI bus;
the Ethernet communication board card is used for outputting a control signal generated by the semi-physical simulation cabinet to the vision host and transmitting an output signal of the vision host to the semi-physical simulation cabinet;
the first bus simulation board card is used for transmitting and interacting CAN bus information between the semi-physical simulation cabinet and the driving simulation operation console;
the analog quantity simulation board card I is used for transmitting and interacting a handle voltage analog quantity signal between the semi-physical simulation cabinet and the driving simulation operation console;
the first digital quantity simulation board card is used for transmission and interaction of pedal switch digital quantity signals between the semi-physical simulation cabinet and the driving simulation operation platform;
the second digital quantity simulation board card is used for transmitting and interacting digital quantity signals between the semi-physical simulation cabinet and the controller to be tested;
the analog quantity simulation board card II is used for transmitting and interacting analog quantity signals between the semi-physical simulation cabinet and the controller to be tested;
the second bus simulation board card is used for transmitting and interacting CAN bus information between the semi-physical simulation cabinet and the controller to be tested;
the PXI real-time controller is used for receiving and analyzing data on the Ethernet and sending the data to the development host through a TCP communication protocol.
Preferably, the driving simulation operation console comprises a visual display, virtual reality glasses, an instrument display, an operation panel, a left operation handle, an accelerator pedal, a brake pedal and a right operation handle;
the visual display and the virtual reality glasses are used for displaying a 3D simulation effect;
the instrument display is used for displaying the running state data of the excavator;
the operation panel is used for an operator to send a control signal to the semi-physical simulation cabinet;
the left operating handle is used for sending command signals for opening the small arm, closing the small arm and rotating left and right;
the right operating handle is used for sending command signals for lifting the big arm, lowering the big arm and turning over the bucket;
the accelerator pedal is used for sending an accelerator opening degree signal;
the brake pedal is used for sending a brake control signal.
Preferably, the VR interface module is further used for establishing communication between the virtual reality glasses and the real-time simulation model of the engineering machinery, and displaying the full-view simulation result.
A third aspect of the present invention provides a method for testing an excavator control program, including:
downloading the compiled excavator control program to a controller to be tested in the visual test system;
configuring a semi-physical simulation cabinet in the visual test system according to a test purpose and a test range, and building an engineering machinery real-time simulation model according to an excavator structure principle and a schematic diagram of a hydraulic system;
and creating a test case, sequentially operating corresponding operating equipment through a driving simulation operating console according to the test case to perform simulation test and result display, and checking whether the excavator control program can normally run or not and whether result output meets requirements or not.
Preferably, the excavator control program is compiled using the method described above.
Preferably, the result display mode includes:
displaying the automatic test execution result of the development host;
3D simulation effect display is carried out through a visual display of a driving simulation console;
and the combination of (a) and (b),
and displaying the immersive full-view simulation result through the VR interface module.
The invention has the beneficial effects that:
(1) according to the invention, the functional requirement logic of a user can be built through the basic module of the simulink, the PLC codes of the control program of the engineering mechanical excavator can be generated intuitively and quickly, the visual simulation verification can be carried out, the error can be found without waiting for the installation test link, the control effect can be felt intuitively, the logical deviation can be found and the error can be modified as soon as possible, the program can be corrected more easily, and the bug can be found to improve the working efficiency.
(2) The invention combines the graphical programming characteristic based on the model, so that the program is convenient to read, the understanding and the experience reuse are convenient, the model is divided by the hierarchy of the design function, the management of complex design is realized, the generated code has consistency, and the generated code automatically conforms to the relevant standard.
(3) The test system of the invention makes the test verification more comprehensive by constructing abundant environment models, and is very suitable for the simulation verification requirements of the engineering machinery industry.
Drawings
FIG. 1 is a flow chart of an automatic generation method of PLC codes of an excavator control program according to the present invention;
FIG. 2 is a model diagram of a work gear voltage analytic control strategy built on the basis of simulink;
FIG. 3 is a system architecture for visually testing a control program of an excavator according to the present invention;
FIG. 4 is a configuration diagram of a driving simulation console in the visual testing system of the present invention;
FIG. 5 is a test flow diagram of the present invention.
Detailed Description
The invention is further described below. The following examples are only for illustrating the technical solutions of the present invention more clearly, and the protection scope of the present invention is not limited thereby.
One embodiment of the present invention provides an automatic generation method of PLC codes of an excavator control program, referring to fig. 1, including:
step 1, building a control strategy model according to customer requirements;
step 2, setting a solver according to the built control strategy model, and carrying out error check on the built control strategy model through simulation operation; after the investigation is finished, parameter configuration is carried out;
step 3, according to IDE (Integrated Development Environment) Environment matched with controller hardware used in the test stage, selecting system target file generated by code, which controls global code generation and directly controls file generation type of code;
step 4, configuring a code annotation generation style, determining whether the generated code contains annotations and the used basic module description, and conveniently tracing and checking the corresponding relation between the module and the code because a subsequently generated report contains hyperlinks which can jump from the code to the corresponding part of the model;
step 5, configuring a report generation format, and determining whether to generate a traceability report or not and whether to automatically open a report after the control strategy model is compiled;
step 6, according to the size or complexity of the model function, the model can be packaged into one or split into a plurality of subsystems, compiling is started, right-click is performed on the divided control strategy model, a PLC Code is selected, then the PLC Code is automatically generated under the current working path by selecting the Generator Code for Subsystem, and then the generated PLC Code is placed under the selected compiling environment to be linked to Generate an executable program file;
and 7, testing and verifying the generated executable program file in a visual testing environment.
In the embodiment, a basic module in a simulink model library is called to build a control strategy model according to user requirements. FIG. 2 is a model diagram of a work gear voltage analytic control strategy built based on simulink.
In the embodiment, an output result is generated by artificially giving an input signal during simulation operation, and if the output result is inconsistent with the expectation of the customer requirement, the error is modified until the requirement is met; another type of error belongs to parameter setting errors, such as misutilization of the data types uint8 and uint16, which results in the simulation operation being unable to be calculated and also needs to be manually modified.
In this embodiment, the parameter configuration includes solver setting, such as selecting a fixed step length or a variable step length, system target file setting for code generation (such as generating an embedded C code or a PLC code), comment option setting, and report format setting.
In this embodiment, since the program runs in the controller at a Fixed period, the solver of the control strategy model is set to a Fixed Step length (Fixed-Step), and the basic sampling period of the model is also set to be consistent with the interrupt period of the controller hardware chip (generally set to 0.01S).
In this embodiment, the IDE environment is determined by the target device that controls the generation code of the policy model, and 3 scodessys 3.5 is selected according to the PLC code compilation version of the target controller.
Another embodiment of the present invention provides a visual test system for an excavator control program, which downloads a compiled executable program file to the visual test system for test verification, so that a developer can test a control strategy before loading. A visual test system of an excavator control program is shown in figure 3 and comprises a vision host (1), a semi-physical simulation cabinet (2), a development host (3), a controller to be tested (19) and a driving simulation operation platform (12).
The visual host (1) is used for building and operating a real-time simulation model and comprises the following parts: the system comprises an environment model (4), a dynamic model (5), a UDP communication module (6), a hydraulic system model (7) and a VR interface module (8).
The environment model mainly refers to a terrain three-dimensional model, and simulates surrounding environments such as terrain and landform in the actual working scene of the excavator.
The dynamic model mainly refers to a three-dimensional model of the vehicle and simulates the running condition of the vehicle.
The hydraulic system model simulates the actions of each hydraulic circuit, including the expansion and the rotation of a hydraulic valve, an oil cylinder and the like.
Information interaction exists among the models, input signals of each model come from other models, and the output of each model influences other models.
The UDP communication module follows an Ethernet communication protocol, is a popular local area network standard, and is used for transmitting control output signals of each model of the simulation environment built in the view host (1) to the semi-physical simulation cabinet (2) to drive the corresponding board card to act, and each physical signal generated by the board card is returned to the corresponding controlled object model in the view host (1) through the UDP communication module to realize control, so that closed-loop feedback is formed.
And the VR interface module is used for transmitting the visual signals to the driving simulation operation console, so that a user can feel the simulation model visually and auditorily and obtain the virtual operation process of the control object in an immersion manner.
Semi-physical simulation rack (2) are used for setting up semi-physical simulation test hardware environment, are responsible for the processing and the conversion of signal, include: the PXI bus backboard (10) comprises an Ethernet communication board card (9), a PXI real-time controller (11), a bus simulation board card I (13), an analog quantity simulation board card I (14), a digital quantity simulation board card I (15), a digital quantity simulation board card II (16), an analog quantity simulation board card II (17) and a bus simulation board card II (18) which are connected with the PXI bus through the PXI bus.
The Ethernet communication board card (9) is used for outputting a control signal generated by the semi-physical simulation cabinet (2) to the visual host (1) and transmitting a UDP module output signal to the semi-physical simulation cabinet (2).
The bus simulation board card I (13) is used for processing transmission and interaction of CAN bus information between the semi-physical simulation cabinet (2) and the driving simulation operation platform (12).
The analog quantity simulation board I (14) is used for processing transmission and interaction of analog quantity signals such as handle voltage and the like between the semi-physical simulation cabinet (2) and the driving simulation operation platform (12).
The digital quantity simulation board card I (15) is used for processing transmission and interaction of digital quantity signals such as pedal switches and the like between the semi-physical simulation cabinet (2) and the driving simulation operation platform (12).
And the digital quantity simulation board card II (16) is used for processing transmission and interaction of digital quantity signals between the semi-physical simulation cabinet (2) and the controller to be tested (19).
And the analog quantity simulation board card II (17) is used for processing the transmission and interaction of analog quantity signals between the semi-physical simulation cabinet (2) and the controller to be tested (19).
And the second bus simulation board card (18) is used for processing the transmission and interaction of CAN bus information between the semi-physical simulation cabinet (2) and the controller to be tested (19).
The PXI real-time controller (11) is used for receiving and analyzing data on the Ethernet and sending the data to the development host (3) through a TCP communication protocol.
The development host (3) is used for configuring a software environment of the semi-physical simulation test, and comprises the following components: configuring and building a test project for a board card in the semi-physical simulation cabinet; and receiving the data transmitted by the PXI real-time controller (11) to compile and execute the test case.
The controller to be tested (19) is used for storing and running the compiled executable program file, and establishing communication with the semi-physical simulation cabinet (2) through the signal simulation board card to test and verify the control strategy.
The driving simulation operation console (12) is used for simulating a cab of the engineering machinery, so that testers can obtain immersive driving experience, and the driving simulation operation console (12) receives a test instruction issued by the controller to be tested through the signal simulation board card and executes corresponding operation actions.
Referring to fig. 4, the driving simulation console (12) mainly includes an immersive display device and a driving simulation device, wherein the immersive display device includes a visual display (20) and virtual reality glasses (21); the driving simulation apparatus includes an instrument display (22), an operation panel (23), a left operation handle (24), an accelerator pedal (25), a brake pedal (26), and a right operation handle (27).
The visual display (20) and the virtual reality glasses (21) are used for displaying a 3D simulation effect, operating engineering machinery which is 'in the scene', and observing a virtual prototype.
The meter display (22) is used to display vehicle operating status data consistent with the functioning of the meters on a normal vehicle.
The operation panel (23) is used for an operator to send control signals to the semi-physical simulation cabinet, such as high-low speed switching, fan dust cleaning and the like.
The left operating handle (24) is used for sending command signals of arm opening, arm closing, left-right rotation and the like.
The accelerator pedal (25) is used for sending an accelerator opening degree signal.
The brake pedal (26) is used for sending a brake control signal.
The right operating handle (27) is used for sending command signals of raising the boom, lowering the boom, turning the bucket and the like.
In this embodiment, the simulation test result can be presented in the following three forms: firstly, displaying an automatic test execution result of a development host; secondly, performing 3D simulation effect display through a visual display of the driving simulation console; and thirdly, establishing communication between the virtual reality glasses and the real-time simulation model by utilizing the VR interface module, and displaying an immersive full-view simulation result.
Based on the visual test system, the general steps of testing the compiled excavator control program are as follows, referring to fig. 5:
downloading the compiled excavator control program to a controller to be tested;
according to the test purpose and the test range, software and hardware configuration is carried out; the hardware configuration mainly includes setting the board cards according to the types of signals to be tested, such as analog quantity, digital quantity and quantity. The software configuration mainly comprises the step of compiling corresponding environment models, dynamics models and hydraulic system models to adapt to the requirements of the test system.
And establishing a vision model (an environment model, a dynamic model and a hydraulic system model) on a vision host according to a vehicle structure principle and a schematic diagram of a hydraulic system, and establishing communication with the virtual reality glasses through a VR interface module.
And creating a test case, sequentially operating corresponding operating equipment through a driving simulation operating console according to the test case to perform simulation test, and checking whether the control program can normally run or not and whether the result output meets the requirements or not.
The test process is as follows:
and a control signal generated when the development host (3) executes the test case is sent to the semi-physical simulation cabinet, and the controller to be tested establishes communication with the semi-physical simulation cabinet through the signal simulation board card to test and verify the control logic.
After receiving digital quantity, analog quantity and bus signals in a semi-physical simulation cabinet board card, a controller to be tested controls a corresponding analog quantity input/output port, a corresponding digital quantity input/output port and a corresponding bus port to perform data exchange with the simulation board card through internal logic operation, a generated control signal is output to a visual host (1) through an Ethernet communication board card (9), and the control signal is sent to a corresponding controlled object (a dynamic model (5) and a hydraulic system model (7)) through a UDP communication module (6) to realize control.
The method comprises the steps of utilizing a model-based PLC code automatic generation method and a visual testing device to realize construction and testing of the excavator control program, building a control strategy model by analyzing and modeling demand functions, automatically generating PLC codes meeting requirements through parameter configuration, compiling the excavator control program, and jointly compiling the generated codes to generate an executable program file in a compiling environment; virtual reality is introduced into the simulation testing device through visual human-computer interaction, so that an operator can operate a virtual prototype more truly. The code generation process is relatively simple to operate, a large amount of working time can be saved compared with a traditional manual coding mode, the readability of software is high, the later-period maintenance and tracking are facilitated, the working efficiency is high, the functions in the visual testing device are rich, the operation is convenient and visual, and the positive promotion effect on the testing and verification of the program is achieved.
The method realizes the generation of the control logic PLC code through a model modeling mode, and simultaneously carries out simulation verification on the control program by combining a visual dynamics testing device, has the following five differences with the traditional manual code compiling and simulation testing, has strong readability of graphical programming, is convenient for finding problems, is easy to quickly understand the logic thought of the program even in later maintenance, and has higher development efficiency; secondly, the codes are generated quickly and conveniently, the error probability is extremely low, the codes generated by the model conforming to the modeling rule automatically meet the rule of the target language, and the practical test is feasible; thirdly, the portability is strong, after the model-based control logic program is built, different target IDE environments are selected for different target equipment platforms without modifying the control logic model, and the universality of the program is stronger; fourthly, the visual performance of simulation verification is strong, a testing device carries professional dynamic simulation software to construct a 3D excavator model, and the engineering machinery can be operated in an on-the-spot manner by combining virtual reality glasses, so that the running effect of a control program can be intuitively felt, and the dynamic response process of the system can be comprehensively known in a systematic manner; and fifthly, the testable environment has rich working conditions, various working conditions can be conveniently verified by constructing different road models, the environment working conditions are convenient to replace, the test result is more sufficient, and the improvement and optimization of the program are greatly facilitated.
The above description is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, several modifications and variations can be made without departing from the technical principle of the present invention, and these modifications and variations should also be regarded as the protection scope of the present invention.

Claims (14)

1.一种挖掘机控制程序PLC代码自动生成方法,其特征在于:1. an excavator control program PLC code automatic generation method is characterized in that: 根据用户需求搭建控制策略模型;Build a control strategy model according to user needs; 根据搭建的控制策略模型设置求解器,对控制策略模型进行错误排查以及进行参数配置;Set the solver according to the built control strategy model, perform error checking and parameter configuration on the control strategy model; 根据目标控制器选择编译环境;Select the compilation environment according to the target controller; 将所搭建的控制策略模型进行封装自动生成PLC代码;Encapsulate the built control strategy model to automatically generate PLC code; 将所生成的PLC代码置于所选择的编译环境中进行集成,生成可执行程序文件。The generated PLC code is placed in the selected compilation environment for integration, and an executable program file is generated. 2.根据权利要求1所述的一种挖掘机控制程序PLC代码自动生成和测试方法,其特征在于:根据用户需求调用simulink模型库中基础模块搭建控制策略模型。2. The method for automatically generating and testing an excavator control program PLC code according to claim 1, wherein the basic module in the simulink model library is called according to user requirements to build a control strategy model. 3.根据权利要求1所述的一种挖掘机控制程序PLC代码自动生成和测试方法,其特征在于:通过求解器进行仿真操作对所搭建的控制策略模型进行错误排查。3. The excavator control program PLC code automatic generation and testing method according to claim 1, characterized in that: performing a simulation operation by a solver to perform error checking on the built control strategy model. 4.根据权利要求1所述的一种挖掘机控制程序PLC代码自动生成和测试方法,其特征在于:所述进行参数配置包括设置求解器步长、设置PLC代码生成的系统目标文件、设置注释选项和设置报告格式。4. a kind of excavator control program PLC code automatic generation and testing method according to claim 1, is characterized in that: described carrying out parameter configuration comprises setting solver step size, setting the system target file that PLC code generates, setting note Options and settings report format. 5.根据权利要求4所述的一种挖掘机控制程序PLC代码自动生成和测试方法,其特征在于:将控制策略模型的求解器设定为定步长;5. a kind of excavator control program PLC code automatic generation and testing method according to claim 4, is characterized in that: the solver of control strategy model is set as fixed step; 以及,将控制策略模型的基础采样周期与目标控制器硬件芯片的中断周期设置一致。And, the basic sampling period of the control strategy model is set consistent with the interrupt period of the target controller hardware chip. 6.根据权利要求4所述的一种挖掘机控制程序PLC代码自动生成和测试方法,其特征在于:6. a kind of excavator control program PLC code automatic generation and testing method according to claim 4 is characterized in that: 所述设置注释选项是指,配置生成的PLC代码中是否包含注释;以及,配置生成的PLC代码中是否包含所用到的基础模块描述;The setting comment option refers to whether the PLC code generated by the configuration contains a comment; and whether the PLC code generated by the configuration contains the description of the basic module used; 所述设置报告格式是指,配置生成的报告中带有从代码跳转到模型对应位置的超连接;配置是否生成可追溯性报告;以及,配置是否在控制策略模型编译结束后自动打开报告。Setting the report format refers to configuring the generated report with a hyperlink jumping from the code to the corresponding position of the model; configuring whether to generate a traceability report; and configuring whether to automatically open the report after the control strategy model is compiled. 7.一种挖掘机控制程序的可视化测试系统,其特征在于,包括:视景主机、半实物仿真机柜、开发主机、待测控制器和驾驶模拟操作台;7. A visual test system for an excavator control program, characterized in that it comprises: a visual host, a semi-physical simulation cabinet, a development host, a controller to be tested and a driving simulation console; 所述视景主机用于搭建工程机械实时仿真模型;The visual host is used to build a real-time simulation model of construction machinery; 所述半实物仿真机柜用于测试过程中信号的处理与转换;The hardware-in-the-loop simulation cabinet is used for signal processing and conversion in the testing process; 所述开发主机用于对半实物仿真机柜中的板卡进行配置,以及基于工程机械仿真模型创建测试用例;The development host is used to configure the boards in the hardware-in-the-loop simulation cabinet, and create test cases based on the engineering machinery simulation model; 所述待测控制器用于存储并运行编译好的可执行程序文件,与半实物仿真机柜建立通讯,控制所述驾驶模拟操作台执行相应的操作动作,对控制策略的可执行程序文件进行测试验证;The controller to be tested is used to store and run the compiled executable program files, establish communication with the semi-physical simulation cabinet, control the driving simulation console to perform corresponding operation actions, and test and verify the executable program files of the control strategy. ; 所述驾驶模拟操作台用于模拟工程机械驾驶室,根据待测控制器下发的测试指令,执行相应的操作动作。The driving simulation console is used for simulating a construction machinery cab, and performs corresponding operation actions according to the test instructions issued by the controller to be tested. 8.根据权利要求7所述的一种挖掘机控制程序的可视化测试系统,其特征在于,所述视景主机包括环境模型、动力学模型、UDP通讯模块、液压系统模型和VR接口模块;8. The visual testing system of a control program of an excavator according to claim 7, wherein the visual host comprises an environment model, a dynamics model, a UDP communication module, a hydraulic system model and a VR interface module; 所述环境模型用于模拟挖掘机现实工作场景的地形三维模型;The environment model is used to simulate the three-dimensional terrain model of the excavator's actual working scene; 所述动力学模型用于模拟挖掘机的三维模型;The dynamic model is used to simulate the three-dimensional model of the excavator; 所述UDP通讯模块用于将视景主机中搭建的各模型的控制输出信号传输给半实物仿真机柜,驱动相应的板卡动作,以及将板卡产生的信号传输至视景主机中相应的被控对象模型;The UDP communication module is used to transmit the control output signal of each model built in the visual host to the hardware-in-the-loop simulation cabinet, drive the corresponding board action, and transmit the signal generated by the board to the corresponding host in the visual host. control object model; 所述液压系统模型用于模拟挖掘机的各液压回路动作;The hydraulic system model is used to simulate the action of each hydraulic circuit of the excavator; 所述VR接口模块用于将各模型的视景信号传输给驾驶模拟操作台。The VR interface module is used to transmit the visual signal of each model to the driving simulation console. 9.根据权利要求7所述的一种挖掘机控制程序的可视化测试系统,其特征在于,所述半实物仿真机柜包括:PXI总线背板以及通过PXI总线与之连接的以太网通讯板卡、PXI实时控制器、总线仿真板卡一、模拟量仿真板卡一、数字量仿真板卡一、数字量仿真板卡二、模拟量仿真板卡二和总线仿真板卡二;9. The visual testing system of a control program of an excavator according to claim 7, wherein the hardware-in-the-loop simulation cabinet comprises: a PXI bus backplane and an Ethernet communication board connected with the PXI bus, PXI real-time controller, bus emulation board 1, analog quantity emulation board 1, digital quantity emulation board 1, digital quantity emulation board 2, analog quantity emulation board 2 and bus emulation board 2; 所述以太网通讯板卡用于将半实物仿真机柜产生的控制信号输出到视景主机,以及将视景主机的输出信号传输至半实物仿真机柜;The Ethernet communication board is used to output the control signal generated by the semi-physical simulation cabinet to the visual host, and to transmit the output signal of the visual host to the semi-physical simulation cabinet; 所述总线仿真板卡一用于半实物仿真机柜和驾驶模拟操作台之间CAN总线信息的传输和交互;The bus simulation board is used for the transmission and interaction of CAN bus information between the semi-physical simulation cabinet and the driving simulation console; 所述模拟量仿真板卡一用于半实物仿真机柜和驾驶模拟操作台之间手柄电压模拟量信号的传输和交互;The analog quantity simulation board-card is used for the transmission and interaction of the handle voltage analog quantity signal between the semi-physical simulation cabinet and the driving simulation console; 所述数字量仿真板卡一用于半实物仿真机柜和驾驶模拟操作台之间踏板开关数字量信号的传输和交互;The digital simulation board is used for the transmission and interaction of the digital signal of the pedal switch between the semi-physical simulation cabinet and the driving simulation console; 所述数字量仿真板卡二用于半实物仿真机柜和待测控制器之间数字量信号的传输和交互;The second digital simulation board is used for the transmission and interaction of digital signals between the semi-physical simulation cabinet and the controller to be tested; 所述模拟量仿真板卡二用于半实物仿真机柜和待测控制器之间模拟量信号的传输和交互;The second analog quantity simulation board is used for the transmission and interaction of analog quantity signals between the semi-physical simulation cabinet and the controller to be tested; 所述总线仿真板卡二用于半实物仿真机柜和待测控制器之间CAN总线信息的传输和交互;The second bus simulation board is used for the transmission and interaction of CAN bus information between the semi-physical simulation cabinet and the controller to be tested; 所述PXI实时控制器用于接收和解析以太网上的数据,并通过TCP通讯协议发送给开发主机。The PXI real-time controller is used to receive and parse the data on the Ethernet, and send it to the development host through the TCP communication protocol. 10.根据权利要求7所述的一种挖掘机控制程序的可视化测试系统,其特征在于,所述驾驶模拟操作台包括视景显示器,虚拟现实眼镜,仪表显示器、操作面板、左操作手柄、加速踏板、制动踏板和右操作手柄;10. The visual testing system of an excavator control program according to claim 7, wherein the driving simulation console comprises a visual display, virtual reality glasses, an instrument display, an operation panel, a left operating handle, an acceleration pedal, brake pedal and right operating handle; 所述视景显示器和虚拟现实眼镜用于进行3D仿真效果的展示;The visual display and virtual reality glasses are used for displaying 3D simulation effects; 所述仪表显示器用于显示挖掘机运行状态数据;The instrument display is used for displaying excavator operating state data; 所述操作面板用于操作者给半实物仿真机柜发送控制信号;The operation panel is used by the operator to send control signals to the semi-physical simulation cabinet; 所述左操作手柄用于发送开小臂、收小臂和左右旋转的指令信号;The left operating handle is used to send command signals for opening the forearm, closing the forearm and rotating left and right; 所述右操作手柄用于发送上升大臂、下降大臂和翻转铲斗的指令信号;The right operating handle is used to send the command signal of the lifting boom, the lowering boom and the overturning bucket; 所述加速踏板用于发送油门开度信号;The accelerator pedal is used to send an accelerator opening signal; 所述制动踏板用于发送制动控制信号。The brake pedal is used to send brake control signals. 11.根据权利要求7所述的一种挖掘机控制程序的可视化测试系统,其特征在于,所述VR接口模块还用于将虚拟现实眼镜与工程机械实时仿真模型建立通讯,展示全视景仿真结果。11. The visual test system of a control program of an excavator according to claim 7, wherein the VR interface module is also used to establish communication between the virtual reality glasses and the real-time simulation model of construction machinery, and to display a full-view simulation result. 12.一种挖掘机控制程序的测试方法,其特征在于,包括:12. A method for testing an excavator control program, comprising: 将编译好的挖掘机控制程序下载到权利要求7至11任意一项所述的可视化测试系统中的待测控制器;Downloading the compiled excavator control program to the controller to be tested in the visual testing system according to any one of claims 7 to 11; 根据测试目的和测试范围,对所述可视化测试系统中的半实物仿真机柜进行配置,以及根据挖掘机结构原理和液压系统的原理图搭建工程机械实时仿真模型;According to the test purpose and test scope, configure the semi-physical simulation cabinet in the visual test system, and build a real-time simulation model of construction machinery according to the structural principle of the excavator and the schematic diagram of the hydraulic system; 创建测试用例,并依据测试用例通过驾驶模拟操作台依次操作相应的操作设备进行仿真测试及结果展示,检验所述挖掘机控制程序是否能够正常运行,结果输出是否满足需求。Create a test case, and operate the corresponding operating equipment through the driving simulation console in turn to perform simulation testing and result display according to the test case, and check whether the excavator control program can run normally and whether the result output meets the requirements. 13.根据权利要求12所述的一种挖掘机控制程序的测试方法,其特征在于,采用权利要求1至6任意一项所述的方法编译挖掘机控制程序。13 . The method for testing an excavator control program according to claim 12 , wherein the excavator control program is compiled using the method according to any one of claims 1 to 6 . 14 . 14.根据权利要求12所述的一种挖掘机控制程序的测试方法,其特征在于,所述结果展示方式包括:14. The method for testing an excavator control program according to claim 12, wherein the result presentation method comprises: 通过开发主机的自动化测试执行结果进行展现;Displayed through the automated test execution results of the development host; 通过驾驶模拟操作台的视景显示器进行3D仿真效果展示;3D simulation effect display through the visual display of the driving simulation console; 和,and, 通过VR接口模块进行沉浸式全视景仿真结果展示。Immersive panoramic simulation results are displayed through the VR interface module.
CN202111196354.4A 2021-10-14 2021-10-14 Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program Pending CN113885426A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111196354.4A CN113885426A (en) 2021-10-14 2021-10-14 Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111196354.4A CN113885426A (en) 2021-10-14 2021-10-14 Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program

Publications (1)

Publication Number Publication Date
CN113885426A true CN113885426A (en) 2022-01-04

Family

ID=79002739

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111196354.4A Pending CN113885426A (en) 2021-10-14 2021-10-14 Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program

Country Status (1)

Country Link
CN (1) CN113885426A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691462A (en) * 2022-04-15 2022-07-01 北京轨道交通技术装备集团有限公司 Urban rail transit vehicle simulation method and device
CN115657544A (en) * 2022-10-24 2023-01-31 中国铁道科学研究院集团有限公司 Intermediate frequency auxiliary converter DCDC control system
CN116125943A (en) * 2022-12-16 2023-05-16 佛山仙湖实验室 Whole vehicle control strategy development test method and device for hydrogen fuel cell automobile

Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106200625A (en) * 2016-08-26 2016-12-07 中通客车控股股份有限公司 Hybrid power whole passenger vehicle controller hardware assemblage on-orbit test platform
CN106911144A (en) * 2015-12-23 2017-06-30 中国科学院沈阳自动化研究所 Photovoltaic inverter control system and method based on modelling exploitation
CN108958466A (en) * 2017-11-08 2018-12-07 北京市燃气集团有限责任公司 Excavation Training Methodology based on virtual reality technology
CN109948192A (en) * 2019-02-22 2019-06-28 江苏徐工工程机械研究院有限公司 Hoisting operation space modeling method and system
CN110196720A (en) * 2019-05-29 2019-09-03 北京灵思创奇科技有限公司 A kind of Simulink generates the optimization method of dynamic link library
CN110376920A (en) * 2019-06-28 2019-10-25 深圳市中科德睿智能科技有限公司 A kind of control method and control device of virtual excavator
CN110847111A (en) * 2019-08-12 2020-02-28 长江勘测规划设计研究有限责任公司 Method for acquiring hydropower station gate scheduling parameters based on semi-physical simulation
CN112965399A (en) * 2021-03-24 2021-06-15 中国人民解放军63653部队 Semi-physical simulation test method and device for engineering mechanical equipment
CN214068035U (en) * 2021-01-25 2021-08-27 江苏融一科技有限公司 Crawler-type excavator simulation training system based on VR and multi-degree-of-freedom platform

Patent Citations (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106911144A (en) * 2015-12-23 2017-06-30 中国科学院沈阳自动化研究所 Photovoltaic inverter control system and method based on modelling exploitation
CN106200625A (en) * 2016-08-26 2016-12-07 中通客车控股股份有限公司 Hybrid power whole passenger vehicle controller hardware assemblage on-orbit test platform
CN108958466A (en) * 2017-11-08 2018-12-07 北京市燃气集团有限责任公司 Excavation Training Methodology based on virtual reality technology
CN109948192A (en) * 2019-02-22 2019-06-28 江苏徐工工程机械研究院有限公司 Hoisting operation space modeling method and system
CN110196720A (en) * 2019-05-29 2019-09-03 北京灵思创奇科技有限公司 A kind of Simulink generates the optimization method of dynamic link library
CN110376920A (en) * 2019-06-28 2019-10-25 深圳市中科德睿智能科技有限公司 A kind of control method and control device of virtual excavator
CN110847111A (en) * 2019-08-12 2020-02-28 长江勘测规划设计研究有限责任公司 Method for acquiring hydropower station gate scheduling parameters based on semi-physical simulation
CN214068035U (en) * 2021-01-25 2021-08-27 江苏融一科技有限公司 Crawler-type excavator simulation training system based on VR and multi-degree-of-freedom platform
CN112965399A (en) * 2021-03-24 2021-06-15 中国人民解放军63653部队 Semi-physical simulation test method and device for engineering mechanical equipment

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
王培金等: "基于模型设计的拖拉机整机控制系统的设计与开发", 《广西大学学报(自然科学版)》, vol. 43, no. 5, pages 1695 - 1703 *

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114691462A (en) * 2022-04-15 2022-07-01 北京轨道交通技术装备集团有限公司 Urban rail transit vehicle simulation method and device
CN115657544A (en) * 2022-10-24 2023-01-31 中国铁道科学研究院集团有限公司 Intermediate frequency auxiliary converter DCDC control system
CN116125943A (en) * 2022-12-16 2023-05-16 佛山仙湖实验室 Whole vehicle control strategy development test method and device for hydrogen fuel cell automobile

Similar Documents

Publication Publication Date Title
CN113885426A (en) Automatic generation method, test method and visual test system for PLC (programmable logic controller) codes of excavator control program
CN109814478B (en) Virtual debugging system based on iOpenWorks
US7865350B1 (en) Partitioning a model in modeling environments
US9501594B2 (en) Graphical design verification environment generator
US9766607B2 (en) Test device for testing a virtual electronic control unit
US7702491B2 (en) Method of part flow model for programmable logic controller logical verification system
CN108345265B (en) Programming method of hardware device, visual programming platform, memory and processor
CN105467858A (en) Graphical integrated development environment for control program of robot
JP2008170998A (en) System and method for turbine control simulation
CN109324601A (en) The test platform of robot controller or control system based on hardware in loop
CN104794258A (en) Automobile hardware-in-loop simulation system
CN111859834B (en) A UVM-based verification platform development method, system, terminal and storage medium
CN103559112A (en) Software fault injection method and system
US11366945B2 (en) Soft-real-time hub providing data transport for processor-in-the-loop (PIL) simulations
CN107797463A (en) A kind of emulation mode of multiaxis electric propulsion semi-physical object simulating test platform
CN104572108B (en) A kind of train network control system software development methodology
CN113589706A (en) Helicopter trailing edge flap control virtual simulation method
CN114894505A (en) Electric power steering system model and automatic test system and method thereof
CN111308910B (en) Simulation teaching platform for electric power system
US4914567A (en) Design system using visual language
CN102867087A (en) Graphical radar signal processing high-level integrated design platform and method
JPH0854907A (en) Verification support system
CN1981250A (en) Method for simulating a technical installation
CN116107886A (en) MCU automatic test method and system based on test bench
CN114898617A (en) An automotive electronic teaching system and its operation method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication

Application publication date: 20220104

RJ01 Rejection of invention patent application after publication