[FluidNC Issue#1454] Problem: (Generic) ModbusVFD (RS485) does not transmit frequency setting command

未分类 bolang 4个月前 (10-14) 47次浏览

Issue #1454 | 状态: 进行中 | 作者: borisov-py | 创建时间: 2025-02-18


Wiki Search Terms

(Generic) ModbusVFD (RS485)

Controller Board

An unknown ESP 32 board was included with the machine.
!Image
!Image
!Image

Machine Description

Portal CNC milling machine size 30x40cm

!Image
!Image

Input Circuits


Configuration file

board: None
name: KJBJ
stepping:
  engine: RMT
  idle_ms: 255
  pulse_us: 10
  dirdelayus: 10
  disabledelayus: 0
  segments: 12
spi:
  miso_pin: gpio.19
  mosi_pin: gpio.23
  sck_pin: gpio.18
kinematics: {}
axes:
  sharedstepperdisable_pin: gpio.13
  sharedstepperresetpin: NOPIN
  homing_runs: 1
  x:
    stepspermm: 639.9
    maxratemmpermin: 3000
    accelerationmmper_sec2: 40
    maxtravelmm: 280
    soft_limits: true
    motor0:
      limitnegpin: gpio.17:low
      limitpospin: NO_PIN
      limitallpin: NO_PIN
      hard_limits: false
      pulloff_mm: 1
      stepstick:
        step_pin: gpio.12
        direction_pin: gpio.14:low
        disablepin: NOPIN
        ms1pin: NOPIN
        ms2pin: NOPIN
        ms3pin: NOPIN
    homing:
      cycle: 2
      positive_direction: false
      mpos_mm: -1
  y:
    stepspermm: 640.2
    maxratemmpermin: 3000
    accelerationmmper_sec2: 40
    maxtravelmm: 400
    soft_limits: true
    motor0:
      limitnegpin: NO_PIN
      limitpospin: gpio.4:low
      limitallpin: NO_PIN
      hard_limits: false
      pulloff_mm: 3
      stepstick:
        step_pin: gpio.26
        direction_pin: gpio.15
        disablepin: NOPIN
        ms1pin: NOPIN
        ms2pin: NOPIN
        ms3pin: NOPIN
    homing:
      cycle: 2
      mpos_mm: -1
      positive_direction: true
  z:
    stepspermm: 800
    maxratemmpermin: 2000
    accelerationmmper_sec2: 30
    maxtravelmm: 120
    soft_limits: true
    motor0:
      limitnegpin: gpio.33:low
      limitpospin: NO_PIN
      limitallpin: NO_PIN
      hard_limits: false
      pulloff_mm: 1
      stepstick:
        step_pin: gpio.27
        direction_pin: gpio.16
        disablepin: NOPIN
        ms1pin: NOPIN
        ms2pin: NOPIN
        ms3pin: NOPIN
    homing:
      cycle: 2
control:
  safetydoorpin: NO_PIN
  resetpin: NOPIN
  feedholdpin: gpio.36:low
  cyclestartpin: gpio.34:low
  macro0pin: NOPIN
  macro1pin: NOPIN
  macro2pin: NOPIN
  macro3pin: NOPIN
  faultpin: NOPIN
  estop_pin: gpio.39:low
coolant:
  floodpin: NOPIN
  mistpin: NOPIN
  delay_ms: 0
probe:
  pin: gpio.32:low
  toolsetterpin: NOPIN
  checkmodestart: true
  hard_stop: false
macros: {}
start:
  must_home: false
  deactivate_parking: false
  check_limits: false
parking:
  enable: false
  axis: Z
  targetmposmm: -5
  ratemmper_min: 800
  pulloutdistancemm: 5
  pulloutratemmpermin: 250
user_outputs:
  analog0pin: NOPIN
  analog1pin: NOPIN
  analog2pin: NOPIN
  analog3pin: NOPIN
  analog0_hz: 5000
  analog1_hz: 5000
  analog2_hz: 5000
  analog3_hz: 5000
  digital0pin: NOPIN
  digital1pin: NOPIN
  digital2pin: NOPIN
  digital3pin: NOPIN
  digital4pin: NOPIN
  digital5pin: NOPIN
  digital6pin: NOPIN
  digital7pin: NOPIN
user_inputs:
  analog0pin: NOPIN
  analog1pin: NOPIN
  analog2pin: NOPIN
  analog3pin: NOPIN
  digital0pin: NOPIN
  digital1pin: NOPIN
  digital2pin: NOPIN
  digital3pin: NOPIN
  digital4pin: NOPIN
  digital5pin: NOPIN
  digital6pin: NOPIN
  digital7pin: NOPIN
arctolerancemm: 0.002
junctiondeviationmm: 0.01
verbose_errors: true
report_inches: false
enableparkingoverride_control: false
uselinenumbers: false
planner_blocks: 16
sdcard:
  carddetectpin: NO_PIN
  cs_pin: gpio.5:pd
uart2:
  txd_pin: gpio.25
  rxd_pin: gpio.22
  rtspin: NOPIN
  baud: 9600
  mode: 8N1
ModbusVFD:
  uart_num: 2
  modbus_id: 1
  model: VFD-M+
  cw_cmd: 06 20 00 00 12 > echo
  ccw_cmd: 06 20 00 00 22 > echo
  off_cmd: 06 20 00 00 01 > echo
  setrpmcmd: 06 20 01 rpm% > echo
  min_RPM: 0
  max_RPM: 24000
  debug: 3

Startup Messages

rst:0x1 (POWERONRESET),boot:0x17 (SPIFASTFLASHBOOT)
configsip: 0, SPIWP:0xee
clkdrv:0x00,qdrv:0x00,ddrv:0x00,cs0drv:0x00,hddrv:0x00,wpdrv:0x00
mode:DIO, clock div:1
load:0x3fff0030,len:1184
load:0x40078000,len:13260
load:0x40080400,len:3028
entry 0x400805e4
[MSG:INFO: uart_channel0 created]
[MSG:RST]
[MSG:INFO: FluidNC 3.9.5-pre1 https://github.com/bdring/FluidNC]
[MSG:INFO: Compiled with ESP32 SDK:v4.4.7-dirty]
[MSG:INFO: Local filesystem type is littlefs]
[MSG:INFO: Configuration file:config (4).yaml]
[MSG:WARN: min_RPM value 0 constrained to range (4294967295,4294967295)]
[MSG:WARN: max_RPM value 24000 constrained to range (4294967295,4294967295)]
[MSG:INFO: Machine KJBJ]
[MSG:INFO: Board None]
[MSG:INFO: UART2 Tx:gpio.25 Rx:gpio.22 RTS:NO_PIN Baud:9600]
[MSG:INFO: SPI SCK:gpio.18 MOSI:gpio.23 MISO:gpio.19]
[MSG:INFO: SD Card cspin:gpio.5:pd detect:NOPIN freq:8000000]
[MSG:INFO: Stepping:RMT Pulse:10us Dsbl Delay:0us Dir Delay:10us Idle Delay:255ms]
[MSG:INFO: Axis count 3]
[MSG:INFO: Shared stepper disable gpio.13]
[MSG:INFO: Axis X (-1.000,279.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     stepstick Step:gpio.12 Dir:gpio.14:low Disable:NO_PIN]
[MSG:INFO:  X Neg Limit gpio.17:low]
[MSG:INFO: Axis Y (-401.000,-1.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     stepstick Step:gpio.26 Dir:gpio.15 Disable:NO_PIN]
[MSG:INFO:  Y Pos Limit gpio.4:low]
[MSG:INFO: Axis Z (-120.000,0.000)]
[MSG:INFO:   Motor0]
[MSG:INFO:     stepstick Step:gpio.27 Dir:gpio.16 Disable:NO_PIN]
[MSG:INFO:  Z Neg Limit gpio.33:low]
[MSG:INFO: feedholdpin gpio.36:low]
[MSG:INFO: cyclestartpin gpio.34:low]
[MSG:INFO: estop_pin gpio.39:low]
[MSG:INFO: Kinematic system: Cartesian]
[MSG:INFO: Connecting to STA SSID:ORASZ]
[MSG:INFO: Connecting.]
[MSG:INFO: Connecting..]
[MSG:INFO: Connected - IP is 192.168.3.166]
[MSG:INFO: WiFi on]
[MSG:INFO: Start mDNS with hostname:http://fluidnc.local/]
[MSG:INFO: HTTP started on port 80]
[MSG:INFO: Telnet started on port 23]
[MSG:INFO: ModbusVFD Spindle Tx:gpio.25 Rx:gpio.22 RTS:NO_PIN Baud:9600]
[MSG:INFO: Probe gpio.32:low]

Grbl 3.9 [FluidNC 3.9.5-pre1 (wifi) '$' for help]

Grbl 3.9 [FluidNC 3.9.5-pre1 (wifi) '$' for help] [MSG:INFO: RS485 Tx: 01 06 20 00 00 01 43 CA] [MSG:INFO: RS485 Rx: 01 06 20 00 00 01 43 CA] ok [VER:3.9 FluidNC 3.9.5-pre1:] [OPT:PHS] [MSG:Machine: KJBJ] [MSG:Mode=STA:SSID=ORASZ:Status=Connected:IP=192.168.3.166:MAC=10-06-1C-68-11-84] ok

User Interface Software

No response

What happened?

I studied the machine diagram and made a table of conclusions. Additionally installed an SD card module. Everything works. I wanted to connect a VFD via RS485. My VFD controller does not have an RS485 interface on the converter board. I connected directly Uart VFD to UART ESP32 via ADUM1201 chip. I checked the functionality of the interface through the terminal on the computer. Initially, I tried various VFD models in the configuration, but they did not fit the parameters. The closest VFD in terms of parameters is YL620. But it transmits frequency, and I need % of the maximum frequency.I found that the universal VFD controller is in the new firmware. I installed new firmware. Configured, but doesn’t work. When I try to set the frequency, it does not issue a command.

!Image
If you just specify the model YL620. the frequency is set to a maximum of 1.6 Hz.
if I copy the settings for the YL620 universal from WIKI, it also does not transmit the 2001 command. I am not a programmer, I could not figure out what was wrong. Please help me figure it out/
There is a Chinese manual for the VFD. I found an analogue in English with modbus commands -hs350-1. 5

!Image

!Image

!Image

!Image

!Image

GCode File

No response

Other Information

No response


评论 (16)

#1 – MitchBradley 于 2025-02-18

Try setrpmcmd: 06 20 01 rpm%*100 > echo, since the speed setting value is 10000 for 100%. Also, when using M3 Snnnn for speed setting, use different values for nnnn for successive commands. If you ask for the same speed twice, the code does not re-send the speed setting command, since the spindle is already supposed to be at that speed.


#2 – borisov-py 于 2025-02-18

in this vfd via rs485 interface the value from -100.00 to 100.00% of the value set in the settings is transmitted, this is reflected in the notes, in my case it is 400 Hz. At no values ​​of revolutions that I changed, there is no command 20 01. but if you use the preset yl620 this command is there but the value does not match. I am also worried about the warning in the log for the values ​​of min_rpm and max rpm. It seems to me that if there was a problem with the value, the command would still be sent. tomorrow I will try your suggestion.


#3 – borisov-py 于 2025-02-19

I tried changing the scaling value, nothing changed, command 2001 no way.
!Image
M5
ok
[MSG:INFO: RS485 Tx: 01 06 20 00 00 01 43 CA]
[MSG:INFO: RS485 Rx: 01 06 20 00 00 01 43 CA]





M3 S24000
ok
[MSG:INFO: RS485 Tx: 01 06 20 00 00 12 02 07]
[MSG:INFO: RS485 Rx: 01 06 20 00 00 12 02 07]



M3 S12000
ok


#4 – borisov-py 于 2025-02-19

config !Image
result M3 S1000
ok

[MSG:INFO: RS485 Tx: 01 06 20 00 00 12 02 07]
[MSG:INFO: RS485 Rx: 01 06 20 00 00 12 02 07]
[MSG:INFO: RS485 Tx: 01 06 20 01 00 0A 53 CD]
[MSG:INFO: RS485 Rx: 01 06 20 01 00 0A 53 CD]

M3 S24000
ok
[MSG:INFO: RS485 Tx: 01 06 20 01 00 28 D3 D4]
[MSG:INFO: RS485 Rx: 01 06 20 01 00 28 D3 D4]

config

!Image

result

M3 S10000
ok
[MSG:INFO: RS485 Tx: 01 06 20 00 00 12 02 07]
[MSG:INFO: RS485 Rx: 01 06 20 00 00 12 02 07]

further, when changing the speed, no commands are received


#5 – borisov-py 于 2025-02-19

I checked the frequency setting via the terminal on the computer. indeed, values ​​from 0 to 10000 DEC correspond to frequencies from 0 to 400 Hz.


#6 – borisov-py 于 2025-02-21

> Try setrpmcmd: 06 20 01 rpm%*100 > echo, since the speed setting value is 10000 for 100%. Also, when using M3 Snnnn for speed setting, use different values for nnnn for successive commands. If you ask for the same speed twice, the code does not re-send the speed setting command, since the spindle is already supposed to be at that speed.

I tried to do as you suggested. Any other thoughts on how to fix my problem?


#7 – MitchBradley 于 2025-02-21

You could control it with 0-10V. Or buy a different inverter for which we already have working code. There is a limit to the amount of time we are able to spend on supporting cheap Chinese hardware that only one person has.


#8 – borisov-py 于 2025-02-21

I found a problem and told you about it. I know about the possibility of using 0-10. You have a universal vfd protocol written. It doesn’t work. Then remove it altogether since it doesn’t work. What’s wrong with this vfd? It works on the yl620 setting. The only thing is that it sets the frequency incorrectly.


#9 – borisov-py 于 2025-02-21

I didn’t ask to support my vfd, I asked to give advice on the universal protocol. Maybe I did something wrong, and I ask to see what I did wrong. How exactly is my vfd not suitable for the universal protocol?


#10 – bdring 于 2025-02-21

Have you tried changing setrpmcmd to a fixed value as a test?

FluidNC has no concept of negative rpm, so that is an issue.


#11 – borisov-py 于 2025-02-21

I set the command setrpmcmd: 06 20 01 rpm%*100. The command 06 20 01 is not transmitted either when turning on or when changing the speed when using the universal vfd driver. If I turn on the yl620, the command is in the log. But there is an incorrect frequency value. I have a different scale. I sent commands to the vfd via the modbus terminal, all my commands that I wrote in the configuration work. In the command 20 01, the values ​​from 0 to 10000dec correspond to frequencies of 0 to 400 Hz. The problem is that there is no command 20 01 when using the universal vfd driver


#12 – borisov-py 于 2025-02-21

commands forward backward and stop are transmitted and work. commands with the frequency value are simply not in the log, so vfd does not react in any way


#13 – bdring 于 2025-02-21

Have you tried changing setrpmcmd to a fixed value as a test?


#14 – borisov-py 于 2025-02-21

no, I didn’t think to set a constant. I’ll check on Monday. but why then is the command transmitted in the yl620 configuration? maybe it’s related to maxrpm and minrpm which I also set as a constant. there are 2 warnings about this in the terminal


#15 – borisov-py 于 2025-02-24

I set the command setrpmcmd: 06 20 01 27 10 > echo this corresponds to 400Hz. After reboot, the controller issues this command to the VFD, the frequency is set to 400Hz. Also, the first activation of the M3 command after a reboot sends the command 06 20 01 27 10. But then, when trying to change the speed through the M3 or M4 command Snnnnn, the speed change commands are no longer sent to the VFD.

!Image


#16 – MitchBradley 于 2025-02-27

The revised version of PR #1431 fixes the problem, to the extent that I was able to test without access to the specific VFD.


原始Issue: https://github.com/bdring/FluidNC/issues/1454

喜欢 (0)