SoftMotion_KeyVisual.jpg

CODESYS Softmotion - How to configure ctrlX CORE and Drives

PLC2030
Long-established Member
Introduction

This article describes the installation and the basic settings to run Codesys Softmotion on ctrlX CORE with two IndraDrive axis.
The article describes the proceeding with crlX CORE 01V16, but CODESYS Softmotion works with ctrlX CORE 01V12 and 01V14 as well.
Additional information is avaialble in the following documents:

Also some help videos are available:

In case of questions or if you experience any problem you can submit your issue in the Area for CODESYS PLC Add-Ons in the Developer Community.

Installation

The following ctrlX CORE apps are required by CODESYS Softmotion:

  • ctrlX PLC
  • EtherCAT Master

For engineering purpose a PC with ctrlX WORKS installation is required. All ctrlX software components need to have version 01V12 or higher.
CODESYS Softmotion and the adaption layer to run CODESYS Softmotion on ctrlX CORE are provided as CODESYS packages in the Collaboration Room.

⚠️ The installation of CODESYS packages requires administrator rights on your Windows PC.

CODESYS Softmotion Installation

The package extraction takes a while. Afterwards you have to confirm the CODESYS license agreement, choose the typical setup and step through the following dialogs with the next button. Close the last dialog with the finish button and close the PLC engineering application. You have to allow the installation process to make changes on your computer. After some waiting time the installation window will open. 

image2022-3-18_10-51-9.png

If the Installation progress window does not popup, you will find it in the Windows task bar with the symbol image2022-3-18_10-50-32.png

Installation of ctrlX Softmotion Adaption Package

all the ctrlX PLC Engineering menu Tools->PackageManager. Click on the Install-Button in the appearing dialog and browse to the location where your download of the ctrlX Softmotion Adaption Package is saved. Select “Allow unsigned and self-signed packages and click ok.

image2022-3-18_10-52-41.png

Accept the license agreement and select typical installation in the next dialogs.

Configuration of IndraDrive Axis

The example is made with two IndraDrives. Ensure

  • that your drives are configured for EtherCAT SOE communication,
  • that the EtherCAT line is connected correctly and
  • that the power supply of the drives is on.

In this example both drives are rotary axis.

⚠️The modulo handling is completely handled by CODESYS Softmotion. Therefor the drives have to be configured without modulo handling and with the full 32 bit range for the increments. The parameter S-0-0278 must be set to its maximum value, namely 214748.3647. The value is the result of (2^31 - 1) / 10000. 

 

You can do this by ctrlX DRIVE Engineering. Click in the drive overview dialog on the box Axis mechanics / scaling and set the values like in the graphic below.

image2022-3-18_11-5-16.png

I/O Configuration

Connect with your web browser to ctrlX CORE, navigate to the EtherCAT menu and add an EtherCAT Master.

image2022-3-18_11-5-46.png

Go to the EtherCAT status page and switch the EtherCAT bus to the state "Init".

image2022-5-2_16-52-10.png

Start ctrlX I/O Engineering and define the name of your application and the destination folder on your engineering PC.

image2022-3-18_11-6-29.png

Ensure that your drives are configured for EtherCAT SOE communication, the EtherCAT line is connected correctly and the power supply of the drives is on. Then click with the right mouse button on the Ethercatmaster node to open the menu where you can select “Scan for Devices”.

image2022-3-18_11-10-1.png

In the scan result you will see the drives which are connected to your ctrlX CORE. Press the button “Insert all newly scanned devices” in the scan result dialog to copy the drives to your project I/O configuration on the left side of the dialog.

image2022-3-18_11-10-41.png

Closing the scan dialog with ok will add the drives under the ethercatmaster node in IO Engineering. Download the EtherCAT configuration to your ctrlX CORE via the I/O Engineering menu entry Online => “Transfer fieldbus configuration”.  The successful download is confirmed in the message window of IO Engineering. Finally save the I/O Engineering project and close IO Engineering.

In ctrlX Web UI you can verify the EtherCAT status and change the operation modes. For further proceeding the operation mode OP has to be active. If the drives are not displayed in the slaves list, refresh the web page.

image2022-3-18_11-15-16.png

PLC Engineering

tart PLC Engineering from ctrlX CORE Web UI.

Click with the right mouse button on the device tree entry “YourDeviceName (ctrlX CORE)” and “Enable Softmotion” in the popup menu. This will add the “Softmotion General Axis Pool” to the device tree.

Open the menu Project=>Project Settings=>Softmotion and check whether the Softmotion version is set correct.

