开源改变世界!!

问题:伺服行程间歇性缓慢 #688

推推 grbl 2年前 (2023-02-05) 118次浏览
关闭
MarkJB 打开了这个问题 2022 年 10 月 31 日 · 19条评论
关闭

问题:伺服行程间歇性缓慢#688

MarkJB 打开了这个问题 2022 年 10 月 31 日 · 19条评论

评论

问题:伺服行程间歇性缓慢 #688
马克杰布 评论了 2022 年 10 月 31 日  

控制板

ESP32_Plotter_Controller (Emerald Dingo RevB)

机器描述

墙机器人

输入电路

没有反应

配置文件

name: ESP32_Plotter_Controller_RevB_Emerald_Dingo
board: Emerald Dingo (RevB)

kinematics:
  WallPlotter:
    left_axis: 0
    left_anchor_x: -326.500
    left_anchor_y: 120.000
    right_axis: 1
    right_anchor_x: 326.000
    right_anchor_y: 120.000
    segment_length: 10.000

stepping:
  engine: RMT
  idle_ms: 255
  dir_delay_us: 0
  pulse_us: 3
  disable_delay_us: 0

axes:
  shared_stepper_disable_pin: gpio.2
  x:
    # Pully = 100mm circumference
    # Steppers are 1.8deg or 200 divs per rev * 16 micro steps = 3200 steps per rev / 100m = 32 steps per mm
    steps_per_mm: 32.000
    max_rate_mm_per_min: 5000.000
    acceleration_mm_per_sec2: 200.000
    max_travel_mm: 300.000
    soft_limits: false
    homing:
      cycle: 2
      mpos_mm: 0.000
      positive_direction: true
      settle_ms: 250.000
      seek_mm_per_min: 2000.000
      feed_mm_per_min: 200.000
      seek_scaler: 1.100
      feed_scaler: 5.000
    motor0:
      limit_all_pin: NO_PIN
      hard_limits: false
      tmc_2130:
        toff_disable: 1
        direction_pin: gpio.26
        step_pin: gpio.25
        run_amps: 0.350
        hold_amps: 0.25
        microsteps: 16
        stallguard: 16
        stallguard_debug: false
        run_mode: StealthChop
        homing_mode: StealthChop
        use_enable: false
        r_sense_ohms: 0.110
        cs_pin: gpio.17
    motor1:
      null_motor:
  y:
    steps_per_mm: 32.000
    max_rate_mm_per_min: 5000.000
    acceleration_mm_per_sec2: 200.000
    max_travel_mm: 300.000
    soft_limits: false
    homing:
      cycle: 2
      mpos_mm: 0.000
      positive_direction: false
      settle_ms: 250.000
      seek_mm_per_min: 2000.000
      feed_mm_per_min: 200.000
      seek_scaler: 1.100
      feed_scaler: 5.000
    motor0:
      limit_all_pin: NO_PIN
      hard_limits: false
      tmc_2130:
        toff_disable: 1
        direction_pin: gpio.33
        step_pin: gpio.32
        run_amps: 0.350
        hold_amps: 0.25
        microsteps: 16
        stallguard: 16
        stallguard_debug: false
        run_mode: StealthChop
        homing_mode: StealthChop
        use_enable: false
        r_sense_ohms: 0.110
        cs_pin: gpio.16
    motor1:
      null_motor:
  z:
    steps_per_mm: 100
    max_rate_mm_per_min: 5000
    acceleration_mm_per_sec2: 100
    max_travel_mm: 5
    homing:
      cycle: 1
      mpos_mm: 0
      positive_direction: true

    motor0:
      rc_servo:
        pwm_hz: 50
        output_pin: gpio.27
        min_pulse_us: 900
        max_pulse_us: 1465

spi:
  miso_pin: gpio.19
  mosi_pin: gpio.23
  sck_pin: gpio.18

sdcard:
  cs_pin: gpio.5

control:
  reset_pin: gpio.0:low:pu

