开源改变世界

家里没有在 K40 激光机上工作 #628

推推 grbl 2年前 (2023-02-05) 211次浏览
关闭
3个任务
Avataar120 开启了这个问题 2022 年 9 月 24 日 · 11 条评论
关闭
3个任务

家里没有在 K40 激光机上工作#628

阿凡达120 开启了这个问题 2022 年 9 月 24 日 · 11 条评论

评论

家里没有在 K40 激光机上工作 #628
贡献者
阿凡达120 评论了 2022 年 9 月 24 日  

控制板

个人板

见下图(此处不接受图片)

董事会供应商的帮助

  • 是的
  • 不适用

机器描述

K40 库存机
X 和 Y 的光学末端开关
触发时提供 5V(HOME 位置)
未触发时提供 0V
(NC 行为)

Z 的机械开关
(NO 行为)

输入电路

没有反应

配置文件

$cd
board: 4_Ava_Shield_7.x_XYZ
name: K40_AvaShield
meta:
stepping:
  engine: I2S_static
  idle_ms: 255
  pulse_us: 4
  dir_delay_us: 1
  disable_delay_us: 0
  segments: 12
axes:
  shared_stepper_disable_pin: NO_PIN
  shared_stepper_reset_pin: NO_PIN
  x:
    steps_per_mm: 78.740
    max_rate_mm_per_min: 20000.000
    acceleration_mm_per_sec2: 2000.000
    max_travel_mm: 310.000
    soft_limits: true
    homing:
      cycle: 1
      allow_single_axis: true
      positive_direction: false
      mpos_mm: 5.000
      feed_mm_per_min: 200.000
      seek_mm_per_min: 2500.000
      settle_ms: 250
      seek_scaler: 1.500
      feed_scaler: 5.000
    motor0:
      limit_neg_pin: gpio.39
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 5.000
      stepstick:
        step_pin: I2SO.2
        direction_pin: I2SO.1
        disable_pin: I2SO.0
        ms1_pin: NO_PIN
        ms2_pin: NO_PIN
        ms3_pin: I2SO.3
        reset_pin: NO_PIN
  y:
    steps_per_mm: 78.740
    max_rate_mm_per_min: 20000.000
    acceleration_mm_per_sec2: 2000.000
    max_travel_mm: 210.000
    soft_limits: true
    homing:
      cycle: 1
      allow_single_axis: true
      positive_direction: false
      mpos_mm: 5.000
      feed_mm_per_min: 200.000
      seek_mm_per_min: 2500.000
      settle_ms: 250
      seek_scaler: 1.500
      feed_scaler: 5.000
    motor0:
      limit_neg_pin: gpio.34
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 5.000
      stepstick:
        step_pin: I2SO.6
        direction_pin: I2SO.5:low
        disable_pin: I2SO.4
        ms1_pin: NO_PIN
        ms2_pin: NO_PIN
        ms3_pin: I2SO.7
        reset_pin: NO_PIN
  z:
    steps_per_mm: 1000.000
    max_rate_mm_per_min: 200.000
    acceleration_mm_per_sec2: 1000.000
    max_travel_mm: 20.000
    soft_limits: false
    homing:
      cycle: 2
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 9.500
      feed_mm_per_min: 100.000
      seek_mm_per_min: 100.000
      settle_ms: 250
      seek_scaler: 1.500
      feed_scaler: 5.000
    motor0:
      limit_neg_pin: gpio.35:low
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 9.500
      stepstick:
        step_pin: I2SO.10
        direction_pin: I2SO.9:low
        disable_pin: I2SO.8
        ms1_pin: NO_PIN
        ms2_pin: NO_PIN
        ms3_pin: I2SO.11
        reset_pin: NO_PIN
    motor1:
      limit_neg_pin: NO_PIN
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 1.000
      null_motor:
kinematics:
  Cartesian:
i2so:
  bck_pin: gpio.22
  data_pin: gpio.21
  ws_pin: gpio.17
spi:
  miso_pin: gpio.19
  mosi_pin: gpio.23
  sck_pin: gpio.18
sdcard:
  cs_pin: gpio.5
  card_detect_pin: NO_PIN
control:
  safety_door_pin: gpio.27:low:pu
  reset_pin: gpio.12:low:pu
  feed_hold_pin: gpio.14:low:pu
  cycle_start_pin: gpio.13:low:pu
  macro0_pin: NO_PIN
  macro1_pin: NO_PIN
  macro2_pin: NO_PIN
  macro3_pin: NO_PIN
coolant:
  flood_pin: NO_PIN
  mist_pin: gpio.4
  delay_ms: 50
