Y_DirectControl
This block allows direct access to any of five possible control modes available for the specified axis. For example,
Y_DirectControl
makes it possible to perform open loop velocity control for winding applications. In any control mode, the IEC application program can apply an algorithm to directly command position, velocity, or torque at every application task scan.
Parameters
| * | Parameter | Data Type | Description | |
|---|---|---|---|---|
| VAR_IN_OUT | ||||
| B | Axis | AXIS_REF | Logical axis reference. This value can be located on the Configuration tab in the Hardware Configuration (logical axis number). | |
| VAR_INPUT | Default | |||
| B | Enable | BOOL | The function will continue to execute every scan while Enable is held high and there are no errors. | FALSE |
| V | ControlMode | Yt_ControlMode | ControlMode: 1=Position, 2=Velocity, 3=Torque, 4=Position with Torque Feed Forward, 5=Velocity with Torque Feed Forward | INT#0 |
| E | Position | LREAL | A positive or negative value within the coordinate system in user units. | LREAL#0.0 |
| E | Velocity | LREAL | Velocity in user units/second. See notes below. | LREAL#0.0 |
| E | Acceleration | LREAL | Value of the acceleration in user units/second^2 (acceleration is applicable with same sign of torque and velocity). Used in control modes 4 and 5. | -- |
| E | Torque | LREAL | Value of the torque (in percentage of rated torque). | LREAL#0.0 |
| V | FilterTimeConstant | LREAL | Moving average filter specified in seconds. See below for details. | LREAL#0.0 (No Filter) |
| E | BufferMode | MC_BufferMode | The behavior of the axis could be Aborting or Buffered MC_BufferMode#Aborting MC_BufferMode#Buffered | MC_BufferMode#Aborting |
| VAR_OUTPUT | ||||
| E | Busy | BOOL | Set high upon the rising edge of the Execute input, and reset when Done, CommandAborted, or Error is true. In the case of a function block with an Enable input, a Busy output indicates the function is operating, but not ready to provide Valid information. (No Error) | |
| E | Active | BOOL | For buffered modes, this output is set high at the moment the block takes control of the axis. For non buffered modes, the outputs Busy and Active have the same value. | |
| E | CommandAborted | BOOL | Set high if motion is aborted by another motion command or MC_Stop. This output is cleared with the same behavior as the Done output. | |
| B | Error | BOOL | Set high if an error has occurred during the execution of the function block. This output is cleared when 'Execute' or 'Enable' goes low. | |
| E | ErrorID | UINT | If Error is true, this output provides the Error ID. This output is reset when 'Execute' or 'Enable' goes low. | |
Notes
- Use the appropriate input(s) for the selected ControlMode as follows:
- In Position mode (1), Velocity input is the velocity feedforward. The Torque input is ignored.
- In Velocity Mode (2), the Torque input is a torque limit.
- In Torque Mode (3), the Velocity input is a velocity limit.
- In Position Mode with Torque feedforward (4), the Torque input is the torque feedforward, Velocity input is the velocity feedforward.
- In Velocity Mode with Torque feedforward (5), the Torque input is the torque feedforward.
- The acceleration input is never used. The user must calculate the required command profile.
- The FilterTimeConstant is specified in seconds. This feature is applicable when the IEC application task rate in which this function is executing is slower than the Motion Engine update. If this time constant is set to the IEC task interval (e.g. 0.01 for a 10 ms scan), then the filter calculates additional command data (an interpolated value) at each Motion Engine update, reaching the set point just before the next IEC application scan. If set to zero or not connected, the command position is changed to the user specified value only at the end of each IEC application task, causing small stair stepping response. Rising edge of Enable is required for a new FilterTimeConstant to be applied.
- If it is necessary to transition from Torque to Position mode, the Y_HoldPosition function block is useful in making that transition.
- Buffered mode is only supported when transitioning between positioning function blocks. Care must be taken to prevent abrupt or unintended motion.
Error Description
See the
Function Block ErrorID List
Example 1
Y_DirectControl
configured in position mode.
Example 2
Y_DirectControl in position mode with filter time constantExample 3
Y_DirectControl configured for velocity mode.