VFD mb2hal

More
18 Mar 2018 11:25 - 18 Mar 2018 11:36 #107486 by BigDo
VFD mb2hal was created by BigDo
Hi guys
I'm trying to control my VFD (Altivar28) via mb2hal.
I can read the parameters from the VFD but how can i send commands to my VFD via linuxcnc? Maybe someone has a VFD running via mb2hal and can give me an example of the *.hal and mb2hal.ini.

if I start linuxcnc with this configuration the status of my VFD-Display changed to nSt = Freewheel stop

I can use this functions only
03 Read N output words 7 max. Reads words that the master can write and read in the slave.
06 Write one output word Writes a 16 bit output word.
16 Write N output words Writes words that the master can write and read in the slave.

Control-Word
W400 CMD:
• By setting bits 15, 3, and 1 to a “1” (800A Hex, 32778 Decimal), the drive controller runs at the frequency reference.
• By setting bits 15, 12, 3, and 1 to a “1” (900A Hex, 36874 Decimal), the drive controller stops the motor on the programmed deceleration ramp.
• By setting bits 15, 13, 3, and 1 to a “1” (A00A Hex, 40970 Decimal), the drive controller stops the motor using the DC injection settings.
• By setting bits 15, 14, 3, and 1 to a “1” C00A Hex, 49162 Decimal), the drive controller fast stops using the Fast Stop settings.
• By setting bits 15, 11, 3, and 1 to a “1” (880A Hex, 34826 Decimal), the drive controller runs in the reverse direction at the frequency reference.

Best regards

Niko
Attachments:
Last edit: 18 Mar 2018 11:36 by BigDo.

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

More
19 Mar 2018 13:41 #107543 by andypugh
Replied by andypugh on topic VFD mb2hal
Does it suggest a way to set the frequency reference?

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

More
19 Mar 2018 14:55 - 19 Mar 2018 14:57 #107546 by BigDo
Replied by BigDo on topic VFD mb2hal
thanks for replay andy,

i think Word 401 is the right way to set a reference but how can i do that from linuxcnc

W401.....LFR......0.1 Hz.......Frequency reference in line mode (signed in two’s complement). Parameter is reinitialized at the end of time-out unless bit 14 of CMI (W402) is set to 1.......LSP to HSP
Last edit: 19 Mar 2018 14:57 by BigDo.

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

More
19 Mar 2018 16:23 #107548 by andypugh
Replied by andypugh on topic VFD mb2hal

i think Word 401 is the right way to set a reference but how can i do that from linuxcnc


I haven't used mb2hal, but how far have you got? I guess you have an INI file and have tried setting up register writes to 400 and 401?

Have you seen any sign of the hoped-for results?

I think that 400 would be a fnct_15 and 401 a fnct_16 ?

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

More
19 Mar 2018 16:36 #107549 by BigDo
Replied by BigDo on topic VFD mb2hal
only functions 3, 6 and 16 are supportet on this VFD.

the Programming Manual is too big for Attachments :(

here is a Link Altivar28Programming.pdf

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

More
19 Mar 2018 17:03 #107552 by Todd Zuercher
Replied by Todd Zuercher on topic VFD mb2hal
I am using Mb2hal to control several VFDs on one machine. But it has been a long time since I set it up. (and there is much I don't remember.)

I used Classiclader to convert my bit commands for stop, start... to the number that is sent to the Mb2hal input pin. That was easier for me to do at the time. If I were to do it over I'd give it a try by only using hal components, such as Weighted_sum to get the number that would be sent to the VFD.

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

More
19 Mar 2018 17:57 #107555 by BigDo
Replied by BigDo on topic VFD mb2hal
Todd can you send me the hal File from your running mashine that use mb2hal?

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

More
19 Mar 2018 18:22 #107556 by Todd Zuercher
Replied by Todd Zuercher on topic VFD mb2hal
They are a little messy, but I'm sure I've posted on the forums before.

Most of the hal pin connections to Mb2hal are in the hal file "mb2hal.hal".

File Attachment:

File Name: Digital6.zip
File Size:45 KB
Attachments:
The following user(s) said Thank You: BigDo

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

More
22 Mar 2018 11:11 - 22 Mar 2018 11:14 #107715 by BigDo
Replied by BigDo on topic VFD mb2hal
thanks for nice examples Todd
i have managed to control the VFD directly over the test hal command
setp mb2hal.set.reference.frq.00 200 - Reference Frequency
setp mb2hal.set.cmd.parameters.00 32778 - forward
setp mb2hal.set.cmd.parameters.00 34826 - reverse
setp mb2hal.set.cmd.parameters.00 36874 - Stop

but how can i use the axis spindle Buttons or pyvcp Buttons in my custom hal-File to set this values, they only accept Bit values - i have decimals?

this is my mb2hal ini File

File Attachment:

File Name: altivar_atv28.ini
File Size:10 KB

this is my custompanel xml File

File Attachment:

File Name: altivar-atv28.xml
File Size:4 KB

this is my custom_postgui hal File

File Attachment:

File Name: altivar_atv28.hal
File Size:1 KB
Attachments:
Last edit: 22 Mar 2018 11:14 by BigDo.

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

More
22 Mar 2018 13:02 - 22 Mar 2018 13:04 #107717 by andypugh
Replied by andypugh on topic VFD mb2hal
A mux4 would work for this, or potentially a mux8.

What data type are the parameters.00 pins? I would guess U32 (unsigned integer).

If they are U32 then a mux_generic would be easier than a mux4.
loadrt mux_generic config="uu4"
...
addf mux-gen.00 servo-thread
...
net spindle-fwd  motion.spindle-forward => mux-gen.00.sel-bit-00
net spindle-rev motion.spindle-reverse  => mux-gen.00.sel-bit-01
net vfd-param mux-gen.00.out =>  mb2hal.set.cmd.parameters.00

#Off = 00 (0), FWD = 01 (1), Rev = 10 (2), Both (error) = 11 (3)
setp mux-gen.00.in-u32-00 36874
setp mux-gen.00.in-u32-01 32778
setp mux-gen.00.in-u32-02 34826
setp mux-gen.00.in-u32-03 36874

(I think I would use hex, 0x900A, 0x800A, 0x880A)

This is reasonably easily expandable for more conditions (error inputs, for example)
Last edit: 22 Mar 2018 13:04 by andypugh.

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

Time to create page: 0.156 seconds
Powered by Kunena Forum