probe:
  pin: gpio.36:low
  check_mode_start: false
macros:
  startup_line0:
  startup_line1:
  macro0:
  macro1:
  macro2:
  macro3:
start:
  must_home: true
  deactivate_parking: false
  check_limits: true
user_outputs:
  analog0_pin: NO_PIN
  analog1_pin: NO_PIN
  analog2_pin: NO_PIN
  analog3_pin: NO_PIN
  analog0_hz: 5000
  analog1_hz: 5000
  analog2_hz: 5000
  analog3_hz: 5000
  digital0_pin: NO_PIN
  digital1_pin: NO_PIN
  digital2_pin: NO_PIN
  digital3_pin: NO_PIN
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
planner_blocks: 16
Laser:
  pwm_hz: 15000
  output_pin: gpio.15
  enable_pin: gpio.16:low
  disable_with_s0: true
  s0_with_disable: false
  tool_num: 0
  speed_map: 0=0.000% 1000=100.000%
ok

启动消息

$ss
[MSG:INFO: FluidNC v3.6.1]
[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:DBG: Running after-parse tasks]
[MSG:DBG: Checking configuration]
[MSG:INFO: Machine K40_AvaShield]
[MSG:INFO: Board 4_Ava_Shield_7.x_XYZ]
[MSG:INFO: I2SO BCK:gpio.22 WS:gpio.17 DATA:gpio.21]
[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:I2S_static Pulse:4us Dsbl Delay:0us Dir Delay:1us Idle Delay:255ms]
[MSG:INFO: Axis count 3]
[MSG:INFO: Axis X (5.000,315.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     stepstick Step:I2SO.2 Dir:I2SO.1 Disable:I2SO.0]
[MSG:INFO:  X Neg Limit gpio.39]
[MSG:DBG: Updating  X Neg Limit]
[MSG:DBG:  X Neg Limit 1]
[MSG:INFO: Axis Y (5.000,215.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     stepstick Step:I2SO.6 Dir:I2SO.5:low Disable:I2SO.4]
[MSG:INFO:  Y Neg Limit gpio.34]
[MSG:DBG: Updating  Y Neg Limit]
[MSG:DBG:  Y Neg Limit 1]
[MSG:INFO: Axis Z (-10.500,9.500)]
[MSG:INFO:   Motor0]
[MSG:INFO:     stepstick Step:I2SO.10 Dir:I2SO.9:low Disable:I2SO.8]
[MSG:INFO:  Z Neg Limit gpio.35:low]
[MSG:DBG: Updating  Z Neg Limit]
[MSG:DBG:  Z Neg Limit 0]
[MSG:INFO:   Motor1]
[MSG:INFO: safety_door_pin gpio.27:low:pu]
[MSG:INFO: reset_pin gpio.12:low:pu]
[MSG:INFO: feed_hold_pin gpio.14:low:pu]
[MSG:INFO: cycle_start_pin gpio.13:low:pu]
[MSG:INFO: Kinematic system: Cartesian]
[MSG:INFO: Laser Ena:gpio.16:low Out:gpio.15 Freq:15000Hz Period:4095]
[MSG:INFO: Using spindle Laser]
[MSG:INFO: Mist coolant gpio.4]
[MSG:INFO: Probe Pin: gpio.36:low]
[MSG:INFO: STA SSID is not set]
[MSG:INFO: AP SSID FluidNC IP 192.168.0.1 mask 255.255.255.0 channel 1]
[MSG:INFO: AP started]
[MSG:INFO: WiFi on]
[MSG:INFO: Captive Portal Started]
[MSG:INFO: HTTP started on port 80]
[MSG:INFO: Telnet started on port 23]
ok

用户界面软件

Lightburn 或 Fluidterm

发生了什么?

当我在 v3.6.1 上发出 $H 命令时:
轴正在移动到左上角 -> OK
当它们碰到限位开关时 -> 移动停止 -> OK
同时在 X 和 Y 轴上拉开 -> OK
慢接近开始 -> OK
X 限位开关首先被击中。X 停止 -> OK
Y 限位开关被击中 -> OK
Y 上的运动不会停止 -> NOK
100% 可重复。我没有尝试使用 NC 机械开关,因为我没有很好的设置
它在 3.4.4 和更早版本上使用相同的配置文件工作。
也可与 ESP32 GRBL 搭配使用。

感谢您的帮助。

登录 v3.6.1:
$h
[MSG:DBG: Homing Cycle XY]
[MSG:DBG: Homing nextPhase FastApproach]
[MSG:DBG: Starting from 0.000,0.000,0.000]
[MSG:DBG: Planned move to -465.000, -315.000,0.000 @ 3535.534]
[MSG:DBG: X Neg Limit 1]
[MSG:DBG: Homing limited X]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Y Neg Limit 1]
[MSG:DBG :归位限制 XY]
[MSG:DBG:归位 nextPhase Pulloff0]
[MSG:DBG:从 -50.572,-45.326,0.000 开始]
[MSG:DBG:计划移动到 -45.572,-40.326,0.000 @ 282.843]
[MSG: DBG:CycleStop Pulloff0]
[MSG:DBG:X Neg Limit 0]
[MSG:DBG:Y Neg Limit 0]
[MSG:DBG:Homing nextPhase SlowApproach]
[MSG:DBG: Starting from -45.568,-40.323,0.000]
[MSG:DBG: Planned move to -70.568,-65.323,0.000 @ 282.843]
[MSG:DBG: X Neg Limit 1]
[MSG:DBG: Homing limited X]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: CycleStop SlowApproach]
[MSG:DBG: X Neg Limit 1]
<Home|MPos:-50.470,-65.329,0.000|FS:0,0|Pn :X|WCO:5.004,5.004,5.200>
警报:9
归位失败。在搜索距离内找不到限位开关。在搜索阶段定义为 1.5 * max_travel,在定位阶段定义为 5 * pulloff。
好的

