搜索
bottom↓
回复: 16

请问光电编码器在改变转动方向时,产生的相位差波形时什么样子的? 改变方向的瞬间该如

[复制链接]

出0入0汤圆

发表于 2010-7-23 12:34:40 | 显示全部楼层 |阅读模式

(原文件名:3.jpg)


(原文件名:4.jpg)

假如在如图示位置突然反向转动 接下来波形该如何的状态呢?

阿莫论坛20周年了!感谢大家的支持与爱护!!

知道什么是神吗?其实神本来也是人,只不过神做了人做不到的事情 所以才成了神。 (头文字D, 杜汶泽)

出0入0汤圆

发表于 2010-7-23 12:41:14 | 显示全部楼层
保持不变,直到移动到另一点。(没处理过的信号,处理过的信号不是这样)

出0入0汤圆

 楼主| 发表于 2010-7-23 12:46:44 | 显示全部楼层
回复【1楼】40130064
保持不变,直到移动到另一点。(没处理过的信号,处理过的信号不是这样)
-----------------------------------------------------------------------
一楼大哥能给个示意图吗?
我不知道从新开始时的起点是高电平还是低电平?

出0入0汤圆

 楼主| 发表于 2010-7-23 13:40:22 | 显示全部楼层
单次反转的波形是这样吗?


(原文件名:1.jpg)


下面是间隔半个多周期的连续反转 波形时这样的吗?

(原文件名:2.jpg)

出0入0汤圆

发表于 2010-7-23 14:11:46 | 显示全部楼层
要对上升沿和下降沿都进行处理,这样一共有四种情况,A上升B高  A上升B低  A下降B高 A下降B低,需要分别对计数进行不同的处理,这样就不需要处理突然反向转动的问题

出0入0汤圆

发表于 2010-7-23 15:16:25 | 显示全部楼层
回复【3楼】281229961 小朱
-----------------------------------------------------------------------

原始信号是这样,所以方向信号提比较难.

出0入0汤圆

 楼主| 发表于 2010-7-27 09:35:27 | 显示全部楼层
还是自己来搞定吧!


(原文件名:状态图.jpg)


(原文件名:振动波形图.jpg)

        process(CLK,RST)
           begin
                if RST = '1' then
                        dir_buf <= '0';
                        cur_state <= "00";
                elsif CLK = '1' and CLK'event then
                        case cur_state is
                                when "00" =>
                                if next_state="01" then
                                                dir_buf <= '0';-------
                                        cur_state <= next_state;
                                elsif next_state="10" then
                                                dir_buf <= '1';-------
                                        cur_state <= next_state;   
                                end if;                            
                                when "01" =>
                                        if next_state="11" then
                                                dir_buf <= '0';-------
                                        cur_state <= next_state;
                                elsif next_state="00" then
                                                dir_buf <= '1';-------
                                        cur_state <= next_state;
                                end if;         
                                when "10" =>
                                        if next_state="00" then
                                                dir_buf <= '0';-------
                                        cur_state <= next_state;
                                elsif next_state="11" then
                                                dir_buf <= '1';-------
                                        cur_state <= next_state;
                                end if;                                        
                                when "11" =>
                                        if next_state="01" then
                                                dir_buf <= '1';-------
                                        cur_state <= next_state;
                                elsif next_state="10" then
                                                dir_buf <= '0';-------
                                        cur_state <= next_state;
                                end if;                                        
                                when others =>
                                        NULL;
                        end case;
              end if;
       end process;

出0入0汤圆

 楼主| 发表于 2010-7-27 09:41:06 | 显示全部楼层
这个只是判断方向的进程,

出0入0汤圆

发表于 2010-7-27 09:43:57 | 显示全部楼层
DING.

出0入0汤圆

发表于 2010-8-1 22:40:50 | 显示全部楼层
有空学习学习

出0入0汤圆

发表于 2010-8-2 22:38:37 | 显示全部楼层
记号

出0入0汤圆

发表于 2010-8-10 08:29:26 | 显示全部楼层
学习

出0入0汤圆

发表于 2010-8-24 17:50:07 | 显示全部楼层
图形应是轴对称的

