MC_CamIn (FB)¶
FUNCTION_BLOCK MC_CamIn
Executes a given cam table.
Note
MC_CamIn should be called after the motion FB controlling
the Master axis has been called. Otherwise, the Slave axis
will lag behind the Master axis.
- InOut:
Scope
Name
Type
Initial
Comment
Inout
MasterReference to master axis. Master need not be stationary.
SlaveReference to slave axis
Input
ExecuteBOOLRising edge: Starts the execution of the function block.
MasterOffsetLREALOffset on master table in master cam table units.
SlaveOffsetLREALOffset on slave table in slave axis units.
Mechanical analogy to the slave offset is a cam plate, which is welded with additional constant layer thickness. Therefore slave positions have a constant offset. The offset can be interpreted as an axis offset of the master axis on the assumption that the slave cam is linearly guided.
MasterScalingLREAL1
Scaling factor for master profile. Must not be 0.
SlaveScalingLREAL1
Scaling factor for slave profile. Must not be 0.
MasterStartDistanceLREALThe master distance (in master cam table units) from the
MasterSyncPositionwhere the slave axis starts synchronization. Only used inStartModeramp_in_dist.If
MasterStartDistanceis 0 (or negative), then the slave movement is started immediately, provided that the master is not in standstill. If BufferMode <> Aborting, then the MasterStartDistance must be 0 (or negative).MasterSyncPositionLREALThe master position in the cam table where the slave axis has to be synchronized to the master. Must be a valid position in the cam table, otherwise the error SMC_CI_MASTER_SYNC_POSITION_OUT_OF_SCALE will be reported. Only used in
StartModeramp_in_dist.AvoidReversalBOOLFALSE: Signals that the reversal of the slave is physically possible and acceptable.TRUE: Signals that a reversal of the modulo slave has to be avoided, e.g. because it is physically impossible or might lead to damage.It works only with modulo slave axes.If a reversal cannot be avoided, the axis is stopped with an error.Only used inStartModeramp_in_dist.Behavior:
- If the slave axis is a modulo axis and the master velocity (times the slope of the cam table at the
MasterSyncPosition) is not oppositeto the slave velocity, thenMC_CamIntries to avoid a reversal of the slave.It tries to “stretch” the slave movement by increasing the distance the slave travels by up to 5 slave periods.If this “stretching” is not successful, i.e. does not avoid a reversal, an error is reported. - If the slave velocity is opposite to the master velocity times the slope of the cam table at the
MasterSyncPosition,an error is reported. If the slave axis is not a modulo axis, an error is reported on the rising edge of the Execute input.
StartModeabsolute
Start mode
Possible values:
absolute, relative: The
Slavewill immediately beInSyncand follow the trajectory defined by cam table andMaster. Depending on the current state of theSlave, this can lead to a jump in position, velocity, and/or acceleration. If the StartMode is absolute, the value ofSlaveAbsoluteset by MC_CamTableSelect will be used. If the StartMode is relative, relative coordinates will be used for the slave position, effectively overwriting of the value ofSlaveAbsolute.ramp_in, ramp_in_pos, ramp_in_neg: The
Slavewill synchronize to the cam as fast as possible using the configuredVelocityDiff,Acceleration,Deceleration, andJerk. If theSlaveis a modulo axis, ramp_in_pos and ramp_in_neg define the direction for ramping in. For a finiteSlave, all three StartModes behave the same.ramp_in_dist: The
Slavewill synchronize to the cam so that it follows the trajectory defined by cam table andMasteras soon as theMasterreaches theMasterSyncPosition. Synchronization will start when theMasteris within theMasterStartDistanceof theMasterSyncPosition.
Please note that the ramping-in StartModes only have an effect on a rising edge of input Execute. If the cam table is changed by modifying input
CamTableID, no ramping-in is performed.CamTableIDIdentification of the cam table. The input is connected with the output of MC_CamTableSelect.
While camming is active, this input can be used to change cam tables on the fly without a new rising edge on
Execute. Compared to restarting camming with a rising edge onExecute, there are a few differences:If ramping with
StartModeramp_in, ramp_in_pos, or ramp_in_neg is active, it is not aborted.Even if the
StartModeis ramp_in, ramp_in_pos, or ramp_in_neg, no new ramping in is initiated.If
EndOfProfilehas been set in the same cycle, the new cam table is automatically offset so that no gap occurs between the two tables.
Please note that when using distance based ramping in (
StartModeramp_in_dist), the errorSMC_CI_CAM_CHANGED_DURING_RAMP_IN_DISTis returned if theCamTableIDchanges while ramping in is still active.BufferModeMC_BUFFER_MODEDefines the chronological sequence of the FB relative to the previous block. Only the BufferModes
Aborting,BufferedandBlendingPreviousare supported.BlendingPreviousmeans that the configured velocity (including the direction) of the previous movement is used as the blending velocity, even if this movement has the opposite direction. If the function block is Busy, then only BufferMode=Aborting is allowed.VelocityDiffLREALMaximum velocity difference in u/s for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg.
AccelerationLREALAcceleration in u/s² for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg.
DecelerationLREALDeceleration in u/s² for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg.
JerkLREALJerk in u/s³ for ``StartMode``s ramp_in, ramp_in_pos, and ramp_in_neg.
TappetHysteresisLREALSize of the hysteresis for tappets in u. A positive value means that the tappet cannot fire immediately after it has fired. The master position first needs to move away from the tappet by more than the value given for
TappetHysteresis.For example, if the master is an encoder, the master position may oscillate by a few increments around the tappet position. Without a hysteresis, the tappet may fire all the time.
Output
InSyncBOOLIndicates that the
Slavefollows the cam profile.BusyBOOLExecution of the function block has not finished.
ActiveBOOLIndicates that the FB has control on the axis
CommandAbortedBOOLCommand has been aborted by another command
ErrorBOOLSignals that an error has occured within the function block.
ErrorIDSMC_ERRORError identification
EndOfProfileBOOLIndicates that the
Masterhas reached a border of the cam table. (This can be either the start or the end of the cam table, depending on theMasterdirection.)For periodic cams, the output is set for one cycle for each new period.
For non-periodic cams, the output stays TRUE while the
Masteris outside the cam range. TheSlavewill remain in synchronized_motion. If theSlaveis not in standstill whenEndOfProfileis reached, another movement must be commanded that takes control of theSlave. MC_CamIn does not stop theSlaveonEndOfProfile.A buffered movement that has been commanded after this movement is started as soon as
EndOfProfileis set. This behavior is the same for periodic and non-periodic cams.Note: With
StartModeramp_in, ramp_in_pos, or ramp_in_neg and depending on the configuredVelocityDiff,Acceleration,Deceleration, andJerk, it is possible that theMasterreachesEndOfProfilebefore the slave isInSync.TappetsSMC_TappetDataTappets: Has to be evaluated by SMC_GetTappetValue function blocks.