A2数字舵机工作原理_第1页
A2数字舵机工作原理_第2页
A2数字舵机工作原理_第3页
A2数字舵机工作原理_第4页
A2数字舵机工作原理_第5页
已阅读5页,还剩1页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

AX-12资料把握原理程序:时间仓促。弄的不是很整齐,有什么问题,请直接联系我!~~概述:DynamixelAX12+伺服电机专用把握0~300°;当用作轮子驱动时,可以选2倍。AX-12+规格参数:1.重量:55g2.齿轮减速比:1/254.扭矩:m〔;·〔V〕4.速度:0.269秒/60度(7V);0.196秒/60度(10V)5.最小区分率:0.35°.最大运行角度:〔有位置把握;连续旋转〔无位置把握〕7.电压:7V~10V〔推举供电:9.6V〕8.最大电流:900mA9.工作温度:-5~+85℃把握信号:数字信号通讯协议:半双工异步串行通信〔、无奇偶效验13.Link方式:TTL-Daisy总线通讯速率:7343bps~1Mbps反响:位置、温度、负载、电压材质:工业塑料LED指示灯或停顿输出扭矩。二.工作原理:硬件电路:TTL电平的半双工异步串行通道。推举就是舵机生产商的名字)CM-5.AX-12。所以我们需要知道它的内部协议。软件:从DATASHEET中得知:AX-12的指令总表如下翻译下:指令功能代码参数个数PING猎取舵机状态数据包0x010READDATARAM的信息0x022WRITEDATARAM的一个字节0x032~REGWRITEACTION激活下同上0x042~ACTION触发命令0x050RESET复位0x060SYNCWRITE把握舵机舵机同时转动0x834~在这里,RESET和SYNCWRITE2个指令!2个指令:复位〔RESET〕FunctionChangesthecontroltablevaluesoftheDynamixelactuatortotheFactoryDefaultValuesettingsLength0X02Instruction0X06ParameterNONEExample4ResettingtheDynamixelactuatorwithanIDof0InstructionPacket:0XFF0XFF0X000X020X060XF7`函数功能:将全部舵机RAM,ROM的内容恢复到出厂状态长度: 0x02指令值:0x06参数: 无处理器发送指令:0XFF0XFF0X000X020X060XF70XFF 0XFF 为起始标志0x00ID号0x02为指令长度0x06为指令代码0xF7为校验码( Check_Sum=~(ID+2+6))把握舵机移动FunctionUsedforcontrollingmanyDynamixelactuatorsat thesametime.ThecommunicationtimedecreasesbytheSynchWriteinstructionsincemanyinstructionscanbetransmittedbyasingleinstruction.However,youcanusethisinstructiononlywhenthelengthsandaddressesofthecontroltabletobewrittentoarethesame.Also,thebroadcastingIDneedstobeusedfortransmitting.ID0XFELength(L+1)*N +4(L:DatalengthforeachDynamixelactuator, N:ThenumberofDynamixelactuators)Instruction0X83Parameter1StartingaddressofthelocationwherethedataistobewrittenParameter2Thelengthofthedatatobewritten(L)Parameter3TheIDofthe1stDynamixelactuatorParameter4The1stdataforthe1stDynamixelactuatorParameter5The2nddataforthe1stDynamixelactuator…ParameterL+3TheLthdataforthe1stDynamixelactuatorParameterL+Dataforthe1stDynamixelactuatorParameterL+4TheIDofthe2ndDynamixelactuatorParameterL+5The1stdataforthe2ndDynamixelactuatorParameterL+6The2nddataforthe2ndDynamixelactuator…Parameter2L+4TheLthdataforthe2ndDynamixelactuator….Example5Settingthefollowingpositionsandvelocitiesfor4DynamixelactuatorsDynamixelactuatorwithanIDof0:toposition0X010withaspeedof0X150DynamixelactuatorwithanIDof1:toposition0X220withaspeedof0X360Dataforthe2ndDynamixelactuator函数功能AX-12舵机同时移动,固然,这条指令也可以把握一个舵机移动。我们用就是用这条指令来使舵机动作!长度: (L+1)*N+4(L:每个舵机的把握信息长度,N:把握舵机数)指令值:0xFE下面我们用这条指令编写一个把握一个舵机的子程序:voidMove_One(unsignedintPostion,unsignedintSpeed,unsignedcharID){unsignedintCheck_Sum;if(Postion>=0x3ff)Postion=0x3ff; //位置值不能超过0x3ffif(Speed>=0x3ff) Speed=0x3ff; //位置值不能超过0x3ff//Check_Sum=~(0xfe+0x09+0x83+0x1e+0x04+ID+Postion%256+Postion/256+Speed%256+Speed/256); //校验码计算Check_Sum=~(0xac+ID+Postion%256+Postion/256+Speed%256+Speed/256);if(Check_Sum>0xff)Check_Sum=Check_Sum%256;uart_t(0xff);uart_t(0xff); //发送起始码uart_t(0xfe); //指令代码uart_t(0x09); //移动一个舵机的参数长度uart_t(0x83); //指令:SYNC_WRITEuart_t(0x1e); uart_t(0x04); //把握信息的长度:两个字节速度,两个字节位置uart_t(ID); uart_t(Postion%256); //目标位置低字节uart_t(Postion/

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论