【ECEN018】How to Design Programs for Palletizing Project

Application Requirement

    The sample project needs to palletize the products with 2x2 arrangement. The distance between the products is 45mm on X-axis and 50mm on Y-axis. The height between each layer is 30mm. User Frame 1 is configured to match the layout of the operating field. As the figure shows, the picking up position starts from P0, then P1, P2, P3. The lifting-up height after gripping the product is 200mm.

Organizing the conditions

    Known:

        Using User Frame 1

        50mm between the products on X-axis

        45mm between the products on Y-axis

        30mm height difference between each layer

        P0 is the starting point

Design

    The sample code is done by Lua script
    pose_mul and pose_inv are exiting functions. Please use EC Lua Manual as reference.

    The following concept designs only introduce using the script for position calculation. 

    For downloading Lua script to robot and interacting with JBI program, please read: https://bbs.elibot.cn/forum/detail/topic/79.html

Design 1

Concept

    Design 1: User Frame stays constant, calculates offset distance from other products to P0 under User Frame 1.

Figures



    As the figure above, assuming the position for P0 under User Frame 1 is [dx, dy, 0, 0, 0, 0], with the give information, the offset based position for other point will be as figures below.


P1:[dx+45,dy,0,0,0,0]


p2:[dx,dy+50,0,0,0,0]


p3:[dx+45, dy+50, 0, 0, 0, 0]

Sample Code

--[[
p0_in_cart: P0 under Cartesian (base) frame
p0_in_user: P0 under user frame
user_frame: User Frame
trsf_x:x-axis offset value
trsf_y:y-axis offset value
trsf_z:z-axis offset value
]]--

-- Calculate each positon under the user frame 
p0_in_user = pose_mul(pose_inv(user_frame), p0_in_cart)
p1_in_user = [p0_in_user[1]+trsf_x, p0_in_user[2], p0_in_user[3], p0_in_user[4], p0_in_user[5], p0_in_user[6]]
p2_in_user = [p0_in_user[1], p0_in_user[2]+trsf_y, p0_in_user[3], p0_in_user[4], p0_in_user[5], p0_in_user[6]]
p3_in_user = [p0_in_user[1]+trsf_x, p0_in_user[2]+trsf_y, p0_in_user[3], p0_in_user[4], p0_in_user[5], p0_in_user[6]]

-- convert each point to Cartesian frame position
p1_in_cart = pose_mul(user_frame, p1_in_user)
p2_in_cart = pose_mul(user_frame, p2_in_user)
p3_in_cart = pose_mul(user_frame, p3_in_user)

Design 2

Concept

    Design 2 Update user frame for every position, but the product position stays same.



    Calculate the position for P0 for the initial user frame.

    p0_in_user = pose_mul(pose_inv(user_frame), p0_in_cart)

    user_frame:Initial user_frame

    p0_in_cart:taught P0 position


    user_frame1 = pose_mul(user_frame, [trsf_x, 0, 0, 0, 0, 0])

    p1 =

    user_frame2 = pose_mul(user_frame, [0, trsf_y, 0, 0, 0, 0])


    user_frame3 = pose_mul(user_frame, [trsf_x, trsf_y, 0, 0, 0, 0])

Sample Code

--[[
p0_in_cart:P0在世界坐标系下的位姿数据
p0_in_user: Position for P0 under user frame
user_frame: initial user frame
user1_frame: user frame for P1
...... : user frame for other product
trsf_x: X-axis offset.
trsf_y: Y-axis offset.
trsf_z: Z-axis offset.
]]--

-- Calculate user frames for each product., then convert result to Cartesian frame position
p0_in_user = pose_mul(pose_inv(user_frame), p0_in_cart)
user_frame1 = pose_mul(user_frame, [trsf_x, 0, 0, 0, 0, 0])
p1_in_cart = pose_mul(user1_frame, p0_in_user)
user_frame2 = pose_mul(user_frame, [0, trsf_y, 0, 0, 0, 0])
p2_in_cart = pose_mul(user2_frame, p0_in_user)
user_frame3 = pose_mul(user_frame, [trsf_x, trsf_y, 0, 0, 0, 0])
p3_in_cart = pose_mul(user3_frame, p0_in_user)
点击显示全文
赞同0
发表评论
分享

手机扫码分享
0
448
收藏
举报
收起
登录
  • 密码登录
  • 验证码登录
还没有账号,立即注册
还没有账号,立即注册
注册
已有账号,立即登录
选择发帖板块
上传文件
举报
请选择举报理由
举报
举报说明