coolant:
  delay_ms: 1000.000

probe:
  check_mode_start: false

macros:
  startup_line0: 
  startup_line1: 
  macro0: 
  macro1: 
  macro2: 
  macro3: 

start:
  must_home: true
  check_limits: true
  deactivate_parking: false

user_outputs:


arc_tolerance_mm: 0.002
junction_deviation_mm: 0.010
verbose_errors: false
report_inches: false
enable_parking_override_control: false
use_line_numbers: false

启动消息

[MSG:INFO: FluidNC v3.6.4]
[MSG:INFO: Compiled with ESP32 SDK:v4.4.1-1-gb8050b365e]
[MSG:INFO: Local filesystem type is spiffs]
[MSG:INFO: Configuration file:config.yaml]
[MSG:INFO: Machine ESP32_Plotter_Controller_RevB_Emerald_Dingo]
[MSG:INFO: Board Emerald Dingo (RevB)]
[MSG:INFO: SPI SCK:gpio.18 MOSI:gpio.23 MISO:gpio.19]
[MSG:INFO: SD Card cs_pin:gpio.5 detect:NO_PIN]
[MSG:INFO: Stepping:RMT Pulse:3us Dsbl Delay:0us Dir Delay:0us Idle Delay:255ms]
[MSG:INFO: Axis count 3]
[MSG:INFO: Shared stepper disable gpio.2]
[MSG:INFO: Axis X (-300.000,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2130 Step:gpio.25 Dir:gpio.26 CS:gpio.17 Disable:NO_PIN Index:-1 R:0.110]
[MSG:INFO:   Motor1]
[MSG:INFO: Axis Y (0.000,300.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2130 Step:gpio.32 Dir:gpio.33 CS:gpio.16 Disable:NO_PIN Index:-1 R:0.110]
[MSG:INFO:   Motor1]
[MSG:INFO: Axis Z (-5.000,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     rc_servo Pin:gpio.27 Pulse Len(900,1465 period:1048575)]
[MSG:INFO: X Axis driver test passed]
[MSG:INFO: Y Axis driver test passed]
[MSG:INFO: reset_pin gpio.0:low:pu]
[MSG:INFO: Kinematic system: WallPlotter]
[MSG:INFO: Using spindle NoSpindle]
[MSG:INFO: Connecting to STA SSID:*****]
[MSG:INFO: Connecting.]
[MSG:INFO: Connected - IP is 192.168.0.115]
[MSG:INFO: WiFi on]
[MSG:INFO: Start mDNS with hostname:http://fluidnc.local/]
[MSG:INFO: SSDP Started]
[MSG:INFO: HTTP started on port 80]
[MSG:INFO: Telnet started on port 23]

用户界面软件

加工草图

发生了什么?

我正在尝试通过串行端口对来自 MindFlex 耳机的数据进行实时绘图可视化。

我看到的问题是伺服(落笔)随机变得非常慢(大约需要 15 秒才能放下笔)。如果您想看到它的发生,您可以从照片和视频中的斑点中看到它非常随机。

问题:伺服行程间歇性缓慢 #688

我明白这可能不是一个 fluidnc 问题,但是 gcode 发送脚本虽然是基本的,但我多年来一直断断续续地使用它,并且没有看到 grbl 或 grblesp 的这个问题。

有关更多上下文:

处理草图从耳机获取数据,将其转换为一组坐标,代表一个形状并在屏幕上绘制形状,还通过串行端口将坐标作为 gcode 发送,一次一行(它等待接收’ok’ 字符串,所以我猜它会填充缓冲区并阻塞,直到它可以发送新的 gcode 命令)。最初,我每 50 毫秒检查一次串行端口是否有新字符,但将其减慢到 1 秒,我想也许我发送数据太快了,但我仍然看到问题。

我最初的想法是填充缓冲区可能会导致它,但我只是再次运行它并且在第一步中,伺服很慢。那时我只发送了 3 个 gcode 命令。您可以看到伺服器缓慢移动(作为调试的一部分,我添加了状态命令输出)。

第一步,G0 X9.000 Y13.000 Z-5 F1500.000 接着是第一次绘制G1 X9.000 Y13.000 Z5 F1500.000,这是伺服开始真正缓慢移动的地方。在调试时,我将从 fluidnc 接收到的“ok”的轮询减慢到 1000 毫秒,并且发送的每个后续 gcode 命令也将获得状态。从状态输出中,您可以看到伺服运动非常缓慢(并且 x 和 y 没有按预期变化)。我猜它大约需要 12 秒,而通常情况下它需要不到一秒。但是在伺服停止移动后开始下一步移动之前也有几秒钟。

rawEvent() method not defined. 
Sending init command: G10 L2 P2 X-140 Y-550
Waiting for grbl
<Idle|MPos:0.000,-0.000,0.000|FS:0,0>

G10 L2 P2 X-140 Y-550
Waiting for grbl
Init command received ok
Waiting for grbl
<Idle|MPos:0.000,-0.000,0.000|FS:0,0>

G55 Z-5
Waiting for grbl
Command received: ok

Waiting for grbl
<Idle|MPos:0.000,-0.000,-5.000|FS:0,0|WCO:-140.000,-550.000,0.000>

G55 X0 Y0 F1500
Waiting for grbl
Command received: ok

col count:15 col spacing:19
row count:25 row spacing:16
Check every 10 secs
We have 0 mindflex data points
Check every 10 secs
We have 1 mindflex data points
Waiting for grbl
<Idle|MPos:-140.008,-550.009,-5.000|FS:0,0>

G0 X9.000 Y13.000 Z-5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.191,-537.261,-5.000|FS:0,0|WCO:-140.000,-550.000,0.000>

G1 X9.000 Y13.000 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-4.810|FS:1,0>

G1 X16.939 Y17.045 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-4.430|FS:1,0>

G1 X18.755 Y14.545 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-4.040|FS:1,0|Ov:100,100,100>

G1 X13.755 Y6.455 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-3.650|FS:1,0>

G1 X16.939 Y8.955 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-3.270|FS:1,0>

G1 X14.000 Y8.000 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-2.890|FS:1,0>

G1 X6.061 Y3.955 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-2.490|FS:1,0|WCO:-140.000,-550.000,0.000>

G1 X9.245 Y11.455 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-2.110|FS:1,0>

G1 X9.245 Y14.545 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-1.720|FS:1,0>

G1 X7.061 Y13.045 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-1.340|FS:1,0|Ov:100,100,100>

G1 X9.000 Y13.000 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-0.960|FS:1,0>

G0 X9.000 Y13.000 Z-5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-0.570|FS:1,0>

G0 X28.000 Y13.000 Z-5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,-0.190|FS:1,0>

G1 X31.000 Y16.000 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,0.200|FS:1,0>

G1 X35.939 Y17.045 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,0.590|FS:1,0|WCO:-140.000,-550.000,0.000>

G1 X32.755 Y9.545 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-130.725,-536.862,5.000|FS:1346,0>

G1 X37.755 Y11.455 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-125.865,-542.939,5.000|FS:545,0>

G1 X30.939 Y3.955 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-133.701,-545.521,5.000|FS:1872,0>

G1 X32.000 Y7.000 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-131.004,-537.010,3.340|FS:1731,0>

G1 X30.061 Y8.955 Z5 F1500.000
Waiting for grbl
Command received: ok

Waiting for grbl
<Run|MPos:-111.643,-536.660,-3.880|FS:1618,0|WCO:-140.000,-550.000,0.000>

G1 X23.245 Y6.455 Z5 F1500.000
Waiting for grbl```


### Other Information

_No response_
问题:伺服行程间歇性缓慢 #688

似乎与加速度设置或工作偏移量无关…

问题:伺服行程间歇性缓慢 #688
作者
马克杰布 评论了 2022 年 10 月 31 日  

串口似乎是一条红鲱鱼。

我将 gcode 写入一个文件(附件),上传它并从 webui 运行它,我看到了同样的问题。
心字形.txt

注意:如果此文件和原始控制台输出之间的 z 移动看起来不同,那是因为我添加了/axes/z/homing/mpos_mm 5并且现在我有 Z5 = pen up 和 Z0 = pen down。

问题:伺服行程间歇性缓慢 #688 MarkJB 改了标题 问题:使用串口时伺服行程间歇性变慢 问题:伺服行程间歇性缓慢 2022 年 10 月 31 日
问题:伺服行程间歇性缓慢 #688
所有者

我可以复制这个问题。看起来像是进给率补偿问题。

问题:伺服行程间歇性缓慢 #688
所有者

这是进给率补偿。您可以编译和测试一个新分支。我们希望得到有关修复的一些反馈。

https://github.com/bdring/FluidNC/tree/WallPlotterMultiAxis

问题:伺服行程间歇性缓慢 #688
作者

到目前为止,一切都很好。

我有一些运行时间更长的情节可以尝试,我会报告回来。

问题:伺服行程间歇性缓慢 #688
作者

没有看到舵机在几个小时内缓慢移动,但在舵机完成行程之前会发生下一步动作。是否有设置来控制稳定时间?(正在寻找类似/axes/z/homing/settle_ms但移动而不是归巢的东西)。

问题:伺服行程间歇性缓慢 #688
作者
马克杰布 评论了 2022 年 11 月 1 日  

当我试图加速伺服时,发生了一些奇怪的事情。启动 z_axis 进给率和加速度后,我手动发送G0 Z0&G0 Z5进行测试,机器在随机方向上运行并nan显示在控制台中。

我还不能重现它,但如果可以的话,我会打开另一个问题。

<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
G0 Z5
ok
G0 Z0
ok
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
G0 Z5
ok
<Idle|MPos:-93.937,-544.058,5.000|FS:0,0>
G0 Z0
ok
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
G0 Z5
ok
<Idle|MPos:-93.937,-544.058,5.000|FS:0,0|WCO:0.000,-0.000,0.001>
G0 Z5
ok
<Run|MPos:19.352,-449.975,5.000|FS:5175,0|Ov:100,100,100>
<Run|MPos:155.031,-237.756,5.000|FS:5175,0>
G0 Z0
ok
<Run|MPos:201.193,43.803,5.000|FS:5175,0>
<Run|MPos:158.648,nan,5.000|FS:5175,0>
<Run|MPos:167.553,nan,4.380|FS:5175,0>
<Run|MPos:200.435,-1.909,3.110|FS:5175,0>
<Run|MPos:144.513,-263.240,1.840|FS:5175,0>
<Run|MPos:-0.411,-469.699,0.570|FS:5175,0>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0|WCO:0.000,-0.000,0.001>
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0|Ov:100,100,100>
G0 Z0
<Idle|MPos:-93.937,-544.058,0.000|FS:0,0>
ok
<Run|MPos:65.364,-396.611,0.000|FS:5175,0>
<Run|MPos:176.207,-173.108,0.000|FS:5175,0>
<Run|MPos:198.476,nan,0.000|FS:5175,0>
<Run|MPos:131.678,nan,0.000|FS:5155,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0|WCO:0.000,-0.000,0.001>
<Idle|MPos:119.671,nan,0.000|FS:0,0|Ov:100,100,100>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0|WCO:0.000,-0.000,0.001>
<Idle|MPos:119.671,nan,0.000|FS:0,0|Ov:100,100,100>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
<Idle|MPos:119.671,nan,0.000|FS:0,0>
问题:伺服行程间歇性缓慢 #688
作者
马克杰布 评论了 2022 年 11 月 1 日  

在调整 z 轴的进给和速度之后,我注意到伺服从 Z5 -> Z0 的速度比从其他方向慢。

这是在将加速度设置为 1000mm/s/s 之后。

问题:伺服行程间歇性缓慢 #688
所有者

nan意思是出事了。wallbot 运动学是由开发团队以外的人贡献的。我们正在尝试在没有机器进行测试的情况下对其进行修补。它可能正在进入一个糟糕的区域。119 靠近锚点的 Y 位置。如果您离开有效运动区域,我们可以添加代码来警告您。

kinematics:
  WallPlotter:
    left_axis: 0
    left_anchor_x: -326.500
    left_anchor_y: 120.000
    right_axis: 1
    right_anchor_x: 326.000
    right_anchor_y: 120.000
    segment_length: 10.000

我注意到你的伺服范围是这个。

[消息:信息:Z 轴 (-5.000,0.000)]

你有G54偏移量吗?

问题:伺服行程间歇性缓慢 #688
作者

是的,我正在使用这个偏移量G10 L2 P2 X-140 Y-550 Z5

问题:伺服行程间歇性缓慢 #688
作者
马克杰布 评论了 2022 年 11 月 1 日  

伺服范围应该是0.000,5.000。

-5.000,0.000 可能是我添加mpos_mm: 5到配置之前的。

问题:伺服行程间歇性缓慢 #688
所有者

我注意到你没有限位开关。

你能发送一个链接到你正在使用的硬件吗?你是如何开始工作的,为什么要设置那个偏移量?

范围在机器空间中。如果你想要 0 到 5mm,你需要将归位 mpos_mm 设置为 5,因为你在 Z 上归正

问题:伺服行程间歇性缓慢 #688
作者

控制器板是我自己的设计之一,但引脚与您的一个兼容。

机器的其余部分是自建的。

偏移量是为了使使用机器坐标系更容易。顶部的半圆是“主页”,处理草图从页面左下角的 0,0 开始,因此是偏移量。

问题:伺服行程间歇性缓慢 #688

问题:伺服行程间歇性缓慢 #688
作者

抱歉 – 忘了说我通过归位开始工作(如果当机器认为它是绘图时吊舱不在原位)然后应用偏移,手动或作为 gcode 的一部分(处理sketch 将发送偏移量并激活它),然后它开始流式传输 gcode。

但是对于最近的测试,我一直在使用播放按钮从 webui 启动 gcode 文件。

问题:伺服行程间歇性缓慢 #688
所有者
培养 评论了 2022 年 11 月 1 日  

(已编辑)我不确定,但我假设您手动将缆车移动到 X 的中心和“锚点”下方的 120,然后启动控制器。

问题:伺服行程间歇性缓慢 #688
作者

(已编辑)我不确定,但我假设您手动将缆车移动到 X 的中心和“锚点”下方的 120,然后启动控制器。

对,那是正确的。

问题:伺服行程间歇性缓慢 #688

我将更改推送到那个可能解决问题的分支。问题的导火索是一手无处可去的棋子,在本例中是 G0 Z5 紧跟在 G0 Z5 之后。

问题:伺服行程间歇性缓慢 #688
作者

到目前为止,一切都很好。密谋断断续续 24 小时,没有看到nan或疯狂的举动。

当这个情节完成后,我会尝试强迫一些疯狂的动作,看看会发生什么。

在伺服器到达预期位置之前开始下一步的问题,这是预期的吗?是否有延迟设置,直到伺服可能完成移动?还是我应该为此提出一个单独的问题?

问题:伺服行程间歇性缓慢 #688
所有者

伺服不是闭环(使用 FluidNC)。它只是尽力跟踪位置。如果您设置的速度和加速度高于伺服可以达到的速度,则下一个动作将在伺服完成运动之前开始。

尝试降低max_rate_mm_per_minZ 轴的值。

大多数伺服系统可以在不到一秒的时间内完成一次完整的移动。对于 5mm Z 移动,我会尝试 200-400 范围内的速率。您可以通过发送来实时调整该值…

$axes/z/max_rate_mm_per_min=300

一旦您喜欢性能,您需要使用该值保存您的配置文件,以便它在启动时读取它。