登录 v3.4.4:
$h
[MSG:DBG: Homing XY]
[MSG:DBG: PrePulloff]
[MSG:DBG: Fast approach]
[MSG:DBG: X target -465.000 rate 2500.000]
[MSG:DBG: Y target -315.000 rate 2500.000]
[MSG:DBG: Pulloff0]
[MSG:DBG: X target 5.000 rate 200.000]
[MSG:DBG: Y target 5.000 rate 200.000]
[MSG:DBG: Slow approach]
[MSG:DBG: X target – 25.000 率 200.000]
[MSG:DBG: Y 目标 -25.000 率 200.000]
[MSG:DBG: Pulloff1]
[MSG:DBG: X 目标 5.000 率 200.000]
[MSG:DBG: Y 目标 5.000 率 200.000]
[MSG:DBG: Homing Z]
[MSG:DBG: PrePulloff]
[MSG:DBG: Fast approach]
[MSG:DBG: Z target 30.000 rate 100.000]
[MSG:DBG: Pulloff0]
[MSG:DBG: Z target -9.500 rate 100.000]
[MSG:DBG: Slow approach]
[MSG:DBG: Z target 47.500 rate 100.000]
[MSG:DBG: Pulloff1]
[MSG:DBG: Z target -9.500 rate 100.000]
ok

其他信息

家里没有在 K40 激光机上工作 #628
家里没有在 K40 激光机上工作 #628

家里没有在 K40 激光机上工作 #628

众所周知,K40 上的光学限位开关非常嘈杂且对杂散光敏感。您是否尝试过保护它们免受环境光的影响?

家里没有在 K40 激光机上工作 #628
贡献者作者

是肯定的。
我非常了解这台机器和相关的常见问题。
即使在完全黑暗的情况下它也不起作用并且总是完全相同的顺序(快速方法效果很好,慢速方法只检测到先被击中的 X 开关而不是之后被击中的 Y 开关……)

据我观察,似乎与任何噪音问题无关。

家里没有在 K40 激光机上工作 #628
贡献者作者

想知道它是否可以来自 NC swicthes。我将尝试使用 NC 开关连接设置以进行测试……但我目前没有开关

家里没有在 K40 激光机上工作 #628

由于我无法复制它,因此我不知道如何进行。

家里没有在 K40 激光机上工作 #628
贡献者作者

明白了。我将尝试进行更多调查/在代码中添加探针以尝试更好地理解

家里没有在 K40 激光机上工作 #628
贡献者作者

你好@MitchBradley,经过一些实验,这里是我的发现……
我已经修改了 LimitPin 代码(仅用于调试目的)

