bdring / FluidNC

The next generation of motion control firmware
Other
1.59k stars 382 forks source link

Problem: Homing not working properly when triggered from FluidNC web interface #1113

Open Avataar120 opened 9 months ago

Avataar120 commented 9 months ago

Wiki Search Terms

Home Web interface etc

Controller Board

Custom design

Machine Description

Test bench

Input Circuits

Not relevant at this stage as it's working perfectly when triggered from fluidterm or lightburn but not working at all when triggered from web interface

Configuration file

$cd
board: 4_Ava_Shield_9.1_XYZA_OLED
name: K40_AvaShield
meta:
stepping:
  engine: I2S_static
  idle_ms: 255
  pulse_us: 6
  dir_delay_us: 1
  disable_delay_us: 0
  segments: 12

uart1:
  txd_pin: gpio.12
  rxd_pin: gpio.26
  rts_pin: NO_PIN
  cts_pin: NO_PIN
  baud: 115200
  mode: 8N1

i2so:
  bck_pin: gpio.22
  data_pin: gpio.21
  ws_pin: gpio.17

i2c0:
  sda_pin: gpio.25
  scl_pin: gpio.33
  frequency: 100000

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

sdcard:
  cs_pin: gpio.5
  card_detect_pin: NO_PIN
  frequency_hz: 8000000

kinematics:
  Cartesian:

axes:
  shared_stepper_disable_pin: NO_PIN
  shared_stepper_reset_pin: NO_PIN
  x:
    steps_per_mm: 78.739998
    max_rate_mm_per_min: 20000.000000
    acceleration_mm_per_sec2: 2000.000000
    max_travel_mm: 310.000000
    soft_limits: false
    homing:
      cycle: 1
      allow_single_axis: true
      positive_direction: false
      mpos_mm: 0.000000
      feed_mm_per_min: 200.000000
      seek_mm_per_min: 2500.000000
      settle_ms: 250
      seek_scaler: 1.500000
      feed_scaler: 5.000000

    motor0:
      limit_neg_pin: gpio.39
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 5.000000
      tmc_2209:
        addr: 0
        cs_pin: NO_PIN
        uart_num: 1
        step_pin: I2SO.2
        direction_pin: I2SO.1
        disable_pin: I2SO.0
        r_sense_ohms: 0.220000
        run_amps: 0.600000
        hold_amps: 0.200000
        microsteps: 8
        toff_disable: 0
        toff_stealthchop: 5
        use_enable: true
        run_mode: CoolStep
        homing_mode: CoolStep
        stallguard: 0
        stallguard_debug: false
        toff_coolstep: 3

  y:
    steps_per_mm: 78.739998
    max_rate_mm_per_min: 20000.000000
    acceleration_mm_per_sec2: 2000.000000
    max_travel_mm: 210.000000
    soft_limits: false
    homing:
      cycle: 1
      allow_single_axis: true
      positive_direction: false
      mpos_mm: 0.000000
      feed_mm_per_min: 200.000000
      seek_mm_per_min: 2500.000000
      settle_ms: 250
      seek_scaler: 1.500000
      feed_scaler: 5.000000

    motor0:
      limit_neg_pin: gpio.34
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 5.000000
      tmc_2209:
        addr: 1
        cs_pin: NO_PIN
        uart_num: 1
        step_pin: I2SO.6
        direction_pin: I2SO.5
        disable_pin: I2SO.4
        r_sense_ohms: 0.220000
        run_amps: 0.600000
        hold_amps: 0.200000
        microsteps: 8
        toff_disable: 0
        toff_stealthchop: 5
        use_enable: true
        run_mode: CoolStep
        homing_mode: CoolStep
        stallguard: 0
        stallguard_debug: false
        toff_coolstep: 3

  z:
    steps_per_mm: 1000.000000
    max_rate_mm_per_min: 200.000000
    acceleration_mm_per_sec2: 1000.000000
    max_travel_mm: 20.000000
    soft_limits: false
    homing:
      cycle: 0
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 9.500000
      feed_mm_per_min: 100.000000
      seek_mm_per_min: 100.000000
      settle_ms: 250
      seek_scaler: 1.500000
      feed_scaler: 5.000000

    motor0:
      limit_neg_pin: gpio.35:low
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: true
      pulloff_mm: 9.500000
      tmc_2209:
        addr: 2
        cs_pin: NO_PIN
        uart_num: 1
        step_pin: I2SO.10
        direction_pin: I2SO.9:low
        disable_pin: I2SO.8
        r_sense_ohms: 0.220000
        run_amps: 0.800000
        hold_amps: 0.200000
        microsteps: 4
        toff_disable: 0
        toff_stealthchop: 5
        use_enable: true
        run_mode: CoolStep
        homing_mode: CoolStep
        stallguard: 0
        stallguard_debug: false
        toff_coolstep: 3

  a:
    steps_per_mm: 2.778000
    max_rate_mm_per_min: 53200.000000
    acceleration_mm_per_sec2: 100000.000000
    max_travel_mm: 360.000000
    soft_limits: false
    homing:
      cycle: 0
      allow_single_axis: true
      positive_direction: true
      mpos_mm: 0.000000
      feed_mm_per_min: 200.000000
      seek_mm_per_min: 2500.000000
      settle_ms: 250
      seek_scaler: 1.500000
      feed_scaler: 5.000000

    motor0:
      limit_neg_pin: gpio.32:low:pu
      limit_pos_pin: NO_PIN
      limit_all_pin: NO_PIN
      hard_limits: false
      pulloff_mm: 5.000000
      tmc_2209:
        addr: 3
        cs_pin: NO_PIN
        uart_num: 1
        step_pin: I2SO.14
        direction_pin: I2SO.13
        disable_pin: I2SO.12
        r_sense_ohms: 0.220000
        run_amps: 0.600000
        hold_amps: 0.200000
        microsteps: 8
        toff_disable: 0
        toff_stealthchop: 5
        use_enable: true
        run_mode: CoolStep
        homing_mode: CoolStep
        stallguard: 0
        stallguard_debug: false
        toff_coolstep: 3

