MB2HAL Vacon vfd

More
7 years 1 day ago - 7 years 1 day ago #149278 by stes
MB2HAL Vacon vfd was created by stes
I have Vacon vfd connected to serial RS-485 to RS-232 converter. How to connect signals in Hal file, so that the Linux cnc can read the spindle speed and send run and speed commands to the vfd?

This is the INI file I have made
Code:
[MB2HAL_INIT] INIT_DEBUG=3 HAL_MODULE_NAME=mb2hal SLOWDOWN=0.0 TOTAL_TRANSACTIONS=3 [TRANSACTION_00] LINK_TYPE=serial SERIAL_PORT=/dev/ttyS0 SERIAL_BAUD=9600 SERIAL_BITS=8 SERIAL_PARITY=none SERIAL_STOP=1 SERIAL_DELAY_MS=10 MB_SLAVE_ID=1 FIRST_ELEMENT=8453 NELEMENTS=16 MB_TX_CODE=fnct_03_read_holding_registers MB_RESPONSE_TIMEOUT_MS=500 MB_BYTE_TIMEOUT_MS=500 HAL_TX_NAME=info MAX_UPDATE_RATE=0.0 DEBUG=1 [TRANSACTION_01] FIRST_ELEMENT=8193 NELEMENTS=16 MB_TX_CODE=fnct_06_write_single_register MB_RESPONSE_TIMEOUT_MS=500 MB_BYTE_TIMEOUT_MS=500 HAL_TX_NAME=runmode MAX_UPDATE_RATE=0.0 DEBUG=1 [TRANSACTION_02] FIRST_ELEMENT=8195 NELEMENTS=16 MB_TX_CODE=fnct_06_write_single_register MB_RESPONSE_TIMEOUT_MS=500 MB_BYTE_TIMEOUT_MS=500 HAL_TX_NAME=rpm MAX_UPDATE_RATE=0.0 DEBUG=1
Last edit: 7 years 1 day ago by stes.

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

More
7 years 15 hours ago #149337 by pl7i92
Replied by pl7i92 on topic MB2HAL Vacon vfd
Thank you for your WORK
good advice is only to get one SPACE line in the INI
it may tweek your interpreter to break away if there is to many space

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

More
7 years 10 hours ago #149351 by stes
Replied by stes on topic MB2HAL Vacon vfd
It's not actually my work but I edited the MB2HAL to suit my Vacon vfd.

But I have no idea how I can make Linux cnc to communicate with the vfd I'm using.

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

More
7 years 9 hours ago #149363 by Todd Zuercher
Replied by Todd Zuercher on topic MB2HAL Vacon vfd
Do you have a machine configuration that runs your machine?

You have to save your MB2HAL ini file you posed into your config directory. Then add the appropriate hal commands to the hal file(s) for your machines configuration.

MB2HAL will then create hal pins defined in your MB2HAL ini file. This isn't the same ini file as your Linuxcnc machine's configuration ini, that is a separate file in the same directory.

If you have your VFD and MB2HAL properly configured, when you start Linuxcnc, the VFD should start to communicate with Linuxcnc. You should then be able to send commands to the VFD by changing the values of the hal input pins created by MB2HAL and read info from the output pins.

You can check the status of and set values to the hal pins while Linuxcnc is running by using Halshow (Show Hal Configuration in the Axis, Machine menu). Or by using the Halcmd prompt from a terminal window (open this using the command "halcmd -kf").

Once you've confirmed that MB2HAL is working with your VFD, you will need to edit your hal files for your configuration to make the right hal pin connections to control your VFD.

I've done this once before, but it was a long time ago. I have posted my configuration for that machine on the forum before as an example. Here is a link to it.
forum.linuxcnc.org/media/kunena/attachments/3190/Digital6.zip
It is for a gang router that has 8 VFDs for 8 router spindles. The config also uses a small Classicladder program for modifying and reading some of the hal pin values that the VFDs use when communicating with MB2HAL. So for all of its complications maybe it is or isn't a good example config.

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

More
7 years 8 hours ago #149368 by stes
Replied by stes on topic MB2HAL Vacon vfd
Yes, the machine is working otherwise.

I don't know how to connect the pins in hal file. 3 first bits control the VFD, or example 1 0 1 would mean run clockwise. right? But what I should write in the hal file, so when I click run spindle in Linux cnc the 1 0 1 control word will be sent to the VFD?

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

More
7 years 6 hours ago #149375 by Todd Zuercher
Replied by Todd Zuercher on topic MB2HAL Vacon vfd
I think I see a number of problems in your MB2HAL ini file and that is making it hard for me to pickout what you are asking for.

for example your first transaction defined is going to create 16 floating point hal output pins that would display the contents of 16 registers read from your VFD starting at the one found at 8453. Those pins will be called "mb2hal.info.00" - "mb2hal.info.15".

Your next two transactions don't even use the correct MB_TX_CODEs. As far as I know "fnct_06_write_single_register" may not even be a valid option in MB2HAL.

To set bits you would need to use "fnct_15_write_multiple_coils". If you changed the 2nd transaction to this, MB2HAL would create 16 hal input single bit pins called "mb2hal.runmode.00" - "mb2hal.runmode.15"

If those1st 3 registers would be the registers you are talking about needing to change to 1 0 1. Then you would need to connect them to the appropriate outputs in your hal file to get the responce you want, Probably pins such as motion.spindle-forward, motion.spindle-reverse, or motion.spindle-on.

If "fnct_06_write_single_register" will work, it would only work on a single register, so I think you will need to change the number of elements to 1.

All of this is kind of guessing from fuzzy memories of what I tried to do a number of years ago. May just need to run it and see what hal pins are made available and what they do.

Another option for you might be trying to use the modbus capabilities of ClassicLadder.

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

Time to create page: 0.061 seconds
Powered by Kunena Forum