When Velocity (Target Velocity) is changed by re-executing a motion control instruction, InVelocity (Target Velocity Reached) operates for the new target velocity that was set at re-execution.
For details on re-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).
Multi-execution of Motion Control Instructions
For details on multi-execution of motion control instructions, refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).
Execution during Execution of Other Instructions
You can switch to this instruction or buffer this instruction if you execute it during execution of another instruction.
You can buffer one instruction per axis.
Specify the operation of this instruction using BufferMode (Buffer Mode Selection) for multi-execution of instructions.
Buffer Mode
Selec-tion Description
Aborting Aborts the instruction being executed and switches to this instruction.
If the direction of axis motion is reversed by switching instructions, the motion will be re-versed according to the Operation Selection at Reversing axis parameter.
Buffered Buffers this instruction and executes it automatically after the current instruction is com-pleted.
For details on BufferMode (Buffer Mode Selection), refer to the NJ/NX-series CPU Unit Motion Control User’s Manual (Cat. No. W507).
Execution of Other Instructions during Instruction Execution
If another instruction is executed during execution of this instruction, the BufferMode input variable to the other instruction must be set to Aborting or Buffered.
If you specify Buffered, the buffered instruction is executed when the InVelocity (Target Velocity
Timing Chart When Error Occurs
Error code Busy
CommandAborted InVelocity
Error
16#0000 ErrorID
Execute
Active
Error Codes
Refer to the NJ/NX-series Troubleshooting Manual (Cat. No. W503) for instruction errors.
Sample Programming
This section shows sample programming for velocity control, such as for a spinner or centrifuge.
Parameter Settings
The minimum settings required for this sample programming are given below.
Setting Axis Parameters
Axis Type
Axis Axis Type
Axis 1 Servo axis
Operation Example
Sensor 1
MC_MoveVelocity
3
Sample Programming
Operation Pattern
Sensor2 Sensor3 First velocity Second velocity
Third velocity
Stop command
Time Velocity
1 Starting Velocity Control
Sensor 1 detects the insertion of liquid chemical. When it turns ON, velocity control starts for axis 1.
2 Changing to the Second Velocity
When the Sensor2 bit changes to TRUE, the override factor is set to 500% and the velocity is changed.
3 Changing to the Third Velocity
When the Sensor3 bit changes to TRUE, the override factor is set to 200% and the velocity is changed.
If both Sensor2 and Sensor3 are TRUE at the same time, the override factor is 200%.
4 Stopping Velocity Control
When the stop command (StopTrig) changes to TRUE, the axis decelerates to a stop.
Ladder Diagram
Main Variables
Name Data type Default Comment
MC_Axis000 _sAXIS_REF --- Axis Variable for axis 1.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE while there is a minor fault level error for axis 1.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 1.
Pwr_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR instance of the
MC_Power instruction. This variable changes to TRUE when the Servo is turned ON.
Name Data type Default Comment
StartPg BOOL FALSE The Servo is turned ON if this variable is TRUE
and EtherCAT process data communications are established.
Vel_Act BOOL FALSE This variable is assigned to the Active output
variable from the VEL instance of the
MC_MoveVelocity instruction. It is TRUE during velocity control by the VEL instance.
Set_Ov_Velfct LREAL 0 This is the velocity override factor.
StopTrig BOOL FALSE When this variable is TRUE, MC_Stop is
exe-cuted.
Sensor1 BOOL FALSE TRUE when chemical solution supply is
detect-ed.
If the Servo is ON for axis 1, the MC_MoveVe-locity (VeMC_MoveVe-locity Control) instruction is executed.
Sensor2 BOOL FALSE If this variable is TRUE, the override factor is
set to 500%. After this variable changes to TRUE, it remains TRUE until Sensor3 changes to TRUE, at which time it changes to FALSE.
Sensor3 BOOL FALSE If this variable is TRUE, the override factor is
set to 200%. After this variable changes to TRUE, it remains TRUE.
Timing Chart
Pwr_Status Sensor1 Vel_Bsy Vel_Act Set_Ov_Bsy Set_Ov_End Sensor2 Sensor3 StopTrig Stp_D Stp_Act
MC_Axis000 Command velocity
Time
MC_MoveVelocity
3
Sample Programming
Sample Programming
StartPg MC_Axis000.DrvStatus.Ready Lock1
If StartPg is TRUE, check that the Servo Drive is ready.
PWR
Error
Axis Axis
Enable Status
Busy MC_Power
ErrorID
Lock1 MC_Axis000 Pwr_Status
Pwr_Bsy Pwr_Err Pwr_ErrID If the Servo Drive is ready, the Servo is turned ON.
FaultHandler MC_Axis000.MFaultLvl.Active
FaultHandler EN
If a minor fault level error occurs for axis 1, the error handler for the device (FaultHandler) is executed.
Program the FaultHandler according to the device.
Vel_InVel
Pwr_Status Sensor1 MC_Axis000
BufferMode VEL
Jerk
Active
Axis Axis
Execute InVelocity
Velocity Busy
Deceleration
Error Direction
Continuous
MC_MoveVelocity
Acceleration
CommandAborted ErrorID _eMC_DIRECTION#_mcPositiveDirection
LREAL#1048576.0 LREAL#1048576.0 LREAL#1048576.0
Vel_Bsy Vel_Act Vel_Ca Vel_Err Vel_ErrID When Sensor1 changes to TRUE, the MC_MoveVelocity (Velocity Control) instruction is executed.
Vel_Act
During execution of the MC_MoveVelocity (Velocity Control) instruction, the override factor is changed according to the status of the Sensor2 and Sensor3 bits.
Note: The contents of the inline ST are given below.
MC_Axis000
Vel_Act Set_Ov_End
Set_Ov_Velfct Set_Ov_Bsy
SET_OV
Axis Axis
Enable Enabled
VelFactor JerkFactor
Error ErrorID MC_SetOverride
AccFactor
Busy
Set_Ov_Err Set_Ov_ErrID The MC_SetOverride (Set Override Factors) instruction is executed during execution of the
MC_MoveVelocity (Velocity Control) instruction.
StopTrig
LREAL#524288.0
Stp_Act STP
Axis Axis
Execute Done
Deceleration
BufferMode
Error ErrorID CommandAborted Active MC_Stop
Jerk
Busy
MC_Axis000 Stp_D
Stp_Bsy
Stp_Ca Stp_Err Stp_ErrID When the stop command (StopTrig) changes to TRUE, the MC_Stop instruction is executed.