- Posts: 17
- Thank you received: 0
Control of an Omrom MX2 VFD via RS485 USB-adaptor
I followed the tutorial on youtube of Marco Reps . However, the VFD is doing nothing.
When I check the USB-ports with the command lsusb, the adaptor is displayed.
The Omrom MX2 VFD is set to be controlled via ModBus network input (A001 = 3, A002 = 3, termination resistor dip switch to the right).
RS485 Adaptor and VFD are connected with a twisted cable with a length of about one meter.
Now my question: Is there a simple way of testing the communication between the RS485-adaptor and my VFD to check if the connection works?
After adding the lines im my custom.hal and custom_postgui.hal I had an error message (attached). This is solved when I comment out the "net spindle-enable" in the hal file. But I guess, that there are more mistakes in my hal file than this one.
Attachment not found
Attachment not found
Attachment not found
Attachment not found
Attachment not found
Please Log in to join the conversation.
# net on motion.spindle-on => vfd.spindle-on
to
net spindle-enable => vfd.spindle-on
You can uncomment the other line in the sudtom_postgui file.
Chris
Please Log in to join the conversation.
the error message is now solved. But still the VFD does not react to the commands of LinuxCNC.
I'm not shure what you ment by "You can uncomment the other line in the custom_postgui file.", so I tried all kind of variation of uncommenting lines. Nothing helped.
I'll try another RS485 adaptor the next days. Is my main hal file ok in the Spindle section?
Dominik
Please Log in to join the conversation.
i read a bit about usb to rs485 devices and apparently they are sometimes bad about the labeling/meaning of the pins.
I wonder if this could be a problem.
www.windmill.co.uk/rs485.html
Chris
Please Log in to join the conversation.
You would need a different component for an Omron VFD.
There are a bunch existing drivers:
linuxcnc.org/docs/2.8/html/man/man1/gs2.1.html
linuxcnc.org/docs/2.8/html/man/man1/hy_gt_vfd.1.html
linuxcnc.org/docs/2.8/html/man/man1/hy_vfd.1.html
linuxcnc.org/docs/2.8/html/man/man1/mitsub_vfd.1.html
linuxcnc.org/docs/2.8/html/man/man1/vfdb_vfd.1.html
linuxcnc.org/docs/2.8/html/man/man1/vfs11_vfd.1.html
Just because they are all different.
If your VFD uses real modbus then mb2hal might be the better bet as it is more adaptable.
forum.linuxcnc.org/24-hal-components/34193-vfd-mb2hal?start=0
is likely to be a good starting point.
Please Log in to join the conversation.
forum.linuxcnc.org/10-advanced-configura...hi-wj200-over-modbus
However, this driver does not work with the USB-RS485 adaptor, as I understood from this post:
forum.linuxcnc.org/25-classicladder/3313...-wj200-setup?start=0
Now, I guess, I have 2 options:
1. get a serial port card and a RS232 -> RS485 converter and use the wj200 driver, or
2. become acquainted with mb2hal and continue with my USB adaptor.
Although I am not a programmer and have a hard time to understand what is written in the post you have linked above, Andy, but somehow I tend to take the challenge of option 2.
Today, I checked the modbus communication with "modpoll". It looks fine, except that modpoll returns negative values for the frequency, as soon as the frequency of the VFD exceeds 327.6 Hz. But I guess this is due to some kind of overflow.
Please Log in to join the conversation.
Domsku wrote: .It looks fine, except that modpoll returns negative values for the frequency, as soon as the frequency of the VFD exceeds 327.6 Hz. But I guess this is due to some kind of overflow.
I would say internally it is using signed integers for the frequency and counting in units of 0.01 Hz.
Signed integer range is from -32767 to +32767 (pretty much exactly what you came up with - see the pattern?)
Please Log in to join the conversation.
Domsku wrote: However, this driver does not work with the USB-RS485 adaptor, as I understood from this post:
forum.linuxcnc.org/25-classicladder/3313...-wj200-setup?start=0 .
Looking a bit deeper than last time (actually being at a LinuxCNC machine helps) it looks like you can select a USB to serial by loading the driver like this:
loadusr wj200_vfd --device /dev/ttyUSB0
Other options are:
--baud
--parity
--stopbits
--databits
--device
Please Log in to join the conversation.
Attachment not found
Also in the manuals of this driver there is no option at all.
Please Log in to join the conversation.
The MX2 only supports the mb2hal-functions "fnct_03_read_holding_registers", "fnct_15_write_multiple_coils" and "fnct_16_write_multiple_registers".
The first transaction in my ini file is to read out the actual frequency of the VFD. The register numbers for the output frequency monitor of the MX2 are 1001 hex for the high value and 1002 hex for the low value. The range is from 0 to 40.000 (0.01 Hz-steps). How can I generate a float variable, wich I can than use as input for motion.spindle-speed-in-rps?
And the same question I have for TRANSACTION_03, just the opposite way around: how do I convert the float variable of motion.spindle−speed−out into two variables, in order to write them into the registers 0001 hex for the hi value and 0002 for the low value?
Please Log in to join the conversation.
