- Posts: 403
- Thank you received: 0
Setting up USB -> Modbus (CH340) for VFD control
- cncnoob1979
- Offline
- Platinum Member
-
When you load the user-space component, the component will create pins for you to connect to. In my custom.hal file listed below is an example of what I have.
I had to chmod 666 the usb dongle to connect with it. If you try to connect and get an error then more than likely you will need to add a rule to connect to the device. But I'm getting ahead of myself, lets see what you have and Ill try to help you as best as I can.
when issueing the command in a terminal
I get the output of:
This is my dongle.
What do you get? You may need to install usbtools I believe it is called for the lsusb to work. Let me know if you run into a snag.
Please Log in to join the conversation.
unfortunately there is no component written for my VFD what i can find.
i purchased a ENC EN600-4T0037G/0055P inverter.
if i run the lsusb i get pretty much the same as you: Bus 003 Device 006: ID 1a86:7523 QinHeng Electronics HL-340 USB-Serial adapter
and it is on /dev/ttyUSB0
So i guess creating the user space component for VFD is my main problem..
Thankful for any help i can get as i'm really stuck on this one!
Please Log in to join the conversation.
- cncnoob1979
- Offline
- Platinum Member
-
- Posts: 403
- Thank you received: 0
well if i was faced with that issue I would control the vfd via analog voltage. The issue is that a user component has to be written and then you can connect via modbus. Perhaps someone here with more experience can help you write one for your use. Or if you are skilled in that particular area you would have to write one yourself. I wish I could help you with that task but I am not talented in that area.
I can help you once a component has been written and afterwards however.
Another solution is to return the ENC EN600-4T0037G and go with a VFD that is commonly used and already has a component written for it.
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
something like this (I make no claims about it's correctness)
Please Log in to join the conversation.
FIRST_ELEMENT=7680 = What is this?
NELEMENTS=1 = What is this?
MB_TX_CODE=fnct_16_write_multiple_registers = is this a standard function in modbus to be able to write values to the vfd?
HAL_TX_NAME=run = is this for linuxcnc's side?
MAX_UPDATE_RATE=0.0
DEBUG=3
# Set Frequency
[TRANSACTION_01] = what would this be?
MB_TX_CODE=fnct_16_write_multiple_registers
FIRST_ELEMENT=7681
NELEMENTS=1
HAL_TX_NAME=frequency
MAX_UPDATE_RATE=0.0
DEBUG=3
Thanks!
Please Log in to join the conversation.
- Todd Zuercher
- Offline
- Platinum Member
-
- Posts: 4739
- Thank you received: 2
Victor wrote: Ok, could you explain what the diffrent codes would translate to in my VFD manual? i'm having a hard time seeing the connection.
FIRST_ELEMENT=7680 = What is this?This is the register address you are reading or writing to
NELEMENTS=1 = What is this?The number of register addresses in this block (can be more than one)
MB_TX_CODE=fnct_16_write_multiple_registers = is this a standard function in modbus to be able to write values to the vfd?yes
HAL_TX_NAME=run = is this for linuxcnc's side?It can define a unique name for the hal pin that is created
MAX_UPDATE_RATE=0.0
DEBUG=3
# Set Frequency
[TRANSACTION_01] = what would this be?each read/write that MB2HAL does needs a unique number this is it
MB_TX_CODE=fnct_16_write_multiple_registers
FIRST_ELEMENT=7681
NELEMENTS=1
HAL_TX_NAME=frequency
MAX_UPDATE_RATE=0.0
DEBUG=3
Thanks!
I was having a little trouble understanding how your drive numbers it's register addresses in the manual you posted, and 7680 is just the decimal version of the hex number(s) listed in your manual and was my best guess at what to use.
Please Log in to join the conversation.
Unfortunately i was unable to get this to work, and this is way over my head and comfort zone.
So i got myself an Mesa 7i76E and will use the analog spindle control instead.
But sincerely a big thanks for your help!
// Victor
Please Log in to join the conversation.
