[ Vfdmod ] An easy VFD control over MODBUS RTU

More
02 Apr 2020 09:06 - 07 Jun 2020 13:08 #162435 by aekhv
Hello everyone!

I wrote my own HAL userspace component - it's called Vfdmod - to control any VFD that supports standard MODBUS RTU transfer mode.


Features
  • Setting command speed with MODBUS function codes 0x06 (write holding register) and 0x10 (write multiple holding registers).
  • Setting control word with MODBUS function codes 0x06, 0x10, 0x05 (write coil) and 0x0F (write multiple coils).
  • Reading any count of user defined parameters with MODBUS function codes 0x01 and 0x03.
  • Four types of user defined parameters are supported: bit, float, s32 and u32.
  • Built-in PyVcp generator.
  • RS485 connection state monitoring including total error count and last error code.
  • Auto reconnection attempts when USB-to-RS485 adapter was physically re-plugged.
  • Huanyang VFDs are not supported because they use non-standard MODBUS function codes.

Screenshots




Examples
  • Configuration file for Tecorp HC1C+ (low cost chinese VFD):
    [Common]
    MaxSpeedRPM=24000
    MinSpeedRPM=3000
    AtSpeedThreshold=0.01
    
    [RS485]
    SlaveAddress=1
    SerialDevice=/dev/rs485
    BaudRate=19200
    DataBits=8
    Parity=N
    StopBits=1
    
    [Control]
    Address=0x2000
    RunForwardValue=0x000A
    RunReverseValue=0x0006
    FaultResetValue=0x0010
    StopValue=0x0001
    
    [SpindleRpmIn]
    Address=0x2001
    Multiplier=1
    Divider=6
    
    [SpindleRpmOut]
    Address=0x0004
    Multiplier=10
    Divider=1
    
    [Command frequency]
    Address=0x0001
    Multiplier=1
    Divider=10
    PinType=float
    PinName=command-frequency
    
    [Output frequency]
    Address=0x0002
    Multiplier=1
    Divider=10
    PinType=float
    PinName=output-frequency
    
    [Output current]
    Address=0x0003
    Multiplier=1
    Divider=10
    PinType=float
    PinName=output-current
    
    [DC bus voltage]
    Address=0x0005
    Multiplier=1
    Divider=10
    PinType=float
    PinName=dc-bus-voltage
    
    [Temperature]
    Address=0x0006
    Multiplier=1
    Divider=10
    PinType=float
    PinName=temperature
Last edit: 07 Jun 2020 13:08 by aekhv. Reason: Updated
The following user(s) said Thank You: tommylight, taloot, COFHAL, Aciera, sdwyer, bbsr_5a, TannerFrisby, mantimei

Please Log in or Create an account to join the conversation.

More
02 Apr 2020 16:15 #162462 by Todd Zuercher
Sounds a lot like Mb2hal. How is your component different/better?

Please Log in or Create an account to join the conversation.

More
02 Apr 2020 16:59 #162469 by bbsr_5a
seams onlyinteresting for longtime users to see the state of the VFD
most wont need it as they just use the error channel to stop f somthing happens
but it is good to have it there

What VFD did you test this

Please Log in or Create an account to join the conversation.

More
03 Apr 2020 01:04 - 03 Apr 2020 01:05 #162521 by aekhv

Sounds a lot like Mb2hal. How is your component different/better?

It's hard to answer because I didn't work with mb2hal :)
Last edit: 03 Apr 2020 01:05 by aekhv.

Please Log in or Create an account to join the conversation.

More
07 Apr 2020 02:35 #163001 by Todd Zuercher
Your new component may be mostly replicating the same function of the pre-existing Mb2hal component. You might want to look into it

Please Log in or Create an account to join the conversation.

More
16 Apr 2020 14:40 #164147 by COFHAL
Excellent work, could you post your hal file? I have questions about how you control your spindle.

Please Log in or Create an account to join the conversation.

More
16 Apr 2020 19:26 #164192 by COFHAL
Does this userspace component work with linuxcnc version 2.9?

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 00:37 #164213 by aekhv

Does this userspace component work with linuxcnc version 2.9?

My CNC machine works on LinuxCNC 2.7, so I can test Vfdmod with this version only.
The following user(s) said Thank You: strahlensauger

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 00:45 #164215 by aekhv

Excellent work, could you post your hal file? I have questions about how you control your spindle.

Thanks a lot! About HAL file see user guide above or ask free here :)

Please Log in or Create an account to join the conversation.

More
17 Apr 2020 22:15 #164341 by COFHAL
Replied by COFHAL on topic [ Vfdmod ] not control
I have a problem with the userspace component vdfmod vdfmod. I installed it to control my VDF Fuling DZB280, when I run linuxcnc, the VDF automatically receives the minimum RPM command, in this case 300 RPM, but it is not possible to control the VDF, it cannot RUN, STOP or change frequency. And on the control panel, the RS245 connection LED is always red. When seeing the HAL configuration, I see that all the vdfmod.parameters are connected to the panel but not to any input as it appears in its picture. The same goes for all vdfmod rs485 commands.
Attachments:

Please Log in or Create an account to join the conversation.

Time to create page: 0.252 seconds
Powered by Kunena Forum