MC_CamIn

PLCopen motion icon

 Function BlockClosed A function block groups an algorithm and a set of private data. It has inputs and outputs. - Performs a slave axis move which follows the master axis based on the Cam Table specified by CamTableID.

Inputs

Input

Data Type

Range

Unit

Default

Description

Execute

BOOL

0, 1

N/A

No default

On the rising edgeClosed The transition of a digital signal from low to high. AKA: positive edge., request to queue the move.

Master

AXIS_REF

1, 256

N/A

No default

Name of a declared instance of the AXIS_REF library functionClosed A function calculates a result according to the current value of its inputs. A function has no internal data and is not linked to declared instances..

Slave

AXIS_REF

1, 256

N/A

No default

AXIS_REF.AXIS_NUM is the slave axis number.

See AXIS_REF Structure.

MasterOffset

LREAL

No range

User units

No default

Master axis offset.

This input is not used if the StartMode input is set to 1 for Resume Mode.

SlaveOffset

LREAL

No range

User units

No default

Slave axis offset.

This input is not used if the StartMode input is set to 1 for Resume Mode.

MasterScaling

LREAL

No range

User units

No default

Master axis scale factor.

SlaveScaling

LREAL

No range

User units

No default

Slave axis scale factor.

  • This input is not used if the StartMode input is set to 1 for Resume Mode.
  • Scaling must be a positive value greater than 0 (zero).

StartMode

INT

0, 1

N/A

No default

Starting mode of the cam profileClosed The position of a slave axis is mathematically linked to the position of a master axis. Example: A system where two rotating drums turn at a given ratio to each other. A more advanced case of electronic gearing is electronic camming. With electronic camming, a slave axis follows a profile that is a function of the master position. This profile need not be linear but it must be a mathematical function..

The function block uses values that were in effect during the most recently programmedClosed The act of performing a sequence of instructions or commands. MC_CamIn move for the slave axis.

0 = Start Mode

  • Input indicates if the axis should start a MC_CamIn move as an initial cam start.

1 = Resume Mode

  • Input indicates if the axis should resume the most recently programmed MC_CamIn move.
  • The inputs MasterOffset, SlaveOffset, MasterScaling, and SlaveScaling are not used.

CamTableID

INT

No range

N/A

No default

Profile ID number.

BufferMode

SINT

N/A

No default

The Buffer mode for CamIn block.

Outputs

Output

Data Type

Range

Unit

Description

InSync

BOOL

0, 1

N/A

Indicates the slave axis is in sync with the profile.

Busy

BOOL

0, 1

N/A

Indicates this function block is executing.

Active

BOOL

0, 1

N/A

Indicates this move is the Active move.

CommandAborted

BOOL

0, 1

N/A

Indicates the move was aborted.

Error

BOOL

0, 1

N/A

Indicates either:

  • An invalid input was specified.
  • The move was terminated due to an error.

ErrorID

INT

No range

N/A

Indicates the error if the Error output is high.

See PLCopen Function Block ErrorIDs.

EndOfProfile

BOOL

0, 1

N/A

Indicates the end of profile has been reached.

Remarks

  • This function block is used to either:
    • Initiate a new MC_CamIn move.
    • Resume a previously programmed MC_CamIn move.
  • See MC_CamStartPos or MC_CamResumePos for more information about positioning the slave axis prior to calling MC_CamIn.
  • See Function Blocks - General Rules about how inputs and outputs work.

Abort Camming

There are two options to stop camming after MC_CamIn has been called:

Figure 1: MC_CamIn

Usage

The slave axis immediately locks on to the Cam Table profile.

  • The Master Offset is used to shift the profile along the master axis.
  • The Master Scaling defines the range of the profile along the master axis.
  • The Slave Offset is used to shift the profile along the Slave axis.
  • The Slave Scaling defines the range of the profile along the slave axis.

Periodic or Not Periodic

  • If the profile is periodic, when the end of profile is reached, the profile continues at the start of the profile.
    • The EndOfProfile output is ON for 1 ladder scan.
  • If the profile is not periodic, when the end of profile is reached, the slave axis stops and remains at the end of the profile until the master axis returns to within the profile range as defined by MasterScaling.
    • The EndOfProfile output remains ON anytime the master axis is outside of the profile range.

Adjustments Computation is Done

When cam is first started, offsets are adjusted if necessary.

  • If the master is not absolute, then master offset = master offset + starting position.
  • If the slave is not absolute, then slave offset = slave offset + starting position.

At run-timeClosed In computer science, runtime (or run-time) describes the operation of a computer program, the duration of its execution, from beginning to termination (compare compile time). In KAS, runtime refers to the virtual machine that manage the program written in a computer language while it is running.:

  • Master position for profile = master position - master offset.
    • Use master position for profile table to obtain slave profile position.
  • Slave commanded position = slave profile position + slave offset.

Dynamically Change a Cam Profile

MC_CamIn can be used to dynamically change from one cam profile to another.

Care must be taken when doing this to avoid unexpected motion.


  • Tips to dynamically change cam profiles:

    • Verify the first cam’s last position and the replacement cam’s first position are the same.
    • Verify the first cam’s last velocity and the replacement cam’s first velocity do not cause any unexpected motion.
    • Jumps can be eliminated by defining the present cam as Cyclic and defining the replacement cam as an Absolute Master and Slave, as set by the MC_CamTblSelect inputs.
      • This eliminates any possible small error accumulating when the cam is switched.

Examples

These examples use the MC_CamIn Example image showing the cam profile MyProfile:

Example 1

Example 2

Example 3

Figure 2: MC_CamIn Example

Example 1

Example 2

Example 3

FBD Language Example

Not available.

FFLD Language Example

IL Language Example

Not available.

ST Language Example

(* MC_CamIn STClosed Structured text - A high-level language that is block structured and syntactically resembles Pascal. example *)  //Inst_MC_CamIn is an instance of MC_CamIn
Inst_MC_CamIn( CamStartBool, Axis1, Axis2, 0.0, 0.0, 360.0, 360.0, 0, CamTableID, 0 );

See Also