Motion Axis Setup: Difference between revisions

From Axel Public Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
(20 intermediate revisions by the same user not shown)
Line 7: Line 7:
* MC_Common.plclib contains the blocks and definition to be used by the application programmer, it implements PLCopen Motion Control part 1 specifications.
* MC_Common.plclib contains the blocks and definition to be used by the application programmer, it implements PLCopen Motion Control part 1 specifications.
* MC_Driver_DS402, which code is clear and editable, contains what we call axis drivers: they contains specific behaviour to do with a specific type of axis.
* MC_Driver_DS402, which code is clear and editable, contains what we call axis drivers: they contains specific behaviour to do with a specific type of axis.
For a better understanding of the whole Architecture of the Axel Motion Library please refer to /* __ADESSO link a presentazione commerciale di Michele */
For a better understanding of the whole Architecture of the Axel Motion Library please refer to '''[http://www.axelsw.it/pwiki/pub/Motion/MCLibraryOverview.pdf MCLibraryOverview.pdf]'''


== Axes and DS402 model ==
== Axes and DS402 model ==
Line 14: Line 14:
In the current version only EtherCAT axis are considered, but there still the possibility to define virtual axes, which can be used to compute trajectories without actually move any motor.
In the current version only EtherCAT axis are considered, but there still the possibility to define virtual axes, which can be used to compute trajectories without actually move any motor.
For any axis in one application, an entry should be created in the configurator:<br>
For any axis in one application, an entry should be created in the configurator:<br>
then LogicLab will generate automatically some variables, one of them is the AXIS_REF structure, which represents the axis in the application and should be used as input variable for mani motion function blocks.<br>
then LogicLab will generate automatically some variables, one of them is the AXIS_REF structure, which represents the axis in the application and should be used as input variable for many motion function blocks.<br>
The axis behave as specified in the corresponding entry in LogicLab configurator,
The axis behave as specified in the corresponding entry in LogicLab configurator,
and it must be binded to a phisical slave in the fieldbusses, which could be a Motion Enabled EtherCAT slave, and a corresponding driver: which is tecnically an object oriented function block which can specify specific behaviours of the axis.<br>
and it must be binded to a phisical slave in the fieldbusses, which could be a Motion Enabled EtherCAT slave, and a corresponding driver: which is tecnically an object oriented function block which can specify specific behaviours of the axis.<br>
Line 22: Line 22:
== EtherCAT Slaves and related PCTs ==
== EtherCAT Slaves and related PCTs ==
To allow the use of an EtherCAT slave in a LogicLab project, first its ESI description file must be imported in the IDE, from that time ahead, that EtherCAT slave could be inserted in any EtherCAT configuration.<br>
To allow the use of an EtherCAT slave in a LogicLab project, first its ESI description file must be imported in the IDE, from that time ahead, that EtherCAT slave could be inserted in any EtherCAT configuration.<br>
The process of importing the ESI file is to generate a descriptor file in the installation directory of logic lab describing its behaviour and capabilities of the slave in an EtherCAT network; the descriptor file, which has PCT extension a this time contains only the informations inside the corresponding ESI file, no EtherCAT profile informations are added, neither its ability to be used as a motion Axis.<br><br>
The process of importing the ESI file is to generate a descriptor file in the installation directory of LogicLab describing its behaviour and capabilities of the slave in an EtherCAT network; the descriptor file, which has PCT extension a this time contains only the informations inside the corresponding ESI file, no EtherCAT profile informations are added, neither its ability to be used as a motion Axis.<br><br>
The scope of this wiki page is to give the basic instructions to modify the PCT of an imported EtherCAT slave, to enable it to be used as a motion axis for the Axel Motion Library
The scope of this wiki page is to give the basic instructions to modify the PCT of an imported EtherCAT slave, to enable it to be used as a motion axis for the Axel Motion Library


