Contact me: hankecnc@gmail.com

CPU 高(已解决?) #1765

推推 grbl 3年前 (2023-02-03) 237次浏览
打开
Metropolicon 打开了这个问题 2022 年 11 月 24 日 · 1条评论
打开

CPU 高(已解决?)#1765

Metropolicon 打开了这个问题 2022 年 11 月 24 日 · 1条评论

评论

CPU 高(已解决?) #1765
大都会 评论了 2022 年 11 月 24 日  

大家好….
在我的树莓派 4 上,运行 gcode,即使在暂停状态下,cpu 核心之一的使用率高达 95%……
在我的 Windows PC 上,任务管理器显示 bCNC 的 cpu 使用率非常高…

探索 bCNC 代码,在 Sender.py 中只添加了两行,问题似乎解决了…..
CPU USAGE now : 20%

def serialIO(自身):

self.sio_wait   = False    # wait for commands to complete (status change to Idle)
self.sio_status = False    # waiting for status <...> report
cline  = []    # length of pipeline commands
sline  = []      # pipeline commands
tosend = None      # next string to send
tr = tg = time.time()    # last time a ? or $G was send to grbl

while self.thread:
  t = time.time()
  if self.running:                                              #-------added this line
    time.sleep(0.05)                                          #-------added this line
  # refresh machine position?
  if t-tr > SERIAL_POLL:

我是简单的幸运儿吗?

CPU 高(已解决?) #1765 大都会 改变了标题 CPU 高(已解决) CPU 高(已解决?) 2022 年 11 月 24 日
CPU 高(已解决?) #1765
贡献者

虽然这确实解决了问题,但如果您尝试每秒发送超过 20 ( 1 / 0.05 ) 行 Gcode,它可能会产生限制性能的副作用,这可能不常见,但并非无法想象,具体取决于你的机器和你的项目。该值可能需要可调以处理这种情况。

免费注册 在 GitHub 上加入此对话。已有帐户? 登录评论
标签
还没有
项目

还没有

发展

没有分支机构或拉取请求

2名参加者
CPU 高(已解决?) #1765CPU 高(已解决?) #1765

喜欢 (0)