control:
  safety_door_pin: gpio.27:low:pu
  reset_pin: NO_PIN
  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
  fault_pin: NO_PIN
  estop_pin: NO_PIN

coolant:
  flood_pin: NO_PIN
  mist_pin: gpio.4
  delay_ms: 50

probe:
  pin: gpio.36:low
  toolsetter_pin: NO_PIN
  check_mode_start: false

macros:
  startup_line0:
  startup_line1:
  macro0:
  macro1:
  macro2:
  macro3:
  after_homing:
  after_reset:
  after_unlock:

start:
  must_home: true
  deactivate_parking: false
  check_limits: true

parking:
  enable: false
  axis: Z
  target_mpos_mm: -5.000000
  rate_mm_per_min: 800.000000
  pullout_distance_mm: 5.000000
  pullout_rate_mm_per_min: 250.000000

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
  digital4_pin: NO_PIN
  digital5_pin: NO_PIN
  digital6_pin: NO_PIN
  digital7_pin: NO_PIN

oled:
  report_interval_ms: 500
  i2c_num: 0
  i2c_address: 60
  width: 128
  height: 64
  radio_delay_ms: 1000

Laser:
  pwm_hz: 15000
  output_pin: gpio.15
  enable_pin: gpio.16:low
  disable_with_s0: false
  s0_with_disable: false
  tool_num: 0
  speed_map: 0=0.00% 1000=100.00%
  off_on_alarm: false

arc_tolerance_mm: 0.002000
junction_deviation_mm: 0.010000
verbose_errors: false
report_inches: false
enable_parking_override_control: false
use_line_numbers: false
planner_blocks: 16

Startup Messages