Line 30: Line 30:
* Create an empty project for an EtherCAT enabled target (for example LLExec for INtime platform).
* Create an empty project for an EtherCAT enabled target (for example LLExec for INtime platform).


[[File:MCScreenshot1.png]]
[[File:MC_Screenshot1.png]]


** (optional) If necessary implement a proper driver by creating a function block which is derived from MC_Driver_DS402 base function block.
* (optional) If necessary implement a proper driver by creating a function block which is derived from MC_Driver_DS402 base function block.
/*__ADESSO*/ screenshot2, screenshot3
 
** (optional) Create a new library to include the created driver.
[[File:MC_Screenshot2.png]]
/*__ADESSO*/ screenshot5, screenshot6
 
 
[[File:MC_Screenshot3.png|1500px]]
 
* (optional) Create a new library to include the created driver.
[[File:MC__Screenshot4.png]]
 
[[File:MC__Screenshot5.png]]
 
[[File:MC__Screenshot6.png]]
* Import the ESI file of the EtherCAT slave.
* Import the ESI file of the EtherCAT slave.
/*__ADESSO*/ screenshot7
 
[[File:MC__Screenshot7.png]]
 
Note that, in order to have the menu entry in the menubar, you should open a program editor.
Note that, in order to have the menu entry in the menubar, you should open a program editor.
* Find, in the Axel Automation Suite installation directory the corresponding PCT file.
* Find, in the Axel Automation Suite installation directory the corresponding PCT file.
/*__ADESSO*/ screenshot 8
 
 
[[File:MC__Screenshot8.png]]
 
* Copy the file in a new file, which will became the motion enabled EtherCAT slave.
* Copy the file in a new file, which will became the motion enabled EtherCAT slave.
/*__ADESSO*/ screenshot 9
 
* Edit, with a text editor, the new motion enabled PCT file and add the <MotionAxes> xml section, as detailed in the document:
 
/*__ADESSO*/ link al documento di customizzazione del motion
[[File:MC__Screenshot9.png]]
 
* Edit, with a text editor, the new motion enabled PCT file and add the <MotionAxes> xml section, as detailed in the document:<br>
'''[http://www.axelsw.it/pwiki/pub/Motion/Axel_Motion_Control_Library_-_Customizing_Axis_Driver.pdf Axel_Motion_Control_Library_-_Customizing_Axis_Driver.pdf]'''
 


== Use steps ==
== Use steps ==
* Close LogicLab.
* Close LogicLab.
* Delete the catalog cache.
* Delete the catalog cache.
/*__ADESSO*/ screenshot10
 
[[File:MC__Screenshot10.png]]
 
* Launch LogicLab again.
* Launch LogicLab again.
* Open the previously created project or create a new project with an EtherCAT enabled and Motion enabled target (for example LLExec for INtime).
* Open the previously created project or create a new project with an EtherCAT enabled and Motion enabled target (for example LLExec for INtime).
* Insert in the EtherCAT network the recently created motion enabled EtherCAT slave.
* Insert in the EtherCAT network the recently created motion enabled EtherCAT slave.
/*__ADESSO*/ screenshot11 e screenshot12
 
* Set the task fast cycle time as desired
[[File:MC__Screenshot11.png]]
/*__ADESSO*/ // screenshot13
* On the resource tree, right click on the node "Motion" and select "Add Axis"
/*__ADESSO*/ // screenshot14
* In the main axis window, in the "Fieldbus" box select the desired motion enabled EtherCAT slave, which is already inserted in the EtherCAT network.
* Select the correct driver in the "Driver" box.
* Once the project is saved, the AXIS_REF variable will appear automatically on the project tree, under the node Motion->Motion_Vars : use it as axis input for the motion function blocks.
* Create an new FBD program and assign it to the Fast task.
* You can define your motion network using the function blocks in the library tree, under the node MC_Common->API as specified by the PLCopen motion control part-1 specification.




