OBIOMotionSinglePTO (FB)
FUNCTION_BLOCK OBIOMotionSinglePTO EXTENDS AbbLConC3
Single axis point-to-point or velocity movement, utilizing the PTO functionality for AC500 eco CPU.
- precondition
the respective channel is configured as PTO channel.
- basic input parameters
- OpenLoop
- MaxFrequency
Used as a reference Value to calculate the acceleration and deceleration. The axis will run from MinFrequency to MaxFrequency in RefAcceleration[ms] time.
- MinFrequency
The movement will start and end with MinFrequency. The Value should not be too small: 1Hz would mean the first/last step needs 1s.
- Cycle
cycle time for the PLC program [ms]. A wrong setting for “Cycle” will result in wrong acceleration/deceleration ramps
- p2p
provides the positioning method. It can either be of type OBIOBasicPoint2Point, which will use trapezoidal ramps, or of type OBIOSineSquaePoint2Point, which will use sinesquare ramps.
- velocity movement
A continuous velocity movement is started with a rising edge at ExecuteVel.
The parameters used are RefFrequency, RefDirection, RefAcceleration and RefDeceleration.
These paremeters can be changed during the movement and will be used immediately.
The output InVelocity indicates that the required velocity is reached.
The movement can be stopped with input Stop.
- positioning movement
A positioning movement can be started with a rising edge at ExecutePos. It is an absolute positioning.
The parameters used are RefFrequency, RefAcceleration, RefDeceleration and RefPosition. No new values will be accepted during the movement.
The output InPosition indicates that the movement is completed.
The movement can be stopped with input Stop.
Note
This block should just be called once per cycle otherwise inconsistent values could be send to PRU, if send twice in short time.
- InOut:
Scope
Name
Type
Initial
Comment
Inherited from
Input
EnableBOOLFALSE
A rising edge (Enable = TRUE) starts the operation, the output Busy goes to TRUE. All other inputs are read and considered continuously. Execution will continue forever until a falling edge (Enable = FALSE) aborts the operation. During Aborting the Busy is still TRUE. Afterward all outputs are reset.
AbbLConC3
Output
BusyBOOLFALSE
Operation is running (while output Error is FALSE)
AbbLConC3
ErrorBOOLFALSE
Operation is stopped with error (while output Busy is FALSE). This output is TRUE for at least one cycle or until Enable is set to FALSE. The output ErrorID gives more details about the error.
AbbLConC3
Input
ChannelBYTEsingle PTO channel, 0..3, requires according configuration
OpenLoopBOOLTRUE
do not use the ActPosition as input if OpenLoop=TRUE is set. Instead, the number of pulses send to PTO output will be written on ActPosition
ResetPosBOOLReset the position on rising edge to “0”, just allowed when Busy=FALSE
ExecutePosBOOLstart the algorithm with a rising edge, absolute positioning, just allowed with Busy=FALSE
ExecuteVelBOOLstart a continuous movement with a rising edge,just allowed with Busy=FALSE
StopBOOLStop using RefDeceleration. Stop will overrule ExecutePos and ExecuteVel
RefPositionDINTabsolute position, where to move with rising edge at ExecutePos
RefFrequencyDWORDReference Frequency in Hz, can be continuously changed for velocity movement
RefDirectionBOOLdirection, used for velocity movement
RefAccelerationTIMETIME#1s0ms
Acceleration as time in ms to run from MinFrequency to MaxFrequency
RefDecelerationTIMETIME#1s0ms
Deceleration as time in ms to run from MinFrequency to MaxFrequency
MaxFrequencyDWORD200000
maximum frequency for frequency output, new value just used with Enable=FALSE
MinFrequencyDWORD500
minimum for frequency output, new value just used with Enable=FALSE
CycleINT1
Cycle time of the PLC-Program in ms, new value just used with Enable=FALSE
EncoderScalingLREAL1
- EncoderScaling, can be used with OpenLoop=FALSE, is ignored otherwise. The parameter will just modify the positioning movement.
Usage: the encoder might have a different number of increments per revolution, compared to the stepper motor.
for example:
motor = 1000 inc/r, encoder = 1000 inc/r *4 (4-fold counting) => EncoderScaling=4
motor = 1000 inc/r, encoder = 1024 inc/r => EncoderScaling=1.024
- If this parameter has a wrong value, the deceleration ramp will not match the given parameter (in positioning movement), as it is adjusted to meet the RefPosition
Note
RefFrequency is issued as a frequency for the stepper motor, it is not affected by this parameter.
Note
a higher position resolution (encoder with more increments) will result in shorter positioning time, with otherwise not modifed parameters.
InterpolationTypeDecide if trapezoidal or sinesquare ramp for positioning is to be used
Inout
ActPositionDINTActual position
Output
ErrorIDError Code
ActiveBOOLpositioning is completed A new movement can just be started with Active=FALSE. Active is mutually exclusive with InPosition. A ExecutePos for the current position might result in InPosition without showing Active.
InPositionBOOLpositioning is completed
InVelocityBOOLRefFrequency=ActFrequency
ActFrequencyDWORDmoving frequency for the drive in inc/s. This value is send to the PTO channel (FB (INTERNAL)).
ActDirectionBOOLTRUE means: move forward. This value has to be connected to a binary output.