MB2HAL - how to upgrade? (files in C -compile?)

09 May 2019 15:12 #133247 by Adam Maszynotwór
I am trying to use MB2HAL to support my spindles.
I encountered a problem with the instructions
she says:
You need LinuxCNC> 2.7.14 (eg the next release as of October 2018), the master branch or need to compile mb2hal yourself with the pull requests [# 487] and [# 489].

I have LinuxCNC 2.7.14 I do not know how to make changes so that MB2HAL would be known, for example, it read PIN_NAMES (because the former author is very nice and the version in 2.7.14 apparently does not know this command)
I found a file github.com/LinuxCNC/linuxcnc/tree/master...al/user_comps/mb2hal
but I do not know what to do next

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

09 May 2019 16:33 #133253 by Todd Zuercher
Mb2hal has been a standard included component of Linuxcnc since before 2.7 was first released. You do not have to install it and there is no compiling or anything like that required either.

That said it is rather complicated to configure and add to your machine's configuration.

Do you have a working machine configuration (without Mb2hal) that you are trying to add modbus spindle control to? What make and model VFD are you using? Every manufacturer's modbus implementation is different so you can't use someone else's configuration settings for your machine unless they have the exact same hardware. This is one of the reasons configuring Mb2hal is so complex.

You are going to need a copy of the Modbus documentation for your drive, and give it a thorough reading (and understand it) to know how to configure Mb2hal for controlling it.

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

09 May 2019 17:37 #133257 by Adam Maszynotwór
Probably MB2HAL is part of version 2.7.14 because when you try to run linuxCNC you can see that the INI file is loading.
but, for example, spills out on the lack of the required NELEMENTS =
because the author according to the principle of the mb2hal_HOWTO.ini file
uses PIN_NAMES instead of NELEMENTS =
Therefore, it seems to me that MB2HAL is not valid in 2.7.14

I try to first run on files from the said author to understand the principle of operation, then replace the register numbers and other necessary values ​​to communicate with my inverter.

Ultimately, it's supposed to work like this:
- 3 different spindles (motors with different parameters)
- using, for example, M110 M120 M130, I send the parameters of the motor I want to use to the inverter
- and then standard M3 commands M5 S to start the selected spindle

The inverter is MMX12AA9D6F0-0 - EATON MOELLER

This will be a tangible road for me, I'm not moving well in the deeper layers of linuxcnc and I have to do everything with a translator because my English is weak

I try not to bother anyone, but I can not get to some of them

Only recently I met Modbus, I bought a converter and I manage to make a connection and send commands to change parameters

the whole is supposed to work with this machine

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

09 May 2019 18:11 #133264 by andypugh
You might want to install the development (master / 2.8 ) version of LinuxCNC as that includes support for multiple spindles.
(M3 $2 to turn on the third spindle, for example)

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

09 May 2019 18:21 - 09 May 2019 18:23 #133266 by Adam Maszynotwór
OOO This is valuable information - I did not know about it
Thank you
Anyway, I will have to do something to make the M3 $ 2 command execute the procedure:
- Switch contactors
- Send parameter group after RS485 to the inverter (motor data from the nameplate of the given spindle motor)
- only start the spindle with the set speed
Last edit: 09 May 2019 18:23 by Adam Maszynotwór.

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

09 May 2019 20:50 - 09 May 2019 20:51 #133290 by Todd Zuercher
There are also other ways of using Modbus communication with Linuxcnc besides Mb2hal. If you can arrange your system to only need less than 16 transactions you can use the Modbus protocol built into Classicladder (a soft PLC that comes with Linuxcnc). It is a little easier to configure with its graphical user interface. Another option is to write your own hal component (example would be some of the VFD RS485 drivers for Linuxcnc).

When I was setting up the machine that use Mb2hal on. I used the Modbus interface in Classicladder to test the commands I would use and figure out how to set up and communicate with the drives. The only reason I am not using that now is because of it's limitation of 16 transactions. That machine is a gang router with 8 spindles, and the 16 transaction limit would only let me control half of the 8 drives. Then using what I learned from that was able to configure Mb2hal to run them.
Last edit: 09 May 2019 20:51 by Todd Zuercher.

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

12 May 2019 23:53 #133605 by Adam Maszynotwór
Thank you for your advice :)

Installing version 2.8 with the help of forum.linuxcnc.org/38-general-linuxcnc-q...s/34817-updating-2-8
partly allowed to eliminate errors (there is the current version of MB2HAL - success :))
However, there were some other errors that Linuxcnc does not run with the example configuration of the inverter (slightly changed for communication with my inverter) - I will come back to this if I can not deal with the problem.

I thought about Clasicladder at the beginning as the only way (I did not know about the existence of MB2HAL)
Unfortunately, ladder programming is alien to me and it is also difficult to find it (there are too few guides especially video)
I do not know if I have 16 transactions.
(I know that an appropriate entry can be made to multiple registers (I have to change many registers because each engine has different ratings) and I think that it can be done with one transaction although I wonder if there is not a limited number of registers that can be changed by one transaction)

Anyway, I'd love to understand how to use Clasicladder

I will come back to the subject with varying frequency (do not be angry as long as I'm silent - I have a lot of other duties) the topic is not urgent yet, but I will have to master it for sure!

I will try somehow at the beginning with tutorials from

(Unfortunately, the translator is badly explaining to me his films)

although it would be useful to use the simplest example of the type "store the value 3500 (dec) in the register 2000 (dec) when you select the M3 command in linuxCNC" so that I can analyze which way the information passes

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

13 May 2019 01:20 #133611 by Todd Zuercher
Registers can be written to as individual bits or integers depending on the transaction type you choose. Like I said I needed 4 transactions per VFD. One activated and unlocked the drive. The second gave drive status (a lot of info.) and served as a watch dog pet. The third started and stopped, and set forward and reverse. The fourth sets the spindle speed. Unfortunately my drives did not allow writing to multiple drives with a single transaction, which could have greatly reduced the number of transactions needed.

Another disadvantage of Mb2hal is that all transactions must be performed each cycle and not on an as needed basis. This can really slow down the system in my case.

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

Time to create page: 0.114 seconds
Powered by Kunena Forum