CN112748697B - Pulse axis control method based on CoDeSys controller - Google Patents
Pulse axis control method based on CoDeSys controller Download PDFInfo
- Publication number
- CN112748697B CN112748697B CN202011599857.1A CN202011599857A CN112748697B CN 112748697 B CN112748697 B CN 112748697B CN 202011599857 A CN202011599857 A CN 202011599857A CN 112748697 B CN112748697 B CN 112748697B
- Authority
- CN
- China
- Prior art keywords
- pulse
- pulse axis
- station device
- axis
- function block
- 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.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G05—CONTROLLING; REGULATING
- G05B—CONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
- G05B19/00—Programme-control systems
- G05B19/02—Programme-control systems electric
- G05B19/04—Programme control other than numerical control, i.e. in sequence controllers or logic controllers
- G05B19/05—Programmable logic controllers, e.g. simulating logic interconnections of signals according to ladder diagrams or function charts
- G05B19/054—Input/output
Landscapes
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Engineering & Computer Science (AREA)
- Automation & Control Theory (AREA)
- Programmable Controllers (AREA)
Abstract
A pulse axis control method based on a CoDesys controller comprises the following steps: creating a pulse axis master station device description file and a pulse axis slave station device description file and importing the pulse axis master station device description file and the pulse axis slave station device description file into a device warehouse; creating an IoDrvStepPulseAxis library and a CmpStepPulseEncoder library required for setting the number of pulses and reading the encoder value and importing the library into a library repository; the IoDrvStepPulseAxis library comprises a pulse AXIS master station device function block and a pulse AXIS slave station device function block, wherein the pulse AXIS slave station device function block is inherited by a function block AXIS _ REF _ SM3 of CoDesys software; adding pulse axis master station equipment and pulse axis slave station equipment in a CoDesys project, and configuring working parameters of a pulse axis; the added pulse axis master station device and pulse axis slave station device are used for controlling the pulse type servo driver. The invention can realize closed-loop control of the pulse shaft, and the pulse shaft is completely equal to other bus shafts.
Description
Technical Field
The present invention relates to PLC technology.
Background
In recent years, as the CoDeSys (controller Development system) has the advantages of being open, reconfigurable, modular, and in compliance with IEC 61131-3 international standard, more and more manufacturers develop motion controllers based on the CoDeSys software platform. The CoDesys software supports most industrial field buses, such as EtherCAT, CANopen, EtherNET/IP, etc., but does not provide support for the pulse axis.
At present, the domestic method for controlling the pulse axis based on the CoDesys software adopts a virtual axis mode, then the output of the virtual axis is converted into specific pulses to control the pulse type servo driver, and related contents can be referred to Chinese patent application with the application number of 201911398445.9 and the name of invention of 'a method for instantiating the pulse axis by using the CoDeSys virtual axis'. Due to the self characteristic of the virtual axis in the CoDesys, namely that the actual position is equal to the target position, the CoDesys cannot be subjected to closed-loop control; in addition, when the motion planning is performed by using the PLCopen-based standard interface specification, the control of the pulse axis by using the virtual axis method cannot be treated equally as other bus axes, and additional operations (such as control of IO, conversion of a pulse value encoder value, variable mapping and other complex and tedious operations) are required to be performed so as to implement operations such as up/down enabling, motion control, error clearing and the like on the pulse axis.
Therefore, it is desirable to design a simple and easy-to-use pulse axis control scheme that conforms to the interface specification of the PLCopen standard.
Disclosure of Invention
The technical problem to be solved by the invention is to provide a pulse axis control method based on a CoDesys controller, which can realize closed-loop control of a pulse axis, the pulse axis is completely equal to other bus axes, and program developers do not need to distinguish the bus axis from the pulse axis.
The pulse axis control method based on the CoDesys controller comprises the following steps:
creating a pulse axis master station device description file and a pulse axis slave station device description file, and importing the created pulse axis master station device description file and the created pulse axis slave station device description file into a device warehouse of CoDesys software;
creating an IoDrvStepPulseAxis library and a CmpTepPulseEncoder library, and importing the IoDrvStepPulseAxis library and the CmpTepPulseEncoder library into a library warehouse of CoDesys software; the IoDrvStepPulseAxis library comprises a pulse AXIS master station device function block and a pulse AXIS slave station device function block, wherein the pulse AXIS master station device function block is used for realizing the function of a pulse AXIS master station device, the pulse AXIS slave station device function block is used for realizing the function of a pulse AXIS slave station device, and the pulse AXIS slave station device function block is obtained by inheriting a function block AXIS _ REF _ SM3 provided by CoDesys software; the CmpStepPulseEncoder library includes functional blocks required for setting the number of pulses and reading the encoder value;
adding pulse axis master station equipment and pulse axis slave station equipment in a CoDesys project, and configuring working parameters of a pulse axis;
the added pulse axis master station device and pulse axis slave station device are used for controlling the pulse type servo driver.
The invention has at least the following advantages:
1. the pulse axis control method based on the CoDesys controller adopts a tree topology structure with one master and multiple slaves, and can realize closed-loop control on the pulse axis;
2. in the PULSE AXIS method based on the CoDesys controller of the embodiment, motion control of the PULSE AXIS is realized through the PULSE AXIS slave station device function block AXIS _ REF _ PULSE _ SM3 inherited from AXIS _ REF _ SM3, all CoDesys standard function block interfaces are completely compatible, the PULSE AXIS is completely equal to other main axes and accords with the PLCopen standard interface specification, and program developers do not need to distinguish the main AXIS from the PULSE AXIS;
3. by adopting the pulse axis control method based on the CoDesys controller in the embodiment, program developers only need to add the pulse axis master station and the pulse axis slave station, and then the PLCopen standard interface specification can be used for controlling the motion of the pulse axis, so that the user operation is simplified.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present invention, the drawings needed to be used in the description of the embodiments will be briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present invention, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flow chart illustrating a pulse axis control method based on a CoDeSys controller according to an embodiment of the present invention.
Fig. 2 shows a system framework diagram of a pulse axis control method based on a CoDeSys controller according to an embodiment of the invention.
Fig. 3 shows that the PULSE AXIS inherits from the station device function block AXIS _ REF _ PULSE _ SM3 from the function block AXIS _ REF _ SM3 provided by the CoDeSys software.
Detailed Description
Fig. 1 is a flow chart showing a pulse axis control method based on a CoDeSys controller according to an embodiment of the present invention, wherein the CoDeSys controller is a motion controller using the CoDeSys software of 3S company, germany. Referring to fig. 1, a pulse axis control method based on a CoDeSys controller according to an embodiment of the present invention includes the following steps:
creating a pulse axis master station device description file and a pulse axis slave station device description file, and importing the created pulse axis master station device description file and the created pulse axis slave station device description file into a device warehouse of CoDesys software;
creating an IoDrvStepPulseAxis library and a CmpTepPulseEncoder library, and importing the IoDrvStepPulseAxis library and the CmpTepPulseEncoder library into a library warehouse of CoDesys software; the IoDrvStepPulseAxis library comprises a pulse AXIS master station device function block and a pulse AXIS slave station device function block, wherein the pulse AXIS master station device function block is used for realizing the function of a pulse AXIS master station device, the pulse AXIS slave station device function block is used for realizing the function of a pulse AXIS slave station device, and the pulse AXIS slave station device function block is obtained by inheriting a function block AXIS _ REF _ SM3 provided by CoDesys software; the CmpStepPulseEncoder library includes functional blocks required for setting the number of pulses and reading the encoder value;
adding pulse axis master station equipment and pulse axis slave station equipment in a CoDesys project, and configuring working parameters of a pulse axis;
the added pulse axis master station device and pulse axis slave station device are used for controlling the pulse type servo driver.
Fig. 2 shows a system framework diagram of a pulse axis control method based on a CoDeSys controller according to an embodiment of the invention. Referring to fig. 2, fig. 2 shows a pulse axis master device description file STEP _ PulseAxis _ master.devdesc.xml and a pulse axis slave device description file STEP _ PulseAxis _ slave.devdesc.xml. The pulse axis master station device description file defines a pulse axis use task type, a required external library IoDrvStepPulseAxis and a corresponding functional Block (Function Block) IoDrvStepPulseAxisMaster; the PULSE AXIS defines the basic properties of the PULSE AXIS, the required external library IoDrvStepPulseAxis and the corresponding function block AXIS _ REF _ PULSE _ SM3 from the station device description file. The master station device description file and the slave station device description file are imported into a device library of CoDesys software, and a PULSE AXIS master station device and a PULSE AXIS slave station device are added in a CoDesys project, so that a PULSE AXIS master station IoDrvStepPulseAxisMaster function block example and a PULSE AXIS slave station AXIS _ REF _ PULSE _ SM3 function block example are instantiated. As can be seen from the inheritance relationship of the function blocks shown in fig. 3, the PULSE AXIS slave station device function block AXIS _ REF _ PULSE _ SM3 is inherited by the driver interface function block AXIS _ REF _ SM3 provided by the CoDeSys software, so that the PULSE AXIS slave station device of the present embodiment can perform start control, motion planning control and stop control on the PULSE AXIS slave station using the PLCopen standard interface specification. And the VIRTUAL AXIS (AXIS _ REF _ VIRTUAL _ SM3) and EtherCAT bus AXIS (AXIS _ REF _ ETC _ DS402_ CS) are also inherited directly or indirectly from AXIS _ REF _ SM3 function blocks.
The CoDeSys Application (Application) will reference the PULSE AXIS master station device function block iodrvsteppulseaxism master and the PULSE AXIS slave station device function block AXIS _ REF _ PULSE _ SM3 in the IoDrvStepPulseAxis library; and the IoDrvStepPulseAxis bank calls function blocks in the CmpStepPulseEncoder bank, which provides function blocks for setting pulse periods, setting pulse types, setting pulse numbers, setting encoder types, reading encoder values, and so on.
The lower left half part of fig. 2 represents a pulse axis one-master-multiple-slave topology structure, and a plurality of pulse axis slave station devices pulseaxissslave can be mounted under the pulse axis master station device PulseAxisMaster, so that linked list management can be realized; the lower middle part of fig. 2 represents XML files corresponding to the pulse axis master station device PulseAxisMaster and the pulse axis slave station device PulseAxisSlave, and the XML files are used for describing the node type, attribute and other characteristics of the devices; the lower right part of fig. 2 represents the corresponding functional blocks of the instantiated pulse axis master device PulseAxisMaster and pulse axis slave device PulseAxisSlave.
The following describes the detailed implementation of the present invention in conjunction with a specific embodiment. The pulse axis control method based on the CoDeSys controller according to this embodiment is implemented as follows.
a. Creating a pulse axis master station device description file STEP _ PulseAxis _ Master
The design of the pulse axis master station device description file follows the CoDesys XML syntax, and the main functions are as follows:
a1, a one-master multi-slave tree topology structure, which is used for mounting pulse axis slave station equipment and is convenient to manage;
a2, specifying a library name to be added when adding a pulse axis master station device in a CoDesys project;
a3, specifying the name of an instantiation function block when adding a pulse axis master station device in CoDesys engineering;
a4, and specifying the running method after the pulse axis master station device is instantiated.
b. Design pulse axis slave station equipment description file STEP _ pulseAxis _ Slave
b1, a master-slave tree topology structure used for specifying a parent device to which the pulse axis slave device is mounted;
b2, specifying library names to be added when pulse axes are added from station equipment in CoDesys engineering;
b3, specifying the name of an instantiation function block when a pulse axis is added from station equipment in CoDesys engineering;
b4, specifying an operation method after the pulse axis is instantiated from the station equipment;
b5, a method called periodically after the pulse axis is instantiated from the station equipment;
b6, pulse axis slave station equipment axis parameters, such as equipment ID, motion type, speed curve type, software-limited maximum speed, software-limited maximum acceleration, software-limited maximum deceleration, software-limited maximum jerk, pulse equivalent and other parameters.
c. The IoDrvStepPulseAxis library required for creating the PULSE AXIS master station device and the PULSE AXIS slave station device plays a role in starting from top to bottom, and for the above, the PULSE AXIS master station device and the PULSE AXIS slave station device added in the CoDeSys engineering use the IoDrvStepPulseAxis master function block and the AXIS _ REF _ PULSE _ SM3 function block in the library. For the next, a functional block in the CmpStepPulseEncoder library is directly called to realize the conversion of the pulse number and the encoder value.
The PULSE AXIS master station device function block IoDrvStepPulseAxisMaster is used for realizing the function of a PULSE AXIS master station device, the PULSE AXIS master station device mainly has the function of managing PULSE AXIS slave station devices, the PULSE AXIS slave station device function block AXIS _ REF _ PULSE _ SM3 is used for realizing the function of the PULSE AXIS slave station devices, the PULSE AXIS slave station device mainly has the function of controlling PULSE type servo drivers, the PULSE AXIS master station device diagnosis function block IoDrvStepPulseAxisMasterDiag is used for realizing the diagnosis of the PULSE AXIS master station devices, the PULSE AXIS slave station device diagnosis function block AXIS _ REF _ PULSE _ SM3_ Diag is used for realizing the diagnosis of the PULSE AXIS slave station devices, and the linked list function block FixAlrayList is used for realizing the linked list management function of the PULSE AXIS master station devices on a plurality of PULSE AXIS slave station devices.
Because the PULSE AXIS slave station function block AXIS _ REF _ PULSE _ SM3 inherits from the driver interface function block AXIS _ REF _ SM3 of CoDesys software, according to the characteristics of object-oriented polymorphism, a Method (Method) in the function block AXIS _ REF _ PULSE _ SM3 needs to be rewritten so as to be suitable for the control of a PULSE type servo driver and make the PULSE type servo driver conform to the PLCopen standard interface specification, and the rewriting Method is shown in the following table,
d. creating the CmpTepPulseEncoder library required to set the number of pulses, read the encoder value
In summary, through the steps a to d in the above embodiment, firstly, a pulse axis master station device description file and a pulse axis slave station device description file are created and imported into a device warehouse of the CoDeSys software; secondly, establishing an IoDrvStepPulseAxis library required by the pulse axis master station equipment and the pulse axis slave station equipment, setting a pulse number, reading a CmpTepPulseEncoder library required by an encoder value, and importing the library into a library of CoDesys software; then, adding pulse axis master station equipment and pulse axis slave station equipment in a CoDesys project, and configuring parameters of a pulse axis; finally, the added pulse axis master station equipment and pulse axis slave station equipment (calling PLCopen standard interface specification) are used for carrying out single-axis, electronic gear, electronic cam, CNC and axis group control on the pulse type servo.
The PULSE AXIS control method based on the CoDesys controller of the embodiment of the invention hides details of PULSE AXIS specific start-stop, PULSE conversion, encoder value conversion and the like through an IoDrvStepPulseAxis library and a CmpTepPulseEncoder library, realizes motion control of a PULSE type servo driver through a PULSE AXIS inherited from an AXIS _ REF _ SM3 slave station equipment function block AXIS _ REF _ PULSE _ SM3, is completely compatible with all CoDesSys standard function block interfaces, is simple and easy to use, is completely parallel to other total AXIS shafts and the like, and can be suitable for single-AXIS control, electronic gear control, electronic cam control, CNC control and shaft group control.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (4)
1. A pulse axis control method based on a CoDesys controller is characterized by comprising the following steps:
creating a pulse axis master station device description file and a pulse axis slave station device description file, and importing the created pulse axis master station device description file and the created pulse axis slave station device description file into a device warehouse of CoDesys software;
creating an IoDrvStepPulseAxis library and a CmpTepPulseEncoder library, and importing the IoDrvStepPulseAxis library and the CmpTepPulseEncoder library into a library warehouse of CoDesys software; the IoDrvStepPulseAxis library comprises a pulse AXIS master station device function block and a pulse AXIS slave station device function block, wherein the pulse AXIS master station device function block is used for realizing the function of a pulse AXIS master station device, the pulse AXIS slave station device function block is used for realizing the function of a pulse AXIS slave station device, and the pulse AXIS slave station device function block is obtained by inheriting a function block AXIS _ REF _ SM3 provided by CoDesys software; the CmpStepPulseEncoder library includes functional blocks required for setting the number of pulses and reading the encoder value;
adding pulse axis master station equipment and pulse axis slave station equipment in a CoDesys project, and configuring working parameters of a pulse axis;
the added pulse axis master station device and pulse axis slave station device are used for controlling the pulse type servo driver.
2. The method of claim 1, wherein the pulse axis master station device function block and the pulse axis slave station device function block in the IoDrvStepPulseAxis library can be called by a CoDesys application program, and the function block in the CmpTepPulseEncoder library can be called by the IoDrvStepPulseAxis library.
3. The CoDesys controller-based pulse axis control method according to claim 2, wherein the CmpTepPulseEncoder library comprises the following functional blocks: setting a pulse period, setting a pulse type, setting a number of pulses, setting an encoder type, and reading an encoder value.
4. The CoDesys controller-based pulse axis control method according to claim 1, wherein the IoDrvStepPulseAxis library comprises a pulse axis master station device diagnostic function block, a pulse axis slave station device diagnostic function block, and a linked list function block; the pulse axis master station device diagnosis function block is used for realizing diagnosis of the pulse axis master station devices, the pulse axis slave station device diagnosis function block is used for realizing diagnosis of the pulse axis slave station devices, and the linked list function block is used for realizing linked list management functions of the pulse axis master station devices on the plurality of pulse axis slave station devices.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011599857.1A CN112748697B (en) | 2020-12-29 | 2020-12-29 | Pulse axis control method based on CoDeSys controller |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN202011599857.1A CN112748697B (en) | 2020-12-29 | 2020-12-29 | Pulse axis control method based on CoDeSys controller |
Publications (2)
Publication Number | Publication Date |
---|---|
CN112748697A CN112748697A (en) | 2021-05-04 |
CN112748697B true CN112748697B (en) | 2021-11-23 |
Family
ID=75647287
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN202011599857.1A Active CN112748697B (en) | 2020-12-29 | 2020-12-29 | Pulse axis control method based on CoDeSys controller |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN112748697B (en) |
Families Citing this family (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN115167265B (en) * | 2022-07-07 | 2023-03-24 | 北京万昇智能科技有限公司 | PLC application package generation method, PLC application package operation method and related device |
Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB925475A (en) * | 1960-12-30 | 1963-05-08 | Peelle Co The | Improvements relating to electro-acoustic control systems |
CN101774364A (en) * | 2010-02-10 | 2010-07-14 | 中国第一汽车集团公司 | VIT hardware cording communication bus control system of commercial vehicle |
CN102789210A (en) * | 2011-05-16 | 2012-11-21 | 上海华建电力设备股份有限公司 | Configurable industrial bus interface supporting protocol |
CN104850065A (en) * | 2015-05-27 | 2015-08-19 | 福建骏鹏通信科技有限公司 | Modular reconfigurable motion controller architecture based on SERCOS |
CN210573276U (en) * | 2019-08-16 | 2020-05-19 | 珠海市睿控科技有限公司 | Resistance-capacitance test packaging machine controller |
CN111190383A (en) * | 2019-12-30 | 2020-05-22 | 无锡信捷电气股份有限公司 | Method for instantiating pulse axis by using codesys virtual axis |
-
2020
- 2020-12-29 CN CN202011599857.1A patent/CN112748697B/en active Active
Patent Citations (6)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
GB925475A (en) * | 1960-12-30 | 1963-05-08 | Peelle Co The | Improvements relating to electro-acoustic control systems |
CN101774364A (en) * | 2010-02-10 | 2010-07-14 | 中国第一汽车集团公司 | VIT hardware cording communication bus control system of commercial vehicle |
CN102789210A (en) * | 2011-05-16 | 2012-11-21 | 上海华建电力设备股份有限公司 | Configurable industrial bus interface supporting protocol |
CN104850065A (en) * | 2015-05-27 | 2015-08-19 | 福建骏鹏通信科技有限公司 | Modular reconfigurable motion controller architecture based on SERCOS |
CN210573276U (en) * | 2019-08-16 | 2020-05-19 | 珠海市睿控科技有限公司 | Resistance-capacitance test packaging machine controller |
CN111190383A (en) * | 2019-12-30 | 2020-05-22 | 无锡信捷电气股份有限公司 | Method for instantiating pulse axis by using codesys virtual axis |
Non-Patent Citations (3)
Title |
---|
基于CoDeSys的EtherCAT总线控制系统设计;郭奕鑫 等;《现代工业经济和信息化》;20180930(第12期);第40-41页 * |
基于CoDeSys的可重构的焊接自动化控制器;陈树君 等;《电焊机》;20130731;第43卷(第7期);第7-12页 * |
基于实时工业以太网的PAC系统关键技术研究与实现;岳士超;《中国优秀硕士学位论文全文数据库 信息科技辑》;20130215(第02期);第I140-434页 * |
Also Published As
Publication number | Publication date |
---|---|
CN112748697A (en) | 2021-05-04 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102427482B (en) | For configuring the method for fieldbus user | |
US7117049B2 (en) | Industrial controller based on distributable technology objects | |
EP2169547B1 (en) | Compilation model for programmable logic controllers (PLC). | |
US9124445B2 (en) | Apparatus for integrating device objects into a superordinated control unit | |
EP1936496A1 (en) | Module classification and searching for industrial control systems | |
JPH08511643A (en) | Computer numerical control system | |
US6826432B2 (en) | Process for programming an automation application | |
US11307550B2 (en) | Sequence control of program modules | |
US20060259243A1 (en) | Provision of diagnosis information | |
US20120023277A1 (en) | Method for Operating an Automation Device | |
Hammerstingl et al. | Unified Plug&Produce architecture for automatic integration of field devices in industrial environments | |
US10805116B2 (en) | Gateway and method for connecting a data source system to an IT system | |
CN114564192B (en) | Data mapping method for real-time Ethernet industrial control software development environment | |
CN112748697B (en) | Pulse axis control method based on CoDeSys controller | |
US20220255987A1 (en) | Method for linking objects of a control program of a control unit of an automation system, and development environment | |
US8713229B2 (en) | Sensor interface engineering | |
US9864721B2 (en) | Cascaded fieldbus system | |
CN207488786U (en) | A kind of industrial automatic controller | |
CN115004118A (en) | Method and engineering system for configuring and parameterizing field bus users | |
Olbort et al. | Integration of Communication using OPC UA in MBSE for the Development of Cyber-Physical Systems | |
CN114968196A (en) | Development platform architecture based on CODESYS software | |
CN111052010A (en) | Control system, development support device, and development support program | |
US9507334B2 (en) | Programming template for distributed application programs | |
US20120303853A1 (en) | Engineering of a data communication | |
Braun et al. | Object-Oriented Programming with SIMOTION: Fundamentals, Program Examples and Software Concepts According to IEC 61131-3 |
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 | ||
GR01 | Patent grant | ||
GR01 | Patent grant |