281229961 发表于 2010-7-23 12:34:40

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

http://cache.amobbs.com/bbs_upload782111/files_31/ourdev_570184.jpg
(原文件名:3.jpg)

http://cache.amobbs.com/bbs_upload782111/files_31/ourdev_570185.jpg
(原文件名:4.jpg)

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

40130064 发表于 2010-7-23 12:41:14

保持不变,直到移动到另一点。(没处理过的信号,处理过的信号不是这样)

281229961 发表于 2010-7-23 12:46:44

回复【1楼】40130064
保持不变,直到移动到另一点。(没处理过的信号,处理过的信号不是这样)
-----------------------------------------------------------------------
一楼大哥能给个示意图吗?
我不知道从新开始时的起点是高电平还是低电平?

281229961 发表于 2010-7-23 13:40:22

单次反转的波形是这样吗?

http://cache.amobbs.com/bbs_upload782111/files_31/ourdev_570205.jpg
(原文件名:1.jpg)


下面是间隔半个多周期的连续反转 波形时这样的吗?
http://cache.amobbs.com/bbs_upload782111/files_31/ourdev_570206.jpg
(原文件名:2.jpg)

wwxx001 发表于 2010-7-23 14:11:46

要对上升沿和下降沿都进行处理,这样一共有四种情况,A上升B高A上升B低A下降B高 A下降B低,需要分别对计数进行不同的处理,这样就不需要处理突然反向转动的问题

40130064 发表于 2010-7-23 15:16:25

回复【3楼】281229961 小朱
-----------------------------------------------------------------------

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

281229961 发表于 2010-7-27 09:35:27

还是自己来搞定吧!

http://cache.amobbs.com/bbs_upload782111/files_31/ourdev_570976.jpg
(原文件名:状态图.jpg)

http://cache.amobbs.com/bbs_upload782111/files_31/ourdev_570977.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;

281229961 发表于 2010-7-27 09:41:06

这个只是判断方向的进程,

Excellence 发表于 2010-7-27 09:43:57

DING.

ldch 发表于 2010-8-1 22:40:50

有空学习学习

tuowai 发表于 2010-8-2 22:38:37

记号

wanwzy 发表于 2010-8-10 08:29:26

学习

wyyu 发表于 2010-8-24 17:50:07

图形应是轴对称的

wyyu 发表于 2010-8-24 17:51:05

翻转点为轴

millwood0 发表于 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[].

justing88 发表于 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.

ibmx311 发表于 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线,由于编码器的处理不当(常规方法作的),所以在许多场合下会损坏电机最好
的情况也是报警和保护,但这种动作很可能会造成工业上极大的危险,所以在稍微严肃点的地方大家都只好采用比如安川的系统
页: [1]
查看完整版本: 请问光电编码器在改变转动方向时,产生的相位差波形时什么样子的? 改变方向的瞬间该如