10-53
10 Sample Programming
NJ/NX-series CPU Unit Motion Control Userās Manual (W507)
10-2 Basic Programming
Samples
10
10-2-13 Using a Cam Profile Curve to Correct the Sync Position
This sample uses a cam profile curve to correct a slave axis in a gear motion. The slave axis for gear
motion is MC_Axis001, a virtual Servo axis, and the slave axis for cam motion is MC_Axis002, also a
virtual Servo axis. These slave axes are combined with MC_CombineAxes and the results is output to
MC_Axis003, a Servo axis. The master axis is MC_Axis000, a Servo axis.
The processing flow is as follows:
ļ¬ Axis Type Settings
The axes types are set in the axis parameters for each axis as given below.
10-2-13 Using a Cam Profile Curve to Correct the Sync Position
Parameter name
Setting
Axis 1 Axis 2 Axis 3 Axis 4
Axes variable name MC_Axis000 MC_Axis001 MC_Axis002 MC_Axis003
Axis type Servo axis Virtual servo axis Virtual servo axis Servo axis
Main Variables Used in the Programming Samples
Variable name Data type Default Comment
MC_Axis000 _sAXIS_REF --- This is the Axis Variable for axis 0.
MC_Axis000.Details.Homed BOOL FALSE TRUE when home is defined for axis 0.
MC_Axis000.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 0.
MC_Axis001 _sAXIS_REF --- This is the Axis Variable for axis 1.
MC_Axis001.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 1.
MC_Axis002 _sAXIS_REF --- This is the Axis Variable for axis 2.
MC_Axis002.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 2.
MC_Axis003 _sAXIS_REF --- This is the Axis Variable for axis 3.
MC_Axis003.Details.Homed BOOL FALSE TRUE when home is defined for axis 3.
MC_Axis003.MFaultLvl.Active BOOL FALSE TRUE when there is a minor fault level error
for axis 3.
CamProfile0 ARRAY[0..109] OF
_sMC_CAM_REF
---
This is the cam data variable.
*1
Pwr1_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR1 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Pwr4_Status BOOL FALSE This variable is assigned to the Status output
variable from the PWR4 instance of the
MC_Power instruction. It is TRUE when the
Servo is ON.
Vel_InVel BOOL FALSE TRUE when the target velocity for
MC_MoveVelocity for axis 0 is reached.
Synchronized motion with gear operation instructions
Master axis: MC_Axis000
Slave axis: MC_Axis001
Synchronized motion with cam operation instructions
Master axis: MC_Axis000
Slave axis: MC_Axis002
Corrected Motion with
Combine Axes Instruction
Slave axis: MC_Axis003