吴坤
Asynchronous Motion
2025-7-24 14:05
阅读:756

// Asynchronous Motion Example:

// Demonstrates using MoveIncremental(), MoveAbsolute() and MoveFreerun() axis-based motion.

program

// Enable and home the axes.

Enable([X, Y, Z])

Home([X, Y, Z])

// Configure the axis-based ramping settings.

// X and Y will use Linear ramping.  Z will use Sine ramping.

SetupAxisRampType([X, Y], RampType.Linear)

 SetupAxisRampType(Z, RampType.Sine)

// X, Y, and Z will use a ramp rate of 1000.0 units/sec/sec.

SetupAxisRampValue([X, Y, Z], RampMode.Rate, 1000.0)

SetupAxisRampValue(Z,0,500)

// Move X, Y, and Z to an initial position of 10 units.

// Move all axes at 20 units/second. // Note: The AeroScript program flow immediately continues after an asynchronous move // is started, so we must explicitly wait for the moves to complete.

MoveAbsolute([X, Y, Z], [10.0, 10.0, 10.0], [20.0, 20.0, 20.0])

WaitForInPosition([X, Y, Z])

// Trigger a data collection snapshot in Studio.

AppDataCollectionSnapshot()

// Perform independent axis moves on X and Y using absolute target positions, followed by

// a move on Z using an incremental distance. // Move X and Y independently to (27.0 units, 13.5 units). // X will move at a maximum speed of 50 units/second. // Y will move at a maximum speed of 75 units/second.

MoveAbsolute([X, Y], [27.0, 13.5], [50.0, 75.0])

WaitForMotionDone([X, Y])

// Move Z from its current location by -15.5 units at a speed of 20.0 units/second.

MoveIncremental(Z, -15.5, 20.0)

WaitForMotionDone(Z)

// Perform a freerun move on the Z axes to a constant velocity of +30.0 units/second.

// After 2 seconds, change the speed to -40.0 units/second. // After 2 additional seconds, stop the motion.

Dwell(1.0)

MoveFreerun(Z, 30.0)

Dwell(2.0)

MoveFreerun(Z, -40.0)

Dwell(2.0)

MoveFreerunStop(Z)

WaitForMotionDone(Z)

// Stop data collection.

AppDataCollectionStop()

// Disable the axes.

Disable([X, Y, Z])

end

转载本文请联系原作者获取授权,同时请注明本文来自吴坤科学网博客。

链接地址:https://wap.sciencenet.cn/blog-54347-1495019.html?mobile=1

收藏

下一篇
当前推荐数:1
推荐人:
推荐到博客首页
网友评论0 条评论
确定删除指定的回复吗?
确定删除本博文吗?