= Steps details =
[[File:MC__Screenshot12.png]]
* Install Axel Automation suite
* Launch LogicLab
* Create an empty project for an EtherCAT enabled target (for example LLExec for INtime platform.
** (optional) If necessary implement a proper driver by creating a function block which is derived from MC_Driver_DS402 base function block.
** (optional) Create a new library to include the created driver.
* Import the ESI file of the EtherCAT slave.
* Find, in the Axel Automation Suite installation directory the corresponding PCT file.
* Copy the file in a new file, which will became the motion enabled EtherCAT slave.
* Edit, with a text editor, the new motion enabled PCT file and add the <MotionAxes> xml section, as detailed in the following chapter.


== Use steps ==
* Close LogicLab.
* Delete the catalog cache.
* Launch LogicLab again.
* Open the previously created project or create a new project with an EtherCAT enabled and Motion enabled target (for example LLExec for INtime).
* Insert in the EtherCAT network the recently created motion enabled EtherCAT slave.
* Set the task fast cycle time as desired
* Set the task fast cycle time as desired
[[File:MC__Screenshot13.png]]
* On the resource tree, right click on the node "Motion" and select "Add Axis"
* On the resource tree, right click on the node "Motion" and select "Add Axis"
[[File:MC__Screenshot14.png]]
* In the main axis window, in the "Fieldbus" box select the desired motion enabled EtherCAT slave, which is already inserted in the EtherCAT network.
* In the main axis window, in the "Fieldbus" box select the desired motion enabled EtherCAT slave, which is already inserted in the EtherCAT network.
* Select the correct driver in the "Driver" box.
* Select the correct driver in the "Driver" box.
* Once the project is saved, the AXIS_REF variable will appear automatically on the project tree, under the node Motion->Motion_Vars : use it as axis input for the motion function blocks.
* Once the project is saved, the AXIS_REF variable will appear automatically on the project tree, under the node Motion->Motion_Vars : use it as axis input for the motion function blocks.
[[File:MC__Screenshot15.png]]
* Create an new FBD program and assign it to the Fast task.
* Create an new FBD program and assign it to the Fast task.
[[File:MC__Screenshot16.png]]
* You can define your motion network using the function blocks in the library tree, under the node MC_Common->API as specified by the PLCopen motion control part-1 specification.
* You can define your motion network using the function blocks in the library tree, under the node MC_Common->API as specified by the PLCopen motion control part-1 specification.


= Further reading =
= Further readings =
/*__ADESSO*/ // link al nostro manuale
'''[http://www.axelsw.it/pwiki/pub/Motion/MCLibraryOverview.pdf MCLibraryOverview.pdf]'''<br>
/*__ADESSO*/ // link al sito PLCopen
'''[http://www.axelsw.it/pwiki/pub/Motion/Axel_Motion_Control_Library_-_Customizing_Axis_Driver.pdf Axel_Motion_Control_Library_-_Customizing_Axis_Driver.pdf]'''<br>
'''[https://plcopen.org/technical-activities/motion-control https://plcopen.org/technical-activities/motion-control]'''
 
[[Category:LogicLab]]

Latest revision as of 15:04, 26 January 2022

This page describes how to setup a motion axis type, to be used within the Axel Motion Library to develop Motion Control applications.

Overview

The Axel Motion Library is automatically added to any new project created with LogicLab, for enabled target runtimes. The library is actually splitted in two differnt modules: MC_Common.plclib and MC_Driver_DS402.plclib

  • MC_Common.plclib contains the blocks and definition to be used by the application programmer, it implements PLCopen Motion Control part 1 specifications.
  • MC_Driver_DS402, which code is clear and editable, contains what we call axis drivers: they contains specific behaviour to do with a specific type of axis.

For a better understanding of the whole Architecture of the Axel Motion Library please refer to MCLibraryOverview.pdf

Axes and DS402 model

An axis is a motor, driven by a control drive, which can communicate with the PLC application by means of some fieldbus, for example EtherCAT or CANopen.
In the current version only EtherCAT axis are considered, but there still the possibility to define virtual axes, which can be used to compute trajectories without actually move any motor. For any axis in one application, an entry should be created in the configurator:
then LogicLab will generate automatically some variables, one of them is the AXIS_REF structure, which represents the axis in the application and should be used as input variable for many motion function blocks.
The axis behave as specified in the corresponding entry in LogicLab configurator, and it must be binded to a phisical slave in the fieldbusses, which could be a Motion Enabled EtherCAT slave, and a corresponding driver: which is tecnically an object oriented function block which can specify specific behaviours of the axis.
The model of axis on wich the library works is inspired to the DS402 (or CiA 402) EtherCAT and CANopen profile for drives.
It is possible to drive other types of Axis, may be very different from the DS402 model: for that a driver must be written to map the DS402 behaviour compute by the library, into the specific details of the actual drive.

EtherCAT Slaves and related PCTs

To allow the use of an EtherCAT slave in a LogicLab project, first its ESI description file must be imported in the IDE, from that time ahead, that EtherCAT slave could be inserted in any EtherCAT configuration.
The process of importing the ESI file is to generate a descriptor file in the installation directory of LogicLab describing its behaviour and capabilities of the slave in an EtherCAT network; the descriptor file, which has PCT extension a this time contains only the informations inside the corresponding ESI file, no EtherCAT profile informations are added, neither its ability to be used as a motion Axis.

The scope of this wiki page is to give the basic instructions to modify the PCT of an imported EtherCAT slave, to enable it to be used as a motion axis for the Axel Motion Library

Steps summary

  • Install Axel Automation suite
  • Launch LogicLab
  • Create an empty project for an EtherCAT enabled target (for example LLExec for INtime platform).

MC Screenshot1.png

  • (optional) If necessary implement a proper driver by creating a function block which is derived from MC_Driver_DS402 base function block.

MC Screenshot2.png


MC Screenshot3.png

  • (optional) Create a new library to include the created driver.

MC Screenshot4.png

MC Screenshot5.png

MC Screenshot6.png

  • Import the ESI file of the EtherCAT slave.

MC Screenshot7.png

Note that, in order to have the menu entry in the menubar, you should open a program editor.

  • Find, in the Axel Automation Suite installation directory the corresponding PCT file.


MC Screenshot8.png

  • Copy the file in a new file, which will became the motion enabled EtherCAT slave.


MC Screenshot9.png

  • Edit, with a text editor, the new motion enabled PCT file and add the <MotionAxes> xml section, as detailed in the document:

Axel_Motion_Control_Library_-_Customizing_Axis_Driver.pdf


Use steps

  • Close LogicLab.
  • Delete the catalog cache.

MC Screenshot10.png

  • Launch LogicLab again.
  • Open the previously created project or create a new project with an EtherCAT enabled and Motion enabled target (for example LLExec for INtime).
  • Insert in the EtherCAT network the recently created motion enabled EtherCAT slave.

MC Screenshot11.png


MC Screenshot12.png

  • Set the task fast cycle time as desired

MC Screenshot13.png

  • On the resource tree, right click on the node "Motion" and select "Add Axis"

MC Screenshot14.png

  • In the main axis window, in the "Fieldbus" box select the desired motion enabled EtherCAT slave, which is already inserted in the EtherCAT network.
  • Select the correct driver in the "Driver" box.
  • Once the project is saved, the AXIS_REF variable will appear automatically on the project tree, under the node Motion->Motion_Vars : use it as axis input for the motion function blocks.

MC Screenshot15.png

  • Create an new FBD program and assign it to the Fast task.

MC Screenshot16.png

  • You can define your motion network using the function blocks in the library tree, under the node MC_Common->API as specified by the PLCopen motion control part-1 specification.

Further readings

MCLibraryOverview.pdf
Axel_Motion_Control_Library_-_Customizing_Axis_Driver.pdf
https://plcopen.org/technical-activities/motion-control