void LimitPin::run(void* arg) {
        bool value = get();
        log_debug ( "Before : " << value);
        delay_us (100);
        value = get();
        log_debug ( "After : " << value);
        ....

您可以在下面看到导致问题的 100us 延迟之前和之后的值不同。
具有 100us 延迟,归位和停止检测工作良好
似乎仍然与边缘检测 INT 和引脚读取之间的输入电路中的不同阈值有关

[MSG:DBG: 归位周期 XY]
[MSG:DBG: 归位下一阶段 FastApproach]
[MSG:DBG: 从 0.000,0.000,0.000 开始]
[MSG:DBG: 计划移动到 -465.000,-315.000,0.000 @ 3535.534]
[ MSG:DBG: Before : 1]
[MSG:DBG: After : 1]
[MSG:DBG: X Neg Limit 1]
[MSG:DBG: Homing limited X]
[MSG:DBG: Before : 0]
[MSG:DBG:之后:1]

[MSG:DBG: Y Neg Limit 1]
[MSG:DBG: Homing limited XY]
[MSG:DBG: Homing nextPhase Pulloff0]
[MSG:DBG: Starting from -72.924,-94.094,0.000]
[MSG: DBG:计划移至 -67.924、-89.094、0.000 @ 282.843]
[MSG:DBG: CycleStop Pulloff0]
[MSG:DBG: X Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG: Homing nextPhase SlowApproach]
[MSG:DBG: Starting from -67.920,-89.091,0.000]
[MSG:DBG: Planned move to -92.920,-114.091,0.000 @ 282.843]
[MSG:DBG: Before : 0 ]
[MSG:DBG: After : 0]
[MSG:DBG: X Neg Limit 0]
[MSG:DBG: Before : 0]
[MSG:DBG: After : 0]
[MSG:DBG: X Neg Limit 0]
[MSG :DBG: 之前 : 0]
[MSG:DBG: 之后 : 1]

[MSG:DBG: X Neg Limit 1]
[MSG:DBG: Homing limited X]
[MSG:DBG: Before : 1]
[MSG:DBG: After :1]
[MSG:DBG: Y Neg Limit 1]
[MSG:DBG: Homing limited XY]
[MSG:DBG: Homing nextPhase Pulloff1]
[MSG:DBG: Starting from -72.847,-94.056,0.000]
[MSG:DBG: Planned move to -67.847,-89.056,0.000 @ 282.843]
[MSG:DBG: CycleStop Pulloff1]
[MSG:DBG: X Neg Limit 0]
[MSG:DBG: Y Neg Limit 0]
[MSG:DBG : Homing nextPhase Pulloff2]
[MSG:DBG: mpos was -67.844,-89.053,0.000]
[MSG:DBG: mpos becomes 5.000,5.000,0.000]
[MSG:DBG: mpos transformed 5.004,5.004,0.000]
[MSG:DBG :归位完成]

家里没有在 K40 激光机上工作 #628

我开始对乐鑫感到非常恼火

家里没有在 K40 激光机上工作 #628
贡献者作者

你好@MitchBradley,

我用 NC 和 NO 机械开关做了一些测试,没有重现与你在限位开关上工作之前相同的问题 ( #547 )。

您可能已经知道了,但 K40 止动器提供的是 0 到 5V 之间的模拟信号。
当轴向其末端位置移动时,电压逐渐从低值变为高值,并与轴移动速度相关(电压取决于传感器感知到的光
)从低到高的电压需要时间(比通过板 RC 滤波器过滤尖锐边缘要多)导致我认为输入读数的缺陷……

家里没有在 K40 激光机上工作 #628

很有意思。极慢的边缘

家里没有在 K40 激光机上工作 #628

这与亚稳态同步问题有关,目前还没有完整的解决方案。有一些技术可以以延迟为代价将故障概率降低到任意数量(但不是 0)。Andreas Bechtolsheim 正在攻读博士学位,但由于创立了 Sun Microsystems 而未能完成。安迪后来创办了其他几家公司,并以高价出售,并因成为谷歌的第一位投资者而成为亿万富翁。当我在 Sun 工作时,我不得不诊断很多问题,这些问题最终被证明是同步失败。通常他们会在数百万次事件中失败一次。

超慢边沿使同步变得更加困难,因为输入信号在过渡区域停留了很长时间,大大增加了两个不同电路元件在状态上不一致的模糊样本的可能性。

在这种情况下,我可以尝试更多的技术来消除歧义,但这会导致额外的延迟,而这正是我希望通过中断驱动的限位开关代码来减少的。也许硬件解决方案会更好。ESP32 GPIO 特别容易受到慢边沿的影响,因为它们没有迟滞(8 位 AVR 芯片具有更好的带迟滞的 GPIO 输入电路)。在光学限制和 ESP32 GPIO 之间放置一个施密特触发器缓冲器可能会更好。6 件装的两个 4x 输入模块都有施密特触发器。

家里没有在 K40 激光机上工作 #628
贡献者作者

你好@MitchBradley,

感谢这个非常详细的答案。
老实说,如果我是唯一遇到此问题的人,请不要在这上面花太多时间。
我有一个适用于我的设置的解决方法(不应在其他情况下实施)。
如果相关,您可以关闭问题

谢谢,