Navigation

    全志在线开发者论坛

    • Register
    • Login
    • Search
    • Categories
    • Tags
    • 在线文档
    • 社区主页

    如何控制IO输出高速脉冲,控制步进电机加减速?

    Linux
    3
    3
    1438
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • X
      xiaofangzi LV 4 last edited by

      linux系统下,通过控制器GPIO输出的频率(非PWM方式)实现对步进电机的速度控制,输出的脉冲的个数控制步进电机运动的长度。
      采用如下伪代码方式,读写GPIO的速度是否满足高速响应?
      write high
      ussleep(dlt);
      write low
      ussleep(dlt);
      pluscnt++;

      WhycanService 1 Reply Last reply Reply Quote Share 0
      • WhycanService
        WhycanService LV 8 @xiaofangzi last edited by

        @xiaofangzi

        GPIO速度可以满足,但是Linux调度的实时性不能满足

        C 1 Reply Last reply Reply Quote Share 0
        • C
          chhjnavy LV 5 @WhycanService last edited by

          @whycanservice 请问:目前我用两个线程,一个线程拍照,一个线程gpio 输出控制电机,但是电机转的断断续续(如果只有一个线程跑电机是正常的),看起来好像是调度问题,这种情况怎么解决?

          1 Reply Last reply Reply Quote Share 0
          • 1 / 1
          • First post
            Last post

          Copyright © 2024 深圳全志在线有限公司 粤ICP备2021084185号 粤公网安备44030502007680号

          行为准则 | 用户协议 | 隐私权政策