Open the DataLayer_Realtime configuration by the right mouse click menu "Edit/Online from ctrlX CORE..." of the node.
The real-time data import dialog will open. Select the Source "ethercat_master_instances_ethercat", press the import button and close the dialog.

image2022-5-2_17-40-34.png

The following nodes will be added to your device tree:

image2022-5-2_18-0-24.png

For each drive you have to add a Softmotion EtherCAT SoE axis by opening the right mouse menu.

image2022-3-18_11-17-20.png

Rename both Softmotion axis to the name which you like to see in your PLC program (e.g. axis_1 and axis_2). You can do this via the Properties dialog which you reach via the right mouse menu of the axis nodes. Confirm that you want to adapt all references in the project.

image2022-3-18_11-17-46.png

image2022-3-18_11-18-7.png

For both IndraDrive Datalayer nodes you have to check the configuration the I/O mapping. You can do this by double-clicking on the IndraDrive real time data layer node and go then to the tab page DataLayerNode I/O Mapping. The mode should be “Always update variables” and “Use parent device setting” .

2022-05-04_14h28_51.png

Additionally you have to check the setting of the bus cycle task. Double-click on the drive node. Go to the tab page “SM_Drive_EtherCAT_SoE_Standard: I/O Mapping” and set the Bus cycle task to “Use parent bus cycle setting”.

2022-05-04_16h28_02.png

Your Main task shall be triggered by an external event which is synchronized with the EtherCAT communication. Open the Main Task property dialog by double-click and set the following properties:

  • Priority : 20
  • Type: External
  • External Event: TASK_EXTERNAL_EVENT_07
  • Enable watchdog
  • Set watchdog time to 2 msec

image2022-5-2_18-8-58.png

Configure ctrlX Scheduler

Until ctrlX 01V14 the event TASK_EXTERNAL_EVENT_07 for triggering the PLC Main task is created automatically by default.

Since ctrlX 01V16 the setup of the event is user-defined. Open the the dialog Settings->Scheduler in the ctrlX web UI and execute the following steps

  • Set the control state to Service by using the switch at the top of the page
  • Add a new callable to the task ctrXAutomation by clicking on the "+" symbol in the related line.

PLC2030_0-1660047047836.png

Make the follwing settings in the Add callable dialog

  • Set the type of the callable to plc-external-event.
  • Set the run index to 5000 (you should enter a run index which is higher than the run index of the EtherCAT master callable to ensure that the PLC task is executed after the EtherCAT communication).
  • Delete in the Arguments field all arguments other than TASK_EXTERNAL_EVENT_007 (you have to configure the same event as configured for the PLC task in PLC Engineering previously).

PLC2030_1-1660047078658.png

Write your PLC Motion Program

Now you can create your PLC motion program using the PLCopen motion function blocks.

Must Read

Trending

Icon--AD-black-48x48Icon--address-consumer-data-black-48x48Icon--appointment-black-48x48Icon--back-left-black-48x48Icon--calendar-black-48x48Icon--center-alignedIcon--Checkbox-checkIcon--clock-black-48x48Icon--close-black-48x48Icon--compare-black-48x48Icon--confirmation-black-48x48Icon--dealer-details-black-48x48Icon--delete-black-48x48Icon--delivery-black-48x48Icon--down-black-48x48Icon--download-black-48x48Ic-OverlayAlertIcon--externallink-black-48x48Icon-Filledforward-right_adjustedIcon--grid-view-black-48x48IC_gd_Check-Circle170821_Icons_Community170823_Bosch_Icons170823_Bosch_Icons170821_Icons_CommunityIC-logout170821_Icons_Community170825_Bosch_Icons170821_Icons_CommunityIC-shopping-cart2170821_Icons_CommunityIC-upIC_UserIcon--imageIcon--info-i-black-48x48Icon--left-alignedIcon--Less-minimize-black-48x48Icon-FilledIcon--List-Check-grennIcon--List-Check-blackIcon--List-Cross-blackIcon--list-view-mobile-black-48x48Icon--list-view-black-48x48Icon--More-Maximize-black-48x48Icon--my-product-black-48x48Icon--newsletter-black-48x48Icon--payment-black-48x48Icon--print-black-48x48Icon--promotion-black-48x48Icon--registration-black-48x48Icon--Reset-black-48x48Icon--right-alignedshare-circle1Icon--share-black-48x48Icon--shopping-bag-black-48x48Icon-shopping-cartIcon--start-play-black-48x48Icon--store-locator-black-48x48Ic-OverlayAlertIcon--summary-black-48x48tumblrIcon-FilledvineIc-OverlayAlertwhishlist