﻿<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<!--Position Control for Kinetix300 Drives-->
<RSLogix5000Content SchemaRevision="1.0" SoftwareRevision="18.01" TargetName="Axis_K300_MI_PositionControl" TargetType="AddOnInstructionDefinition" TargetRevision="1.0 " TargetLastEdited="2010-09-01T21:58:31.905Z" ContainsContext="true" Owner="Rockwell Automation, Rockwell Automation" ExportDate="Tue Sep 28 09:04:59 2010" ExportOptions="References DecoratedData Context Dependencies AllProjDocTrans">
<Controller Use="Context" Name="Kinetix300_EtherNetIP">
<DataTypes Use="Context">
</DataTypes>
<AddOnInstructionDefinitions Use="Context">
<AddOnInstructionDefinition Name="Axis_K300_MI_StateObject" Revision="17.2" Vendor="Rockwell Automation" ExecutePrescan="true" ExecutePostscan="false" ExecuteEnableInFalse="true" CreatedDate="2009-11-06T21:24:07.981Z" CreatedBy="NA\BMcMulle" EditedDate="2010-08-18T01:44:41.556Z" EditedBy="GOTC\MAC" SoftwareRevision="v17.00"
>
<RevisionNote>
<![CDATA[17.2 - Anomoly fix for *.O.DriveEN lockup when drive is lcoally disabled
17.1 - Help file updates
17.0 - Name change to reflect operation type MI (motion instruction), Major rev changed to reflect minimum Major rev of RSLogix required for operation
3.0 - ******BETA*******
1.0 - Alpha



]]>
</RevisionNote>
<AdditionalHelpText>
<![CDATA[------------------------------------------------------------------------------
Instruction
------------------------------------------------------------------------------
Overview:

The Kinetix 300 Motion Instruction State Object
is used to encapsulate the logic required to enable, 
disable, ans perform fault reset on the Kinetix 300 drive.
Additionally, basic status is added to monitor hardware enable
input status, drive fault status, drive enabled / disbled status and 
drive ready for motion status.

------------------------------------------------------------------------------

=====================================================================================


=====================================================================================
General Information - Parameter Prefixing:

Inp_
-----
Input:
Generally used to designate a connection to a real I/O input point or an upstream block.

Set_
-----
Setpoint:
Used as a setpoint coming into the instruction. May come from th
operator via the HMI, or from the controller program itself.

Cmd_
-----	
Command:
Generally used to as a command input either from
the operator via the HMI or from the program.

Cfg_
-----
Configuration:
Generally used to designate a configuration value.
Typically, but not always, something that is only changed irregularly.

Par_
-----
Parameter:
Equipment parameter or input parameter from Batching systems.  Generally used to
designate a value that receives changes on a regular basis.

Wrk_
-----
Working Register:
In many cases the control routine will require some internal working storage locations.
This is targeted at the control routine that lies inside a normal UDT. 
In the case of AOI’s, these registers can simply become “Local Tags”.

Out_
-----
Output:
Generally used to designate a connection to a real 
I/O output point or a downstream block.

Val_
-----
Value:
Designates a value calculated inside the instruction, which 
may or may not be the primary output of the instruction.

Rpt_
-----
Report:
Designates a value calculated inside the instruction 
that is typically used for batch reporting.

Sts_
-----
Status:
Status of the instruction.  Also contains two required members.
	Ex.
	Sts_Alarm  -  An alarm exists. (Boolean)

	Sts_ER -  The instruction itself has an error. 	(Boolean)

Alm_
-----
Alarm:
Alarm indicators to display which actual alarm is occurring.  All of these are Booleans.

Rdy_
-----
Ready:
Command ready bits.  Booleans determined inside the control routines 
to reflect whether the routine will allow state change commands.  
Used with the HMI faceplates to enable or disable command buttons.

=====================================================================================]]>
</AdditionalHelpText>
<Parameters>
<Parameter Name="EnableIn" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="false" ExternalAccess="Read Only">
<Description>
<![CDATA[Enable Input - System Defined Parameter]]>
</Description>
</Parameter>
<Parameter Name="EnableOut" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="false" ExternalAccess="Read Only">
<Description>
<![CDATA[Enable Output - System Defined Parameter]]>
</Description>
</Parameter>
<Parameter Name="Ref_K300_I" TagType="Base" DataType="AB:K300:I:0" Usage="InOut" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Kinetix 300 Input Assembly]]>
</Description>
</Parameter>
<Parameter Name="Ref_K300_O" TagType="Base" DataType="AB:K300:O:0" Usage="InOut" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Kinetix 300 Output Assembly]]>
</Description>
</Parameter>
<Parameter Name="Cmd_Enable" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="true" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Drive Enable Command]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cmd_Disable" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="true" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Drive Disable Command]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cmd_ClearFaults" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="true" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Drive Clear Faults (Fault Reset) Command]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_EN" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Instruction is being scanned]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveHardwareEnableInput" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive Hardware Enable Input is active]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveFaulted" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is currently in a faulted state]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveDisabled" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is currently in a disabled state]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveEnabled" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is currently in a enabled state]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveReadyForMotion" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is ready for motion commands]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
</Parameters>
<LocalTags>
<LocalTag Name="Wrk_ClearON" DataType="TIMER" ExternalAccess="Read/Write">
<DefaultData>00 00 00 00 FA 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Structure DataType="TIMER">
<DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="250"/>
<DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="TT" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
</Structure>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_ClearOFF" DataType="TIMER" ExternalAccess="Read/Write">
<DefaultData>00 00 00 00 FA 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Structure DataType="TIMER">
<DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="250"/>
<DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="TT" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
</Structure>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_SealClear" DataType="BOOL" Radix="Decimal" ExternalAccess="Read/Write">
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_DriveEnableTimeout" DataType="TIMER" ExternalAccess="Read/Write">
<DefaultData>00 00 00 00 00 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Structure DataType="TIMER">
<DataValueMember Name="PRE" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="ACC" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="TT" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
</Structure>
</DefaultData>
</LocalTag>
</LocalTags>
<Routines>
<Routine Name="EnableInFalse" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Text>
<![CDATA[OTU(Sts_EN)OTU(Sts_DriveDisabled)OTU(Sts_DriveEnabled)OTU(Sts_DriveFaulted)OTU(Sts_DriveHardwareEnableInput)OTU(Sts_DriveReadyForMotion);]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Text>
<![CDATA[OTU(Ref_K300_O.DriveEn)OTU(Ref_K300_O.StartMotion)OTU(Ref_K300_O.StartHoming)OTU(Ref_K300_O.DefineHome);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
<Routine Name="Logic" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Text>
<![CDATA[XIO(Sts_EN)MOV(250,Wrk_ClearON.PRE)MOV(250,Wrk_ClearOFF.PRE);]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Text>
<![CDATA[OTE(Sts_EN);]]>
</Text>
</Rung>
<Rung Number="2" Type="N">
<Text>
<![CDATA[XIC(Cmd_Enable)XIC(Sts_DriveHardwareEnableInput)XIO(Ref_K300_I.PhysicalAxisFault)EQU(Ref_K300_I.Fault,0)XIO(Ref_K300_I.DriveEn)XIO(Ref_K300_I.PowerStructureEn)OTL(Ref_K300_O.DriveEn);]]>
</Text>
</Rung>
<Rung Number="3" Type="N">
<Text>
<![CDATA[XIC(Cmd_Disable)[XIC(Ref_K300_I.DriveEn) ,XIC(Ref_K300_I.PowerStructureEn) ]OTU(Ref_K300_O.DriveEn);]]>
</Text>
</Rung>
<Rung Number="4" Type="N">
<Text>
<![CDATA[XIC(Ref_K300_O.DriveEn)MOV(256,Wrk_DriveEnableTimeout.PRE)TON(Wrk_DriveEnableTimeout,?,?)XIC(Wrk_DriveEnableTimeout.DN)XIO(Ref_K300_I.DriveEn)XIO(Ref_K300_I.PowerStructureEn)OTU(Ref_K300_O.DriveEn);]]>
</Text>
</Rung>
<Rung Number="5" Type="N">
<Text>
<![CDATA[XIC(Cmd_ClearFaults)[XIC(Ref_K300_I.PhysicalAxisFault) ,XIC(Wrk_SealClear) ][XIO(Wrk_ClearOFF.DN) TON(Wrk_ClearON,?,?) XIC(Wrk_ClearON.DN) TON(Wrk_ClearOFF,?,?) ,XIC(Wrk_ClearON.TT) OTL(Ref_K300_O.DriveEn) OTL(Wrk_SealClear) ,XIC(Wrk_ClearOFF.TT) OTU(Ref_K300_O.DriveEn) OTU(Wrk_SealClear) ];]]>
</Text>
</Rung>
<Rung Number="6" Type="N">
<Text>
<![CDATA[[XIO(Ref_K300_I.DriveEn) ,XIC(Ref_K300_I.PhysicalAxisFault) ]OTE(Sts_DriveDisabled);]]>
</Text>
</Rung>
<Rung Number="7" Type="N">
<Text>
<![CDATA[XIC(Ref_K300_I.DigitalInputA3Status)OTE(Sts_DriveHardwareEnableInput);]]>
</Text>
</Rung>
<Rung Number="8" Type="N">
<Text>
<![CDATA[XIC(Ref_K300_I.DriveEn)OTE(Sts_DriveEnabled);]]>
</Text>
</Rung>
<Rung Number="9" Type="N">
<Text>
<![CDATA[XIC(Ref_K300_I.PowerStructureEn)OTE(Sts_DriveReadyForMotion);]]>
</Text>
</Rung>
<Rung Number="10" Type="N">
<Text>
<![CDATA[[NEQ(Ref_K300_I.Fault,0) ,XIC(Ref_K300_I.PhysicalAxisFault) ]OTE(Sts_DriveFaulted);]]>
</Text>
</Rung>
<Rung Number="11" Type="N">
<Text>
<![CDATA[NOP();]]>
</Text>
</Rung>
</RLLContent>
</Routine>
<Routine Name="Prescan" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Text>
<![CDATA[OTU(Sts_EN)OTU(Sts_DriveDisabled)OTU(Sts_DriveEnabled)OTU(Sts_DriveFaulted)OTU(Sts_DriveHardwareEnableInput)OTU(Sts_DriveReadyForMotion);]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Text>
<![CDATA[OTU(Ref_K300_O.DriveEn)OTU(Ref_K300_O.StartMotion)OTU(Ref_K300_O.StartHoming)OTU(Ref_K300_O.DefineHome);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
</Routines>
</AddOnInstructionDefinition>
<AddOnInstructionDefinition Use="Target" Name="Axis_K300_MI_PositionControl" Revision="1.0" ExecutePrescan="false" ExecutePostscan="false" ExecuteEnableInFalse="true" CreatedDate="2010-07-09T21:16:37.956Z" CreatedBy="NA\AMDasilv" EditedDate="2010-09-01T21:58:31.905Z" EditedBy="NA\AMDasilv" SoftwareRevision="v18.00"
>
<Description>
<![CDATA[Position Control for Kinetix300 Drives]]>
</Description>
<RevisionNote>
<![CDATA[R1.0 - original version]]>
</RevisionNote>
<AdditionalHelpText>
<![CDATA[The “Axis_K300_MI_PositionControl” Add-On Instruction (AOI) is used for position control of a Kinetix300 drive where the position loop is closed in this AOI while the drive is configured to velocity mode. The position reference to the AOI is the position command of a virtual axis that can be used with any motion instruction. Thus, the Kinetix300 set in this AOI will follow the position command of a virtual axis that can be set to caming, linear moves, jogging, gearing or coordinated motion. Thus, any motion instruction including MAPC, MATC, MAM, MAJ, MAG, MCLM, and MCCM used to control the virtual axis will consequently control the Kinetix300 drive. 

PARAMETER DEFINITIONS

>> Ref_VirtualAxis

The virtual axis that is commanded to the motion profiles that the Kinetix300 drive needs to follow is set in Ref_VIrtualAxis. The AOI uses the CommandPosition of the virtual axis as the position reference. Thus, motion instructions such as MATC, MAPC, MAM, MAJ, MAG, MCLM, and MCCM can be used to generate the position reference to the Kinetix300 drive. 

>> Ref_K300_I

The input assembly of the Kinetix300 drive is set in Ref_K300_I.

>> Ref_K300_O

The output assembly of the Kinetix300 drive is set in Ref_K300_O.

>> Cfg_MaxMotorSpeed

The maximum motor speed in user units is set in Cfg_MaxMotorSpeed. If the speed required by a certain profile is higher than the value defined in Cfg_MaxMotorSpeed, the actual velocity is trimmed at the value of this parameter.

>> Cfg_PosLoop_Kp

The proportional gain of the position loop is set in the Cfg_PosLoop_Kp parameter.

>> Cfg_PosLoop_Ki

The integral gain of the position loop is set in the Cfg_PosLoop_Ki parameter.

>> Cfg_Vel_FF

The velocity feedforward gain is set in the Cfg_Vel_FF parameter. This parameter is usually between 0 and 1, where 1 represents 100% velocity feedforward. This parameter is usually used to reduce position error.

>> Cmd_Enable_Drive

The drive is commanded to enable by setting Cmd_Enable_Drive to 1. This parameter is automatically set back to zero after enabling the drive. If the drive is faulted, the Cmd_Enable_Drive will reset the fault and enable the drive.

>> Cmd_Disable_Drive

The drive is commanded to disable by setting Cmd_Disable_Drive to 1. This parameter is automatically set back to zero after disabling the drive. 

>> Cmd_Clear_Drive_Fault

The drive is commanded to reset a fault by setting Cmd_Clear_Drive_Fault to 1. This parameter is automatically set back to zero after resetting a drive fault. 

>> Cmd_Auto_Tune_PosLoop

The position loop in the controller can be automatically tuned by setting the Cmd_Auto_Tune_PosLoop to 1, which will calculate the Cfg_PosLoop_Kp and the Cfg_PosLoop_Ki parameters based on the gains of the velocity loop in the drive and the damping factor set in Inp_PosLoop_DampingFactor. The velocity loop in the drive needs to be tuned via MotionView or message instructions before performing the auto-tune of the position loop in the AOI.

>> Inp_PosLoop_DampingFactor

The damping factor of the position loop is defined in Inp_PosLoop_DampingFactor. This parameter is usually defined between 0.8 and 1.6 although a wider window can be used. As the value of this parameter increases, the resulting Kp and Ki for position loop reduce by a factor of the square of the damping factor. This damping factor has effect only during the auto-tuning process started by the Cmd_Auto_Tune_PosLoop.

>> Msg_VelLoop_Kp

The proportional gain of the velocity loop residing in the drive is obtained via message instruction which is set in Msg_VelLoop_Kp. The configuration of this message instruction is as follows:
	Message Type: CIP Generic
	Service Type: Get Attribute Single
	Instance: 44
	Class: 374
	Attribute: 3
	Destination: AOITagName.Inp_VelLoop_Scale

Set the Communication tab of the Message Configuration window to the Kinetix300 drive controlled by the AOI.

>> Msg_VelLoop_GainScaling

The gain scaling of the velocity loop residing in the drive is obtained via message instruction which is set in Msg_VelLoop_Kp. The configuration of this message instruction is as follows:
	Message Type: CIP Generic
	Service Type: Get Attribute Single
	Instance: 51
	Class: 374
	Attribute: 1
	Destination: AOITagName.Inp_VelLoop_Scale

Set the Communication tab of the Message Configuration window to the Kinetix300 drive controlled by the AOI.

>> Msg_EncoderPPR

The encoder resolution is obtained via message instruction which is set in Msg_EncoderPPR. The configuration of this message instruction is as follows:
	Message Type: CIP Generic
	Service Type: Get Attribute Single
	Instance: 26
	Class: 374
	Attribute: 3
	Destination: AOITagName. Inp_EncoderPPR

Set the Communication tab of the Message Configuration window to the Kinetix300 drive controlled by the AOI.


PARAMETER DEFINITION OF STATUS BITS


>> Sts_EN

The Enable bit is set while the rung is on.

>> Sts_ER

The Error bit is set when the AOI fails to enable the drive or if the Damping Factor is zero during auto-tune.

>> Sts_DriveFaulted

The Drive Faulted bit is set when any fault occur with the drive. The fault code is displayed on the drive. 

>> Sts_AutoTuneFault

The Auto Tune Fault bit is set when the message instruction used to read the proportional gain and the gain scaling factor of the velocity loop in the drive fails.

>> Sts_DriveDisabled

The Drive Disable bit is set when the drive is in the disabled state.

>> Sts_DriveEnabled

The Drive Enabled bit is set when the drive is in the enabled state.

>> Sts_DriveHardwareEnableInput

The Drive Hardware Enable Input is set when the drive enable switch wired to the Digital Input A3 (I/O Connector - IOD - Pin 29) is on.]]>
</AdditionalHelpText>
<Parameters>
<Parameter Name="EnableIn" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="false" ExternalAccess="Read Only">
<Description>
<![CDATA[Enable Input - System Defined Parameter]]>
</Description>
</Parameter>
<Parameter Name="EnableOut" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="false" ExternalAccess="Read Only">
<Description>
<![CDATA[Enable Output - System Defined Parameter]]>
</Description>
</Parameter>
<Parameter Name="Ref_VirtualAxis" TagType="Base" DataType="AXIS_VIRTUAL" Usage="InOut" Required="true" Visible="true">
<Description>
<![CDATA[Virtual Axis that is commanded to the desired cam profile]]>
</Description>
</Parameter>
<Parameter Name="Ref_K300_I" TagType="Base" DataType="AB:K300:I:0" Usage="InOut" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Input parameters of the Kinetix300 drive]]>
</Description>
</Parameter>
<Parameter Name="Ref_K300_O" TagType="Base" DataType="AB:K300:O:0" Usage="InOut" Required="true" Visible="true" Constant="false">
<Description>
<![CDATA[Output parameters of the Kinetix300 drive]]>
</Description>
</Parameter>
<Parameter Name="Cfg_MaxMotorSpd" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Maximum motor speed in user units]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cfg_PosLoop_Kp" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Proportional Gain of Position Loop]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cfg_PosLoop_Ki" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Integral gain of Position Loop]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cfg_Vel_FF" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Feedforward Gain: 
0 ...1]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cmd_Enable_Drive" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Enable axis]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cmd_Disable_Drive" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Disable axis]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cmd_Clear_Drive_Fault" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Clear axis faults]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_EN" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[AOI is enabled]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_ER" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[An Error occured in the AOI]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveFaulted" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is in Faulted State]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_AutoTuneFault" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Auto-tune failed.]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveDisabled" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is in Disable State]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveEnabled" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Drive is in Enable State]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Sts_DriveHardwareEnableInput" TagType="Base" DataType="BOOL" Usage="Output" Radix="Decimal" Required="false" Visible="true" ExternalAccess="Read Only">
<Description>
<![CDATA[Digital Input for Drive Enable is ON]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Cmd_Auto_Tune_PosLoop" TagType="Base" DataType="BOOL" Usage="Input" Radix="Decimal" Required="false" Visible="true" ExternalAccess="None">
<Description>
<![CDATA[Initiate Auto-tune of position loop residing in the controller]]>
</Description>
<DefaultData>00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="BOOL" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Inp_PosLoop_DampingFactor" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="true" ExternalAccess="Read/Write">
<Description>
<![CDATA[Damping Factor for position loop used during auto-tune. Greater than zero.]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Msg_VelLoop_Kp" TagType="Base" DataType="MESSAGE" Usage="InOut" Required="true" Visible="true">
<Description>
<![CDATA[Read the proportional gain of the velocity loop during auto-tune.]]>
</Description>
</Parameter>
<Parameter Name="Msg_VelLoop_GainScaling" TagType="Base" DataType="MESSAGE" Usage="InOut" Required="true" Visible="true">
<Description>
<![CDATA[Read the Gain Scaling of the velocity loop during auto-tune.]]>
</Description>
</Parameter>
<Parameter Name="Inp_Pvel_Gain" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="false" ExternalAccess="None">
<Description>
<![CDATA[Proportional Gain of velocity loop residing in the drive. Value read during auto-tune.]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
<Parameter Name="Inp_VelLoop_Scale" TagType="Base" DataType="DINT" Usage="Input" Radix="Decimal" Required="false" Visible="false" ExternalAccess="None">
<Description>
<![CDATA[Gain Scaling of velocity loop residing in the drive. Value read during auto-tune.]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</Parameter>
<Parameter Name="Msg_EncoderPPR" TagType="Base" DataType="MESSAGE" Usage="InOut" Required="true" Visible="true">
<Description>
<![CDATA[Read the encoder resolution in pulses per revolution]]>
</Description>
</Parameter>
<Parameter Name="Inp_EncoderPPR" TagType="Base" DataType="REAL" Usage="Input" Radix="Float" Required="false" Visible="false" ExternalAccess="None">
<Description>
<![CDATA[Resolution of encoder in pulses per revolution]]>
</Description>
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</Parameter>
</Parameters>
<LocalTags>
<LocalTag Name="Wrk_A01_StateObject" DataType="Axis_K300_MI_StateObject" ExternalAccess="None">
<DefaultData>01 00 00 00 00 00 00 00 FA 00 00 00 00 00 00 00 
00 00 00 00 FA 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Structure DataType="Axis_K300_MI_StateObject">
<DataValueMember Name="EnableIn" DataType="BOOL" Value="1"/>
<DataValueMember Name="EnableOut" DataType="BOOL" Value="0"/>
<DataValueMember Name="Cmd_Enable" DataType="BOOL" Value="0"/>
<DataValueMember Name="Cmd_Disable" DataType="BOOL" Value="0"/>
<DataValueMember Name="Cmd_ClearFaults" DataType="BOOL" Value="0"/>
<DataValueMember Name="Sts_EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="Sts_DriveHardwareEnableInput" DataType="BOOL" Value="0"/>
<DataValueMember Name="Sts_DriveFaulted" DataType="BOOL" Value="0"/>
<DataValueMember Name="Sts_DriveDisabled" DataType="BOOL" Value="0"/>
<DataValueMember Name="Sts_DriveEnabled" DataType="BOOL" Value="0"/>
<DataValueMember Name="Sts_DriveReadyForMotion" DataType="BOOL" Value="0"/>
</Structure>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_Bits" DataType="DINT" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<Comments>
<Comment Operand=".5">
<![CDATA[Start move to match pos of virtual and physical axes]]>
</Comment>
<Comment Operand=".6">
<![CDATA[Pos of virtual and physical axes match]]>
</Comment>
</Comments>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cmd_Bits" DataType="DINT" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<Comments>
<Comment Operand=".0">
<![CDATA[Enable drive]]>
</Comment>
<Comment Operand=".1">
<![CDATA[Disable Drive]]>
</Comment>
<Comment Operand=".2">
<![CDATA[Clear drive]]>
</Comment>
<Comment Operand=".3">
<![CDATA[RPI update failure]]>
</Comment>
</Comments>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cfg_MovePosition" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cfg_MI" DataType="MOTION_INSTRUCTION" Dimensions="10" ExternalAccess="None">
<DefaultData>00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 
00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Array DataType="MOTION_INSTRUCTION" Dimensions="10">
<Element Index="[0]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[1]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[2]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[3]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[4]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[5]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[6]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[7]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[8]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
<Element Index="[9]">
<Structure DataType="MOTION_INSTRUCTION">
<DataValueMember Name="FLAGS" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EN" DataType="BOOL" Value="0"/>
<DataValueMember Name="DN" DataType="BOOL" Value="0"/>
<DataValueMember Name="ER" DataType="BOOL" Value="0"/>
<DataValueMember Name="PC" DataType="BOOL" Value="0"/>
<DataValueMember Name="IP" DataType="BOOL" Value="0"/>
<DataValueMember Name="AC" DataType="BOOL" Value="0"/>
<DataValueMember Name="ACCEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="DECEL" DataType="BOOL" Value="0"/>
<DataValueMember Name="ERR" DataType="INT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATUS" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="STATE" DataType="SINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="SEGMENT" DataType="DINT" Radix="Decimal" Value="0"/>
<DataValueMember Name="EXERR" DataType="SINT" Radix="Decimal" Value="0"/>
</Structure>
</Element>
</Array>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_PreviousIntegralCV" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cmd_CV" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cmd_Pos_1CUP_ago" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Sts_TaskScanTime" DataType="DINT" Dimensions="2" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Array DataType="DINT" Dimensions="2" Radix="Decimal">
<Element Index="[0]" Value="0"/>
<Element Index="[1]" Value="0"/>
</Array>
</DefaultData>
</LocalTag>
<LocalTag Name="Sts_TaskScanTimePrev" DataType="DINT" Dimensions="2" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00 00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<Array DataType="DINT" Dimensions="2" Radix="Decimal">
<Element Index="[0]" Value="0"/>
<Element Index="[1]" Value="0"/>
</Array>
</DefaultData>
</LocalTag>
<LocalTag Name="Sts_CUP_ms_Prev" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_ErrorCounts1" DataType="DINT" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_ProportialCV" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cfg_SSV_MsgType" DataType="DINT" Radix="Decimal" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Sts_BWVel" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cmd_Pos_dPdt" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Cmd_PosError" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Sts_CUP_ms" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_ErrorCounts0" DataType="DINT" Radix="Decimal" ExternalAccess="Read Only">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="DINT" Radix="Decimal" Value="0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_IntegralCV" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
<LocalTag Name="Wrk_K300_ActualPosPrevious" DataType="REAL" Radix="Float" ExternalAccess="None">
<DefaultData>00 00 00 00</DefaultData>
<DefaultData Format="Decorated">
<DataValue DataType="REAL" Radix="Float" Value="0.0"/>
</DefaultData>
</LocalTag>
</LocalTags>
<Routines>
<Routine Name="EnableInFalse" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Text>
<![CDATA[OTU(Sts_EN)OTU(Sts_ER)OTU(Cmd_Bits.0)OTU(Cmd_Bits.1)OTU(Cmd_Bits.2)OTU(Cmd_Enable_Drive)OTU(Cmd_Disable_Drive)OTU(Cmd_Clear_Drive_Fault)OTU(Sts_ER)OTU(Sts_AutoTuneFault);]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Text>
<![CDATA[OTU(Msg_VelLoop_Kp.ER)OTU(Msg_VelLoop_GainScaling.ER);]]>
</Text>
</Rung>
<Rung Number="2" Type="N">
<Text>
<![CDATA[MOV(0,Cmd_Bits)MOV(0,Wrk_Bits);]]>
</Text>
</Rung>
</RLLContent>
</Routine>
<Routine Name="Logic" Type="RLL">
<RLLContent>
<Rung Number="0" Type="N">
<Comment>
<![CDATA[=====================================================
AXIS_K300_MI_POSITONCONTROL ADD-ON INSTRUCTION
=====================================================
Rockwell Automation
August 2010]]>
</Comment>
<Text>
<![CDATA[AFI()NOP();]]>
</Text>
</Rung>
<Rung Number="1" Type="N">
<Comment>
<![CDATA[Initialize]]>
</Comment>
<Text>
<![CDATA[XIO(Sts_EN)MOV(0,Cmd_Pos_1CUP_ago)MOV(0,Cmd_Bits)MOV(0,Wrk_Bits)MOV(1,Ref_K300_O.ReferenceSource)OTU(Cmd_Bits.3);]]>
</Text>
</Rung>
<Rung Number="2" Type="N">
<Text>
<![CDATA[OTE(Sts_EN);]]>
</Text>
</Rung>
<Rung Number="3" Type="N">
<Text>
<![CDATA[[COP(Sts_TaskScanTime[0],Sts_TaskScanTimePrev[0],2) GSV(Task,THIS,StartTime,Sts_TaskScanTime[0]) SUB(Sts_TaskScanTime[0],Sts_TaskScanTimePrev[0],Sts_CUP_ms) DIV(Sts_CUP_ms,1000000,Sts_CUP_ms) ,[GRT(Sts_CUP_ms,0.04) ,LES(Sts_CUP_ms,0) ] MOV(Sts_CUP_ms_Prev,Sts_CUP_ms) ,[GRT(Sts_CUP_ms,0.04) ,LES(Sts_CUP_ms,0) ] MOV(0.04,Sts_CUP_ms) ,MOV(Sts_CUP_ms,Sts_CUP_ms_Prev) ];]]>
</Text>
</Rung>
<Rung Number="4" Type="N">
<Comment>
<![CDATA[ENABLE DRIVE]]>
</Comment>
<Text>
<![CDATA[[Axis_K300_MI_StateObject(Wrk_A01_StateObject,Ref_K300_I,Ref_K300_O,Cmd_Bits.0,Cmd_Bits.1,Cmd_Bits.2) ,XIC(Wrk_A01_StateObject.Sts_DriveEnabled) ONS(Wrk_Bits.3) OTU(Cmd_Bits.0) ,XIC(Wrk_A01_StateObject.Sts_DriveDisabled) ONS(Wrk_Bits.2) OTU(Cmd_Bits.1) OTU(Cmd_Disable_Drive) ,XIO(Wrk_A01_StateObject.Sts_DriveFaulted) ONS(Wrk_Bits.4) OTU(Cmd_Bits.2) OTU(Cmd_Clear_Drive_Fault) ];]]>
</Text>
</Rung>
<Rung Number="5" Type="N">
<Text>
<![CDATA[XIC(Cmd_Enable_Drive)ONS(Wrk_Bits.0)MOV(Ref_K300_I.ActualPosition,Cfg_MovePosition)OTL(Wrk_Bits.5)OTU(Cmd_Enable_Drive)OTU(Cmd_Bits.0)OTU(Wrk_Bits.6);]]>
</Text>
</Rung>
<Rung Number="6" Type="N">
<Text>
<![CDATA[XIC(Wrk_Bits.6)XIC(Wrk_Bits.5)OTL(Cmd_Clear_Drive_Fault)XIO(Wrk_A01_StateObject.Sts_DriveFaulted)ONS(Wrk_Bits.1)OTU(Wrk_Bits.5)OTU(Wrk_Bits.6)OTL(Cmd_Bits.0);]]>
</Text>
</Rung>
<Rung Number="7" Type="N">
<Text>
<![CDATA[XIC(Wrk_Bits.5)[SUB(Cfg_MovePosition,Ref_VirtualAxis.ActualPosition,Cfg_MovePosition) MRP(Ref_VirtualAxis,Cfg_MI[0],Relative,Actual,Cfg_MovePosition) ,[XIC(Cfg_MI[0].DN) ONS(Cmd_Bits.5) OTL(Wrk_Bits.6) ,[XIC(Cfg_MI[0].ER) ,XIC(Cfg_MI[2].ER) ] OTL(Sts_ER) ] ];]]>
</Text>
</Rung>
<Rung Number="8" Type="N">
<Comment>
<![CDATA[Disable Drives and Clear Faults]]>
</Comment>
<Text>
<![CDATA[XIC(Cmd_Disable_Drive)[XIO(Wrk_A01_StateObject.Sts_DriveDisabled) OTL(Cmd_Bits.1) ,XIC(Wrk_A01_StateObject.Sts_DriveDisabled) OTU(Cmd_Disable_Drive) ];]]>
</Text>
</Rung>
<Rung Number="9" Type="N">
<Text>
<![CDATA[XIC(Cmd_Clear_Drive_Fault)[XIC(Wrk_A01_StateObject.Sts_DriveFaulted) OTL(Cmd_Bits.2) ,XIO(Wrk_A01_StateObject.Sts_DriveFaulted) OTU(Cmd_Clear_Drive_Fault) ];]]>
</Text>
</Rung>
<Rung Number="10" Type="N">
<Text>
<![CDATA[[XIC(Wrk_A01_StateObject.Sts_DriveFaulted) ,XIC(Wrk_A01_StateObject.Sts_DriveDisabled) ]MOV(0,Wrk_IntegralCV)MOV(0,Wrk_PreviousIntegralCV);]]>
</Text>
</Rung>
<Rung Number="11" Type="N">
<Comment>
<![CDATA[PI CONTROLLER FOR POSITION LOOP with:
>> anti Windup for the integral gain ( the PV due to integral gain is limited to the Command Velocity of the virtual axis)
>> hold on of the integral gain while axis is moving.]]>
</Comment>
<Text>
<![CDATA[SUB(Ref_VirtualAxis.CommandPosition,Ref_K300_I.ActualPosition,Cmd_PosError)[MUL(Cmd_PosError,Cfg_PosLoop_Kp,Wrk_ProportialCV) ,XIO(Ref_VirtualAxis.AccelStatus) XIO(Ref_VirtualAxis.DecelStatus) [MUL(Cmd_PosError,Cfg_PosLoop_Ki,Wrk_IntegralCV) MUL(Wrk_IntegralCV,Sts_CUP_ms,Wrk_IntegralCV) ADD(Wrk_IntegralCV,Wrk_PreviousIntegralCV,Wrk_IntegralCV) ,GRT(Wrk_IntegralCV,Cfg_MaxMotorSpd) MOV(Cfg_MaxMotorSpd,Wrk_IntegralCV) ,CMP(Wrk_IntegralCV<(-Cfg_MaxMotorSpd)) MUL(Cfg_MaxMotorSpd,-1,Wrk_IntegralCV) ] ,MOV(Wrk_IntegralCV,Wrk_PreviousIntegralCV) ,EQU(Cfg_PosLoop_Ki,0) MOV(0,Wrk_PreviousIntegralCV) MOV(0,Wrk_IntegralCV) ,ADD(Wrk_ProportialCV,Wrk_IntegralCV,Cmd_CV) ];]]>
</Text>
</Rung>
<Rung Number="12" Type="N">
<Comment>
<![CDATA[Feedforward gain]]>
</Comment>
<Text>
<![CDATA[MUL(Ref_VirtualAxis.CommandVelocity,Cfg_Vel_FF,Cmd_Pos_dPdt);]]>
</Text>
</Rung>
<Rung Number="13" Type="N">
<Comment>
<![CDATA[Add Feedforward Command to PI Command to generate the Command Variable (CV)
If motion is disabled, Command Velocity to drive is reset to zero.
Verify if RPI failured, and if it does, the command velocity to the drive becomes the command velocity of the virtual axis that contain the cam profile.]]>
</Comment>
<Text>
<![CDATA[[XIC(Cmd_Bits.3) [NEQ(Ref_K300_I.ActualPosition,Wrk_K300_ActualPosPrevious) ,XIC(Cmd_Bits.4) ] ADD(Wrk_ErrorCounts1,1,Wrk_ErrorCounts1) [LES(Wrk_ErrorCounts1,2) MOV(Ref_VirtualAxis.CommandVelocity,Ref_K300_O.CommandCurrentOrVelocity) ,GRT(Wrk_ErrorCounts1,2) OTU(Cmd_Bits.3) ,OTU(Cmd_Bits.4) ,MOV(0,Wrk_ErrorCounts0) ] ,[XIO(Cmd_Bits.3) ,EQU(0,Ref_VirtualAxis.CommandVelocity) ] ADD(Cmd_CV,Cmd_Pos_dPdt,Ref_K300_O.CommandCurrentOrVelocity) MOV(0,Wrk_ErrorCounts1) OTU(Cmd_Bits.3) ,NEQ(Ref_K300_I.ActualPosition,Wrk_K300_ActualPosPrevious) MOV(0,Wrk_ErrorCounts0) ,[NEQ(0,Ref_VirtualAxis.CommandVelocity) NEQ(0,Ref_K300_I.ActualVelocity) ,XIC(Cmd_Bits.3) XIC(Cmd_Bits.7) ] EQU(Ref_K300_I.ActualPosition,Wrk_K300_ActualPosPrevious) ADD(Wrk_ErrorCounts0,1,Wrk_ErrorCounts0) GEQ(Wrk_ErrorCounts0,2) MOV(Ref_VirtualAxis.CommandVelocity,Ref_K300_O.CommandCurrentOrVelocity) OTL(Cmd_Bits.3) ];]]>
</Text>
</Rung>
<Rung Number="14" Type="N">
<Text>
<![CDATA[[AFI() MOV(Ref_K300_I.ActualPosition,Wrk_K300_ActualPosPrevious) ,MOV(Ref_K300_I.ActualPosition,Wrk_K300_ActualPosPrevious) ];]]>
</Text>
</Rung>
<Rung Number="15" Type="N">
<Comment>
<![CDATA[Limit the Command Variable (CV) to the maximum motor velocity]]>
</Comment>
<Text>
<![CDATA[[GRT(Ref_K300_O.CommandCurrentOrVelocity,Cfg_MaxMotorSpd) MOV(Cfg_MaxMotorSpd,Ref_K300_O.CommandCurrentOrVelocity) ,CMP(Ref_K300_O.CommandCurrentOrVelocity<(-Cfg_MaxMotorSpd)) MUL(Cfg_MaxMotorSpd,-1,Ref_K300_O.CommandCurrentOrVelocity) ];]]>
</Text>
</Rung>
<Rung Number="16" Type="N">
<Comment>
<![CDATA[Status]]>
</Comment>
<Text>
<![CDATA[XIC(Wrk_A01_StateObject.Sts_DriveEnabled)OTE(Sts_DriveEnabled);]]>
</Text>
</Rung>
<Rung Number="17" Type="N">
<Text>
<![CDATA[XIC(Wrk_A01_StateObject.Sts_DriveDisabled)OTE(Sts_DriveDisabled);]]>
</Text>
</Rung>
<Rung Number="18" Type="N">
<Text>
<![CDATA[XIC(Wrk_A01_StateObject.Sts_DriveFaulted)OTE(Sts_DriveFaulted);]]>
</Text>
</Rung>
<Rung Number="19" Type="N">
<Text>
<![CDATA[XIC(Wrk_A01_StateObject.Sts_DriveHardwareEnableInput)OTE(Sts_DriveHardwareEnableInput);]]>
</Text>
</Rung>
<Rung Number="20" Type="N">
<Comment>
<![CDATA[AUTO-TUNE OF POSITION LOOP]]>
</Comment>
<Text>
<![CDATA[XIC(Cmd_Auto_Tune_PosLoop)[ONS(Cmd_Bits.6) OTU(Sts_AutoTuneFault) ,MOV(0,Cfg_SSV_MsgType) SSV(Message,Msg_VelLoop_Kp,MessageType,Cfg_SSV_MsgType) MOV(3,Msg_VelLoop_Kp.Attribute) MOV(44,Msg_VelLoop_Kp.Instance) MOV(884,Msg_VelLoop_Kp.Class) MOV(1,Cfg_SSV_MsgType) SSV(Message,Msg_VelLoop_Kp,MessageType,Cfg_SSV_MsgType) ,MOV(0,Cfg_SSV_MsgType) SSV(Message,Msg_VelLoop_GainScaling,MessageType,Cfg_SSV_MsgType) MOV(1,Msg_VelLoop_GainScaling.Attribute) MOV(51,Msg_VelLoop_GainScaling.Instance) MOV(884,Msg_VelLoop_GainScaling.Class) MOV(1,Cfg_SSV_MsgType) SSV(Message,Msg_VelLoop_GainScaling,MessageType,Cfg_SSV_MsgType) ,MOV(0,Cfg_SSV_MsgType) SSV(Message,Msg_EncoderPPR,MessageType,Cfg_SSV_MsgType) MOV(3,Msg_EncoderPPR.Attribute) MOV(26,Msg_EncoderPPR.Instance) MOV(884,Msg_EncoderPPR.Class) MOV(1,Cfg_SSV_MsgType) SSV(Message,Msg_EncoderPPR,MessageType,Cfg_SSV_MsgType) ,MSG(Msg_VelLoop_Kp) ,MSG(Msg_VelLoop_GainScaling) ,MSG(Msg_EncoderPPR) ,XIC(Msg_VelLoop_Kp.DN) XIC(Msg_VelLoop_GainScaling.DN) XIC(Msg_EncoderPPR.DN) [CPT(Sts_BWVel,Inp_Pvel_Gain*(2**(11+Inp_VelLoop_Scale))*0.000125*4/6.2831853) ,GRT(Inp_PosLoop_DampingFactor,0) CPT(Cfg_PosLoop_Kp,0.25*Sts_BWVel*(Inp_EncoderPPR/4)*0.000125*4/(Inp_PosLoop_DampingFactor**2)) ,LEQ(Inp_PosLoop_DampingFactor,0) OTL(Sts_ER) ,CPT(Cfg_PosLoop_Ki,0.25*0.001*(Cfg_PosLoop_Kp**2)) ,OTU(Cmd_Auto_Tune_PosLoop) ] ,[XIC(Msg_VelLoop_Kp.ER) ,XIC(Msg_VelLoop_GainScaling.ER) ,XIC(Msg_EncoderPPR.ER) ] OTL(Sts_ER) OTL(Sts_AutoTuneFault) OTU(Cmd_Auto_Tune_PosLoop) ];]]>
</Text>
</Rung>
</RLLContent>
</Routine>
</Routines>
<Dependencies>
<Dependency Type="AddOnInstructionDefinition" Name="Axis_K300_MI_StateObject"/>
</Dependencies>
</AddOnInstructionDefinition>
</AddOnInstructionDefinitions>
</Controller>
</RSLogix5000Content>
