Control of an Omrom MX2 VFD via RS485 USB-adaptor

More
26 Jan 2020 11:02 #155783 by Domsku
I think, I managed to set up the custom.hal and mb2hal.ini files correctly. If I check the hal pins, everything looks fine: motion.spindle-speed-out-rps is multiplied by 200 and written to OmronMX2.VFDSetFrequency.00. Also the direction and run command are correct. But still the spindle does not turn.

When I start the spindle by pushing the buttons of the front panel of the MX2, I get the correct values for OmronMX2.VFDActualFrequency.00.

Does anyone have an idea what could be the problem with my setup?
Attachments:

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

More
26 Jan 2020 12:25 #155796 by bbsr_5a
if you still can use the Button of the VFD there is a Jumper Wrong or a Parameter
the omron can do 3 Way controlling BUT only one at the TIME
1 Buttons
2 Vin / Fwd
3 RS485

We got a omron that has to be 3Pin controlled so one needs to be blocked high/GND see documentation

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

More
26 Jan 2020 14:28 - 26 Jan 2020 17:14 #155808 by Domsku
Yes, if I want to use the push-buttons, I always have to change the frequency source (A001) and run command source (A002) at the MX2 to "2". And to controll it via modbus, I have to set it to "3".

Actually, during the last hours I found out that the frequency control via modbus already works. So there is just left the problem with the run comand.
When I look at the "number of errors" of the run command (and also of the direction command) in hal, I get about 10 errors per second.
Last edit: 26 Jan 2020 17:14 by Domsku. Reason: Correction of mistakes, error discription added

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

More
26 Jan 2020 16:43 #155816 by bbsr_5a
ok
so it is just to use the linuxcnc component

wj200-vfd.N.commanded-frequency RPM
wj200-vfd.N.reverse (1 = REV, 0 = FWD)
wj200-vfd.N.run (1 = run, 0 = stop)
wj200-vfd.N.enable 1= on

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

More
26 Jan 2020 17:18 #155828 by Domsku
I tryed the wj200 driver. However it does not work with the USB-adaptor.

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

More
26 Jan 2020 19:18 #155836 by andypugh

I tryed the wj200 driver. However it does not work with the USB-adaptor.


Did you pass it the address of the USB adaptor?
loadusr wj200_vfd  --device=/tty/usb0

Or similar. It is understandable if you didn't because the documentation does not mention this.

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

More
27 Jan 2020 20:20 #155947 by Domsku
Yes, I did. I have posted the error message some days ago:
forum.linuxcnc.org/49-basic-configuratio...aptor?start=0#155094

I am so close making it run with mb2hal and I realy like the flexibility of mb2hal. I can read out much more registers than the wj200 driver does. As I said, I can already control the spindle speed. Just missing the run an direction command.

In the hal window I can see the number of errors I receive from the run-command (10 per second). Is there a way of reading out an error message?

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

More
28 Jan 2020 10:55 #155987 by bbsr_5a
can you post the HAL lines that is responsible
and ofcause to your INFO the RS485 are soposed to be in a POSTGUI File
NOT inside the Main Machine HAL File
as comunication outside the Interpreter main loop BASE is only to be there
use of SERVO tread and outside Hardware communication shoudt always be setup that way

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

More
28 Jan 2020 11:58 #156000 by andypugh

and ofcause to your INFO the RS485 are soposed to be in a POSTGUI File
NOT inside the Main Machine HAL File
as comunication outside the Interpreter main loop BASE is only to be there


The only things that _need_ to be in the Postgui files are references to HAL pins that are created by the GUI (and hence won't exist until the GUI has loaded)

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

More
01 Feb 2020 18:04 - 02 Feb 2020 08:28 #156309 by Domsku
OK, I gave up trying to do everything by using modbus. I draw two cables from the VFD programmable input pins (run cw, run ccw) to the MESA 7i76 spindle terminal (ENA, DIR). Setting the frequency, observing spindle status and actual speed is made by modbus. Now everything is working fine.

Thanks Andy for your advices, using mb2hal was a verry good suggestion. Even though I'm not able to write coils for some reason. I tryed the --device option in all kinds of variation for the wj200 driver this morning once again. It still did not work. I saw on github that jamwaffles added this feature somewhen in 2016. I actually installed my linuxcnc in 2017. Maybe the update was not yet in my distribution.

I attached my custom.hal and mb2hal.ini in case someone has a use for it.
Attachments:
Last edit: 02 Feb 2020 08:28 by Domsku.

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

Time to create page: 0.273 seconds
Powered by Kunena Forum