FB_SimCoE402_Servo

FB_SimCoE402_Servo 1:

This class implements a simulation of a CoE402 servo drive. The FB offers mapping elements for CoE interfaces of servo drives. Mapping is done in the same way as for the real drive unit.

Syntax:

FUNCTION_BLOCK FB_SimCoE402_Servo EXTENDS FB_SimAxCommon
VAR_INPUT
    NcAdapt: FB_CoE402_ServoAdapt; 
END_VAR

FB_SimCoE402_Servo 2: I/O variables

Name

Type

Direction

Description

NcAdapt

FB_CoE402_ServoAdapt

Input/Output

The mapping interface for the NC axis.

FB_SimCoE402_Servo 3: Properties

Name

Type

Access

Description

ActualPosition

LREAL

Get, Set

This runtime value provides information about the simulated axis position.

Notice The simulated position of the actuator can deviate from the reported axis position.

ActualTorque

LREAL

Get

The simulated actual torque.

ExternalTorque

LREAL

Get, Set

Here, an external torque can be specified from the simulation of a simulated process.

Inertia

LREAL

Get

Moment of inertia [kg * m³], formed from MovingMass and a chaining of gears.

PositionLagKp

LREAL

Get, Set

The position control gain of the simulated servo.

Reversed

BOOL

Get, Set

TRUE if the direction of rotation of the simulated servo is inverted.

StatusWord

WORD

Get

The status word of the servo.

TorqueLimitNegative

LREAL

Get, Set

The negative torque limit.

TorqueLimitPositive

LREAL

Get, Set

The positive torque limit.

AbsolutSwitch

BOOL

Get

This runtime value provides information about the simulated feedback signal as defined by AbsSwitchHighSelect.

AbsSwitchHighEnd

LREAL

Get, Set

This parameter defines the threshold in case AbsSwitchHighSelect=TRUE: AbsolutSwitch will be TRUE if the simulated actuator position is >= AbsSwitchHighEnd.

Notice The simulated position of the actuator can deviate from the reported axis position.

AbsSwitchHighSelect

BOOL

Get, Set

This parameter defines the active AbsolutSwitch. A TRUE will select AbsSwitchHighEnd while a FALSE makes the AbsSwitchLowEnd the active AbsolutSwitch.

AbsSwitchLowEnd

LREAL

Get, Set

This parameter defines the threshold in case AbsSwitchHighSelect=FALSE: AbsolutSwitch will be TRUE if the simulated actuator position is <= AbsSwitchLowEnd.

Notice The simulated position of the actuator can deviate from the reported axis position.

CycleTime

LREAL

Get, Set

This parameter must be initialized with the update calling cycle of the Cyclic() method and will be forwarded to any sub-component if required. It is used to define any time behavior.

EncoderInterpolation

LREAL

Get, Set

This parameter must be initialized with the same value as the corresponding parameter in the motion technology:

  • NC: encoder, parameter, scaling factor denominator
  • Hydraulics library: encoder, inc. Interpolation

EncoderNoiseLevel

LREAL

Get, Set

The simulated axis offers the possibility to disturb the reported position with a pseudo-random white noise. This is realized by a FB_Noise() function block. The parameter EncoderNoiseLevel is forwarded as SetWhiteNoiseLevel.

EncoderWeighting

LREAL

Get, Set

This parameter must be initialized with the same value as the corresponding parameter in the motion technology:

  • NC: encoder, parameter, scaling factor numerator
  • Hydraulics library: encoder, weighting factor

EncoderZeroShift

LREAL

Get, Set

This parameter must be initialized with the same value as the corresponding parameter in the motion technology:

  • NC: rotary encoder, parameter, position bias
  • Hydraulics library: encoder, zero offset

HighSideBlock

LREAL

Get, Set

The simulated position of the actuator is limited to a value less than or equal to this parameter.

HighSideEndswitch

LREAL

Get, Set

This parameter defines the UpperEndSwitch threshold that becomes TRUE when the simulated position of the actuator is >= this parameter.

HighSideSpringLengt

LREAL

Get, Set

This parameter defines the length of a simulated spring-like effect at the upper side of the actuator stroke.

LowerEndSwitch

BOOL

Get

This runtime value provides information about the state of a simulated sensor. Becomes TRUE if the position of the simulated actuator is >= HighSideEndswitch.

LowSideBlock

LREAL

Get, Set

The simulated position of the actuator is limited to a value above or equal to this parameter.

LowSideEndswitch

LREAL

Get, Set

This parameter defines the LowerEndSwitch threshold that becomes TRUE when the simulated position of the actuator is <= this parameter.

LowSideSpringLength

LREAL

Get, Set

This parameter defines the length of a simulated spring-like effect at the lower side of the actuator stroke.

MovingMass

LREAL

Get, Set

This parameter can be used to define a moving mass. It is used to calculate dynamic acceleration and deceleration forces, torques or pressures.

NoBlock

BOOL

Get, Set

If this parameter is set to TRUE, the use of the springs and blocks on the upper and lower sides will be disabled.

UpperEndSwitch

BOOL

Get

This runtime value provides information about the state of a simulated sensor. It becomes TRUE if the position of the simulated actuator is <= LowSideEndswitch.

Notice

When using a simulated servo drive, a FB of type FB_SimTorqueLimitingCoE402_Servo or FB_SimTorqueLimitingCoE402_Mapped must be used to perform the data exchange between TwinCAT 3 Plastic Functions and the simulation.

FB_SimCoE402_Servo 4: Methods

Name

Description

GoFaultState()

This method can be used to simulate an error situation on the simulated axis.

Cyclic()

This method must be called cyclically.

Gear()

Starts a chaining of gear factors.

GearBox()

Rotary transmission (gearbox).

GearRackNPinion()

Linear transmission by rack and pinion.

GearScrew()

Linear transmission by spindle.

FB_SimCoE402_Servo 5: Interfaces

Type

Description

I_SimAxCommon

Standard interface for FB_SimAxCommon.

I_SimCoE402_Servo

Standard interface for FB_SimCoE402_Servo.

I_SimAxGear

Gear interface for coupling gear ratios of the axis.

Requirements

Development environment

Target platform

PLC libraries to include

TwinCAT v3.1.4024.55

PC or CX (x64, x86)

Tc3_PlasticFunctions (>= v3.12.5.0)