elmo驱动器上位机的使用

1.接线

2.连接和配置

3.调试

4.开机自运行

1.接线示意图

2. 连接和配置

(1)添加驱动器到工作空间。在工作空间右键,选择Add Gold Driver。

(2)新建驱动器(Driver03)如图所示,前面两个为之前新建过的。

(3)在Driver03里,选择目标连接方式,选择Direct Access USB(直接使用USB)连接。

(4)选择USB连接的端口。选择第一步在设备管理器里的端口,这里选择com3接口。

(5)连接驱动器。在右侧系统设置的工作区里,右键Driver03,选择connect。

(6)电机参数如下:

 

 

 

 最后,点击自动调节,进行应用,期间电机会小幅运动,注意安全。

3.调试

如下界面,进行如下设置,点击enable会后,填写好sine参数,点击start,即可开始运动。前提是确认编码器是校准标定过的,如果编码器红灯,一定要标定变绿才行。

4.开机自运行一个sin的往复运动

根据需要,调节k的值,可以更改运动速度的大小,初始可以给个比较小的值,比如k=1000 //k is the unit factor.

#@AUTOEXEC
//Call your Auto Exec Function Here 
until AN[6]>20
wait 1000
main()

function P2P_Abs(float Distance)
float k

if (UM!=5)    // Ensure motor is in position mode, otherwise disable the motor
 MO=0
end
if (MO==0)
 UM=5 // Set position mode before enable motor
 MO=1 // Enable motor
end

k=1000 //k is the unit factor.

PR= Distance*k     // Set P2P motion target position(point-to-point relative motion), PA is point-to-point absolute motion
SP= 0.4e6*k     // Set P2P motion speed
AC=60*k          // Set P2P motion acceleration
DC=60*k          // Set P2P motion deceleration
SD=60*k          // Set P2P motion stop deceleration
SF=20 // Set Smooth Factor
BG // Begin motion

return

//positive isodistance segmented motion, the total stroke is Distance, and the number of segments is Num, which can be used to the laser interferometer measurement
function pos_func(float Num,float Distance)
float i,deltaDis,realPos
deltaDis=Distance/Num
realPos=0
for i=1:Num
realPos=realPos+deltaDis
P2P_Abs(realPos)
wait(3000)
end
return

function neg_func(float Num,float Distance)
float i,deltaDis,realPos
deltaDis=Distance/Num
realPos=Distance
for i=1:Num
realPos=realPos-deltaDis
P2P_Abs(realPos)
wait(3000)
end
return

// The main program
function main()
int j,k
HM[1]=1 //Modify a position counter (homing)
for j=1:200
pos_func(1,45)
pos_func(1,-45)
//for k=1:3
//wait(10e3)
//end
end

MO=0
return

①选择Drive Programming,右键单击Solution并从下拉菜单中选择New Project,新建一个工程;②然后右键单击Project名称并选择New Program,即可开始编写运动程序;③编译程序之前,要先将驱动器链接到Project,在Workspace tree中右键单击drive,从下拉菜单中选择Link Project;④下一步是构建和下载程序,单击Build按钮,IDE软件将编译程序,如果在编译期间没有报错,它就会将程序下载到驱动器上。这个选项只能在online模式下使用。同时Output选项卡显示该操作的结果。⑤最后,在驱动器中运行程序,单击Start按钮。这个按钮运行程序,忽略任何选择的调试选项,如断点。

界面截图如下所示:

 如果加入了开机自动启动的头三行代码,在启动运行之后,按照顺序,先拔掉电源,再拔掉连接的数据线。再次连接电源,即可发现能够自动运行了。

  • 6
    点赞
  • 24
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值