01. Preliminary Preparations
Software: Sysctrl Studio (PLC programming software)
Hardware: M-series controller (taking M511S as an example)
Servo (taking HN-Y7FB040A-S as an example)
02. Communication Connection
This tutorial uses the M controller HCM511S-32MT4-D and the servo HN-Y7FB040A-S, and the connection method is shown in the figure below.
03. Sysctrl Studio Project Basic Configuration
Basic settings
Add Slave Station >> Add Servo Axis >> Associate Device >> Mechanism Parameter Settings
04. Positioning Control Commands
MC_MoveAbsolute (Absolute displacement command)
① Function Description
The control axis moves to the position specified by Position according to the set speed, acceleration/deceleration, and rate of change of acceleration. Position specifies the absolute position with 0 as the reference.
② Pin Description
MC_MoveRelative (Relative displacement command)
① Function Description
The control axis moves the distance specified by Distance from its current position. The reference position is the moment when the command begins execution (control axis movement).
② Pin Description
Command Test
Project settings
Testing the MC_MoveAbsolute and MC_MoveRelative function blocks (the following are the sequential steps)
a. Enable the axis and trigger the MC_MoveAbsolute function block.
Result: The shaft reached 200 at a speed of 10.
b. Trigger the MC_MoveRelative function block
Result: The shaft reached 400 at a speed of 15.
c. Trigger the MC_MoveAbsolute function block again.
Result: The shaft reached 200 at a speed of 10.
[Explanation] The comparison results show that the main difference between the MC_MoveAbsolute instruction and the MC_MoveRelative instruction is that one uses 0 as the reference and the other uses the current position of the axis as the reference.
MC_MoveAdditive (Additional relative displacement command)
① Function Description
The control axis moves an additional distance (the value set by distance).
② Pin Description
MC_MoveSuperimposed (Superimposed relative displacement instructions)
① Function Description
The control axis is superimposed with a relative displacement on the current motion.
② Pin Description
MC_HaltSuperimposed (Terminate superimposed displacement instruction)
① Function Description
Terminate superimposed displacement (terminate MC_HaltSuperimposed instruction).
② Pin Description
Command Test
Project settings
Testing the MC_MoveAdditive, MC_MoveSuperimposed, and MC_HaltSuperimposed function blocks (the following are sequential steps)
Swipe up to read
First method: Testing the MC_MoveAdditive function block
a. Enable the axis, first perform a return-to-home operation, triggering the MC_MoveRelative instruction.
Result: The shaft runs at a speed of 10.
b. Trigger the MC_MoveAdditive instruction again.
Result: This function block will interrupt the executing MC_MoveRelative instruction, causing the axis to run at a speed of 20, eventually reaching a displacement of 500.
【Explanation】After the MC_MoveRelative function block is interrupted, the unfinished displacement will be completed by the MC_MoveAdditive instruction, eventually reaching the position 200+300=500.
The second method: MC_MoveSuperimposed function block test
a. Enable the axis, first perform a return-to-home operation, triggering the MC_MoveRelative instruction.
Result: The shaft runs at a speed of 10.
b. Trigger the MC_MoveSuperimposed command again.
Result: This function block will not interrupt the executing MC_MoveRelative instruction. The axis will run at a speed of 30 and eventually reach a displacement of 500.
[Note] Triggering the MC_MoveSuperimposed instruction will not affect the currently executing MC_MoveRelative instruction. Speed and displacement are the combined effect of the two instructions; the speed will run at 10+20=30, eventually reaching a position of 200+300=500.
The third method: MC_HaltSuperimposed function block test
a. Enable the axis, first perform a return-to-home operation, triggering the MC_MoveRelative instruction.
Result: The shaft runs at a speed of 10.
b. Trigger the MC_MoveSuperimposed command
Result: The shaft runs at a speed of 30.
c. Trigger the MC_HaltSuperimposed command
Result: The shaft continued to run at a speed of 10, and then stopped.
[Note] The MC_HaltSuperimposed instruction is only used with the MC_MoveSuperimposed instruction, so triggering this instruction will not affect the currently executing MC_MoveRelative instruction. The final offset is 200 units of the MC_MoveRelative instruction's execution time, plus the offset already executed by the MC_MoveSuperimposed instruction. The offset already executed by the MC_MoveSuperimposed instruction can be seen on this pin covereddistance.
[Note] The differences between the MC_MoveAdditive and MC_MoveSuperimposed commands are as follows:
More information
For a more detailed description of the instructions, please click "Read the original text" below to view the "M Series Controller_Motion Control Instruction Manual".
✦Control Technology Product Line✦