[MSG:INFO: FluidNC v3.7.12 (main-e89add39) https://github.com/bdring/FluidNC.git]
[MSG:INFO: Compiled with ESP32 SDK:v4.4.4]
[MSG:INFO: Local filesystem type is littlefs]
[MSG:INFO: Configuration file:config.yaml]
[MSG:INFO: Machine K40_AvaShield]
[MSG:INFO: Board 4_Ava_Shield_9.1_XYZA_OLED]
[MSG:INFO: UART1 Tx:gpio.12 Rx:gpio.26 RTS:NO_PIN Baud:115200]
[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 freq:8000000]
[MSG:INFO: I2C SDA: gpio.25, SCL: gpio.33, Freq: 100000, Bus #: 0]
[MSG:INFO: OLED I2C address: 0x3c width: 128 height: 64]
[MSG:INFO: Stepping:I2S_static Pulse:6us Dsbl Delay:0us Dir Delay:1us Idle Delay:255ms]
[MSG:INFO: Axis count 4]
[MSG:INFO: Axis X (0.000,310.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2209 UART1 Addr:0 CS:NO_PIN Step:I2SO.2 Dir:I2SO.1 Disable:I2SO.0 R:0.220]
[MSG:INFO:  X Neg Limit gpio.39]
[MSG:INFO: Axis Y (0.000,210.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2209 UART1 Addr:1 CS:NO_PIN Step:I2SO.6 Dir:I2SO.5 Disable:I2SO.4 R:0.220]
[MSG:INFO:  Y Neg Limit gpio.34]
[MSG:INFO: Axis Z (-10.500,9.500)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2209 UART1 Addr:2 CS:NO_PIN Step:I2SO.10 Dir:I2SO.9:low Disable:I2SO.8 R:0.220]
[MSG:INFO:  Z Neg Limit gpio.35:low]
[MSG:INFO: Axis A (-360.000,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     tmc_2209 UART1 Addr:3 CS:NO_PIN Step:I2SO.14 Dir:I2SO.13 Disable:I2SO.12 R:0.220]
[MSG:INFO:  A Neg Limit gpio.32:low:pu]
[MSG:INFO: X Axis driver test passed]
[MSG:INFO: Y Axis driver test passed]
[MSG:INFO: Z Axis driver test passed]
[MSG:INFO: A Axis driver test passed]
[MSG:INFO: safety_door_pin gpio.27: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: ....PwnPin Create]
[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]

User Interface Software

WebUI

What happened?

With the latest version from Github (Main [e89add3]), If I trigger a home from Fluidterm or Lightburn -> everything is working fine If I trigger a home from WebUI, motor speed is random and very often very very slow, then end stops are not detected, home is failing

GCode File

$h

Other Information

No response

MitchBradley commented 9 months ago

I am working on it. I should have a fix soon

MitchBradley commented 9 months ago

It is fixed in the MSG_JSON branch. https://github.com/bdring/FluidNC/commit/674b0df0d5fb33c567c11544304de6cae1731908

Avataar120 commented 9 months ago

It's working perfectly on my setup ! Thx !

BlueOrangeLive commented 9 months ago

Hello Avataar120. Can you test whether in the WebUI if you have a job running, pause it and then stop it or then let it continue running.

Avataar120 commented 9 months ago

Hi, you're right. Pause is working, but resume has no effect. Impossible to resume the job

MitchBradley commented 9 months ago

I'm working on it.

MitchBradley commented 9 months ago

Fixed

Avataar120 commented 9 months ago

Working !

Avataar120 commented 9 months ago

Hi @MitchBradley ,

In fact, lot of instabilities I don't have with the previous versions (in USB mode with gcode sender) For instance : SVG is only a circle, FluidNC will pause for few secs 3 or 4 times along the path, or the program won't start.

I reopen the ticket to avoid merging in Main without more tests.

Unfortunately, I have to leave for tonight. I'll make more tests tomorrow to give you more infos.

Avataar120 commented 9 months ago

@MitchBradley I do confirm the issue when streaming GDCODE through USB.

Steps to reproduce : Latest MSG_JSON firmware ([11f5d18])

Home ($H) -> OK Frame (see GCODE below) -> OK G00 G17 G40 G21 G54 G90 G1 X136Y125S0F12000 G1 Y231 G1 X38 G1 Y125 G90

Simple circle. GCODE sent through Lightburn. GCODE attached -> NOK circle.zip

No movement at all, USB connexion seems to be dead, not possible to send any command to the ESP32, ...

MitchBradley commented 9 months ago

I have reproduced the problem. In my setup, it only fails when using Lightburn buffered sending mode. Synchronous mode works fine. That provides a clue to help me track it down.

Avataar120 commented 9 months ago

I'll try it tonight CET after going back home. Thanks !

Avataar120 commented 9 months ago

I tested both WebUI and ligthburn (buffered) and everything is working fine. Sync mode is working fine as well. I think this is the good one !

MitchBradley commented 9 months ago

I made some improvements about half an hour ago. They work great for me, but it would be good to get some additional testing.

Avataar120 commented 9 months ago

I think I have tested the latest one ("v3.7.12 (MSG_JSON-71a1c460)")