Setup JVL Stepper Motor and run motion with custom library
| Version Number | Description |
|---|---|
| 1.0 | Initial version |
1. Supported Components
| Component Name | Version |
|---|---|
| iC92xx series | ≥ 2024.3 |
| iCube Engineer | ≥ 2024.3 |
| JVL-MIS173xx | ≥ V3.54.10298 |
|
|
|
2. Solution details
- Start a new project
- Make sure the project contains the following libraries
- Y_JVL_Toolbox_v01
- Add the Drive to the project
-
Download the ESI file from JVL.dk
Ethernet configuration files and Examples / DEMO programs (jvl.dk)
-
Import the ESI file for the Drive that will be used.
- Go to iCube Engineer File --> Import --> Import ESI File(s)...
-
Load the downloaded ESI file from the previous step.
-
Select the Drive model that should be added to the project.
- The following banner will appear when the file is imported successfully.
- In the Plant add the Drive to the EtherCAT network.
- Select the correct Drive from the Network in the COMPONENTS Area
- Or the EtherCAT bus scan can be used to add the Drive to the project
-
Go to the PDO Tab of the motor
-
Add PDO Data Objects (make sure to select the correct datatype)
- For this example add at least the following objects:
- Modes of operation (SINT)
- Profile velocity (UDINT)
- Profile acceleration (UDINT)
-
More objects could be added for better monitoring options:
- Operation mode display (SINT)
- Velocity actual value (DINT)
- Torque actual value (INT)
- Error code (UINT)
- ...
How to add the objects to the TxPDO and RxPDO:
Click on Input Index 0x1A00 (TxDPO1) and then on "Edit the selected row":
Click on 'PDO Entry' tab:
0x6061: Operation Mode display
Sorting in 'General' tab and up/down buttons
- PDO Items are available for the Drive by double-clicking on the Drive in the Plant and going to the Data List tab.
- Create a variable of type "JVL_MIS17x_CiA402_Struct" in the PLC data list.
- Link the Process data items to the Structure.
- Initialize the following data in the "JVL_MIS17x_CiA402_Struct" structure in the PLC Variable list or in an Init Task.
-
g_JVL_AxisStruct.AxisCtrl.StationAddress --> Initializes the station address of the axis. The station address is defined in the settings tab under the EtherCAT node.
- g_JVL_AxisStruct.DriveConversion.FeedConstant --> Defines the user units per motor shaft revolution
-
g_JVL_AxisStruct.DriveConversion.PosScale --> The position scale is defined as Encoder Resolution divided by the Feed Constant, in this example the Resolution of the Encoder of this Motor model is 409600 pulses per revolution. Please edit this entry according to the Motor model used.
-
g_JVL_AxisStruct.DriveConversion.VelScale --> The velocity scale is used to convert the units of the feedback velocity (0x606C) [rpm] in user units per second.
- Implement the Driver Function Block. This FB is necessary in order to move the axis.
- JVL_Driver
- When the "Valid" output is equal to TRUE, the FBs below can be used.
- Run Motion
- The following function blocks can now be used in a motion program.
- JVL_ReadStatusWord
- JVL_ReadActualTorque
- JVL_ReadActualVelocity
- JVL_ReadActualPosition
- JVL_Reset
- JVL_Power
- JVL_MoveAbsolute
- JVL_MoveRelative
- JVL_Stop
- Currently it is not possible to Execute one function block when a previous movement is still ongoing. The function blocks have to be executed when the absolute or relative move has been finished.
|
ErrorID |
Name |
Description |
FB |
|
1 |
StationAddressErrorID |
Station Address cannot be zero |
Driver |
|
2 |
FeedConstantErrorID |
FeedConstant cannot be zero |
Driver |
|
3 |
AddToIdFBErrorID |
Y_EC_AddressToId Function Block has an Error |
Driver |
|
11 |
BusError |
EtherCAT bus is not in operational state, or the Driver FB is not enabled. |
|
|
21 |
OpModeErrorID |
Wrong operation mode. The operation mode in the Status word must be = 1 |
MoveAbsolute, MoveRelative |
|
22 |
VelocityErrorID |
The velocity input must be greater than zero |
MoveAbsolute, MoveRelative |
|
23 |
AccErrorID |
The Acceleration input must be greater than zero |
MoveAbsolute, MoveRelative |
|
24 |
PowerErrorID |
The Axis is not switched on |
MoveAbsolute, MoveRelative |
|
25 |
DecErrorID |
Not supported |
Stop |
|
31 |
DistanceErrorID |
The distance input must not be zero |
MoveRelative |
|
41 |
PosScaleErrorErrorID |
Position Scale cannot be zero |
ReadActualPosition |
|
51 |
VelScaleErrorErrorID |
Velocity Scale cannot be zero |
ReadActualVelocity |