土司Apple

    1. 本帖最后由 土司Apple 于 2017-11-13 14:40 编辑 请问楼主:现在把STM32timer3配置成TI1双边沿计数   sConfig.EncoderMode = TIM_ENCODERMODE_TI1;   sConfig.IC1Polarity = TIM_ICPOLARITY_BOTHEDGE;   sConfig.IC1Selection = TIM_ICSELECTION_DIRECTTI;   sConfig.IC1Prescaler = TIM_ICPSC_DIV1;   sConfig.IC1Filter = 0;   sConfig.IC2Polarity = TIM_ICPOLARITY_BOTHEDGE;   sConfig.IC2Selection = TIM_ICSELECTION_DIRECTTI;   sConfig.IC2Prescaler = TIM_ICPSC_DIV1;   sConfig.IC2Filter = 0; 这么配置有个现象一开机电机不转,但是编码器会开始计数,让电机转动一下,然后清零计数器,就好了。这是为啥? 其他的方式配置编码器计数方向会不准(TI12一起双边沿计数,开机之后计数防线快跟所测编码器波形指示的方向不同),再有f407参考手册里面 CC1 channel configured as input: CC1NP/CC1P bits select the active polarity of TI1FP1 and TI2FP1 for trigger or capture operations. 00: non-inverted/rising edge The circuit is sensitive to TIxFP1 rising edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode or encoder mode). 01: inverted/falling edge The circuit is sensitive to TIxFP1 falling edge (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is inverted (trigger operation in gated mode or encoder mode). 10: reserved, do not use this configuration. 11: non-inverted/both edges The circuit is sensitive to both TIxFP1 rising and falling edges (capture or trigger operations in reset, external clock or trigger mode), TIxFP1 is not inverted (trigger operation in gated mode). This configuration must not be used in encoder mode(这一句话意思跟设置成双边沿计数的方式是否矛盾?) 多谢多谢,盼望楼主慷慨解答。
    2. huo_hu 发表于 2017-10-31 14:04 编码器的手册上应该有,挂上示波器做下实验是最好的
      这里的板子是直接读取的伺服驱动器上的编码器差分输出,差分接收之后再转换成ABZ三个信号接到STM32,配置是AB双边沿计数,4分频,这样的话就是编码器输出多少计数器的数值就是多少,最后的现象是方向不准,我向一个方向转的时候,编码器的输出一会正传一会儿反转,这样的话计数也就不准了。
    3. huo_hu 发表于 2015-2-22 15:26 好的,我来补充一下, 1.编码器有个转速上限,超过这个上限是不能正常工作的,这个是硬件的限制,原则上线数越 ...
      编码器的转速上限这个信息如何获取,芯片手册还是得自己计算?

最近访客

< 1/1 >

统计信息

已有2人来访过

  • 芯积分:--
  • 好友:--
  • 主题:--
  • 回复:3

留言

你需要登录后才可以留言 登录 | 注册


现在还没有留言