出0入0汤圆

发表于 2010-8-24 17:51:05 | 显示全部楼层
翻转点为轴

出0入0汤圆

发表于 2010-8-24 18:38:44 | 显示全部楼层
"还是自己来搞定吧! "

that's overly complicated.

the state chart actually provides you with a very simple way to read a rotary switch. if you simply read the levels of A and B, and compare the results of previous and current read, you will know 1) if the rotary switch has turned, and 2) if it turns in a particular direction.

for example, if your last read is 00 and the current read is 01, you know, per your state chart, that the rotary has turned counter-clock wise.

so you can define a 4-bit array:

const unsigned char state-chart[]={
  0,  //input of 00/00 is stationary
  -1, //input of 00/01 -> counter clock wise
  1,  //00/10 -> clock wise
  0,  //00/11 -> invalid
  1,  //01/00 -> clock wise
  0,  //01/01 -> stationary
  0,  //01/10 -> invalid
  -1, //01/11 -> counter clock
.....

then all you need to do in your code is to compose a unsigned char whose bit 0..1 contain the current read and bit 2..3 contain the previous read and use it to index state-chart[].

出0入0汤圆

发表于 2011-10-20 10:45:57 | 显示全部楼层
回复【14楼】millwood0  
-----------------------------------------------------------------------

where is this suggestion from? ti or pic ? can you give me more detailed information ? i need to deepen it , thk u.

出0入300汤圆

发表于 2011-10-20 11:22:01 | 显示全部楼层
还是在比较初级的状态下
估计你想玩伺付,就多说几句

要是想真正正确的解码尤其是在4倍频的情况下,必须参考编码器转动之前的状态(我没在网上的论坛上看到过有这样的例程)
这时对处理器的要求就比较高了
我先用STM32做,编码器5000线,电机3600转,发现根本解不出来
而stm32自带的编码器解码是极简易的方式,根本不适合稍严肃点的工业应用
后用C8051f120时钟100M,用汇编可以工作到2000转,C写只能工作到1600转
最后改用EPM240-C3,时钟加到350MHz才搞定,这时电机可以到5000转,编码器每圈20000线(四倍频)

现在专用的主轴伺服电机基本用2500线编码器,转速达到8000转,一般的矢量位置变频器(比如台达的)只能处理500线(8000转时)
但好一点的比如三菱A740系列可以处理到800线
这时最好的办法只有将编码器先分频,最合适的和最省事的芯片只能是MC145151

光电增量编码器是个无尽的话题,许多人一知半解就觉得明白了,其实真正用到工业上不是简单的事情
目前国产伺服电机的编码器一般2500线,由于编码器的处理不当(常规方法作的),所以在许多场合下会损坏电机最好
的情况也是报警和保护,但这种动作很可能会造成工业上极大的危险,所以在稍微严肃点的地方大家都只好采用比如安川的系统
回帖提示: 反政府言论将被立即封锁ID 在按“提交”前,请自问一下:我这样表达会给举报吗,会给自己惹麻烦吗? 另外:尽量不要使用Mark、顶等没有意义的回复。不得大量使用大字体和彩色字。【本论坛不允许直接上传手机拍摄图片,浪费大家下载带宽和论坛服务器空间,请压缩后(图片小于1兆)才上传。压缩方法可以在微信里面发给自己(不要勾选“原图),然后下载,就能得到压缩后的图片。注意:要连续压缩2次才能满足要求!!】。另外,手机版只能上传图片,要上传附件需要切换到电脑版(不需要使用电脑,手机上切换到电脑版就行,页面底部)。
您需要登录后才可以回帖 登录 | 注册

本版积分规则

手机版|Archiver|amobbs.com 阿莫电子技术论坛 ( 粤ICP备2022115958号, 版权所有:东莞阿莫电子贸易商行 创办于2004年 (公安交互式论坛备案:44190002001997 ) )

GMT+8, 2024-7-23 13:10

© Since 2004 www.amobbs.com, 原www.ourdev.cn, 原www.ouravr.com

快速回复 返回顶部 返回列表