Share this

Easily Achieve Online Speed ​​Variables: BufferMode Application in Leadsys Software

2026-04-06 02:24:56 · · #1

01. Overview

Online speed definition

Implementing point-to-point motion control and speed control for a single axis in Leadsys software is quite simple. It can be easily achieved by calling the point-to-point control and speed control function blocks in the single-axis motion instructions. These motion speeds are often fixed when the function block is triggered, and subsequent motion is performed at this speed, which is difficult for the user to change during the motion process. Changing the motion speed during point-to-point motion control and speed control constitutes online speed regulation of the motion.

Implementation method brief

To achieve online speed change of motion, we provide two commonly used methods: using the BufferMode function of the single-axis motion instruction in the SM3_Baisc library, and using the online speed change instruction provided by Leadshine. The following is a detailed introduction to online speed change implemented through BufferMode.

02. Online speed regulation implemented via BufferMode

Overview of Single-Axis Motion Commands

In single-axis motion control, the most commonly used movements are point-to-point control, constant-speed motion that maintains a constant axis speed, and JOG motion, which is frequently used during debugging. Point-to-point motion includes absolute point-to-point motion and relative point-to-point motion, totaling four common single-axis movements. The SM3_Baisc library provides these four basic motion control instructions, as shown in the table below. Using these four instructions, most single-axis motion control operations can be implemented.

BufferMode

1. Introduction

Some motion function blocks have a BufferMode pin among their input pins. BufferMode is used to set how a moving axis starts a new motion. This can be to interrupt the current motion with a new motion, wait for the axis to complete the current motion and then start a new motion in a specified way, etc. BufferMode is set in the new motion instruction to be executed.

2. Mode

The BufferMode input pin is of type MC_BUFFER_MODE, which is an enumeration type. The enumeration values ​​and corresponding motion connection methods are shown in the table below.

BufferMode can be broadly categorized into three types: Interrupt, Wait, and Blend, with Blend having four sub-modes. Interrupt stops the current motion and executes a new motion. Wait waits for the current motion to complete before starting a new motion. Blend combines two motion segments; there is a speed change process when switching between the two motion segments, during which the speed does not drop to 0.

MC_MoveAbsolute (absolute position movement) and MC_MoveRelative (relative position movement) can use all six BufferModes, while MC_MoveVelocity (constant speed movement) only supports Aborting and Buffered modes. Below, we demonstrate the motion effects of the six BufferModes using the same two actions with different BufferModes: Add two relative positioning motion commands to the program. Command 1 keeps the default BufferMode (Aborting), while command 2 sets a different BufferMode. Start the relative positioning motion of command 1 first, and execute command 2 during the motion of command 1. The following are their motion effects.

Aborting mode:

Relative motion command 2 uses Aborting mode. During the motion controlled by command 1, command 2 is triggered and its execution is interrupted. Command 2 interrupts the motion controlled by command 1, but the axis does not stop during the interruption process.

Buffered mode:

The relative motion command 2 uses the buffered mode. The execution of command 2 is triggered during the motion controlled by command 1. Command 2 starts to control the motion of the axis when the motion of command 1 is completed. There is a process of axis stopping between the two motions.

BlendingLow mode:

Relative motion command 2 uses the BlendingLow mode and is executed during the motion controlled by command 1.

The blending range refers to the range of motion leading to the end of the previous motion segment. Within this range, the axis speed can behave in two ways: either the speed remains constant, and after leaving the blending range (reaching the end of the previous motion segment), the axis accelerates or decelerates to the speed of the next motion segment; or the axis accelerates or decelerates, and after leaving the blending range, the axis accelerates or decelerates exactly to the speed of the next motion segment. Which scenario applies depends on the Buffered setting of the blending mode and the speeds set for the two motion segments. In BlendingLow mode, the blending range uses the slower speed of the two motion segments. If the first motion segment is slow, the blending range speed remains constant, and after leaving the blending range, the axis accelerates to the speed set for the next motion segment (as shown in the diagram). If the first motion segment is fast, the axis decelerates within the blending range, and after leaving the blending range, the axis speed is exactly the speed set for the next motion segment.

BlendingPrevious mode:

The relative motion command 2 uses the BlendingPrevious mode, which triggers the execution of command 2 during the motion controlled by command 1.

Within the mixing range, the speed of the previous motion is used. After leaving the mixing range (i.e., reaching the end of the previous motion), the axis accelerates or decelerates to the speed of the next motion. The following diagram shows the acceleration to the speed of the next motion after leaving the mixing range.

BlendingNext mode:

The relative motion instruction 2 uses the BlendingNext mode, which triggers the execution of instruction 2 during the motion controlled by instruction 1.

Within the mixing range, the shaft accelerates or decelerates; upon leaving the mixing range, the shaft accelerates or decelerates to the speed of the next phase of motion. The diagram below shows acceleration within the mixing range, with the shaft speed reaching the speed of the next phase of motion upon leaving the mixing range.

BlendingHigh mode:

Relative motion command 2 uses BlendingHigh mode and is executed during the motion controlled by command 1.

The mixing range uses the faster speed of the two motion segments. If the speed of the first motion segment is fast, the speed of the mixing range remains unchanged, and the axis begins to decelerate to the speed set for the second motion segment after leaving the mixing range; if the speed of the first motion segment is slow, the axis accelerates within the mixing range, and the speed of the axis after leaving the mixing range is exactly the speed set for the second motion segment (as shown in the figure below).

Programming methods

Example 1

The control axis moves at a speed of 20 to position 100, and then accelerates to 30 to position 200.

program:

① Add an MC_Power axis enable function block to enable the axis. ② Instantiate two MC_MoveAbsolute function blocks. Function block 1 is set to position 100, speed 20, and default BufferMode. Function block 2 is set to position 200, speed 30, and BufferMode BlendingPrevious. The CFC program executes in the following order: first function block 1, then function block 2. ③ Add a variable MoveStart and bind it to both MC_MoveAbsolute function blocks to control the motion execution.

result:

Note: A TRUE output pin for MC_MoveAbsolute.Active indicates that the motion controlled by the function block is in operation.

Example 2

The control axis starts moving at a speed of 10 to position 100. During the movement, it receives the in1 input signal and increases the speed to 20.

program:

① Add the MC_Power axis enable function block to enable the axis. ② Add the MC_MoveAbsolute function block, and add variables to control the function block's start, movement position, and movement speed.

③ Write the control program. When the input signal in0 is triggered, the axis starts to move at a speed of 10 to 100; if the input signal in1 is triggered during the movement, the speed of the axis increases to 20; when the axis reaches 100, the movement is completed.

result:

That concludes this technical sharing session on "Online Gear Shifting Implemented via BufferMode". For more exciting content, please continue to follow the "Leadsai Control Technology" WeChat official account. In the next session, we will share "Implementing Online Gear Shifting Using Online Gear Shifting Function Blocks Provided by Leadsai". Stay tuned!

-END-

Read next

CATDOLL 138CM Tami TPE

Height: 138cm Weight: 26kg Shoulder Width: 30cm Bust/Waist/Hip: 65/61/76cm Oral Depth: 3-5cm Vaginal Depth: 3-15cm Anal...

Articles 2026-02-22