返回列表 发布新帖

AX 多圈绝对值编码器断电保持

317 0
发表于 2024-7-10 18:16:53 | 查看全部 阅读模式

马上注册,结交更多好友,享用更多功能,让你轻松玩转社区。

您需要 登录 才可以下载或查看,没有账号?立即注册

×
<ol style="list-style-type: none;" class=" list-paddingleft-2"><li><p><br/></p></li><ol style="list-style-type: num;" class="custom_num list-paddingleft-1"><li class="list-num-1-1 list-num-paddingleft-1"><p><span style="font-family: 宋体; font-size: 12pt;"><strong>线性模式(Finite)<br/></strong></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 2pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">AX的实际位置Axis.fActPosition是通过计算得出的,参与计算的变量有:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 2pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">A:对象字典<strong>0x6064</strong>(用户实际反馈指令单位)。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 2pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">B:Axis.iTurn(溢出次数,PLC记录的伺服<span style="color: red;">相对运动</span>距离大于2^32指令单位时加一,<em>注意:不是读取伺服的多圈值</em>)。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 21pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">C:Axis.dwRatioTechUnitsDenom(比例单位分母)。D:Axis.iRatioTechUnitsNum(比例单位分子)。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 21pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">E:Axis.fOffsetPosition(位置偏移)。<br/></span></p></li></ol></ol><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">计算公式:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 75pt; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: justify;"><span style="color: red; font-family: 宋体; font-size: 12pt;"><em>fActPosition = ((iTurn *2^32 +&nbsp;<strong>0x6064</strong>)* iRatioTechUnitsNum)/ dwRatioTechUnitsDenom – fOffsetPosition<br/></em></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: center;"><br/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">通过后台软件监控当前Axis.fActPosition、A、B、C、D的值分别为:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: center;"><img src="/upload/image/20220905/1662357779672555.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">((iTurn&nbsp;<em>2^32 +&nbsp;<strong>0x6064</strong>)</em>&nbsp;iRatioTechUnitsNum)/ dwRatioTechUnitsDenom<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">= ((1 * 2^32 +(-100663300)) * 1)/8388608<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">= (2^32/8388608) – 100663300/8388608<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">= 512 –12.000000476837158203125<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">= 499.999999523162841796875(与监控的Axis.fActPositon的值相同)<br/></span></p><ol style="list-style-type: none;" class=" list-paddingleft-2"><li><p><span style="font-family: 宋体; font-size: 12pt;"><strong>旋转模式(Modulo)<br/></strong></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 2pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">该模式下,AX的实际位置Axis.fActPosition的计算方法是另一种,参与计算的变量有:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 2pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">A: 对象字典<strong>0x6064</strong>(用户实际反馈脉冲单位)。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 2pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">B:</span><span style="font-size: 10pt;"><br/></span><span style="font-family: 宋体; font-size: 12pt;">Axis.dwPosOffsetForResiduals (剩余位置偏移)。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 21pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">C:Axis.dwRatioTechUnitsDenom(比例单位分母)。D:Axis.iRatioTechUnitsNum(比例单位分子)。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 21pt; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">E:Axis.fOffsetPosition(位置偏移)。<br/></span></p></li></ol><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">计算公式:</span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><em style="color: red; font-family: 宋体; font-size: 12pt; text-indent: 30px;">fActPosition = ((((DWORD)<strong>0x6064</strong>)- dwPosOffsetForResiduals) * iRatioTechUnitsNum / dwRatioTechUnitsDenom)) – fOffsetPosition</em></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">例如:后台配置:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: center;"><img src="/upload/image/20220905/1662357780501379.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">通过后台软件监控当前Axis.fActPosition、A、B、C、D的值分别为:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: center;"><img src="/upload/image/20220905/1662357780259547.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/><span style="font-family: 宋体; font-size: 12pt;"><br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; margin-left: 75pt; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">(1176735336–1174405120)* 45 / 1048576<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">= (2330216 * 45)/ 1048576<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">= 100.00202178955078125(与监控的Axis.fActPositon的值相同)。、<br/></span></p><ol style="list-style-type: none;" class=" list-paddingleft-2"><li><p><span style="font-family: 宋体; font-size: 12pt;"><strong>AX如何保存绝对位置信息<br/></strong></span></p><p style="margin-top: 0px; margin-bottom: 15px; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;"><strong>2.1、保存功能块<br/></strong></span></p><p style="margin-top: 0px; margin-bottom: 15px; text-align: justify;"><span style="font-family: 宋体; font-size: 12pt;">通过上面的计算方法,如果需要掉电保持数据,必须保存B、C、D、E栏的值。其中0x6064是从编码器读取的,不需要保存。而C、D栏的数据在下载程序的时候已存储到PLC。所以程序只要保存B栏数据:iTurn(溢出次数)、dwPosOffsetForResiduals (剩余位置偏移)。多圈绝对值编码器位置保存功能块提供了保存、加载B栏数据的功能,功能块如下图所示:<br/></span></p></li></ol><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><img class="aligncenter" src="/upload/image/20220905/1662357780466735.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block; text-align: center;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-size: 12pt;">功能块的参数的解释如下</span>:</p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><img class="aligncenter" src="/upload/image/20220905/1662357781986734.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block; text-align: center;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;"><strong>2.2、保存功能块的使用<br/></strong></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">2.2.1、新建一个SMC3_PersistPosition类型的实例,命名SMC3_PersistPosition_0。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><img src="/upload/image/20220905/1662357781999550.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">2.2.2、新建一个SMC3_PersistPosition_Data类型实例persistentData。变量类型为RETAIN PERSISTENT,如下图:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: center;"><img src="/upload/image/20220905/1662357781579758.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">SMC3_PersistPosition_Data结构体变量如下</span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal; text-align: center;"><img src="/upload/image/20220905/1662357782442945.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">2.2.3、SMC3_PersistPosition_0实例的bEnable变量初始化为 TRUE,或者直接给输入端口赋值TRUE、Axis输入端为需要保存位置的轴。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">2.2.4、新建保持变量文件,添加完成后,重新编译程序。<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;"><br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="font-family: 宋体; font-size: 12pt;">2.2.5、编译无误后,打开”PersistentVars”文件,在文件空白处右击选择”Add all instance paths(添加所有实例路径)”后,编译下载程序,绝对值编码器的数据保存功能已生效,如图:<br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><img src="/upload/image/20220905/1662357783663093.png" alt="" style="height: auto; vertical-align: middle; border: 0px; margin: 0px auto; display: block;"/><span style="font-family: 宋体; font-size: 12pt;"><br/></span></p><p style="margin-top: 0px; margin-bottom: 15px; color: rgb(85, 85, 85); font-family: &quot;Microsoft Yahei&quot;, &quot;Helvetica Neue&quot;, Helvetica, Arial, sans-serif; font-size: 15px; text-indent: 30px; white-space: normal;"><span style="color: red; font-family: 宋体; font-size: 12pt;"><strong>注意:</strong></span><span style="font-family: 宋体; font-size: 12pt;">为了保证上电后SMC3_PersistPosition_0加载数据的正确性,需判断输出变量bPositionRestored的状态,如果数据读取正确,bPositionRestored的状态为TRUE。</span></p><p><br/></p>

回复

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Copyright © 2001-2025 英威腾技术论坛 版权所有 All Rights Reserved. 粤ICP备07504406号
关灯 在本版发帖
扫一扫添加微信客服
返回顶部
快速回复 返回顶部 返回列表