This is the second episode of the Servo Drive Tutorial for Festo’s CMMT-ST Series. This time, we will explain the points to keep in mind when linking the CMMT-AS Drive with the Beckhoff TwinCAT3 and the program.
Let’s get started!
Here is a Japanese-language video I made, in which I test drive a CMMT-ST Servo Drive using the Festo Automation suite.
Here is a video I made explaining the program when using the Beckhoff TwinCAT3 and CMMT-ST Servo Drive.
This is Servo Drive Tutorial Part 1 for Festo’s CMMT-ST Series, showing how to operate the Automation Suite and commission the CMMT-ST.
Festo also has CPX Series products and offers a comprehensive Fieldbus Solution for EIP/Profinet/Ethercat. Please refer to the following link if you like.
I have written my own Step by Step guideline connecting Festo CPX modules with Beckhoff TwinCAT, Keyence, and IQR.
Port1 XF1 is the EtherCAT IN Port and Port XF2 is the EtherCAT Output Port.
Distributed clocks DC (Distributed Clocks)
All Real-Time-Clocks in all DC-capable EtherCAT slave controller ESCs of an EtherCAT network can be synchronized by means of a distributed ClockDC mechanism.
By default, the first DC-capable slave in the EtherCAT network controls the Clock Master with a reference clock (Ref Clock).
At intervals of a cycle, the master sends a synchronization datagram, in which the Clock Master writes the current reference time (Ref Time) to the reference clock.
All subsequent Slaves read this value and the EtherCAT slave controller ASC calculates the time from the reference time (Ref Time) and the DC time from the execution time (Offset) calculated by the controller.
Its DC distributed clock is continuously synchronized with each subsequent synchronous datagram, and cyclical synchronous processing can be performed via the DC (e.g., multiple axes can be operated in a cyclical synchronous manner).
The transmission and processing of cyclical process data is controlled by the Sync Manager.
The transmission and processing of cyclical process data is specified in the synchronization, which is controlled by the DC (Distributed Clocks DC).
CMMT supports the following synchronization modes
- Free run (no synchronization)
- Process data (sync to SM2 event)
- Sync (sync with DC Sync 0 event)
Process data communication
Process data communication involves the cyclic exchange of process data (e.g., settings and current values) between the CMMT and the Controller and others.
Each time a process data frame is executed, process data output is read from the frame and process data input is written to the frame.
In the CMMT, the controller is Mapped to Sync Managers 2 and 3 for process data communication. The largest RxPDO/TxPDO then contains 16 output/input objects (Sub: 0x01 …) each with 64 bytes of user data. … .0x10) with 64 bytes of user data each can be allocated.
It is important to note that process data communication will start with the “Safe Operational” status; the CMMT will send TxPDOs to the controller from this status.” After reaching “Operational” status, the RxPDOs are processed and executed by the CMMT; CMMT synchronization is controlled by the DC (Distributed Clocks).
This is the Mapping for RxPDO01.
This is the Mapping for TxPDO01.
This is the Mapping for TxPDO03.
Download ESI File
Download the ESI File for CMMT-ST from Festo’s website.
On the Festo side, Automation Suite is used to set limits, etc.
Open Axis>Monitoring Function.
Limit Velocity allows you to change Servo’s Max Speed value.
Open Axis1>Axis and make settings related to Drive position limits, etc.
The parameters such as Velocity Lower/Higher limit and homing method can be changed during the process.
Install ESI File
When the file downloaded from Festo HP is extracted, an XML file is stored.
Store this XML File in the following Path.
Create New Project
Start TwinCAT and create a new project at File>New>Project.
Select TwinCAT XAE Project >OK to proceed.
Done!A new TwinCAT project has been added.
Add EtherCAT Master
To add an EtherCAT Master to the TwinCAT Master, go to I/O>Device>Add New Item.
Select EtherCAT>EtherCAT Master>Ok.
Done!EtherCAT Master has been added.
Double-click EtherCAT Master to open the Adapter tab.
From this tab, click the Search button to search for a Network Adapter that IPC can support.
Set up the Network Adapter that you want to run as EtherCAT Master in it.
Update ESI File
Click on TwinCAT>EtherCAT Devices>Reload Device Descriptions to update the ESI File you have just imported into the TwinCAT System.
Add Festo CMMT-ST to the EtherCAT Network: right-click on EtherCAT Master>Add New Item.
Choose Festo>CMMT>CMMT-ST and proceed with Ok.
A popup will appear asking if you want to automatically add an NC Axis from TwinCAT? popup appears, select NC-Configuration and proceed with Ok.
Done!CMMT-ST Drive and NC axes have also been added.
CMMT-ST’s has DC Synchronization Enabled by Default, but let’s check again just to be sure: click on CMMT-ST, open the DC Tab, and see if the Operation Mode is set to DC For Synchronization.
Clicking on “Advanced Settings” will take you to detailed settings for DC synchronization, but we will leave it at “Default” for now.
Add PLC Item
Next, to add a PLC to the project, go to PLC>Right Click>Add New Item.
Select Standard PLC Project and proceed with Add.
To add a Global Variables List, add Add>Global Variable List.
Enter the Global Variables List name and press Ok to proceed.
Define the following variables in the GVL
iMsiMode AT %I*:SINT;
qMsiMode AT %Q*:SINT:=8;
To use AXIS_REF, you must add a library.
To use AXIS_REF, you must add a library.
Compile the project once with Build>Build Solution.
Change the Mapping of the Drive on the Festo CMMT-ST.
Right click on CMMT-ST>Inputs>Modes of operation display>Change Link.
Let’s tie it to the GVL.iMsiMode defined earlier in GVL.
Outputs>Mode of operation is also right-click>Change Link.
Let’s Link it to the GVL.qMsiMode defined earlier in GVL.
The last one is Program, which reads the current state, speed, and position of Festo’s CMMT-ST, and also issues commands such as Servo ON, Jog Operation, etc.
//Read the ActualPosition of Axis
IF mc_ReadActualPosition.Error THEN
//Read the ActualVelocity of Axis
IF MC_ReadActualVelocity.Error THEN
//Read the Status of Axis
IF mc_Power.Error THEN
IF mc_reset.Busy OR mc_reset.Busy THEN
IF mc_halt.Busy OR mc_halt.Error THEN
AND NOT MC_Jog_Forward
AND NOT MC_Jog_Backword
IF mc_home.Busy OR mc_home.Error THEN
AND NOT MC_Status.HasJob
IF MC_MoveAbsolute.Busy OR MC_MoveAbsolute.Error THEN
AND NOT MC_Status.HasJob
IF MC_MoveRelative.Busy OR MC_MoveRelative.Error THEN
The last step is to change the parameters of the NC axes. Here some parameters must be matched with those set in Festo Automation Suite.
The first thing that must be matched with Festo’s Drive is the Enc setting.
Parameters has a parameter called Scaling Factor Numbertor.
Go to Festo Automation Sutie>Field bus and set it according to the setting of the Position item.In the figure below, the value is -6, so it is 0.000001.
The next step is to configure the Axis itself.
Reference Velocity, etc., should also match the actual motor data.
Link to PLC
Open Axes>Axis1 to connect Axis to AXIS_REF in TwinCAT.
Click the Link to PLC button on the Parameters Tab.
Tie it to the AXIS_REF defined in GVL.
Download Hardware Configuration to Runtime.
Proceed with Ok.
Finally, download the program to Runtime.
MC_Power to turn on the Drive
This video shows the operation to Power On Festo’s Servo Drive from TwinCAT3.
MC_Reset to reset the Drive
This video shows the operation to reset Festo’s Servo Drive from TwinCAT3.
This video shows the relative positioning of Festo’s Servo Drive from TwinCAT3.
This video shows the absolute positioning operation of Festo’s Servo Drive from TwinCAT3.
This video shows the JOG operation of Festo’s Servo Drive from TwinCAT3.
Download the project from this link.