开源改变世界

伺服不动 #516

推推 grbl 2年前 (2023-02-05) 219次浏览
关闭
3 个任务中的第 1 个
deranku 打开了这个 issue 2022 年 7 月 5 日 · 26条评论
关闭
3 个任务中的第 1 个

伺服不动#516

deranku 打开了这个 issue 2022 年 7 月 5 日 · 26条评论

评论

伺服不动 #516
德兰库 评论了 2022 年 7 月 5 日  

控制板

FluidNC Pen 激光控制器 (SPI)

董事会供应商的帮助

  • 是的
  • 不适用

机器描述

这将是一个弦乐艺术机器,x 上有外部步进驱动器,y 上有螺线管,z 上有伺服。

配置文件

name: "Stringer"
board: "FluidNC Pen/Laser"

start:
  must_home: false
  deactivate_parking: true


stepping:
  engine: RMT
  # 255: dauerhaft an
  idle_ms: 255
  # dir_delay_us: 5 us
  dir_delay_us: 10
  # pulse_us: not less than 2.5 us
  pulse_us: 3
  # Some motors need a delay from when they are enabled to when they can take the first step.: at least 5 us
  disable_delay_us: 10

axes:
  shared_stepper_disable_pin: gpio.13
  
  # Teller/Stepper
  x: 
    # actually steps per nail
    steps_per_mm: 300
    max_rate_mm_per_min: 2000
    acceleration_mm_per_sec2: 25
    max_travel_mm: 1000
    soft_limits: false
    homing:
      cycle: 1
      positive_direction: false
      mpos_mm: 150.000
      feed_mm_per_min: 100.000
      seek_mm_per_min: 200.000
      settle_ms: 500
      seek_scaler: 1.100
      feed_scaler: 1.100
    
    motor0:
      limit_neg_pin: gpio.39:high
      hard_limits: false
      pulloff_mm: 1.0
      standard_stepper:
        step_pin: gpio.14
        direction_pin: gpio.12


  # Fädler/Solenoid
  y:
    steps_per_mm: 100.000
    max_rate_mm_per_min: 5000.000
    acceleration_mm_per_sec2: 100.000
    max_travel_mm: 5.000
    soft_limits: false
    homing:
      cycle: 1
      positive_direction: true
      mpos_mm: 5.000
        
    motor0:
      solenoid:
        output_pin: gpio.27:high
        pwm_hz: 1000
        off_percent: 0.000
        pull_percent: 100.000
        hold_percent: 100.000
        pull_ms: 100


  # Bohrer/Servo
  z:
    steps_per_mm: 100
    max_rate_mm_per_min: 5000
    acceleration_mm_per_sec2: 50
    max_travel_mm: 40
    soft_limits: false
    homing:
      cycle: 1
      positive_direction: true
      mpos_mm: 0
    
    motor0:
      rc_servo:
        pwm_hz: 50
        # output_pin: gpio.22
        output_pin: gpio.21
        min_pulse_us: 540
        max_pulse_us: 2470


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

sdcard:
  cs_pin: gpio.5
  card_detect_pin: NO_PIN

coolant:
  # M7
  mist_pin:  NO_PIN
  # M8
  flood_pin: NO_PIN
  # M9 turns both off

probe:
  pin: NO_PIN

# macros:
#   startup_line0:
#   startup_line1:
#   macro0: G90&G53G0Z-1&G0X0Y0
#   macro1: $SD/Run=drill.nc
#   macro2:
#   macro3:

启动消息

[MSG:INFO: FluidNC v3.5.0-pre4]
[MSG:INFO: Compiled with ESP32 SDK:v4.4.1-1-gb8050b365e]
[MSG:INFO: Local filesystem type is SPIFFS]
[MSG:INFO: Configuration file:stringer_config.yaml]
[MSG:INFO: Machine Stringer]
[MSG:INFO: Board FluidNC Pen/Laser]
[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:10us Dir Delay:10us Idle Delay:255ms]
[MSG:INFO: Axis count 3]
[MSG:INFO: Shared stepper disable gpio.13]
[MSG:INFO: Axis X (150.000,1150.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     standard_stepper Step:gpio.14 Dir:gpio.12 Disable:NO_PIN]
[MSG:INFO:     Neg Limit gpio.39]
[MSG:INFO: Axis Y (0.000,5.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     solenoid Pin: gpio.21 Off: 0.000 Hold: 100.000 Pull:100.000 Duration:100 pwm hz:1000]
[MSG:INFO: Axis Z (-5.000,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     rc_servo Pin:gpio.27 Pulse Len(900,2100)]
[MSG:INFO: Kinematic system: Cartesian]
[MSG:INFO: Using spindle NoSpindle]
[MSG:INFO: Connecting to STA SSID:Hakaniemi]
[MSG:INFO: Connecting.]
[MSG:INFO: Connecting..]
[MSG:INFO: Connected - IP is 192.168.178.63]
[MSG:INFO: WiFi on]
[MSG:INFO: Start mDNS with hostname:http://stringer.local/]
[MSG:INFO: SSDP Started]
[MSG:INFO: HTTP started on port 80]
[MSG:INFO: Telnet started on port 23]

Grbl 3.5 [FluidNC v3.5.0-pre4 (wifi) '$' for help]

用户界面软件

网页界面

发生了什么?

带有连接到伺服输出引脚的伺服的 z 轴根本没有移动。另一个轴按预期工作。

我尝试了三种不同的。在 FNC 的 OTA 更新期间,第一个烟消云散。有点慌,不排除是我接错了。

然后我尝试了两种不同的 5 V 爱好伺服系统,它们都可以很好地与 Arduino“Sweep”示例配合使用。Arduino Servo lib 提供 50 Hz 信号,因此我将其用于 FNC 配置。最小和最大脉冲来自一个舵机数据表,但我尝试了不同的值(和默认值)。当 ESP 通电时,其中一个舵机移动了一点,而另一个则刚好没电。两者都不能通过 Web 界面移动。

电路板提供的 5 V 电压可以测量,但为了排除在伺服器#1死机期间电源或 GPIO 22 损坏,我将伺服器连接到外部电源和 GPIO 21,结果相同。

其他信息

伺服不动 #516
标准 5 V 爱好伺服系统。上面的配置正在进行中。不过,轴/电机部分应该可以工作。

伺服不动 #516 deranku 改了标题 问题: 伺服不动 2022 年 7 月 5 日
伺服不动 #516

舵机和 ESP32 之间是什么?是否有某种 H 桥,或者您是否试图将伺服系统直接连接到 GPIO 引脚?

伺服不动 #516
作者
德兰库 评论了 2022 年 7 月 5 日  

舵机直接连接到板上。尝试使用电路板和外部电源提供的 5 V 电压。

伺服不动 #516

这是行不通的。ESP32 引脚无法提供足够的电压或电流来驱动舵机。即使是微型伺服系统也需要 100 毫安或更多。ESP32 GPIO 最多可以驱动约 20mA。ESP32 和舵机之间需要一个直流电机驱动电路。

伺服不动 #516
作者

啊哈!谢谢你,米奇。我认为电源部分覆盖有 5 V 单独进入伺服系统,因此信号引脚本身不会消耗任何电流。电路板上的伺服引脚对我来说意味着这一点。再次感谢。

伺服不动 #516

经常用于此目的的一种芯片是 L293D。带有该芯片的廉价模块很容易在亚马逊、eBay 上买到,…